diff --git a/analyticsadmin/v1alpha/analyticsadmin-api.json b/analyticsadmin/v1alpha/analyticsadmin-api.json index a45f45a6571..5ee3ebe9736 100644 --- a/analyticsadmin/v1alpha/analyticsadmin-api.json +++ b/analyticsadmin/v1alpha/analyticsadmin-api.json @@ -2911,6 +2911,160 @@ } } }, + "expandedDataSets": { + "methods": { + "create": { + "description": "Creates a ExpandedDataSet.", + "flatPath": "v1alpha/properties/{propertiesId}/expandedDataSets", + "httpMethod": "POST", + "id": "analyticsadmin.properties.expandedDataSets.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. Example format: properties/1234", + "location": "path", + "pattern": "^properties/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+parent}/expandedDataSets", + "request": { + "$ref": "GoogleAnalyticsAdminV1alphaExpandedDataSet" + }, + "response": { + "$ref": "GoogleAnalyticsAdminV1alphaExpandedDataSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit" + ] + }, + "delete": { + "description": "Deletes a ExpandedDataSet on a property.", + "flatPath": "v1alpha/properties/{propertiesId}/expandedDataSets/{expandedDataSetsId}", + "httpMethod": "DELETE", + "id": "analyticsadmin.properties.expandedDataSets.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Example format: properties/1234/expandedDataSets/5678", + "location": "path", + "pattern": "^properties/[^/]+/expandedDataSets/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+name}", + "response": { + "$ref": "GoogleProtobufEmpty" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit" + ] + }, + "get": { + "description": "Lookup for a single ExpandedDataSet.", + "flatPath": "v1alpha/properties/{propertiesId}/expandedDataSets/{expandedDataSetsId}", + "httpMethod": "GET", + "id": "analyticsadmin.properties.expandedDataSets.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the Audience to get. Example format: properties/1234/expandedDataSets/5678", + "location": "path", + "pattern": "^properties/[^/]+/expandedDataSets/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+name}", + "response": { + "$ref": "GoogleAnalyticsAdminV1alphaExpandedDataSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit", + "https://www.googleapis.com/auth/analytics.readonly" + ] + }, + "list": { + "description": "Lists ExpandedDataSets on a property.", + "flatPath": "v1alpha/properties/{propertiesId}/expandedDataSets", + "httpMethod": "GET", + "id": "analyticsadmin.properties.expandedDataSets.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "The maximum number of resources to return. If unspecified, at most 50 resources will be returned. The maximum value is 200 (higher values will be coerced to the maximum).", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "A page token, received from a previous `ListExpandedDataSets` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListExpandedDataSet` must match the call that provided the page token.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. Example format: properties/1234", + "location": "path", + "pattern": "^properties/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+parent}/expandedDataSets", + "response": { + "$ref": "GoogleAnalyticsAdminV1alphaListExpandedDataSetsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit", + "https://www.googleapis.com/auth/analytics.readonly" + ] + }, + "patch": { + "description": "Updates a ExpandedDataSet on a property.", + "flatPath": "v1alpha/properties/{propertiesId}/expandedDataSets/{expandedDataSetsId}", + "httpMethod": "PATCH", + "id": "analyticsadmin.properties.expandedDataSets.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Output only. The resource name for this ExpandedDataSet resource. Format: properties/{property_id}/expandedDataSets/{expanded_data_set}", + "location": "path", + "pattern": "^properties/[^/]+/expandedDataSets/[^/]+$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Required. The list of fields to be updated. Field names must be in snake case (e.g., \"field_to_update\"). Omitted fields will not be updated. To replace the entire entity, use one path with the string \"*\" to match all fields.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "v1alpha/{+name}", + "request": { + "$ref": "GoogleAnalyticsAdminV1alphaExpandedDataSet" + }, + "response": { + "$ref": "GoogleAnalyticsAdminV1alphaExpandedDataSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit" + ] + } + } + }, "firebaseLinks": { "methods": { "create": { @@ -3588,7 +3742,7 @@ } } }, - "revision": "20230214", + "revision": "20230221", "rootUrl": "https://analyticsadmin.googleapis.com/", "schemas": { "GoogleAnalyticsAdminV1alphaAccessBetweenFilter": { @@ -6019,6 +6173,24 @@ }, "type": "object" }, + "GoogleAnalyticsAdminV1alphaListExpandedDataSetsResponse": { + "description": "Response message for ListExpandedDataSets RPC.", + "id": "GoogleAnalyticsAdminV1alphaListExpandedDataSetsResponse", + "properties": { + "expandedDataSets": { + "description": "List of ExpandedDataSet. These will be ordered stably, but in an arbitrary order.", + "items": { + "$ref": "GoogleAnalyticsAdminV1alphaExpandedDataSet" + }, + "type": "array" + }, + "nextPageToken": { + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "type": "string" + } + }, + "type": "object" + }, "GoogleAnalyticsAdminV1alphaListFirebaseLinksResponse": { "description": "Response message for ListFirebaseLinks RPC", "id": "GoogleAnalyticsAdminV1alphaListFirebaseLinksResponse", diff --git a/analyticsadmin/v1alpha/analyticsadmin-gen.go b/analyticsadmin/v1alpha/analyticsadmin-gen.go index 3e457a03629..fd79fe92bd6 100644 --- a/analyticsadmin/v1alpha/analyticsadmin-gen.go +++ b/analyticsadmin/v1alpha/analyticsadmin-gen.go @@ -211,6 +211,7 @@ func NewPropertiesService(s *Service) *PropertiesService { rs.DataStreams = NewPropertiesDataStreamsService(s) rs.DisplayVideo360AdvertiserLinkProposals = NewPropertiesDisplayVideo360AdvertiserLinkProposalsService(s) rs.DisplayVideo360AdvertiserLinks = NewPropertiesDisplayVideo360AdvertiserLinksService(s) + rs.ExpandedDataSets = NewPropertiesExpandedDataSetsService(s) rs.FirebaseLinks = NewPropertiesFirebaseLinksService(s) rs.GoogleAdsLinks = NewPropertiesGoogleAdsLinksService(s) rs.SearchAds360Links = NewPropertiesSearchAds360LinksService(s) @@ -239,6 +240,8 @@ type PropertiesService struct { DisplayVideo360AdvertiserLinks *PropertiesDisplayVideo360AdvertiserLinksService + ExpandedDataSets *PropertiesExpandedDataSetsService + FirebaseLinks *PropertiesFirebaseLinksService GoogleAdsLinks *PropertiesGoogleAdsLinksService @@ -341,6 +344,15 @@ type PropertiesDisplayVideo360AdvertiserLinksService struct { s *Service } +func NewPropertiesExpandedDataSetsService(s *Service) *PropertiesExpandedDataSetsService { + rs := &PropertiesExpandedDataSetsService{s: s} + return rs +} + +type PropertiesExpandedDataSetsService struct { + s *Service +} + func NewPropertiesFirebaseLinksService(s *Service) *PropertiesFirebaseLinksService { rs := &PropertiesFirebaseLinksService{s: s} return rs @@ -3745,6 +3757,10 @@ type GoogleAnalyticsAdminV1alphaExpandedDataSet struct { // properties/{property_id}/expandedDataSets/{expanded_data_set} Name string `json:"name,omitempty"` + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. // "DataCollectionStartTime") to unconditionally include in API // requests. By default, fields with empty or default values are omitted @@ -4728,6 +4744,46 @@ func (s *GoogleAnalyticsAdminV1alphaListDisplayVideo360AdvertiserLinksResponse) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleAnalyticsAdminV1alphaListExpandedDataSetsResponse: Response +// message for ListExpandedDataSets RPC. +type GoogleAnalyticsAdminV1alphaListExpandedDataSetsResponse struct { + // ExpandedDataSets: List of ExpandedDataSet. These will be ordered + // stably, but in an arbitrary order. + ExpandedDataSets []*GoogleAnalyticsAdminV1alphaExpandedDataSet `json:"expandedDataSets,omitempty"` + + // NextPageToken: A token, which can be sent as `page_token` to retrieve + // the next page. If this field is omitted, there are no subsequent + // pages. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ExpandedDataSets") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ExpandedDataSets") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleAnalyticsAdminV1alphaListExpandedDataSetsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleAnalyticsAdminV1alphaListExpandedDataSetsResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleAnalyticsAdminV1alphaListFirebaseLinksResponse: Response // message for ListFirebaseLinks RPC type GoogleAnalyticsAdminV1alphaListFirebaseLinksResponse struct { @@ -20603,6 +20659,795 @@ func (c *PropertiesDisplayVideo360AdvertiserLinksPatchCall) Do(opts ...googleapi } +// method id "analyticsadmin.properties.expandedDataSets.create": + +type PropertiesExpandedDataSetsCreateCall struct { + s *Service + parent string + googleanalyticsadminv1alphaexpandeddataset *GoogleAnalyticsAdminV1alphaExpandedDataSet + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a ExpandedDataSet. +// +// - parent: Example format: properties/1234. +func (r *PropertiesExpandedDataSetsService) Create(parent string, googleanalyticsadminv1alphaexpandeddataset *GoogleAnalyticsAdminV1alphaExpandedDataSet) *PropertiesExpandedDataSetsCreateCall { + c := &PropertiesExpandedDataSetsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleanalyticsadminv1alphaexpandeddataset = googleanalyticsadminv1alphaexpandeddataset + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PropertiesExpandedDataSetsCreateCall) Fields(s ...googleapi.Field) *PropertiesExpandedDataSetsCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *PropertiesExpandedDataSetsCreateCall) Context(ctx context.Context) *PropertiesExpandedDataSetsCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *PropertiesExpandedDataSetsCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *PropertiesExpandedDataSetsCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphaexpandeddataset) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/expandedDataSets") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "analyticsadmin.properties.expandedDataSets.create" call. +// Exactly one of *GoogleAnalyticsAdminV1alphaExpandedDataSet or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleAnalyticsAdminV1alphaExpandedDataSet.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 *PropertiesExpandedDataSetsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleAnalyticsAdminV1alphaExpandedDataSet, 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 := &GoogleAnalyticsAdminV1alphaExpandedDataSet{ + 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 + // { + // "description": "Creates a ExpandedDataSet.", + // "flatPath": "v1alpha/properties/{propertiesId}/expandedDataSets", + // "httpMethod": "POST", + // "id": "analyticsadmin.properties.expandedDataSets.create", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. Example format: properties/1234", + // "location": "path", + // "pattern": "^properties/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+parent}/expandedDataSets", + // "request": { + // "$ref": "GoogleAnalyticsAdminV1alphaExpandedDataSet" + // }, + // "response": { + // "$ref": "GoogleAnalyticsAdminV1alphaExpandedDataSet" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + +// method id "analyticsadmin.properties.expandedDataSets.delete": + +type PropertiesExpandedDataSetsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a ExpandedDataSet on a property. +// +// - name: Example format: properties/1234/expandedDataSets/5678. +func (r *PropertiesExpandedDataSetsService) Delete(name string) *PropertiesExpandedDataSetsDeleteCall { + c := &PropertiesExpandedDataSetsDeleteCall{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 information. +func (c *PropertiesExpandedDataSetsDeleteCall) Fields(s ...googleapi.Field) *PropertiesExpandedDataSetsDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *PropertiesExpandedDataSetsDeleteCall) Context(ctx context.Context) *PropertiesExpandedDataSetsDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *PropertiesExpandedDataSetsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *PropertiesExpandedDataSetsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", 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) +} + +// Do executes the "analyticsadmin.properties.expandedDataSets.delete" call. +// Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GoogleProtobufEmpty.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 *PropertiesExpandedDataSetsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, 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 := &GoogleProtobufEmpty{ + 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 + // { + // "description": "Deletes a ExpandedDataSet on a property.", + // "flatPath": "v1alpha/properties/{propertiesId}/expandedDataSets/{expandedDataSetsId}", + // "httpMethod": "DELETE", + // "id": "analyticsadmin.properties.expandedDataSets.delete", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. Example format: properties/1234/expandedDataSets/5678", + // "location": "path", + // "pattern": "^properties/[^/]+/expandedDataSets/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+name}", + // "response": { + // "$ref": "GoogleProtobufEmpty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + +// method id "analyticsadmin.properties.expandedDataSets.get": + +type PropertiesExpandedDataSetsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Lookup for a single ExpandedDataSet. +// +// - name: The name of the Audience to get. Example format: +// properties/1234/expandedDataSets/5678. +func (r *PropertiesExpandedDataSetsService) Get(name string) *PropertiesExpandedDataSetsGetCall { + c := &PropertiesExpandedDataSetsGetCall{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 information. +func (c *PropertiesExpandedDataSetsGetCall) Fields(s ...googleapi.Field) *PropertiesExpandedDataSetsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PropertiesExpandedDataSetsGetCall) IfNoneMatch(entityTag string) *PropertiesExpandedDataSetsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *PropertiesExpandedDataSetsGetCall) Context(ctx context.Context) *PropertiesExpandedDataSetsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *PropertiesExpandedDataSetsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *PropertiesExpandedDataSetsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + 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, "v1alpha/{+name}") + 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) +} + +// Do executes the "analyticsadmin.properties.expandedDataSets.get" call. +// Exactly one of *GoogleAnalyticsAdminV1alphaExpandedDataSet or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleAnalyticsAdminV1alphaExpandedDataSet.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 *PropertiesExpandedDataSetsGetCall) Do(opts ...googleapi.CallOption) (*GoogleAnalyticsAdminV1alphaExpandedDataSet, 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 := &GoogleAnalyticsAdminV1alphaExpandedDataSet{ + 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 + // { + // "description": "Lookup for a single ExpandedDataSet.", + // "flatPath": "v1alpha/properties/{propertiesId}/expandedDataSets/{expandedDataSetsId}", + // "httpMethod": "GET", + // "id": "analyticsadmin.properties.expandedDataSets.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The name of the Audience to get. Example format: properties/1234/expandedDataSets/5678", + // "location": "path", + // "pattern": "^properties/[^/]+/expandedDataSets/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+name}", + // "response": { + // "$ref": "GoogleAnalyticsAdminV1alphaExpandedDataSet" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// method id "analyticsadmin.properties.expandedDataSets.list": + +type PropertiesExpandedDataSetsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists ExpandedDataSets on a property. +// +// - parent: Example format: properties/1234. +func (r *PropertiesExpandedDataSetsService) List(parent string) *PropertiesExpandedDataSetsListCall { + c := &PropertiesExpandedDataSetsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of resources to return. If unspecified, at most 50 resources will be +// returned. The maximum value is 200 (higher values will be coerced to +// the maximum). +func (c *PropertiesExpandedDataSetsListCall) PageSize(pageSize int64) *PropertiesExpandedDataSetsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous `ListExpandedDataSets` call. Provide this to +// retrieve the subsequent page. When paginating, all other parameters +// provided to `ListExpandedDataSet` must match the call that provided +// the page token. +func (c *PropertiesExpandedDataSetsListCall) PageToken(pageToken string) *PropertiesExpandedDataSetsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PropertiesExpandedDataSetsListCall) Fields(s ...googleapi.Field) *PropertiesExpandedDataSetsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PropertiesExpandedDataSetsListCall) IfNoneMatch(entityTag string) *PropertiesExpandedDataSetsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *PropertiesExpandedDataSetsListCall) Context(ctx context.Context) *PropertiesExpandedDataSetsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *PropertiesExpandedDataSetsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *PropertiesExpandedDataSetsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + 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, "v1alpha/{+parent}/expandedDataSets") + 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{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "analyticsadmin.properties.expandedDataSets.list" call. +// Exactly one of +// *GoogleAnalyticsAdminV1alphaListExpandedDataSetsResponse or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleAnalyticsAdminV1alphaListExpandedDataSetsResponse.ServerRespons +// e.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 *PropertiesExpandedDataSetsListCall) Do(opts ...googleapi.CallOption) (*GoogleAnalyticsAdminV1alphaListExpandedDataSetsResponse, 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 := &GoogleAnalyticsAdminV1alphaListExpandedDataSetsResponse{ + 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 + // { + // "description": "Lists ExpandedDataSets on a property.", + // "flatPath": "v1alpha/properties/{propertiesId}/expandedDataSets", + // "httpMethod": "GET", + // "id": "analyticsadmin.properties.expandedDataSets.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "pageSize": { + // "description": "The maximum number of resources to return. If unspecified, at most 50 resources will be returned. The maximum value is 200 (higher values will be coerced to the maximum).", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token, received from a previous `ListExpandedDataSets` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListExpandedDataSet` must match the call that provided the page token.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. Example format: properties/1234", + // "location": "path", + // "pattern": "^properties/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+parent}/expandedDataSets", + // "response": { + // "$ref": "GoogleAnalyticsAdminV1alphaListExpandedDataSetsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *PropertiesExpandedDataSetsListCall) Pages(ctx context.Context, f func(*GoogleAnalyticsAdminV1alphaListExpandedDataSetsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "analyticsadmin.properties.expandedDataSets.patch": + +type PropertiesExpandedDataSetsPatchCall struct { + s *Service + name string + googleanalyticsadminv1alphaexpandeddataset *GoogleAnalyticsAdminV1alphaExpandedDataSet + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates a ExpandedDataSet on a property. +// +// - name: Output only. The resource name for this ExpandedDataSet +// resource. Format: +// properties/{property_id}/expandedDataSets/{expanded_data_set}. +func (r *PropertiesExpandedDataSetsService) Patch(name string, googleanalyticsadminv1alphaexpandeddataset *GoogleAnalyticsAdminV1alphaExpandedDataSet) *PropertiesExpandedDataSetsPatchCall { + c := &PropertiesExpandedDataSetsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googleanalyticsadminv1alphaexpandeddataset = googleanalyticsadminv1alphaexpandeddataset + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. The +// list of fields to be updated. Field names must be in snake case +// (e.g., "field_to_update"). Omitted fields will not be updated. To +// replace the entire entity, use one path with the string "*" to match +// all fields. +func (c *PropertiesExpandedDataSetsPatchCall) UpdateMask(updateMask string) *PropertiesExpandedDataSetsPatchCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PropertiesExpandedDataSetsPatchCall) Fields(s ...googleapi.Field) *PropertiesExpandedDataSetsPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *PropertiesExpandedDataSetsPatchCall) Context(ctx context.Context) *PropertiesExpandedDataSetsPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *PropertiesExpandedDataSetsPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *PropertiesExpandedDataSetsPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleanalyticsadminv1alphaexpandeddataset) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", 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) +} + +// Do executes the "analyticsadmin.properties.expandedDataSets.patch" call. +// Exactly one of *GoogleAnalyticsAdminV1alphaExpandedDataSet or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleAnalyticsAdminV1alphaExpandedDataSet.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 *PropertiesExpandedDataSetsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleAnalyticsAdminV1alphaExpandedDataSet, 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 := &GoogleAnalyticsAdminV1alphaExpandedDataSet{ + 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 + // { + // "description": "Updates a ExpandedDataSet on a property.", + // "flatPath": "v1alpha/properties/{propertiesId}/expandedDataSets/{expandedDataSetsId}", + // "httpMethod": "PATCH", + // "id": "analyticsadmin.properties.expandedDataSets.patch", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Output only. The resource name for this ExpandedDataSet resource. Format: properties/{property_id}/expandedDataSets/{expanded_data_set}", + // "location": "path", + // "pattern": "^properties/[^/]+/expandedDataSets/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "updateMask": { + // "description": "Required. The list of fields to be updated. Field names must be in snake case (e.g., \"field_to_update\"). Omitted fields will not be updated. To replace the entire entity, use one path with the string \"*\" to match all fields.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1alpha/{+name}", + // "request": { + // "$ref": "GoogleAnalyticsAdminV1alphaExpandedDataSet" + // }, + // "response": { + // "$ref": "GoogleAnalyticsAdminV1alphaExpandedDataSet" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + // method id "analyticsadmin.properties.firebaseLinks.create": type PropertiesFirebaseLinksCreateCall struct { diff --git a/androidenterprise/v1/androidenterprise-api.json b/androidenterprise/v1/androidenterprise-api.json index a77aabf442d..064bbf1d7c0 100644 --- a/androidenterprise/v1/androidenterprise-api.json +++ b/androidenterprise/v1/androidenterprise-api.json @@ -2649,7 +2649,7 @@ } } }, - "revision": "20230111", + "revision": "20230219", "rootUrl": "https://androidenterprise.googleapis.com/", "schemas": { "Administrator": { @@ -3157,6 +3157,18 @@ "description": "The Google Play Services Android ID for the device encoded as a lowercase hex string. For example, \"123456789abcdef0\".", "type": "string" }, + "device": { + "description": "The internal hardware codename of the device. This comes from android.os.Build.DEVICE. (field named \"device\" per logs/wireless/android/android_checkin.proto)", + "type": "string" + }, + "latestBuildFingerprint": { + "description": "The build fingerprint of the device if known.", + "type": "string" + }, + "maker": { + "description": "The manufacturer of the device. This comes from android.os.Build.MANUFACTURER.", + "type": "string" + }, "managementType": { "description": "Identifies the extent to which the device is controlled by a managed Google Play EMM in various deployment configurations. Possible values include: - \"managedDevice\", a device that has the EMM's device policy controller (DPC) as the device owner. - \"managedProfile\", a device that has a profile managed by the DPC (DPC is profile owner) in addition to a separate, personal profile that is unavailable to the DPC. - \"containerApp\", no longer used (deprecated). - \"unmanagedProfile\", a device that has been allowed (by the domain's admin, using the Admin Console to enable the privilege) to use managed Google Play, but the profile is itself not owned by a DPC. ", "enum": [ @@ -3173,13 +3185,30 @@ ], "type": "string" }, + "model": { + "description": "The model name of the device. This comes from android.os.Build.MODEL.", + "type": "string" + }, "policy": { "$ref": "Policy", "description": "The policy enforced on the device." }, + "product": { + "description": "The product name of the device. This comes from android.os.Build.PRODUCT.", + "type": "string" + }, "report": { "$ref": "DeviceReport", "description": "The device report updated with the latest app states." + }, + "retailBrand": { + "description": "Retail brand for the device, if set. See https://developer.android.com/reference/android/os/Build.html#BRAND", + "type": "string" + }, + "sdkVersion": { + "description": "API compatibility version.", + "format": "int32", + "type": "integer" } }, "type": "object" diff --git a/androidenterprise/v1/androidenterprise-gen.go b/androidenterprise/v1/androidenterprise-gen.go index 8fba659651b..02f2fa91dbb 100644 --- a/androidenterprise/v1/androidenterprise-gen.go +++ b/androidenterprise/v1/androidenterprise-gen.go @@ -1184,6 +1184,18 @@ type Device struct { // as a lowercase hex string. For example, "123456789abcdef0". AndroidId string `json:"androidId,omitempty"` + // Device: The internal hardware codename of the device. This comes from + // android.os.Build.DEVICE. (field named "device" per + // logs/wireless/android/android_checkin.proto) + Device string `json:"device,omitempty"` + + // LatestBuildFingerprint: The build fingerprint of the device if known. + LatestBuildFingerprint string `json:"latestBuildFingerprint,omitempty"` + + // Maker: The manufacturer of the device. This comes from + // android.os.Build.MANUFACTURER. + Maker string `json:"maker,omitempty"` + // ManagementType: Identifies the extent to which the device is // controlled by a managed Google Play EMM in various deployment // configurations. Possible values include: - "managedDevice", a device @@ -1203,12 +1215,27 @@ type Device struct { // "unmanagedProfile" ManagementType string `json:"managementType,omitempty"` + // Model: The model name of the device. This comes from + // android.os.Build.MODEL. + Model string `json:"model,omitempty"` + // Policy: The policy enforced on the device. Policy *Policy `json:"policy,omitempty"` + // Product: The product name of the device. This comes from + // android.os.Build.PRODUCT. + Product string `json:"product,omitempty"` + // Report: The device report updated with the latest app states. Report *DeviceReport `json:"report,omitempty"` + // RetailBrand: Retail brand for the device, if set. See + // https://developer.android.com/reference/android/os/Build.html#BRAND + RetailBrand string `json:"retailBrand,omitempty"` + + // SdkVersion: API compatibility version. + SdkVersion int64 `json:"sdkVersion,omitempty"` + // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` diff --git a/api-list.json b/api-list.json index f17d2ebd33c..895223ee369 100644 --- a/api-list.json +++ b/api-list.json @@ -218,7 +218,7 @@ "name": "advisorynotifications", "version": "v1", "title": "Advisory Notifications API", - "description": "", + "description": "An API for accessing Advisory Notifications in Google Cloud", "discoveryRestUrl": "https://advisorynotifications.googleapis.com/$discovery/rest?version=v1", "icons": { "x16": "https://www.gstatic.com/images/branding/product/1x/googleg_16dp.png", @@ -4552,6 +4552,21 @@ "documentationLink": "https://cloud.google.com/pubsub/lite/docs", "preferred": true }, + { + "kind": "discovery#directoryItem", + "id": "readerrevenuesubscriptionlinking:v1", + "name": "readerrevenuesubscriptionlinking", + "version": "v1", + "title": "Reader Revenue Subscription Linking API", + "description": "readerrevenuesubscriptionlinking.googleapis.com API.", + "discoveryRestUrl": "https://readerrevenuesubscriptionlinking.googleapis.com/$discovery/rest?version=v1", + "icons": { + "x16": "https://www.gstatic.com/images/branding/product/1x/googleg_16dp.png", + "x32": "https://www.gstatic.com/images/branding/product/1x/googleg_32dp.png" + }, + "documentationLink": "https://developers.google.com/news/subscribe/subscription-linking/overview", + "preferred": true + }, { "kind": "discovery#directoryItem", "id": "realtimebidding:v1alpha", diff --git a/baremetalsolution/v2/baremetalsolution-api.json b/baremetalsolution/v2/baremetalsolution-api.json index 41c9226db0a..8fa5b78b0a0 100644 --- a/baremetalsolution/v2/baremetalsolution-api.json +++ b/baremetalsolution/v2/baremetalsolution-api.json @@ -429,7 +429,7 @@ ], "parameters": { "name": { - "description": "Immutable. The resource name of this `Instance`. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. Format: `projects/{project}/locations/{location}/instances/{instance}`", + "description": "Required. The `name` field is used to identify the instance. Format: projects/{project}/locations/{location}/instances/{instance}", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$", "required": true, @@ -441,7 +441,7 @@ "$ref": "RenameInstanceRequest" }, "response": { - "$ref": "Operation" + "$ref": "Instance" }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" @@ -1521,7 +1521,7 @@ } } }, - "revision": "20230206", + "revision": "20230215", "rootUrl": "https://baremetalsolution.googleapis.com/", "schemas": { "AllowedClient": { @@ -2974,11 +2974,7 @@ "description": "Message requesting rename of a server.", "id": "RenameInstanceRequest", "properties": { - "instance": { - "$ref": "Instance", - "description": "Required. The `name` field is used to identify the instance. Format: projects/{project}/locations/{location}/instances/{instance}" - }, - "name": { + "newName": { "description": "Required. The new `name` of the instance. Format: {instancename}", "type": "string" } diff --git a/baremetalsolution/v2/baremetalsolution-gen.go b/baremetalsolution/v2/baremetalsolution-gen.go index 3168a8c8e48..dc0fc38e0fc 100644 --- a/baremetalsolution/v2/baremetalsolution-gen.go +++ b/baremetalsolution/v2/baremetalsolution-gen.go @@ -2157,16 +2157,11 @@ func (s *QosPolicy) UnmarshalJSON(data []byte) error { // RenameInstanceRequest: Message requesting rename of a server. type RenameInstanceRequest struct { - // Instance: Required. The `name` field is used to identify the - // instance. Format: - // projects/{project}/locations/{location}/instances/{instance} - Instance *Instance `json:"instance,omitempty"` - - // Name: Required. The new `name` of the instance. Format: + // NewName: Required. The new `name` of the instance. Format: // {instancename} - Name string `json:"name,omitempty"` + NewName string `json:"newName,omitempty"` - // ForceSendFields is a list of field names (e.g. "Instance") to + // ForceSendFields is a list of field names (e.g. "NewName") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2174,7 +2169,7 @@ type RenameInstanceRequest struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Instance") to include in + // NullFields is a list of field names (e.g. "NewName") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -4468,10 +4463,8 @@ type ProjectsLocationsInstancesRenameCall struct { // Rename: RenameInstance sets a new name for an instance. // -// - name: Immutable. The resource name of this `Instance`. Resource -// names are schemeless URIs that follow the conventions in -// https://cloud.google.com/apis/design/resource_names. Format: -// `projects/{project}/locations/{location}/instances/{instance}`. +// - name: The `name` field is used to identify the instance. Format: +// projects/{project}/locations/{location}/instances/{instance}. func (r *ProjectsLocationsInstancesService) Rename(name string, renameinstancerequest *RenameInstanceRequest) *ProjectsLocationsInstancesRenameCall { c := &ProjectsLocationsInstancesRenameCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name @@ -4533,13 +4526,13 @@ func (c *ProjectsLocationsInstancesRenameCall) doRequest(alt string) (*http.Resp } // Do executes the "baremetalsolution.projects.locations.instances.rename" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at +// Exactly one of *Instance or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Instance.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 *ProjectsLocationsInstancesRenameCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *ProjectsLocationsInstancesRenameCall) Do(opts ...googleapi.CallOption) (*Instance, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4558,7 +4551,7 @@ func (c *ProjectsLocationsInstancesRenameCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &Instance{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -4579,7 +4572,7 @@ func (c *ProjectsLocationsInstancesRenameCall) Do(opts ...googleapi.CallOption) // ], // "parameters": { // "name": { - // "description": "Immutable. The resource name of this `Instance`. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. Format: `projects/{project}/locations/{location}/instances/{instance}`", + // "description": "Required. The `name` field is used to identify the instance. Format: projects/{project}/locations/{location}/instances/{instance}", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$", // "required": true, @@ -4591,7 +4584,7 @@ func (c *ProjectsLocationsInstancesRenameCall) Do(opts ...googleapi.CallOption) // "$ref": "RenameInstanceRequest" // }, // "response": { - // "$ref": "Operation" + // "$ref": "Instance" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" diff --git a/batch/v1/batch-api.json b/batch/v1/batch-api.json index 878d7c10509..b45445dc4da 100644 --- a/batch/v1/batch-api.json +++ b/batch/v1/batch-api.json @@ -201,7 +201,7 @@ "type": "string" }, "requestId": { - "description": "Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "description": "Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query", "type": "string" } @@ -239,7 +239,7 @@ "type": "string" }, "requestId": { - "description": "Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes after the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + "description": "Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes after the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", "location": "query", "type": "string" } @@ -277,37 +277,6 @@ "https://www.googleapis.com/auth/cloud-platform" ] }, - "getIamPolicy": { - "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", - "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/jobs/{jobsId}:getIamPolicy", - "httpMethod": "GET", - "id": "batch.projects.locations.jobs.getIamPolicy", - "parameterOrder": [ - "resource" - ], - "parameters": { - "options.requestedPolicyVersion": { - "description": "Optional. The maximum policy version that will be used to format the policy. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional role bindings must specify version 3. Policies with no conditional role bindings may specify any valid value or leave the field unset. The policy in the response might use the policy version that you specified, or it might use a lower policy version. For example, if you specify version 3, but the policy has no conditional role bindings, the response uses version 1. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).", - "format": "int32", - "location": "query", - "type": "integer" - }, - "resource": { - "description": "REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", - "location": "path", - "pattern": "^projects/[^/]+/locations/[^/]+/jobs/[^/]+$", - "required": true, - "type": "string" - } - }, - "path": "v1/{+resource}:getIamPolicy", - "response": { - "$ref": "Policy" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, "list": { "description": "List all Jobs for a project within a region.", "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/jobs", @@ -348,62 +317,6 @@ "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ] - }, - "setIamPolicy": { - "description": "Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.", - "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/jobs/{jobsId}:setIamPolicy", - "httpMethod": "POST", - "id": "batch.projects.locations.jobs.setIamPolicy", - "parameterOrder": [ - "resource" - ], - "parameters": { - "resource": { - "description": "REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", - "location": "path", - "pattern": "^projects/[^/]+/locations/[^/]+/jobs/[^/]+$", - "required": true, - "type": "string" - } - }, - "path": "v1/{+resource}:setIamPolicy", - "request": { - "$ref": "SetIamPolicyRequest" - }, - "response": { - "$ref": "Policy" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - "testIamPermissions": { - "description": "Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.", - "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/jobs/{jobsId}:testIamPermissions", - "httpMethod": "POST", - "id": "batch.projects.locations.jobs.testIamPermissions", - "parameterOrder": [ - "resource" - ], - "parameters": { - "resource": { - "description": "REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", - "location": "path", - "pattern": "^projects/[^/]+/locations/[^/]+/jobs/[^/]+$", - "required": true, - "type": "string" - } - }, - "path": "v1/{+resource}:testIamPermissions", - "request": { - "$ref": "TestIamPermissionsRequest" - }, - "response": { - "$ref": "TestIamPermissionsResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ] } }, "resources": { @@ -643,7 +556,7 @@ } } }, - "revision": "20230130", + "revision": "20230213", "rootUrl": "https://batch.googleapis.com/", "schemas": { "Accelerator": { @@ -905,54 +818,6 @@ }, "type": "object" }, - "AuditConfig": { - "description": "Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs. If there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditLogConfig are exempted. Example Policy with multiple AuditConfigs: { \"audit_configs\": [ { \"service\": \"allServices\", \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\", \"exempted_members\": [ \"user:jose@example.com\" ] }, { \"log_type\": \"DATA_WRITE\" }, { \"log_type\": \"ADMIN_READ\" } ] }, { \"service\": \"sampleservice.googleapis.com\", \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\" }, { \"log_type\": \"DATA_WRITE\", \"exempted_members\": [ \"user:aliya@example.com\" ] } ] } ] } For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts `jose@example.com` from DATA_READ logging, and `aliya@example.com` from DATA_WRITE logging.", - "id": "AuditConfig", - "properties": { - "auditLogConfigs": { - "description": "The configuration for logging of each type of permission.", - "items": { - "$ref": "AuditLogConfig" - }, - "type": "array" - }, - "service": { - "description": "Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services.", - "type": "string" - } - }, - "type": "object" - }, - "AuditLogConfig": { - "description": "Provides the configuration for logging a type of permissions. Example: { \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\", \"exempted_members\": [ \"user:jose@example.com\" ] }, { \"log_type\": \"DATA_WRITE\" } ] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ logging.", - "id": "AuditLogConfig", - "properties": { - "exemptedMembers": { - "description": "Specifies the identities that do not cause logging for this type of permission. Follows the same format of Binding.members.", - "items": { - "type": "string" - }, - "type": "array" - }, - "logType": { - "description": "The log type that this config enables.", - "enum": [ - "LOG_TYPE_UNSPECIFIED", - "ADMIN_READ", - "DATA_WRITE", - "DATA_READ" - ], - "enumDescriptions": [ - "Default case. Should never be this.", - "Admin reads. Example: CloudIAM getIamPolicy", - "Data writes. Example: CloudSQL Users create", - "Data reads. Example: CloudSQL Users list" - ], - "type": "string" - } - }, - "type": "object" - }, "Barrier": { "description": "Barrier runnable blocks until all tasks in a taskgroup reach it.", "id": "Barrier", @@ -964,28 +829,6 @@ }, "type": "object" }, - "Binding": { - "description": "Associates `members`, or principals, with a `role`.", - "id": "Binding", - "properties": { - "condition": { - "$ref": "Expr", - "description": "The condition that is associated with this binding. If the condition evaluates to `true`, then this binding applies to the current request. If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the principals in this binding. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies)." - }, - "members": { - "description": "Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding.", - "items": { - "type": "string" - }, - "type": "array" - }, - "role": { - "description": "Role that is assigned to the list of `members`, or principals. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.", - "type": "string" - } - }, - "type": "object" - }, "CancelOperationRequest": { "description": "The request message for Operations.CancelOperation.", "id": "CancelOperationRequest", @@ -1118,29 +961,6 @@ }, "type": "object" }, - "Expr": { - "description": "Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. Example (Comparison): title: \"Summary size limit\" description: \"Determines if a summary is less than 100 chars\" expression: \"document.summary.size() \u003c 100\" Example (Equality): title: \"Requestor is owner\" description: \"Determines if requestor is the document owner\" expression: \"document.owner == request.auth.claims.email\" Example (Logic): title: \"Public documents\" description: \"Determine whether the document should be publicly visible\" expression: \"document.type != 'private' \u0026\u0026 document.type != 'internal'\" Example (Data Manipulation): title: \"Notification string\" description: \"Create a notification string with a timestamp.\" expression: \"'New message received at ' + string(document.create_time)\" The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.", - "id": "Expr", - "properties": { - "description": { - "description": "Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.", - "type": "string" - }, - "expression": { - "description": "Textual representation of an expression in Common Expression Language syntax.", - "type": "string" - }, - "location": { - "description": "Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.", - "type": "string" - }, - "title": { - "description": "Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.", - "type": "string" - } - }, - "type": "object" - }, "GCS": { "description": "Represents a Google Cloud Storage volume.", "id": "GCS", @@ -1294,7 +1114,7 @@ "type": "array" }, "priority": { - "description": "Priority of the Job. The valid value range is [0, 100). A job with higher priority value is more likely to run earlier if all other requirements are satisfied.", + "description": "Priority of the Job. The valid value range is [0, 100). Default value is 0. Higher value indicates higher priority. A job with higher priority value is more likely to run earlier if all other requirements are satisfied.", "format": "int64", "type": "string" }, @@ -1406,7 +1226,7 @@ "id": "LifecyclePolicy", "properties": { "action": { - "description": "Action to execute when ActionCondition is true.", + "description": "Action to execute when ActionCondition is true. When RETRY_TASK is specified, we will retry failed tasks if we notice any exit code match and fail tasks if no match is found. Likewise, when FAIL_TASK is specified, we will fail tasks if we notice any exit code match and retry tasks if no match is found.", "enum": [ "ACTION_UNSPECIFIED", "RETRY_TASK", @@ -1774,37 +1594,6 @@ }, "type": "object" }, - "Policy": { - "description": "An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. A `Policy` is a collection of `bindings`. A `binding` binds one or more `members`, or principals, to a single `role`. Principals can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role. For some types of Google Cloud resources, a `binding` can also specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** { \"bindings\": [ { \"role\": \"roles/resourcemanager.organizationAdmin\", \"members\": [ \"user:mike@example.com\", \"group:admins@example.com\", \"domain:google.com\", \"serviceAccount:my-project-id@appspot.gserviceaccount.com\" ] }, { \"role\": \"roles/resourcemanager.organizationViewer\", \"members\": [ \"user:eve@example.com\" ], \"condition\": { \"title\": \"expirable access\", \"description\": \"Does not grant access after Sep 2020\", \"expression\": \"request.time \u003c timestamp('2020-10-01T00:00:00.000Z')\", } } ], \"etag\": \"BwWWja0YfJA=\", \"version\": 3 } **YAML example:** bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time \u003c timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3 For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).", - "id": "Policy", - "properties": { - "auditConfigs": { - "description": "Specifies cloud audit logging configuration for this policy.", - "items": { - "$ref": "AuditConfig" - }, - "type": "array" - }, - "bindings": { - "description": "Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`.", - "items": { - "$ref": "Binding" - }, - "type": "array" - }, - "etag": { - "description": "`etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy. **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.", - "format": "byte", - "type": "string" - }, - "version": { - "description": "Specifies the format of the policy. Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected. Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations: * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).", - "format": "int32", - "type": "integer" - } - }, - "type": "object" - }, "ReportAgentStateRequest": { "description": "Request to report agent's state. The Request itself implies the agent is healthy.", "id": "ReportAgentStateRequest", @@ -1921,22 +1710,6 @@ }, "type": "object" }, - "SetIamPolicyRequest": { - "description": "Request message for `SetIamPolicy` method.", - "id": "SetIamPolicyRequest", - "properties": { - "policy": { - "$ref": "Policy", - "description": "REQUIRED: The complete policy to be applied to the `resource`. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Google Cloud services (such as Projects) might reject them." - }, - "updateMask": { - "description": "OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only the fields in the mask will be modified. If no mask is provided, the following default mask is used: `paths: \"bindings, etag\"`", - "format": "google-fieldmask", - "type": "string" - } - }, - "type": "object" - }, "Status": { "description": "The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).", "id": "Status", @@ -2123,7 +1896,7 @@ "type": "object" }, "lifecyclePolicies": { - "description": "Lifecycle management schema when any task in a task group is failed. The valid size of lifecycle policies are [0, 10]. For each lifecycle policy, when the condition is met, the action in that policy will execute. If there are multiple policies that the task execution result matches, we use the action from the first matched policy. If task execution result does not meet with any of the defined lifecycle policy, we consider it as the default policy. Default policy means if the exit code is 0, exit task. If task ends with non-zero exit code, retry the task with max_retry_count.", + "description": "Lifecycle management schema when any task in a task group is failed. Currently we only support one lifecycle policy. When the lifecycle policy condition is met, the action in the policy will execute. If task execution result does not meet with the defined lifecycle policy, we consider it as the default policy. Default policy means if the exit code is 0, exit task. If task ends with non-zero exit code, retry the task with max_retry_count.", "items": { "$ref": "LifecyclePolicy" }, @@ -2190,34 +1963,6 @@ }, "type": "object" }, - "TestIamPermissionsRequest": { - "description": "Request message for `TestIamPermissions` method.", - "id": "TestIamPermissionsRequest", - "properties": { - "permissions": { - "description": "The set of permissions to check for the `resource`. Permissions with wildcards (such as `*` or `storage.*`) are not allowed. For more information see [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).", - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object" - }, - "TestIamPermissionsResponse": { - "description": "Response message for `TestIamPermissions` method.", - "id": "TestIamPermissionsResponse", - "properties": { - "permissions": { - "description": "A subset of `TestPermissionsRequest.permissions` that the caller is allowed.", - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object" - }, "Volume": { "description": "Volume describes a volume and parameters for it to be mounted to a VM.", "id": "Volume", diff --git a/batch/v1/batch-gen.go b/batch/v1/batch-gen.go index 595459c67d9..8883f304a82 100644 --- a/batch/v1/batch-gen.go +++ b/batch/v1/batch-gen.go @@ -597,103 +597,6 @@ func (s *AttachedDisk) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// AuditConfig: Specifies the audit configuration for a service. The -// configuration determines which permission types are logged, and what -// identities, if any, are exempted from logging. An AuditConfig must -// have one or more AuditLogConfigs. If there are AuditConfigs for both -// `allServices` and a specific service, the union of the two -// AuditConfigs is used for that service: the log_types specified in -// each AuditConfig are enabled, and the exempted_members in each -// AuditLogConfig are exempted. Example Policy with multiple -// AuditConfigs: { "audit_configs": [ { "service": "allServices", -// "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": -// [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { -// "log_type": "ADMIN_READ" } ] }, { "service": -// "sampleservice.googleapis.com", "audit_log_configs": [ { "log_type": -// "DATA_READ" }, { "log_type": "DATA_WRITE", "exempted_members": [ -// "user:aliya@example.com" ] } ] } ] } For sampleservice, this policy -// enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts -// `jose@example.com` from DATA_READ logging, and `aliya@example.com` -// from DATA_WRITE logging. -type AuditConfig struct { - // AuditLogConfigs: The configuration for logging of each type of - // permission. - AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"` - - // Service: Specifies a service that will be enabled for audit logging. - // For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - // `allServices` is a special value that covers all services. - Service string `json:"service,omitempty"` - - // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "AuditLogConfigs") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. - NullFields []string `json:"-"` -} - -func (s *AuditConfig) MarshalJSON() ([]byte, error) { - type NoMethod AuditConfig - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// AuditLogConfig: Provides the configuration for logging a type of -// permissions. Example: { "audit_log_configs": [ { "log_type": -// "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { -// "log_type": "DATA_WRITE" } ] } This enables 'DATA_READ' and -// 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ -// logging. -type AuditLogConfig struct { - // ExemptedMembers: Specifies the identities that do not cause logging - // for this type of permission. Follows the same format of - // Binding.members. - ExemptedMembers []string `json:"exemptedMembers,omitempty"` - - // LogType: The log type that this config enables. - // - // Possible values: - // "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this. - // "ADMIN_READ" - Admin reads. Example: CloudIAM getIamPolicy - // "DATA_WRITE" - Data writes. Example: CloudSQL Users create - // "DATA_READ" - Data reads. Example: CloudSQL Users list - LogType string `json:"logType,omitempty"` - - // ForceSendFields is a list of field names (e.g. "ExemptedMembers") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "ExemptedMembers") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. - NullFields []string `json:"-"` -} - -func (s *AuditLogConfig) MarshalJSON() ([]byte, error) { - type NoMethod AuditLogConfig - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - // Barrier: Barrier runnable blocks until all tasks in a taskgroup reach // it. type Barrier struct { @@ -724,84 +627,6 @@ func (s *Barrier) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// Binding: Associates `members`, or principals, with a `role`. -type Binding struct { - // Condition: The condition that is associated with this binding. If the - // condition evaluates to `true`, then this binding applies to the - // current request. If the condition evaluates to `false`, then this - // binding does not apply to the current request. However, a different - // role binding might grant the same role to one or more of the - // principals in this binding. To learn which resources support - // conditions in their IAM policies, see the IAM documentation - // (https://cloud.google.com/iam/help/conditions/resource-policies). - Condition *Expr `json:"condition,omitempty"` - - // Members: Specifies the principals requesting access for a Google - // Cloud resource. `members` can have the following values: * - // `allUsers`: A special identifier that represents anyone who is on the - // internet; with or without a Google account. * - // `allAuthenticatedUsers`: A special identifier that represents anyone - // who is authenticated with a Google account or a service account. Does - // not include identities that come from external identity providers - // (IdPs) through identity federation. * `user:{emailid}`: An email - // address that represents a specific Google account. For example, - // `alice@example.com` . * `serviceAccount:{emailid}`: An email address - // that represents a Google service account. For example, - // `my-other-app@appspot.gserviceaccount.com`. * - // `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: - // An identifier for a Kubernetes service account - // (https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). - // For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. - // * `group:{emailid}`: An email address that represents a Google group. - // For example, `admins@example.com`. * `domain:{domain}`: The G Suite - // domain (primary) that represents all the users of that domain. For - // example, `google.com` or `example.com`. * - // `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus - // unique identifier) representing a user that has been recently - // deleted. For example, `alice@example.com?uid=123456789012345678901`. - // If the user is recovered, this value reverts to `user:{emailid}` and - // the recovered user retains the role in the binding. * - // `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address - // (plus unique identifier) representing a service account that has been - // recently deleted. For example, - // `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. - // If the service account is undeleted, this value reverts to - // `serviceAccount:{emailid}` and the undeleted service account retains - // the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: - // An email address (plus unique identifier) representing a Google group - // that has been recently deleted. For example, - // `admins@example.com?uid=123456789012345678901`. If the group is - // recovered, this value reverts to `group:{emailid}` and the recovered - // group retains the role in the binding. - Members []string `json:"members,omitempty"` - - // Role: Role that is assigned to the list of `members`, or principals. - // For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - Role string `json:"role,omitempty"` - - // ForceSendFields is a list of field names (e.g. "Condition") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Condition") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *Binding) MarshalJSON() ([]byte, error) { - type NoMethod Binding - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - // CancelOperationRequest: The request message for // Operations.CancelOperation. type CancelOperationRequest struct { @@ -1016,66 +841,6 @@ func (s *Environment) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// Expr: Represents a textual expression in the Common Expression -// Language (CEL) syntax. CEL is a C-like expression language. The -// syntax and semantics of CEL are documented at -// https://github.com/google/cel-spec. Example (Comparison): title: -// "Summary size limit" description: "Determines if a summary is less -// than 100 chars" expression: "document.summary.size() < 100" Example -// (Equality): title: "Requestor is owner" description: "Determines if -// requestor is the document owner" expression: "document.owner == -// request.auth.claims.email" Example (Logic): title: "Public documents" -// description: "Determine whether the document should be publicly -// visible" expression: "document.type != 'private' && document.type != -// 'internal'" Example (Data Manipulation): title: "Notification string" -// description: "Create a notification string with a timestamp." -// expression: "'New message received at ' + -// string(document.create_time)" The exact variables and functions that -// may be referenced within an expression are determined by the service -// that evaluates it. See the service documentation for additional -// information. -type Expr struct { - // Description: Optional. Description of the expression. This is a - // longer text which describes the expression, e.g. when hovered over it - // in a UI. - Description string `json:"description,omitempty"` - - // Expression: Textual representation of an expression in Common - // Expression Language syntax. - Expression string `json:"expression,omitempty"` - - // Location: Optional. String indicating the location of the expression - // for error reporting, e.g. a file name and a position in the file. - Location string `json:"location,omitempty"` - - // Title: Optional. Title for the expression, i.e. a short string - // describing its purpose. This can be used e.g. in UIs which allow to - // enter the expression. - Title string `json:"title,omitempty"` - - // ForceSendFields is a list of field names (e.g. "Description") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Description") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *Expr) MarshalJSON() ([]byte, error) { - type NoMethod Expr - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - // GCS: Represents a Google Cloud Storage volume. type GCS struct { // RemotePath: Remote path, either a bucket name or a subdirectory of a @@ -1279,9 +1044,10 @@ type Job struct { // Notifications: Notification configurations. Notifications []*JobNotification `json:"notifications,omitempty"` - // Priority: Priority of the Job. The valid value range is [0, 100). A - // job with higher priority value is more likely to run earlier if all - // other requirements are satisfied. + // Priority: Priority of the Job. The valid value range is [0, 100). + // Default value is 0. Higher value indicates higher priority. A job + // with higher priority value is more likely to run earlier if all other + // requirements are satisfied. Priority int64 `json:"priority,omitempty,string"` // Status: Output only. Job status. It is read only for users. @@ -1451,7 +1217,11 @@ func (s *KMSEnvMap) MarshalJSON() ([]byte, error) { // LifecyclePolicy: LifecyclePolicy describes how to deal with task // failures based on different conditions. type LifecyclePolicy struct { - // Action: Action to execute when ActionCondition is true. + // Action: Action to execute when ActionCondition is true. When + // RETRY_TASK is specified, we will retry failed tasks if we notice any + // exit code match and fail tasks if no match is found. Likewise, when + // FAIL_TASK is specified, we will fail tasks if we notice any exit code + // match and retry tasks if no match is found. // // Possible values: // "ACTION_UNSPECIFIED" - Action unspecified. @@ -2054,116 +1824,6 @@ func (s *OperationMetadata) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// Policy: An Identity and Access Management (IAM) policy, which -// specifies access controls for Google Cloud resources. A `Policy` is a -// collection of `bindings`. A `binding` binds one or more `members`, or -// principals, to a single `role`. Principals can be user accounts, -// service accounts, Google groups, and domains (such as G Suite). A -// `role` is a named list of permissions; each `role` can be an IAM -// predefined role or a user-created custom role. For some types of -// Google Cloud resources, a `binding` can also specify a `condition`, -// which is a logical expression that allows access to a resource only -// if the expression evaluates to `true`. A condition can add -// constraints based on attributes of the request, the resource, or -// both. To learn which resources support conditions in their IAM -// policies, see the IAM documentation -// (https://cloud.google.com/iam/help/conditions/resource-policies). -// **JSON example:** { "bindings": [ { "role": -// "roles/resourcemanager.organizationAdmin", "members": [ -// "user:mike@example.com", "group:admins@example.com", -// "domain:google.com", -// "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { -// "role": "roles/resourcemanager.organizationViewer", "members": [ -// "user:eve@example.com" ], "condition": { "title": "expirable access", -// "description": "Does not grant access after Sep 2020", "expression": -// "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], -// "etag": "BwWWja0YfJA=", "version": 3 } **YAML example:** bindings: - -// members: - user:mike@example.com - group:admins@example.com - -// domain:google.com - -// serviceAccount:my-project-id@appspot.gserviceaccount.com role: -// roles/resourcemanager.organizationAdmin - members: - -// user:eve@example.com role: roles/resourcemanager.organizationViewer -// condition: title: expirable access description: Does not grant access -// after Sep 2020 expression: request.time < -// timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3 -// For a description of IAM and its features, see the IAM documentation -// (https://cloud.google.com/iam/docs/). -type Policy struct { - // AuditConfigs: Specifies cloud audit logging configuration for this - // policy. - AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"` - - // Bindings: Associates a list of `members`, or principals, with a - // `role`. Optionally, may specify a `condition` that determines how and - // when the `bindings` are applied. Each of the `bindings` must contain - // at least one principal. The `bindings` in a `Policy` can refer to up - // to 1,500 principals; up to 250 of these principals can be Google - // groups. Each occurrence of a principal counts towards these limits. - // For example, if the `bindings` grant 50 different roles to - // `user:alice@example.com`, and not to any other principal, then you - // can add another 1,450 principals to the `bindings` in the `Policy`. - Bindings []*Binding `json:"bindings,omitempty"` - - // Etag: `etag` is used for optimistic concurrency control as a way to - // help prevent simultaneous updates of a policy from overwriting each - // other. It is strongly suggested that systems make use of the `etag` - // in the read-modify-write cycle to perform policy updates in order to - // avoid race conditions: An `etag` is returned in the response to - // `getIamPolicy`, and systems are expected to put that etag in the - // request to `setIamPolicy` to ensure that their change will be applied - // to the same version of the policy. **Important:** If you use IAM - // Conditions, you must include the `etag` field whenever you call - // `setIamPolicy`. If you omit this field, then IAM allows you to - // overwrite a version `3` policy with a version `1` policy, and all of - // the conditions in the version `3` policy are lost. - Etag string `json:"etag,omitempty"` - - // Version: Specifies the format of the policy. Valid values are `0`, - // `1`, and `3`. Requests that specify an invalid value are rejected. - // Any operation that affects conditional role bindings must specify - // version `3`. This requirement applies to the following operations: * - // Getting a policy that includes a conditional role binding * Adding a - // conditional role binding to a policy * Changing a conditional role - // binding in a policy * Removing any role binding, with or without a - // condition, from a policy that includes conditions **Important:** If - // you use IAM Conditions, you must include the `etag` field whenever - // you call `setIamPolicy`. If you omit this field, then IAM allows you - // to overwrite a version `3` policy with a version `1` policy, and all - // of the conditions in the version `3` policy are lost. If a policy - // does not include any conditions, operations on that policy may - // specify any valid version or leave the field unset. To learn which - // resources support conditions in their IAM policies, see the IAM - // documentation - // (https://cloud.google.com/iam/help/conditions/resource-policies). - Version int64 `json:"version,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "AuditConfigs") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "AuditConfigs") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *Policy) MarshalJSON() ([]byte, error) { - type NoMethod Policy - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - // ReportAgentStateRequest: Request to report agent's state. The Request // itself implies the agent is healthy. type ReportAgentStateRequest struct { @@ -2381,43 +2041,6 @@ func (s *ServiceAccount) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// SetIamPolicyRequest: Request message for `SetIamPolicy` method. -type SetIamPolicyRequest struct { - // Policy: REQUIRED: The complete policy to be applied to the - // `resource`. The size of the policy is limited to a few 10s of KB. An - // empty policy is a valid policy but certain Google Cloud services - // (such as Projects) might reject them. - Policy *Policy `json:"policy,omitempty"` - - // UpdateMask: OPTIONAL: A FieldMask specifying which fields of the - // policy to modify. Only the fields in the mask will be modified. If no - // mask is provided, the following default mask is used: `paths: - // "bindings, etag" - UpdateMask string `json:"updateMask,omitempty"` - - // ForceSendFields is a list of field names (e.g. "Policy") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Policy") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) { - type NoMethod SetIamPolicyRequest - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - // Status: The `Status` type defines a logical error model that is // suitable for different programming environments, including REST APIs // and RPC APIs. It is used by gRPC (https://github.com/grpc). Each @@ -2691,14 +2314,12 @@ type TaskSpec struct { Environments map[string]string `json:"environments,omitempty"` // LifecyclePolicies: Lifecycle management schema when any task in a - // task group is failed. The valid size of lifecycle policies are [0, - // 10]. For each lifecycle policy, when the condition is met, the action - // in that policy will execute. If there are multiple policies that the - // task execution result matches, we use the action from the first - // matched policy. If task execution result does not meet with any of - // the defined lifecycle policy, we consider it as the default policy. - // Default policy means if the exit code is 0, exit task. If task ends - // with non-zero exit code, retry the task with max_retry_count. + // task group is failed. Currently we only support one lifecycle policy. + // When the lifecycle policy condition is met, the action in the policy + // will execute. If task execution result does not meet with the defined + // lifecycle policy, we consider it as the default policy. Default + // policy means if the exit code is 0, exit task. If task ends with + // non-zero exit code, retry the task with max_retry_count. LifecyclePolicies []*LifecyclePolicy `json:"lifecyclePolicies,omitempty"` // MaxRetryCount: Maximum number of retries on failures. The default, 0, @@ -2786,72 +2407,6 @@ func (s *TaskStatus) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// TestIamPermissionsRequest: Request message for `TestIamPermissions` -// method. -type TestIamPermissionsRequest struct { - // Permissions: The set of permissions to check for the `resource`. - // Permissions with wildcards (such as `*` or `storage.*`) are not - // allowed. For more information see IAM Overview - // (https://cloud.google.com/iam/docs/overview#permissions). - Permissions []string `json:"permissions,omitempty"` - - // ForceSendFields is a list of field names (e.g. "Permissions") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Permissions") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) { - type NoMethod TestIamPermissionsRequest - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// TestIamPermissionsResponse: Response message for `TestIamPermissions` -// method. -type TestIamPermissionsResponse struct { - // Permissions: A subset of `TestPermissionsRequest.permissions` that - // the caller is allowed. - Permissions []string `json:"permissions,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "Permissions") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Permissions") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) { - type NoMethod TestIamPermissionsResponse - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - // Volume: Volume describes a volume and parameters for it to be mounted // to a VM. type Volume struct { @@ -3302,7 +2857,7 @@ func (c *ProjectsLocationsJobsCreateCall) JobId(jobId string) *ProjectsLocations // if you must retry your request, the server will know to ignore the // request if it has already been completed. The server will guarantee // that for at least 60 minutes since the first request. For example, -// consider a situation where you make an initial request and t he +// consider a situation where you make an initial request and the // request times out. If you make the request again with the same // request ID, the server can check if original operation with the same // request ID was received, and if so, will ignore the second request. @@ -3427,7 +2982,7 @@ func (c *ProjectsLocationsJobsCreateCall) Do(opts ...googleapi.CallOption) (*Job // "type": "string" // }, // "requestId": { - // "description": "Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + // "description": "Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", // "location": "query", // "type": "string" // } @@ -3477,7 +3032,7 @@ func (c *ProjectsLocationsJobsDeleteCall) Reason(reason string) *ProjectsLocatio // if you must retry your request, the server will know to ignore the // request if it has already been completed. The server will guarantee // that for at least 60 minutes after the first request. For example, -// consider a situation where you make an initial request and t he +// consider a situation where you make an initial request and the // request times out. If you make the request again with the same // request ID, the server can check if original operation with the same // request ID was received, and if so, will ignore the second request. @@ -3597,7 +3152,7 @@ func (c *ProjectsLocationsJobsDeleteCall) Do(opts ...googleapi.CallOption) (*Ope // "type": "string" // }, // "requestId": { - // "description": "Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes after the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", + // "description": "Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes after the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).", // "location": "query", // "type": "string" // } @@ -3759,53 +3314,48 @@ func (c *ProjectsLocationsJobsGetCall) Do(opts ...googleapi.CallOption) (*Job, e } -// method id "batch.projects.locations.jobs.getIamPolicy": +// method id "batch.projects.locations.jobs.list": -type ProjectsLocationsJobsGetIamPolicyCall struct { +type ProjectsLocationsJobsListCall struct { s *Service - resource string + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// GetIamPolicy: Gets the access control policy for a resource. Returns -// an empty policy if the resource exists and does not have a policy -// set. +// List: List all Jobs for a project within a region. // -// - resource: REQUIRED: The resource for which the policy is being -// requested. See Resource names -// (https://cloud.google.com/apis/design/resource_names) for the -// appropriate value for this field. -func (r *ProjectsLocationsJobsService) GetIamPolicy(resource string) *ProjectsLocationsJobsGetIamPolicyCall { - c := &ProjectsLocationsJobsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.resource = resource +// - parent: Parent path. +func (r *ProjectsLocationsJobsService) List(parent string) *ProjectsLocationsJobsListCall { + c := &ProjectsLocationsJobsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Filter sets the optional parameter "filter": List filter. +func (c *ProjectsLocationsJobsListCall) Filter(filter string) *ProjectsLocationsJobsListCall { + c.urlParams_.Set("filter", filter) return c } -// OptionsRequestedPolicyVersion sets the optional parameter -// "options.requestedPolicyVersion": The maximum policy version that -// will be used to format the policy. Valid values are 0, 1, and 3. -// Requests specifying an invalid value will be rejected. Requests for -// policies with any conditional role bindings must specify version 3. -// Policies with no conditional role bindings may specify any valid -// value or leave the field unset. The policy in the response might use -// the policy version that you specified, or it might use a lower policy -// version. For example, if you specify version 3, but the policy has no -// conditional role bindings, the response uses version 1. To learn -// which resources support conditions in their IAM policies, see the IAM -// documentation -// (https://cloud.google.com/iam/help/conditions/resource-policies). -func (c *ProjectsLocationsJobsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsJobsGetIamPolicyCall { - c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) +// PageSize sets the optional parameter "pageSize": Page size. +func (c *ProjectsLocationsJobsListCall) PageSize(pageSize int64) *ProjectsLocationsJobsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": Page token. +func (c *ProjectsLocationsJobsListCall) PageToken(pageToken string) *ProjectsLocationsJobsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsJobsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsJobsGetIamPolicyCall { +func (c *ProjectsLocationsJobsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsJobsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -3815,7 +3365,7 @@ func (c *ProjectsLocationsJobsGetIamPolicyCall) Fields(s ...googleapi.Field) *Pr // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsJobsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsJobsGetIamPolicyCall { +func (c *ProjectsLocationsJobsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsJobsListCall { c.ifNoneMatch_ = entityTag return c } @@ -3823,21 +3373,21 @@ func (c *ProjectsLocationsJobsGetIamPolicyCall) IfNoneMatch(entityTag string) *P // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsJobsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsJobsGetIamPolicyCall { +func (c *ProjectsLocationsJobsListCall) Context(ctx context.Context) *ProjectsLocationsJobsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsJobsGetIamPolicyCall) Header() http.Header { +func (c *ProjectsLocationsJobsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsJobsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsJobsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -3850,7 +3400,7 @@ func (c *ProjectsLocationsJobsGetIamPolicyCall) doRequest(alt string) (*http.Res var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/jobs") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -3858,19 +3408,19 @@ func (c *ProjectsLocationsJobsGetIamPolicyCall) doRequest(alt string) (*http.Res } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "resource": c.resource, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "batch.projects.locations.jobs.getIamPolicy" call. -// Exactly one of *Policy or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Policy.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 *ProjectsLocationsJobsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { +// Do executes the "batch.projects.locations.jobs.list" call. +// Exactly one of *ListJobsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListJobsResponse.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 *ProjectsLocationsJobsListCall) Do(opts ...googleapi.CallOption) (*ListJobsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -3889,7 +3439,7 @@ func (c *ProjectsLocationsJobsGetIamPolicyCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Policy{ + ret := &ListJobsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -3901,211 +3451,41 @@ func (c *ProjectsLocationsJobsGetIamPolicyCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", - // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/jobs/{jobsId}:getIamPolicy", + // "description": "List all Jobs for a project within a region.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/jobs", // "httpMethod": "GET", - // "id": "batch.projects.locations.jobs.getIamPolicy", + // "id": "batch.projects.locations.jobs.list", // "parameterOrder": [ - // "resource" + // "parent" // ], // "parameters": { - // "options.requestedPolicyVersion": { - // "description": "Optional. The maximum policy version that will be used to format the policy. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional role bindings must specify version 3. Policies with no conditional role bindings may specify any valid value or leave the field unset. The policy in the response might use the policy version that you specified, or it might use a lower policy version. For example, if you specify version 3, but the policy has no conditional role bindings, the response uses version 1. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).", + // "filter": { + // "description": "List filter.", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "Page size.", // "format": "int32", // "location": "query", // "type": "integer" // }, - // "resource": { - // "description": "REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", + // "pageToken": { + // "description": "Page token.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Parent path.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/jobs/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+resource}:getIamPolicy", + // "path": "v1/{+parent}/jobs", // "response": { - // "$ref": "Policy" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform" - // ] - // } - -} - -// method id "batch.projects.locations.jobs.list": - -type ProjectsLocationsJobsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// List: List all Jobs for a project within a region. -// -// - parent: Parent path. -func (r *ProjectsLocationsJobsService) List(parent string) *ProjectsLocationsJobsListCall { - c := &ProjectsLocationsJobsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// Filter sets the optional parameter "filter": List filter. -func (c *ProjectsLocationsJobsListCall) Filter(filter string) *ProjectsLocationsJobsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// PageSize sets the optional parameter "pageSize": Page size. -func (c *ProjectsLocationsJobsListCall) PageSize(pageSize int64) *ProjectsLocationsJobsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": Page token. -func (c *ProjectsLocationsJobsListCall) PageToken(pageToken string) *ProjectsLocationsJobsListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsLocationsJobsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsJobsListCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsJobsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsJobsListCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsLocationsJobsListCall) Context(ctx context.Context) *ProjectsLocationsJobsListCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *ProjectsLocationsJobsListCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ProjectsLocationsJobsListCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - 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/{+parent}/jobs") - 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{ - "parent": c.parent, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "batch.projects.locations.jobs.list" call. -// Exactly one of *ListJobsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListJobsResponse.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 *ProjectsLocationsJobsListCall) Do(opts ...googleapi.CallOption) (*ListJobsResponse, 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 := &ListJobsResponse{ - 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 - // { - // "description": "List all Jobs for a project within a region.", - // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/jobs", - // "httpMethod": "GET", - // "id": "batch.projects.locations.jobs.list", - // "parameterOrder": [ - // "parent" - // ], - // "parameters": { - // "filter": { - // "description": "List filter.", - // "location": "query", - // "type": "string" - // }, - // "pageSize": { - // "description": "Page size.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "Page token.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Parent path.", - // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+$", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v1/{+parent}/jobs", - // "response": { - // "$ref": "ListJobsResponse" + // "$ref": "ListJobsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -4135,303 +3515,6 @@ func (c *ProjectsLocationsJobsListCall) Pages(ctx context.Context, f func(*ListJ } } -// method id "batch.projects.locations.jobs.setIamPolicy": - -type ProjectsLocationsJobsSetIamPolicyCall struct { - s *Service - resource string - setiampolicyrequest *SetIamPolicyRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// SetIamPolicy: Sets the access control policy on the specified -// resource. Replaces any existing policy. Can return `NOT_FOUND`, -// `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. -// -// - resource: REQUIRED: The resource for which the policy is being -// specified. See Resource names -// (https://cloud.google.com/apis/design/resource_names) for the -// appropriate value for this field. -func (r *ProjectsLocationsJobsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsJobsSetIamPolicyCall { - c := &ProjectsLocationsJobsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.resource = resource - c.setiampolicyrequest = setiampolicyrequest - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsLocationsJobsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsJobsSetIamPolicyCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsLocationsJobsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsJobsSetIamPolicyCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *ProjectsLocationsJobsSetIamPolicyCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ProjectsLocationsJobsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "resource": c.resource, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "batch.projects.locations.jobs.setIamPolicy" call. -// Exactly one of *Policy or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Policy.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 *ProjectsLocationsJobsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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 := &Policy{ - 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 - // { - // "description": "Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.", - // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/jobs/{jobsId}:setIamPolicy", - // "httpMethod": "POST", - // "id": "batch.projects.locations.jobs.setIamPolicy", - // "parameterOrder": [ - // "resource" - // ], - // "parameters": { - // "resource": { - // "description": "REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", - // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/jobs/[^/]+$", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v1/{+resource}:setIamPolicy", - // "request": { - // "$ref": "SetIamPolicyRequest" - // }, - // "response": { - // "$ref": "Policy" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform" - // ] - // } - -} - -// method id "batch.projects.locations.jobs.testIamPermissions": - -type ProjectsLocationsJobsTestIamPermissionsCall struct { - s *Service - resource string - testiampermissionsrequest *TestIamPermissionsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// TestIamPermissions: Returns permissions that a caller has on the -// specified resource. If the resource does not exist, this will return -// an empty set of permissions, not a `NOT_FOUND` error. Note: This -// operation is designed to be used for building permission-aware UIs -// and command-line tools, not for authorization checking. This -// operation may "fail open" without warning. -// -// - resource: REQUIRED: The resource for which the policy detail is -// being requested. See Resource names -// (https://cloud.google.com/apis/design/resource_names) for the -// appropriate value for this field. -func (r *ProjectsLocationsJobsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsJobsTestIamPermissionsCall { - c := &ProjectsLocationsJobsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.resource = resource - c.testiampermissionsrequest = testiampermissionsrequest - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsLocationsJobsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsJobsTestIamPermissionsCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsLocationsJobsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsJobsTestIamPermissionsCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *ProjectsLocationsJobsTestIamPermissionsCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ProjectsLocationsJobsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "resource": c.resource, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "batch.projects.locations.jobs.testIamPermissions" call. -// Exactly one of *TestIamPermissionsResponse or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *TestIamPermissionsResponse.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 *ProjectsLocationsJobsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, 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 := &TestIamPermissionsResponse{ - 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 - // { - // "description": "Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.", - // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/jobs/{jobsId}:testIamPermissions", - // "httpMethod": "POST", - // "id": "batch.projects.locations.jobs.testIamPermissions", - // "parameterOrder": [ - // "resource" - // ], - // "parameters": { - // "resource": { - // "description": "REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", - // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/jobs/[^/]+$", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v1/{+resource}:testIamPermissions", - // "request": { - // "$ref": "TestIamPermissionsRequest" - // }, - // "response": { - // "$ref": "TestIamPermissionsResponse" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform" - // ] - // } - -} - // method id "batch.projects.locations.jobs.taskGroups.tasks.get": type ProjectsLocationsJobsTaskGroupsTasksGetCall struct { diff --git a/bigqueryreservation/v1/bigqueryreservation-api.json b/bigqueryreservation/v1/bigqueryreservation-api.json index cb3b8bb40db..aad37214a34 100644 --- a/bigqueryreservation/v1/bigqueryreservation-api.json +++ b/bigqueryreservation/v1/bigqueryreservation-api.json @@ -823,7 +823,7 @@ } } }, - "revision": "20230205", + "revision": "20230215", "rootUrl": "https://bigqueryreservation.googleapis.com/", "schemas": { "Assignment": { @@ -939,14 +939,14 @@ "type": "string" }, "edition": { - "description": "Edition of the capacity commitment.", + "description": "Do not use.", "enum": [ "EDITION_UNSPECIFIED", "ENTERPRISE" ], "enumDescriptions": [ - "Default value, only for legacy reservations and capacity commitments.", - "Enterprise edition." + "Do not use.", + "Do not use." ], "type": "string" }, @@ -980,7 +980,7 @@ "Trial commitments have a committed period of 182 days after becoming ACTIVE. After that, they are converted to a new commitment based on the `renewal_plan`. Default `renewal_plan` for Trial commitment is Flex so that it can be deleted right after committed period ends.", "Monthly commitments have a committed period of 30 days after becoming ACTIVE. After that, they are not in a committed period anymore and can be removed any time.", "Annual commitments have a committed period of 365 days after becoming ACTIVE. After that they are converted to a new commitment based on the renewal_plan.", - "Should only be used for `renewal_plan` and is only meaningful if edition is specified to values other than EDITION_UNSPECIFIED. Otherwise CreateCapacityCommitmentRequest or UpdateCapacityCommitmentRequest will be rejected with error code `google.rpc.Code.INVALID_ARGUMENT`. If the renewal_plan is NONE, capacity commitment will be removed at the end of its commitment period." + "Do not use." ], "type": "string" }, @@ -1000,7 +1000,7 @@ "Trial commitments have a committed period of 182 days after becoming ACTIVE. After that, they are converted to a new commitment based on the `renewal_plan`. Default `renewal_plan` for Trial commitment is Flex so that it can be deleted right after committed period ends.", "Monthly commitments have a committed period of 30 days after becoming ACTIVE. After that, they are not in a committed period anymore and can be removed any time.", "Annual commitments have a committed period of 365 days after becoming ACTIVE. After that they are converted to a new commitment based on the renewal_plan.", - "Should only be used for `renewal_plan` and is only meaningful if edition is specified to values other than EDITION_UNSPECIFIED. Otherwise CreateCapacityCommitmentRequest or UpdateCapacityCommitmentRequest will be rejected with error code `google.rpc.Code.INVALID_ARGUMENT`. If the renewal_plan is NONE, capacity commitment will be removed at the end of its commitment period." + "Do not use." ], "type": "string" }, @@ -1134,14 +1134,14 @@ "type": "string" }, "edition": { - "description": "Edition of the reservation.", + "description": "Do not use.", "enum": [ "EDITION_UNSPECIFIED", "ENTERPRISE" ], "enumDescriptions": [ - "Default value, only for legacy reservations and capacity commitments.", - "Enterprise edition." + "Do not use.", + "Do not use." ], "type": "string" }, diff --git a/bigqueryreservation/v1/bigqueryreservation-gen.go b/bigqueryreservation/v1/bigqueryreservation-gen.go index d021dc1dcc0..827862f7f56 100644 --- a/bigqueryreservation/v1/bigqueryreservation-gen.go +++ b/bigqueryreservation/v1/bigqueryreservation-gen.go @@ -358,12 +358,11 @@ type CapacityCommitment struct { // period. It is applicable only for ACTIVE capacity commitments. CommitmentStartTime string `json:"commitmentStartTime,omitempty"` - // Edition: Edition of the capacity commitment. + // Edition: Do not use. // // Possible values: - // "EDITION_UNSPECIFIED" - Default value, only for legacy reservations - // and capacity commitments. - // "ENTERPRISE" - Enterprise edition. + // "EDITION_UNSPECIFIED" - Do not use. + // "ENTERPRISE" - Do not use. Edition string `json:"edition,omitempty"` // FailureStatus: Output only. For FAILED commitment plan, provides the @@ -404,13 +403,7 @@ type CapacityCommitment struct { // "ANNUAL" - Annual commitments have a committed period of 365 days // after becoming ACTIVE. After that they are converted to a new // commitment based on the renewal_plan. - // "NONE" - Should only be used for `renewal_plan` and is only - // meaningful if edition is specified to values other than - // EDITION_UNSPECIFIED. Otherwise CreateCapacityCommitmentRequest or - // UpdateCapacityCommitmentRequest will be rejected with error code - // `google.rpc.Code.INVALID_ARGUMENT`. If the renewal_plan is NONE, - // capacity commitment will be removed at the end of its commitment - // period. + // "NONE" - Do not use. Plan string `json:"plan,omitempty"` // RenewalPlan: The plan this capacity commitment is converted to after @@ -436,13 +429,7 @@ type CapacityCommitment struct { // "ANNUAL" - Annual commitments have a committed period of 365 days // after becoming ACTIVE. After that they are converted to a new // commitment based on the renewal_plan. - // "NONE" - Should only be used for `renewal_plan` and is only - // meaningful if edition is specified to values other than - // EDITION_UNSPECIFIED. Otherwise CreateCapacityCommitmentRequest or - // UpdateCapacityCommitmentRequest will be rejected with error code - // `google.rpc.Code.INVALID_ARGUMENT`. If the renewal_plan is NONE, - // capacity commitment will be removed at the end of its commitment - // period. + // "NONE" - Do not use. RenewalPlan string `json:"renewalPlan,omitempty"` // SlotCount: Number of slots in this commitment. @@ -702,12 +689,11 @@ type Reservation struct { // CreationTime: Output only. Creation time of the reservation. CreationTime string `json:"creationTime,omitempty"` - // Edition: Edition of the reservation. + // Edition: Do not use. // // Possible values: - // "EDITION_UNSPECIFIED" - Default value, only for legacy reservations - // and capacity commitments. - // "ENTERPRISE" - Enterprise edition. + // "EDITION_UNSPECIFIED" - Do not use. + // "ENTERPRISE" - Do not use. Edition string `json:"edition,omitempty"` // IgnoreIdleSlots: If false, any query or pipeline job using this diff --git a/chromepolicy/v1/chromepolicy-api.json b/chromepolicy/v1/chromepolicy-api.json index 6c7fabd14fe..c1c0e0b32a6 100644 --- a/chromepolicy/v1/chromepolicy-api.json +++ b/chromepolicy/v1/chromepolicy-api.json @@ -557,7 +557,7 @@ } } }, - "revision": "20230213", + "revision": "20230220", "rootUrl": "https://chromepolicy.googleapis.com/", "schemas": { "ChromeCrosDpanelAutosettingsProtoPolicyApiLifecycle": { @@ -954,6 +954,54 @@ }, "type": "object" }, + "GoogleChromePolicyVersionsV1PolicyModificationError": { + "description": "Error information for a modification request of a specific policy on a specific target.", + "id": "GoogleChromePolicyVersionsV1PolicyModificationError", + "properties": { + "errors": { + "description": "Output only. The non-field errors related to the modification.", + "items": { + "type": "string" + }, + "readOnly": true, + "type": "array" + }, + "fieldErrors": { + "description": "Output only. The error messages related to the modification.", + "items": { + "$ref": "GoogleChromePolicyVersionsV1PolicyModificationFieldError" + }, + "readOnly": true, + "type": "array" + }, + "policySchema": { + "description": "Output only. The specific policy schema modification that had an error.", + "readOnly": true, + "type": "string" + }, + "policyTargetKey": { + "$ref": "GoogleChromePolicyVersionsV1PolicyTargetKey", + "description": "Output only. The specific policy target modification that had error.", + "readOnly": true + } + }, + "type": "object" + }, + "GoogleChromePolicyVersionsV1PolicyModificationErrorDetails": { + "description": "Details of the errors encountered during a policy modification request. This message will be returned as part of the details of a google.rpc.Status returned to the user when there is an error in their request.", + "id": "GoogleChromePolicyVersionsV1PolicyModificationErrorDetails", + "properties": { + "modificationErrors": { + "description": "Output only. List of specific policy modifications errors that may have occurred during a modifying request.", + "items": { + "$ref": "GoogleChromePolicyVersionsV1PolicyModificationError" + }, + "readOnly": true, + "type": "array" + } + }, + "type": "object" + }, "GoogleChromePolicyVersionsV1PolicyModificationFieldError": { "description": "Error information for a modification request of a specific field on a specific policy.", "id": "GoogleChromePolicyVersionsV1PolicyModificationFieldError", diff --git a/chromepolicy/v1/chromepolicy-gen.go b/chromepolicy/v1/chromepolicy-gen.go index 4a5bd97a523..98e8b5afb9d 100644 --- a/chromepolicy/v1/chromepolicy-gen.go +++ b/chromepolicy/v1/chromepolicy-gen.go @@ -1024,6 +1024,84 @@ func (s *GoogleChromePolicyVersionsV1NumericRangeConstraint) MarshalJSON() ([]by return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleChromePolicyVersionsV1PolicyModificationError: Error +// information for a modification request of a specific policy on a +// specific target. +type GoogleChromePolicyVersionsV1PolicyModificationError struct { + // Errors: Output only. The non-field errors related to the + // modification. + Errors []string `json:"errors,omitempty"` + + // FieldErrors: Output only. The error messages related to the + // modification. + FieldErrors []*GoogleChromePolicyVersionsV1PolicyModificationFieldError `json:"fieldErrors,omitempty"` + + // PolicySchema: Output only. The specific policy schema modification + // that had an error. + PolicySchema string `json:"policySchema,omitempty"` + + // PolicyTargetKey: Output only. The specific policy target modification + // that had error. + PolicyTargetKey *GoogleChromePolicyVersionsV1PolicyTargetKey `json:"policyTargetKey,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Errors") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Errors") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleChromePolicyVersionsV1PolicyModificationError) MarshalJSON() ([]byte, error) { + type NoMethod GoogleChromePolicyVersionsV1PolicyModificationError + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleChromePolicyVersionsV1PolicyModificationErrorDetails: Details +// of the errors encountered during a policy modification request. This +// message will be returned as part of the details of a +// google.rpc.Status returned to the user when there is an error in +// their request. +type GoogleChromePolicyVersionsV1PolicyModificationErrorDetails struct { + // ModificationErrors: Output only. List of specific policy + // modifications errors that may have occurred during a modifying + // request. + ModificationErrors []*GoogleChromePolicyVersionsV1PolicyModificationError `json:"modificationErrors,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ModificationErrors") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ModificationErrors") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleChromePolicyVersionsV1PolicyModificationErrorDetails) MarshalJSON() ([]byte, error) { + type NoMethod GoogleChromePolicyVersionsV1PolicyModificationErrorDetails + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleChromePolicyVersionsV1PolicyModificationFieldError: Error // information for a modification request of a specific field on a // specific policy. diff --git a/cloudresourcemanager/v3/cloudresourcemanager-api.json b/cloudresourcemanager/v3/cloudresourcemanager-api.json index 34182aff126..800e39bf5b7 100644 --- a/cloudresourcemanager/v3/cloudresourcemanager-api.json +++ b/cloudresourcemanager/v3/cloudresourcemanager-api.json @@ -1761,7 +1761,7 @@ } } }, - "revision": "20230129", + "revision": "20230219", "rootUrl": "https://cloudresourcemanager.googleapis.com/", "schemas": { "AuditConfig": { @@ -2009,6 +2009,10 @@ "description": "The name of the TagKey, in the format `tagKeys/{id}`, such as `tagKeys/123`.", "type": "string" }, + "tagKeyParentName": { + "description": "The parent name of the tag key. Must be in the format `organizations/{organization_id}`.", + "type": "string" + }, "tagValue": { "description": "Resource name for TagValue in the format `tagValues/456`.", "type": "string" diff --git a/cloudresourcemanager/v3/cloudresourcemanager-gen.go b/cloudresourcemanager/v3/cloudresourcemanager-gen.go index a556587a689..da5689cbdb2 100644 --- a/cloudresourcemanager/v3/cloudresourcemanager-gen.go +++ b/cloudresourcemanager/v3/cloudresourcemanager-gen.go @@ -676,6 +676,10 @@ type EffectiveTag struct { // `tagKeys/123`. TagKey string `json:"tagKey,omitempty"` + // TagKeyParentName: The parent name of the tag key. Must be in the + // format `organizations/{organization_id}`. + TagKeyParentName string `json:"tagKeyParentName,omitempty"` + // TagValue: Resource name for TagValue in the format `tagValues/456`. TagValue string `json:"tagValue,omitempty"` diff --git a/cloudtasks/v2beta2/cloudtasks-api.json b/cloudtasks/v2beta2/cloudtasks-api.json index ee7ad3447c7..9b5cda8ff33 100644 --- a/cloudtasks/v2beta2/cloudtasks-api.json +++ b/cloudtasks/v2beta2/cloudtasks-api.json @@ -876,7 +876,7 @@ } } }, - "revision": "20230201", + "revision": "20230214", "rootUrl": "https://cloudtasks.googleapis.com/", "schemas": { "AcknowledgeTaskRequest": { @@ -1025,7 +1025,7 @@ "type": "object" }, "BufferTaskRequest": { - "description": "Request message for BufferTask.", + "description": "LINT.IfChange Request message for BufferTask.", "id": "BufferTaskRequest", "properties": { "body": { diff --git a/cloudtasks/v2beta2/cloudtasks-gen.go b/cloudtasks/v2beta2/cloudtasks-gen.go index e1ad12403d2..059cbd024ab 100644 --- a/cloudtasks/v2beta2/cloudtasks-gen.go +++ b/cloudtasks/v2beta2/cloudtasks-gen.go @@ -627,7 +627,7 @@ func (s *Binding) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// BufferTaskRequest: Request message for BufferTask. +// BufferTaskRequest: LINT.IfChange Request message for BufferTask. type BufferTaskRequest struct { // Body: Optional. Body of the HTTP request. The body can take any // generic value. The value is written to the HttpRequest of the [Task]. diff --git a/cloudtasks/v2beta3/cloudtasks-api.json b/cloudtasks/v2beta3/cloudtasks-api.json index ef10339fd35..8694da295e4 100644 --- a/cloudtasks/v2beta3/cloudtasks-api.json +++ b/cloudtasks/v2beta3/cloudtasks-api.json @@ -732,7 +732,7 @@ } } }, - "revision": "20230201", + "revision": "20230214", "rootUrl": "https://cloudtasks.googleapis.com/", "schemas": { "AppEngineHttpQueue": { @@ -869,7 +869,7 @@ "type": "object" }, "BufferTaskRequest": { - "description": "Request message for BufferTask.", + "description": "LINT.IfChange Request message for BufferTask.", "id": "BufferTaskRequest", "properties": { "body": { diff --git a/cloudtasks/v2beta3/cloudtasks-gen.go b/cloudtasks/v2beta3/cloudtasks-gen.go index 4d2b081a1c9..00924de2b8b 100644 --- a/cloudtasks/v2beta3/cloudtasks-gen.go +++ b/cloudtasks/v2beta3/cloudtasks-gen.go @@ -551,7 +551,7 @@ func (s *Binding) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// BufferTaskRequest: Request message for BufferTask. +// BufferTaskRequest: LINT.IfChange Request message for BufferTask. type BufferTaskRequest struct { // Body: Optional. Body of the HTTP request. The body can take any // generic value. The value is written to the HttpRequest of the [Task]. diff --git a/connectors/v1/connectors-api.json b/connectors/v1/connectors-api.json index b4f57ecdfe2..6037c1e6381 100644 --- a/connectors/v1/connectors-api.json +++ b/connectors/v1/connectors-api.json @@ -1079,7 +1079,7 @@ } } }, - "revision": "20230125", + "revision": "20230208", "rootUrl": "https://connectors.googleapis.com/", "schemas": { "AuditConfig": { @@ -1547,7 +1547,8 @@ "INACTIVE", "DELETING", "UPDATING", - "ERROR" + "ERROR", + "AUTHORIZATION_REQUIRED" ], "enumDescriptions": [ "Connection does not have a state yet.", @@ -1556,7 +1557,8 @@ "Connection is stopped.", "Connection is being deleted.", "Connection is being updated.", - "Connection is not running due to an error." + "Connection is not running due to an error.", + "Connection is not running due to an auth error for the Oauth2 Auth Code based connector." ], "type": "string" }, diff --git a/connectors/v1/connectors-gen.go b/connectors/v1/connectors-gen.go index 77b81c40586..0820967f0af 100644 --- a/connectors/v1/connectors-gen.go +++ b/connectors/v1/connectors-gen.go @@ -870,6 +870,8 @@ type ConnectionStatus struct { // "DELETING" - Connection is being deleted. // "UPDATING" - Connection is being updated. // "ERROR" - Connection is not running due to an error. + // "AUTHORIZATION_REQUIRED" - Connection is not running due to an auth + // error for the Oauth2 Auth Code based connector. State string `json:"state,omitempty"` // Status: Status provides detailed information for the state. diff --git a/container/v1beta1/container-api.json b/container/v1beta1/container-api.json index 5a51855deea..6d12b8aee72 100644 --- a/container/v1beta1/container-api.json +++ b/container/v1beta1/container-api.json @@ -2512,7 +2512,7 @@ } } }, - "revision": "20230117", + "revision": "20230207", "rootUrl": "https://container.googleapis.com/", "schemas": { "AcceleratorConfig": { @@ -5328,7 +5328,7 @@ "type": "object" }, "NodeTaint": { - "description": "Kubernetes taint is comprised of three fields: key, value, and effect. Effect can only be one of three types: NoSchedule, PreferNoSchedule or NoExecute. See [here](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration) for more information, including usage and the valid values.", + "description": "Kubernetes taint is composed of three fields: key, value, and effect. Effect can only be one of three types: NoSchedule, PreferNoSchedule or NoExecute. See [here](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration) for more information, including usage and the valid values.", "id": "NodeTaint", "properties": { "effect": { diff --git a/container/v1beta1/container-gen.go b/container/v1beta1/container-gen.go index 7c6e6c623f7..15949792eb0 100644 --- a/container/v1beta1/container-gen.go +++ b/container/v1beta1/container-gen.go @@ -5036,7 +5036,7 @@ func (s *NodePoolLoggingConfig) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// NodeTaint: Kubernetes taint is comprised of three fields: key, value, +// NodeTaint: Kubernetes taint is composed of three fields: key, value, // and effect. Effect can only be one of three types: NoSchedule, // PreferNoSchedule or NoExecute. See here // (https://kubernetes.io/docs/concepts/configuration/taint-and-toleration) diff --git a/content/v2.1/content-api.json b/content/v2.1/content-api.json index 36677b5f90d..0e21a7a3a13 100644 --- a/content/v2.1/content-api.json +++ b/content/v2.1/content-api.json @@ -1506,6 +1506,213 @@ } } }, + "conversionsources": { + "methods": { + "create": { + "description": "Creates a new conversion source.", + "flatPath": "{merchantId}/conversionsources", + "httpMethod": "POST", + "id": "content.conversionsources.create", + "parameterOrder": [ + "merchantId" + ], + "parameters": { + "merchantId": { + "description": "Required. The ID of the account that owns the new conversion source.", + "format": "int64", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "{merchantId}/conversionsources", + "request": { + "$ref": "ConversionSource" + }, + "response": { + "$ref": "ConversionSource" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "delete": { + "description": "Archives an existing conversion source. It will be recoverable for 30 days. This archiving behavior is not typical in the Content API and unique to this service.", + "flatPath": "{merchantId}/conversionsources/{conversionSourceId}", + "httpMethod": "DELETE", + "id": "content.conversionsources.delete", + "parameterOrder": [ + "merchantId", + "conversionSourceId" + ], + "parameters": { + "conversionSourceId": { + "description": "Required. The ID of the conversion source to be deleted.", + "location": "path", + "required": true, + "type": "string" + }, + "merchantId": { + "description": "Required. The ID of the account that owns the new conversion source.", + "format": "int64", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "{merchantId}/conversionsources/{conversionSourceId}", + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "get": { + "description": "Fetches a conversion source.", + "flatPath": "{merchantId}/conversionsources/{conversionSourceId}", + "httpMethod": "GET", + "id": "content.conversionsources.get", + "parameterOrder": [ + "merchantId", + "conversionSourceId" + ], + "parameters": { + "conversionSourceId": { + "description": "Required. The REST ID of the collection.", + "location": "path", + "required": true, + "type": "string" + }, + "merchantId": { + "description": "Required. The ID of the account that owns the new conversion source.", + "format": "int64", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "{merchantId}/conversionsources/{conversionSourceId}", + "response": { + "$ref": "ConversionSource" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "list": { + "description": "Retrieves the list of conversion sources the caller has access to.", + "flatPath": "{merchantId}/conversionsources", + "httpMethod": "GET", + "id": "content.conversionsources.list", + "parameterOrder": [ + "merchantId" + ], + "parameters": { + "merchantId": { + "description": "Required. The ID of the account that owns the new conversion source.", + "format": "int64", + "location": "path", + "required": true, + "type": "string" + }, + "pageSize": { + "description": "The maximum number of conversion sources to return in a page. If no `page_size` is specified, `100` is used as the default value. The maximum value is `200`. Values above `200` will be coerced to `200`. Regardless of pagination, at most `200` conversion sources are returned in total.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Page token.", + "location": "query", + "type": "string" + }, + "showDeleted": { + "description": "If true, also returns archived conversion sources.", + "location": "query", + "type": "boolean" + } + }, + "path": "{merchantId}/conversionsources", + "response": { + "$ref": "ListConversionSourcesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "patch": { + "description": "Updates information of an existing conversion source.", + "flatPath": "{merchantId}/conversionsources/{conversionSourceId}", + "httpMethod": "PATCH", + "id": "content.conversionsources.patch", + "parameterOrder": [ + "merchantId", + "conversionSourceId" + ], + "parameters": { + "conversionSourceId": { + "description": "Required. The ID of the conversion source to be updated.", + "location": "path", + "required": true, + "type": "string" + }, + "merchantId": { + "description": "Required. The ID of the account that owns the new conversion source.", + "format": "int64", + "location": "path", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Required. List of fields being updated.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "{merchantId}/conversionsources/{conversionSourceId}", + "request": { + "$ref": "ConversionSource" + }, + "response": { + "$ref": "ConversionSource" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "undelete": { + "description": "Re-enables an archived conversion source.", + "flatPath": "{merchantId}/conversionsources/{conversionSourceId}:undelete", + "httpMethod": "POST", + "id": "content.conversionsources.undelete", + "parameterOrder": [ + "merchantId", + "conversionSourceId" + ], + "parameters": { + "conversionSourceId": { + "description": "Required. The ID of the conversion source to be undeleted.", + "location": "path", + "required": true, + "type": "string" + }, + "merchantId": { + "description": "Required. The ID of the account that owns the new conversion source.", + "format": "int64", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "{merchantId}/conversionsources/{conversionSourceId}:undelete", + "request": { + "$ref": "UndeleteConversionSourceRequest" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + }, "csses": { "methods": { "get": { @@ -5953,7 +6160,7 @@ } } }, - "revision": "20230208", + "revision": "20230217", "rootUrl": "https://shoppingcontent.googleapis.com/", "schemas": { "Account": { @@ -5992,6 +6199,10 @@ "$ref": "AccountBusinessInformation", "description": "The business information of the account." }, + "conversionSettings": { + "$ref": "AccountConversionSettings", + "description": "Settings for conversion tracking." + }, "cssId": { "description": "ID of CSS the account belongs to.", "format": "uint64", @@ -6133,6 +6344,17 @@ }, "type": "object" }, + "AccountConversionSettings": { + "description": "Settings for conversion tracking.", + "id": "AccountConversionSettings", + "properties": { + "freeListingsAutoTaggingEnabled": { + "description": "When enabled, free listing URLs have a parameter to enable conversion tracking for products owned by the current merchant account. See [auto-tagging](https://support.google.com/merchants/answer/11127659).", + "type": "boolean" + } + }, + "type": "object" + }, "AccountCredentials": { "description": "Credentials allowing Google to call a partner's API on behalf of a merchant.", "id": "AccountCredentials", @@ -7164,6 +7386,66 @@ }, "type": "object" }, + "AttributionSettings": { + "description": "Represents attribution settings for conversion sources receiving pre-attribution data.", + "id": "AttributionSettings", + "properties": { + "attributionLookbackWindowInDays": { + "description": "Required. Lookback windows (in days) used for attribution in this source. Supported values are 7, 30, 60, 90.", + "format": "int32", + "type": "integer" + }, + "attributionModel": { + "description": "Required. Attribution model.", + "enum": [ + "ATTRIBUTION_MODEL_UNSPECIFIED", + "CROSS_CHANNEL_LAST_CLICK", + "ADS_PREFERRED_LAST_CLICK", + "CROSS_CHANNEL_DATA_DRIVEN", + "CROSS_CHANNEL_FIRST_CLICK", + "CROSS_CHANNEL_LINEAR", + "CROSS_CHANNEL_POSITION_BASED", + "CROSS_CHANNEL_TIME_DECAY" + ], + "enumDescriptions": [ + "", + "Cross-channel Last Click model.", + "Ads-preferred Last Click model.", + "Cross-channel Data Driven model.", + "Cross-channel Frist Click model.", + "Cross-channel Linear model.", + "Cross-channel Position Based model.", + "Cross-channel Time Decay model." + ], + "type": "string" + }, + "conversionType": { + "description": "Immutable. Unordered list. List of different conversion types a conversion event can be classified as. A standard \"purchase\" type will be automatically created if this list is empty at creation time.", + "items": { + "$ref": "AttributionSettingsConversionType" + }, + "type": "array" + } + }, + "type": "object" + }, + "AttributionSettingsConversionType": { + "description": "Message representing a types of conversion events", + "id": "AttributionSettingsConversionType", + "properties": { + "includeInReporting": { + "description": "Output only. Option indicating if the type should be included in Merchant Center reporting.", + "readOnly": true, + "type": "boolean" + }, + "name": { + "description": "Output only. Conversion event name, as it'll be reported by the client.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, "BestSellers": { "description": "Fields related to the [Best Sellers reports](https://support.google.com/merchants/answer/9488679).", "id": "BestSellers", @@ -7673,6 +7955,49 @@ }, "type": "object" }, + "ConversionSource": { + "description": "Represents a conversion source owned by a Merchant account. A merchant account can have up to 200 conversion sources.", + "id": "ConversionSource", + "properties": { + "conversionSourceId": { + "description": "Output only. Generated by the Content API upon creation of a new `ConversionSource`. Format: [a-z]{4}:.+ The four characters before the colon represent the type of conversio source. Content after the colon represents the ID of the conversion source within that type. The ID of two different conversion sources might be the same across different types. The following type prefixes are supported: - galk: For GoogleAnalyticsLink sources. - mcdn: For MerchantCenterDestination sources.", + "readOnly": true, + "type": "string" + }, + "expireTime": { + "description": "Output only. The time when an archived conversion source becomes permanently deleted and is no longer available to undelete.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "googleAnalyticsLink": { + "$ref": "GoogleAnalyticsLink", + "description": "Immutable. Conversion Source of type \"Link to Google Analytics Property\"." + }, + "merchantCenterDestination": { + "$ref": "MerchantCenterDestination", + "description": "Conversion Source of type \"Merchant Center Tag Destination\"." + }, + "state": { + "description": "Output only. Current state of this conversion source. Can't be edited through the API.", + "enum": [ + "STATE_UNSPECIFIED", + "ACTIVE", + "ARCHIVED", + "PENDING" + ], + "enumDescriptions": [ + "", + "Conversion source is fully functional.", + "Conversion source has been archived in the last 30 days and not currently functional. Can be restored using the undelete method.", + "Conversion source creation has started but not fully finished yet." + ], + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, "Css": { "description": "Information about CSS domain.", "id": "Css", @@ -8646,6 +8971,28 @@ }, "type": "object" }, + "GoogleAnalyticsLink": { + "description": "\"Google Analytics Link\" sources can be used to get conversion data from an existing Google Analytics property into the linked Merchant Center account.", + "id": "GoogleAnalyticsLink", + "properties": { + "attributionSettings": { + "$ref": "AttributionSettings", + "description": "Output only. Attribution settings for the linked Google Analytics property.", + "readOnly": true + }, + "propertyId": { + "description": "Required. Immutable. ID of the Google Analytics property the merchant is linked to.", + "format": "int64", + "type": "string" + }, + "propertyName": { + "description": "Output only. Name of the Google Analytics property the merchant is linked to.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, "Headers": { "description": "A non-empty list of row or column headers for a table. Exactly one of `prices`, `weights`, `numItems`, `postalCodeGroupNames`, or `location` must be set.", "id": "Headers", @@ -9283,6 +9630,24 @@ }, "type": "object" }, + "ListConversionSourcesResponse": { + "description": "Response message for the ListConversionSources method.", + "id": "ListConversionSourcesResponse", + "properties": { + "conversionSources": { + "description": "List of conversion sources.", + "items": { + "$ref": "ConversionSource" + }, + "type": "array" + }, + "nextPageToken": { + "description": "Token to be used to fetch the next results page.", + "type": "string" + } + }, + "type": "object" + }, "ListCssesResponse": { "description": "The response message for the `ListCsses` method", "id": "ListCssesResponse", @@ -9572,6 +9937,30 @@ }, "type": "object" }, + "MerchantCenterDestination": { + "description": "\"Merchant Center Destination\" sources can be used to send conversion events from a website using a Google tag directly to a Merchant Center account where the source is created.", + "id": "MerchantCenterDestination", + "properties": { + "attributionSettings": { + "$ref": "AttributionSettings", + "description": "Required. Attribution settings being used for the Merchant Center Destination." + }, + "currencyCode": { + "description": "Required. Three-letter currency code (ISO 4217). The currency code defines in which currency the conversions sent to this destination will be reported in Merchant Center.", + "type": "string" + }, + "destinationId": { + "description": "Output only. Merchant Center Destination ID.", + "readOnly": true, + "type": "string" + }, + "displayName": { + "description": "Required. Merchant-specified display name for the destination. This is the name that identifies the conversion source within the Merchant Center UI. Limited to 64 characters.", + "type": "string" + } + }, + "type": "object" + }, "MerchantOrderReturn": { "description": "Order return. Production access (all methods) requires the order manager role. Sandbox access does not.", "id": "MerchantOrderReturn", @@ -12902,7 +13291,7 @@ "type": "string" }, "id": { - "description": "The REST ID of the product. Content API methods that operate on products take this as their `productId` parameter. The REST ID for a product is of the form channel:contentLanguage: targetCountry: offerId.", + "description": "The REST ID of the product. Content API methods that operate on products take this as their `productId` parameter. The REST ID for a product has one of the 2 forms channel:contentLanguage: targetCountry: offerId or channel:contentLanguage:feedLabel: offerId.", "type": "string" }, "identifierExists": { @@ -17059,6 +17448,12 @@ }, "type": "object" }, + "UndeleteConversionSourceRequest": { + "description": "Request message for the UndeleteConversionSource method.", + "id": "UndeleteConversionSourceRequest", + "properties": {}, + "type": "object" + }, "UnitInvoice": { "id": "UnitInvoice", "properties": { diff --git a/content/v2.1/content-gen.go b/content/v2.1/content-gen.go index 497658e2205..f28d9555d11 100644 --- a/content/v2.1/content-gen.go +++ b/content/v2.1/content-gen.go @@ -123,6 +123,7 @@ func New(client *http.Client) (*APIService, error) { s.Buyongoogleprograms = NewBuyongoogleprogramsService(s) s.Collections = NewCollectionsService(s) s.Collectionstatuses = NewCollectionstatusesService(s) + s.Conversionsources = NewConversionsourcesService(s) s.Csses = NewCssesService(s) s.Datafeeds = NewDatafeedsService(s) s.Datafeedstatuses = NewDatafeedstatusesService(s) @@ -172,6 +173,8 @@ type APIService struct { Collectionstatuses *CollectionstatusesService + Conversionsources *ConversionsourcesService + Csses *CssesService Datafeeds *DatafeedsService @@ -328,6 +331,15 @@ type CollectionstatusesService struct { s *APIService } +func NewConversionsourcesService(s *APIService) *ConversionsourcesService { + rs := &ConversionsourcesService{s: s} + return rs +} + +type ConversionsourcesService struct { + s *APIService +} + func NewCssesService(s *APIService) *CssesService { rs := &CssesService{s: s} return rs @@ -655,6 +667,9 @@ type Account struct { // BusinessInformation: The business information of the account. BusinessInformation *AccountBusinessInformation `json:"businessInformation,omitempty"` + // ConversionSettings: Settings for conversion tracking. + ConversionSettings *AccountConversionSettings `json:"conversionSettings,omitempty"` + // CssId: ID of CSS the account belongs to. CssId uint64 `json:"cssId,omitempty,string"` @@ -919,6 +934,39 @@ func (s *AccountBusinessInformation) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// AccountConversionSettings: Settings for conversion tracking. +type AccountConversionSettings struct { + // FreeListingsAutoTaggingEnabled: When enabled, free listing URLs have + // a parameter to enable conversion tracking for products owned by the + // current merchant account. See auto-tagging + // (https://support.google.com/merchants/answer/11127659). + FreeListingsAutoTaggingEnabled bool `json:"freeListingsAutoTaggingEnabled,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "FreeListingsAutoTaggingEnabled") to unconditionally include in API + // requests. By default, fields with empty or default values are omitted + // from API requests. However, any non-pointer, non-interface field + // appearing in ForceSendFields will be sent to the server regardless of + // whether the field is empty or not. This may be used to include empty + // fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. + // "FreeListingsAutoTaggingEnabled") to include in API requests with the + // JSON null value. By default, fields with empty values are omitted + // from API requests. However, any field with an empty value appearing + // in NullFields will be sent to the server as null. It is an error if a + // field in this list has a non-empty value. This may be used to include + // null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *AccountConversionSettings) MarshalJSON() ([]byte, error) { + type NoMethod AccountConversionSettings + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // AccountCredentials: Credentials allowing Google to call a partner's // API on behalf of a merchant. type AccountCredentials struct { @@ -2746,6 +2794,94 @@ func (s *Amount) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// AttributionSettings: Represents attribution settings for conversion +// sources receiving pre-attribution data. +type AttributionSettings struct { + // AttributionLookbackWindowInDays: Required. Lookback windows (in days) + // used for attribution in this source. Supported values are 7, 30, 60, + // 90. + AttributionLookbackWindowInDays int64 `json:"attributionLookbackWindowInDays,omitempty"` + + // AttributionModel: Required. Attribution model. + // + // Possible values: + // "ATTRIBUTION_MODEL_UNSPECIFIED" + // "CROSS_CHANNEL_LAST_CLICK" - Cross-channel Last Click model. + // "ADS_PREFERRED_LAST_CLICK" - Ads-preferred Last Click model. + // "CROSS_CHANNEL_DATA_DRIVEN" - Cross-channel Data Driven model. + // "CROSS_CHANNEL_FIRST_CLICK" - Cross-channel Frist Click model. + // "CROSS_CHANNEL_LINEAR" - Cross-channel Linear model. + // "CROSS_CHANNEL_POSITION_BASED" - Cross-channel Position Based + // model. + // "CROSS_CHANNEL_TIME_DECAY" - Cross-channel Time Decay model. + AttributionModel string `json:"attributionModel,omitempty"` + + // ConversionType: Immutable. Unordered list. List of different + // conversion types a conversion event can be classified as. A standard + // "purchase" type will be automatically created if this list is empty + // at creation time. + ConversionType []*AttributionSettingsConversionType `json:"conversionType,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "AttributionLookbackWindowInDays") to unconditionally include in API + // requests. By default, fields with empty or default values are omitted + // from API requests. However, any non-pointer, non-interface field + // appearing in ForceSendFields will be sent to the server regardless of + // whether the field is empty or not. This may be used to include empty + // fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. + // "AttributionLookbackWindowInDays") to include in API requests with + // the JSON null value. By default, fields with empty values are omitted + // from API requests. However, any field with an empty value appearing + // in NullFields will be sent to the server as null. It is an error if a + // field in this list has a non-empty value. This may be used to include + // null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *AttributionSettings) MarshalJSON() ([]byte, error) { + type NoMethod AttributionSettings + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// AttributionSettingsConversionType: Message representing a types of +// conversion events +type AttributionSettingsConversionType struct { + // IncludeInReporting: Output only. Option indicating if the type should + // be included in Merchant Center reporting. + IncludeInReporting bool `json:"includeInReporting,omitempty"` + + // Name: Output only. Conversion event name, as it'll be reported by the + // client. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "IncludeInReporting") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "IncludeInReporting") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *AttributionSettingsConversionType) MarshalJSON() ([]byte, error) { + type NoMethod AttributionSettingsConversionType + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // BestSellers: Fields related to the Best Sellers reports // (https://support.google.com/merchants/answer/9488679). type BestSellers struct { @@ -3459,6 +3595,72 @@ func (s *CollectionStatusItemLevelIssue) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// ConversionSource: Represents a conversion source owned by a Merchant +// account. A merchant account can have up to 200 conversion sources. +type ConversionSource struct { + // ConversionSourceId: Output only. Generated by the Content API upon + // creation of a new `ConversionSource`. Format: [a-z]{4}:.+ The four + // characters before the colon represent the type of conversio source. + // Content after the colon represents the ID of the conversion source + // within that type. The ID of two different conversion sources might be + // the same across different types. The following type prefixes are + // supported: - galk: For GoogleAnalyticsLink sources. - mcdn: For + // MerchantCenterDestination sources. + ConversionSourceId string `json:"conversionSourceId,omitempty"` + + // ExpireTime: Output only. The time when an archived conversion source + // becomes permanently deleted and is no longer available to undelete. + ExpireTime string `json:"expireTime,omitempty"` + + // GoogleAnalyticsLink: Immutable. Conversion Source of type "Link to + // Google Analytics Property". + GoogleAnalyticsLink *GoogleAnalyticsLink `json:"googleAnalyticsLink,omitempty"` + + // MerchantCenterDestination: Conversion Source of type "Merchant Center + // Tag Destination". + MerchantCenterDestination *MerchantCenterDestination `json:"merchantCenterDestination,omitempty"` + + // State: Output only. Current state of this conversion source. Can't be + // edited through the API. + // + // Possible values: + // "STATE_UNSPECIFIED" + // "ACTIVE" - Conversion source is fully functional. + // "ARCHIVED" - Conversion source has been archived in the last 30 + // days and not currently functional. Can be restored using the undelete + // method. + // "PENDING" - Conversion source creation has started but not fully + // finished yet. + State string `json:"state,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ConversionSourceId") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ConversionSourceId") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *ConversionSource) MarshalJSON() ([]byte, error) { + type NoMethod ConversionSource + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // Css: Information about CSS domain. type Css struct { // CssDomainId: Output only. Immutable. The CSS domain ID. @@ -5027,6 +5229,46 @@ func (s *GmbAccountsGmbAccount) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleAnalyticsLink: "Google Analytics Link" sources can be used to +// get conversion data from an existing Google Analytics property into +// the linked Merchant Center account. +type GoogleAnalyticsLink struct { + // AttributionSettings: Output only. Attribution settings for the linked + // Google Analytics property. + AttributionSettings *AttributionSettings `json:"attributionSettings,omitempty"` + + // PropertyId: Required. Immutable. ID of the Google Analytics property + // the merchant is linked to. + PropertyId int64 `json:"propertyId,omitempty,string"` + + // PropertyName: Output only. Name of the Google Analytics property the + // merchant is linked to. + PropertyName string `json:"propertyName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AttributionSettings") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AttributionSettings") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleAnalyticsLink) MarshalJSON() ([]byte, error) { + type NoMethod GoogleAnalyticsLink + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // Headers: A non-empty list of row or column headers for a table. // Exactly one of `prices`, `weights`, `numItems`, // `postalCodeGroupNames`, or `location` must be set. @@ -6221,6 +6463,43 @@ func (s *ListCollectionsResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// ListConversionSourcesResponse: Response message for the +// ListConversionSources method. +type ListConversionSourcesResponse struct { + // ConversionSources: List of conversion sources. + ConversionSources []*ConversionSource `json:"conversionSources,omitempty"` + + // NextPageToken: Token to be used to fetch the next results page. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ConversionSources") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ConversionSources") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *ListConversionSourcesResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListConversionSourcesResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // ListCssesResponse: The response message for the `ListCsses` method type ListCssesResponse struct { // Csses: The CSS domains affiliated with the specified CSS group. @@ -6776,6 +7055,51 @@ func (s *LoyaltyPoints) UnmarshalJSON(data []byte) error { return nil } +// MerchantCenterDestination: "Merchant Center Destination" sources can +// be used to send conversion events from a website using a Google tag +// directly to a Merchant Center account where the source is created. +type MerchantCenterDestination struct { + // AttributionSettings: Required. Attribution settings being used for + // the Merchant Center Destination. + AttributionSettings *AttributionSettings `json:"attributionSettings,omitempty"` + + // CurrencyCode: Required. Three-letter currency code (ISO 4217). The + // currency code defines in which currency the conversions sent to this + // destination will be reported in Merchant Center. + CurrencyCode string `json:"currencyCode,omitempty"` + + // DestinationId: Output only. Merchant Center Destination ID. + DestinationId string `json:"destinationId,omitempty"` + + // DisplayName: Required. Merchant-specified display name for the + // destination. This is the name that identifies the conversion source + // within the Merchant Center UI. Limited to 64 characters. + DisplayName string `json:"displayName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AttributionSettings") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AttributionSettings") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *MerchantCenterDestination) MarshalJSON() ([]byte, error) { + type NoMethod MerchantCenterDestination + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // MerchantOrderReturn: Order return. Production access (all methods) // requires the order manager role. Sandbox access does not. type MerchantOrderReturn struct { @@ -12504,8 +12828,8 @@ type Product struct { // Id: The REST ID of the product. Content API methods that operate on // products take this as their `productId` parameter. The REST ID for a - // product is of the form channel:contentLanguage: targetCountry: - // offerId. + // product has one of the 2 forms channel:contentLanguage: + // targetCountry: offerId or channel:contentLanguage:feedLabel: offerId. Id string `json:"id,omitempty"` // IdentifierExists: False when the item does not have unique product @@ -18962,6 +19286,11 @@ func (s *TransitTableTransitTimeRowTransitTimeValue) MarshalJSON() ([]byte, erro return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// UndeleteConversionSourceRequest: Request message for the +// UndeleteConversionSource method. +type UndeleteConversionSourceRequest struct { +} + type UnitInvoice struct { // AdditionalCharges: Additional charges for a unit, for example, // shipping costs. @@ -25812,6 +26141,927 @@ func (c *CollectionstatusesListCall) Pages(ctx context.Context, f func(*ListColl } } +// method id "content.conversionsources.create": + +type ConversionsourcesCreateCall struct { + s *APIService + merchantId int64 + conversionsource *ConversionSource + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a new conversion source. +// +// - merchantId: The ID of the account that owns the new conversion +// source. +func (r *ConversionsourcesService) Create(merchantId int64, conversionsource *ConversionSource) *ConversionsourcesCreateCall { + c := &ConversionsourcesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.merchantId = merchantId + c.conversionsource = conversionsource + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ConversionsourcesCreateCall) Fields(s ...googleapi.Field) *ConversionsourcesCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ConversionsourcesCreateCall) Context(ctx context.Context) *ConversionsourcesCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ConversionsourcesCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ConversionsourcesCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionsource) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/conversionsources") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatInt(c.merchantId, 10), + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "content.conversionsources.create" call. +// Exactly one of *ConversionSource or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ConversionSource.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 *ConversionsourcesCreateCall) Do(opts ...googleapi.CallOption) (*ConversionSource, 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 := &ConversionSource{ + 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 + // { + // "description": "Creates a new conversion source.", + // "flatPath": "{merchantId}/conversionsources", + // "httpMethod": "POST", + // "id": "content.conversionsources.create", + // "parameterOrder": [ + // "merchantId" + // ], + // "parameters": { + // "merchantId": { + // "description": "Required. The ID of the account that owns the new conversion source.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/conversionsources", + // "request": { + // "$ref": "ConversionSource" + // }, + // "response": { + // "$ref": "ConversionSource" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.conversionsources.delete": + +type ConversionsourcesDeleteCall struct { + s *APIService + merchantId int64 + conversionSourceId string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Archives an existing conversion source. It will be +// recoverable for 30 days. This archiving behavior is not typical in +// the Content API and unique to this service. +// +// - conversionSourceId: The ID of the conversion source to be deleted. +// - merchantId: The ID of the account that owns the new conversion +// source. +func (r *ConversionsourcesService) Delete(merchantId int64, conversionSourceId string) *ConversionsourcesDeleteCall { + c := &ConversionsourcesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.merchantId = merchantId + c.conversionSourceId = conversionSourceId + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ConversionsourcesDeleteCall) Fields(s ...googleapi.Field) *ConversionsourcesDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ConversionsourcesDeleteCall) Context(ctx context.Context) *ConversionsourcesDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ConversionsourcesDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ConversionsourcesDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/conversionsources/{conversionSourceId}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatInt(c.merchantId, 10), + "conversionSourceId": c.conversionSourceId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "content.conversionsources.delete" call. +func (c *ConversionsourcesDeleteCall) Do(opts ...googleapi.CallOption) error { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return gensupport.WrapError(err) + } + return nil + // { + // "description": "Archives an existing conversion source. It will be recoverable for 30 days. This archiving behavior is not typical in the Content API and unique to this service.", + // "flatPath": "{merchantId}/conversionsources/{conversionSourceId}", + // "httpMethod": "DELETE", + // "id": "content.conversionsources.delete", + // "parameterOrder": [ + // "merchantId", + // "conversionSourceId" + // ], + // "parameters": { + // "conversionSourceId": { + // "description": "Required. The ID of the conversion source to be deleted.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "merchantId": { + // "description": "Required. The ID of the account that owns the new conversion source.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/conversionsources/{conversionSourceId}", + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.conversionsources.get": + +type ConversionsourcesGetCall struct { + s *APIService + merchantId int64 + conversionSourceId string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Fetches a conversion source. +// +// - conversionSourceId: The REST ID of the collection. +// - merchantId: The ID of the account that owns the new conversion +// source. +func (r *ConversionsourcesService) Get(merchantId int64, conversionSourceId string) *ConversionsourcesGetCall { + c := &ConversionsourcesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.merchantId = merchantId + c.conversionSourceId = conversionSourceId + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ConversionsourcesGetCall) Fields(s ...googleapi.Field) *ConversionsourcesGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ConversionsourcesGetCall) IfNoneMatch(entityTag string) *ConversionsourcesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ConversionsourcesGetCall) Context(ctx context.Context) *ConversionsourcesGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ConversionsourcesGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ConversionsourcesGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + 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, "{merchantId}/conversionsources/{conversionSourceId}") + 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{ + "merchantId": strconv.FormatInt(c.merchantId, 10), + "conversionSourceId": c.conversionSourceId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "content.conversionsources.get" call. +// Exactly one of *ConversionSource or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ConversionSource.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 *ConversionsourcesGetCall) Do(opts ...googleapi.CallOption) (*ConversionSource, 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 := &ConversionSource{ + 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 + // { + // "description": "Fetches a conversion source.", + // "flatPath": "{merchantId}/conversionsources/{conversionSourceId}", + // "httpMethod": "GET", + // "id": "content.conversionsources.get", + // "parameterOrder": [ + // "merchantId", + // "conversionSourceId" + // ], + // "parameters": { + // "conversionSourceId": { + // "description": "Required. The REST ID of the collection.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "merchantId": { + // "description": "Required. The ID of the account that owns the new conversion source.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/conversionsources/{conversionSourceId}", + // "response": { + // "$ref": "ConversionSource" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.conversionsources.list": + +type ConversionsourcesListCall struct { + s *APIService + merchantId int64 + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Retrieves the list of conversion sources the caller has access +// to. +// +// - merchantId: The ID of the account that owns the new conversion +// source. +func (r *ConversionsourcesService) List(merchantId int64) *ConversionsourcesListCall { + c := &ConversionsourcesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.merchantId = merchantId + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of conversion sources to return in a page. If no `page_size` is +// specified, `100` is used as the default value. The maximum value is +// `200`. Values above `200` will be coerced to `200`. Regardless of +// pagination, at most `200` conversion sources are returned in total. +func (c *ConversionsourcesListCall) PageSize(pageSize int64) *ConversionsourcesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": Page token. +func (c *ConversionsourcesListCall) PageToken(pageToken string) *ConversionsourcesListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ShowDeleted sets the optional parameter "showDeleted": If true, also +// returns archived conversion sources. +func (c *ConversionsourcesListCall) ShowDeleted(showDeleted bool) *ConversionsourcesListCall { + c.urlParams_.Set("showDeleted", fmt.Sprint(showDeleted)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ConversionsourcesListCall) Fields(s ...googleapi.Field) *ConversionsourcesListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ConversionsourcesListCall) IfNoneMatch(entityTag string) *ConversionsourcesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ConversionsourcesListCall) Context(ctx context.Context) *ConversionsourcesListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ConversionsourcesListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ConversionsourcesListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + 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, "{merchantId}/conversionsources") + 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{ + "merchantId": strconv.FormatInt(c.merchantId, 10), + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "content.conversionsources.list" call. +// Exactly one of *ListConversionSourcesResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ListConversionSourcesResponse.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 *ConversionsourcesListCall) Do(opts ...googleapi.CallOption) (*ListConversionSourcesResponse, 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 := &ListConversionSourcesResponse{ + 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 + // { + // "description": "Retrieves the list of conversion sources the caller has access to.", + // "flatPath": "{merchantId}/conversionsources", + // "httpMethod": "GET", + // "id": "content.conversionsources.list", + // "parameterOrder": [ + // "merchantId" + // ], + // "parameters": { + // "merchantId": { + // "description": "Required. The ID of the account that owns the new conversion source.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of conversion sources to return in a page. If no `page_size` is specified, `100` is used as the default value. The maximum value is `200`. Values above `200` will be coerced to `200`. Regardless of pagination, at most `200` conversion sources are returned in total.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Page token.", + // "location": "query", + // "type": "string" + // }, + // "showDeleted": { + // "description": "If true, also returns archived conversion sources.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "{merchantId}/conversionsources", + // "response": { + // "$ref": "ListConversionSourcesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ConversionsourcesListCall) Pages(ctx context.Context, f func(*ListConversionSourcesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "content.conversionsources.patch": + +type ConversionsourcesPatchCall struct { + s *APIService + merchantId int64 + conversionSourceId string + conversionsource *ConversionSource + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates information of an existing conversion source. +// +// - conversionSourceId: The ID of the conversion source to be updated. +// - merchantId: The ID of the account that owns the new conversion +// source. +func (r *ConversionsourcesService) Patch(merchantId int64, conversionSourceId string, conversionsource *ConversionSource) *ConversionsourcesPatchCall { + c := &ConversionsourcesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.merchantId = merchantId + c.conversionSourceId = conversionSourceId + c.conversionsource = conversionsource + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. List +// of fields being updated. +func (c *ConversionsourcesPatchCall) UpdateMask(updateMask string) *ConversionsourcesPatchCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ConversionsourcesPatchCall) Fields(s ...googleapi.Field) *ConversionsourcesPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ConversionsourcesPatchCall) Context(ctx context.Context) *ConversionsourcesPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ConversionsourcesPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ConversionsourcesPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionsource) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/conversionsources/{conversionSourceId}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatInt(c.merchantId, 10), + "conversionSourceId": c.conversionSourceId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "content.conversionsources.patch" call. +// Exactly one of *ConversionSource or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ConversionSource.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 *ConversionsourcesPatchCall) Do(opts ...googleapi.CallOption) (*ConversionSource, 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 := &ConversionSource{ + 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 + // { + // "description": "Updates information of an existing conversion source.", + // "flatPath": "{merchantId}/conversionsources/{conversionSourceId}", + // "httpMethod": "PATCH", + // "id": "content.conversionsources.patch", + // "parameterOrder": [ + // "merchantId", + // "conversionSourceId" + // ], + // "parameters": { + // "conversionSourceId": { + // "description": "Required. The ID of the conversion source to be updated.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "merchantId": { + // "description": "Required. The ID of the account that owns the new conversion source.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "updateMask": { + // "description": "Required. List of fields being updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "{merchantId}/conversionsources/{conversionSourceId}", + // "request": { + // "$ref": "ConversionSource" + // }, + // "response": { + // "$ref": "ConversionSource" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.conversionsources.undelete": + +type ConversionsourcesUndeleteCall struct { + s *APIService + merchantId int64 + conversionSourceId string + undeleteconversionsourcerequest *UndeleteConversionSourceRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Undelete: Re-enables an archived conversion source. +// +// - conversionSourceId: The ID of the conversion source to be +// undeleted. +// - merchantId: The ID of the account that owns the new conversion +// source. +func (r *ConversionsourcesService) Undelete(merchantId int64, conversionSourceId string, undeleteconversionsourcerequest *UndeleteConversionSourceRequest) *ConversionsourcesUndeleteCall { + c := &ConversionsourcesUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.merchantId = merchantId + c.conversionSourceId = conversionSourceId + c.undeleteconversionsourcerequest = undeleteconversionsourcerequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ConversionsourcesUndeleteCall) Fields(s ...googleapi.Field) *ConversionsourcesUndeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ConversionsourcesUndeleteCall) Context(ctx context.Context) *ConversionsourcesUndeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ConversionsourcesUndeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ConversionsourcesUndeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeleteconversionsourcerequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/conversionsources/{conversionSourceId}:undelete") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatInt(c.merchantId, 10), + "conversionSourceId": c.conversionSourceId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "content.conversionsources.undelete" call. +func (c *ConversionsourcesUndeleteCall) Do(opts ...googleapi.CallOption) error { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return gensupport.WrapError(err) + } + return nil + // { + // "description": "Re-enables an archived conversion source.", + // "flatPath": "{merchantId}/conversionsources/{conversionSourceId}:undelete", + // "httpMethod": "POST", + // "id": "content.conversionsources.undelete", + // "parameterOrder": [ + // "merchantId", + // "conversionSourceId" + // ], + // "parameters": { + // "conversionSourceId": { + // "description": "Required. The ID of the conversion source to be undeleted.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "merchantId": { + // "description": "Required. The ID of the account that owns the new conversion source.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/conversionsources/{conversionSourceId}:undelete", + // "request": { + // "$ref": "UndeleteConversionSourceRequest" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + // method id "content.csses.get": type CssesGetCall struct { diff --git a/datamigration/v1/datamigration-api.json b/datamigration/v1/datamigration-api.json index 1481ef58e18..860279b0895 100644 --- a/datamigration/v1/datamigration-api.json +++ b/datamigration/v1/datamigration-api.json @@ -109,6 +109,42 @@ "resources": { "locations": { "methods": { + "fetchStaticIps": { + "description": "Fetches a set of static IP addresses that need to be allowlisted by the customer when using the static-IP connectivity method.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}:fetchStaticIps", + "httpMethod": "GET", + "id": "datamigration.projects.locations.fetchStaticIps", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name for the location for which static IPs should be returned. Must be in the format `projects/*/locations/*`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+$", + "required": true, + "type": "string" + }, + "pageSize": { + "description": "Maximum number of IPs to return.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "A page token, received from a previous `FetchStaticIps` call.", + "location": "query", + "type": "string" + } + }, + "path": "v1/{+name}:fetchStaticIps", + "response": { + "$ref": "FetchStaticIpsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "get": { "description": "Gets information about a location.", "flatPath": "v1/projects/{projectsId}/locations/{locationsId}", @@ -194,14 +230,14 @@ "type": "string" }, "parent": { - "description": "Required. The parent, which owns this collection of connection profiles.", + "description": "Required. The parent which owns this collection of connection profiles.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+$", "required": true, "type": "string" }, "requestId": { - "description": "Optional. A unique id used to identify the request. If the server receives two requests with the same id, then the second request will be ignored. It is recommended to always set this value to a UUID. The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", + "description": "Optional. A unique ID used to identify the request. If the server receives two requests with the same ID, then the second request is ignored. It is recommended to always set this value to a UUID. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", "location": "query", "type": "string" }, @@ -249,7 +285,7 @@ "type": "string" }, "requestId": { - "description": "A unique id used to identify the request. If the server receives two requests with the same id, then the second request will be ignored. It is recommended to always set this value to a UUID. The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", + "description": "A unique ID used to identify the request. If the server receives two requests with the same ID, then the second request is ignored. It is recommended to always set this value to a UUID. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", "location": "query", "type": "string" } @@ -338,7 +374,7 @@ "type": "string" }, "pageSize": { - "description": "The maximum number of connection profiles to return. The service may return fewer than this value. If unspecified, at most 50 connection profiles will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + "description": "The maximum number of connection profiles to return. The service may return fewer than this value. If unspecified, at most 50 connection profiles will be returned. The maximum value is 1000; values above 1000 are coerced to 1000.", "format": "int32", "location": "query", "type": "integer" @@ -349,7 +385,7 @@ "type": "string" }, "parent": { - "description": "Required. The parent, which owns this collection of connection profiles.", + "description": "Required. The parent which owns this collection of connection profiles.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+$", "required": true, @@ -381,7 +417,7 @@ "type": "string" }, "requestId": { - "description": "Optional. A unique id used to identify the request. If the server receives two requests with the same id, then the second request will be ignored. It is recommended to always set this value to a UUID. The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", + "description": "Optional. A unique ID used to identify the request. If the server receives two requests with the same ID, then the second request is ignored. It is recommended to always set this value to a UUID. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", "location": "query", "type": "string" }, @@ -391,7 +427,7 @@ "type": "boolean" }, "updateMask": { - "description": "Required. Field mask is used to specify the fields to be overwritten in the connection profile resource by the update.", + "description": "Required. Field mask is used to specify the fields to be overwritten by the update in the conversion workspace resource.", "format": "google-fieldmask", "location": "query", "type": "string" @@ -474,7 +510,7 @@ "conversionWorkspaces": { "methods": { "apply": { - "description": "Apply draft tree onto a specific destination database", + "description": "Applies draft tree onto a specific destination database.", "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/conversionWorkspaces/{conversionWorkspacesId}:apply", "httpMethod": "POST", "id": "datamigration.projects.locations.conversionWorkspaces.apply", @@ -483,7 +519,7 @@ ], "parameters": { "name": { - "description": "Required. Name of the conversion workspace resource to apply draft to destination for. in the form of: projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.", + "description": "Required. The name of the conversion workspace resource for which to apply the draft tree. Must be in the form of: projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/conversionWorkspaces/[^/]+$", "required": true, @@ -572,14 +608,14 @@ "type": "string" }, "parent": { - "description": "Required. The parent, which owns this collection of conversion workspaces.", + "description": "Required. The parent which owns this collection of conversion workspaces.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+$", "required": true, "type": "string" }, "requestId": { - "description": "A unique id used to identify the request. If the server receives two requests with the same id, then the second request will be ignored. It is recommended to always set this value to a UUID. The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", + "description": "A unique ID used to identify the request. If the server receives two requests with the same ID, then the second request is ignored. It is recommended to always set this value to a UUID. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", "location": "query", "type": "string" } @@ -612,7 +648,7 @@ "type": "string" }, "requestId": { - "description": "A unique id used to identify the request. If the server receives two requests with the same id, then the second request will be ignored. It is recommended to always set this value to a UUID. The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", + "description": "A unique ID used to identify the request. If the server receives two requests with the same ID, then the second request is ignored. It is recommended to always set this value to a UUID. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", "location": "query", "type": "string" } @@ -635,12 +671,12 @@ ], "parameters": { "commitId": { - "description": "Optional. Optional filter to request a specific commit id", + "description": "Optional. Optional filter to request a specific commit ID.", "location": "query", "type": "string" }, "conversionWorkspace": { - "description": "Required. Name of the conversion workspace resource whose revisions are listed. in the form of: projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.", + "description": "Required. Name of the conversion workspace resource whose revisions are listed. Must be in the form of: projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/conversionWorkspaces/[^/]+$", "required": true, @@ -656,7 +692,7 @@ ] }, "describeDatabaseEntities": { - "description": "Use this method to describe the database entities tree for a specific conversion workspace and a specific tree type. The DB Entities are not a resource like conversion workspace or mapping rule, and they can not be created, updated or deleted like one. Instead they are simple data objects describing the structure of the client database.", + "description": "Describes the database entities tree for a specific conversion workspace and a specific tree type. Database entities are not resources like conversion workspaces or mapping rules, and they can't be created, updated or deleted. Instead, they are simple data objects describing the structure of the client database.", "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/conversionWorkspaces/{conversionWorkspacesId}:describeDatabaseEntities", "httpMethod": "GET", "id": "datamigration.projects.locations.conversionWorkspaces.describeDatabaseEntities", @@ -665,12 +701,12 @@ ], "parameters": { "commitId": { - "description": "Request a specific commit id. If not specified, the entities from the latest commit are returned.", + "description": "Request a specific commit ID. If not specified, the entities from the latest commit are returned.", "location": "query", "type": "string" }, "conversionWorkspace": { - "description": "Required. Name of the conversion workspace resource whose DB entities are described in the form of: projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.", + "description": "Required. Name of the conversion workspace resource whose database entities are described. Must be in the form of: projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/conversionWorkspaces/[^/]+$", "required": true, @@ -682,7 +718,7 @@ "type": "string" }, "pageSize": { - "description": "The maximum number of entities to return. The service may return fewer than this value.", + "description": "The maximum number of entities to return. The service may return fewer entities than the value specifies.", "format": "int32", "location": "query", "type": "integer" @@ -701,10 +737,10 @@ "DESTINATION_TREE" ], "enumDescriptions": [ - "Unspecified tree type", - "The source database tree", - "The draft database tree", - "The destination database tree" + "Unspecified tree type.", + "The source database tree.", + "The draft database tree.", + "The destination database tree." ], "location": "query", "type": "string" @@ -789,12 +825,12 @@ ], "parameters": { "filter": { - "description": "A filter expression that filters conversion workspaces listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c. For example, list conversion workspaces created this year by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** You can also filter nested fields. For example, you could specify **source.version = \"12.c.1\"** to select all conversion workspaces with source database version equal to 12.c.1", + "description": "A filter expression that filters conversion workspaces listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c. For example, list conversion workspaces created this year by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** You can also filter nested fields. For example, you could specify **source.version = \"12.c.1\"** to select all conversion workspaces with source database version equal to 12.c.1.", "location": "query", "type": "string" }, "pageSize": { - "description": "The maximum number of conversion workspaces to return. The service may return fewer than this value. If unspecified, at most 50 sets will be returned.", + "description": "The maximum number of conversion workspaces to return. The service may return fewer than this value. If unspecified, at most 50 sets are returned.", "format": "int32", "location": "query", "type": "integer" @@ -805,7 +841,7 @@ "type": "string" }, "parent": { - "description": "Required. The parent, which owns this collection of conversion workspaces.", + "description": "Required. The parent which owns this collection of conversion workspaces.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+$", "required": true, @@ -837,12 +873,12 @@ "type": "string" }, "requestId": { - "description": "A unique id used to identify the request. If the server receives two requests with the same id, then the second request will be ignored. It is recommended to always set this value to a UUID. The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", + "description": "A unique ID used to identify the request. If the server receives two requests with the same ID, then the second request is ignored. It is recommended to always set this value to a UUID. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", "location": "query", "type": "string" }, "updateMask": { - "description": "Required. Field mask is used to specify the fields to be overwritten in the conversion workspace resource by the update.", + "description": "Required. Field mask is used to specify the fields to be overwritten by the update in the conversion workspace resource.", "format": "google-fieldmask", "location": "query", "type": "string" @@ -860,7 +896,7 @@ ] }, "rollback": { - "description": "Rollbacks a conversion workspace to the last committed spanshot.", + "description": "Rolls back a conversion workspace to the last committed snapshot.", "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/conversionWorkspaces/{conversionWorkspacesId}:rollback", "httpMethod": "POST", "id": "datamigration.projects.locations.conversionWorkspaces.rollback", @@ -869,7 +905,7 @@ ], "parameters": { "name": { - "description": "Required. Name of the conversion workspace resource to rollback to.", + "description": "Required. Name of the conversion workspace resource to roll back to.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/conversionWorkspaces/[^/]+$", "required": true, @@ -888,7 +924,7 @@ ] }, "searchBackgroundJobs": { - "description": "Use this method to search/list the background jobs for a specific conversion workspace. The background jobs are not a resource like conversion workspace or mapping rule, and they can not be created, updated or deleted like one. Instead they are a way to expose the data plane jobs log.", + "description": "Searches/lists the background jobs for a specific conversion workspace. The background jobs are not resources like conversion workspaces or mapping rules, and they can't be created, updated or deleted. Instead, they are a way to expose the data plane jobs log.", "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/conversionWorkspaces/{conversionWorkspacesId}:searchBackgroundJobs", "httpMethod": "GET", "id": "datamigration.projects.locations.conversionWorkspaces.searchBackgroundJobs", @@ -897,26 +933,26 @@ ], "parameters": { "completedUntilTime": { - "description": "Optional. If supplied, will only return jobs that completed until (not including) the given timestamp.", + "description": "Optional. If provided, only returns jobs that completed until (not including) the given timestamp.", "format": "google-datetime", "location": "query", "type": "string" }, "conversionWorkspace": { - "description": "Required. Name of the conversion workspace resource whos jobs are listed. in the form of: projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.", + "description": "Required. Name of the conversion workspace resource whose jobs are listed, in the form of: projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/conversionWorkspaces/[^/]+$", "required": true, "type": "string" }, "maxSize": { - "description": "Optional. The maximum number of jobs to return. The service may return fewer than this value. If unspecified, at most 100 jobs will be returned. The maximum value is 100; values above 100 will be coerced to 100.", + "description": "Optional. The maximum number of jobs to return. The service may return fewer than this value. If unspecified, at most 100 jobs are returned. The maximum value is 100; values above 100 are coerced to 100.", "format": "int32", "location": "query", "type": "integer" }, "returnMostRecentPerJobType": { - "description": "Optional. Whether or not to return just the most recent job per job type", + "description": "Optional. Whether or not to return just the most recent job per job type,", "location": "query", "type": "boolean" } @@ -939,7 +975,7 @@ ], "parameters": { "name": { - "description": "Name of the conversion workspace resource to seed with new database structure. in the form of: projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.", + "description": "Name of the conversion workspace resource to seed with new database structure, in the form of: projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/conversionWorkspaces/[^/]+$", "required": true, @@ -1066,14 +1102,14 @@ "type": "string" }, "parent": { - "description": "Required. The parent, which owns this collection of migration jobs.", + "description": "Required. The parent which owns this collection of migration jobs.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+$", "required": true, "type": "string" }, "requestId": { - "description": "A unique id used to identify the request. If the server receives two requests with the same id, then the second request will be ignored. It is recommended to always set this value to a UUID. The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", + "description": "A unique ID used to identify the request. If the server receives two requests with the same ID, then the second request is ignored. It is recommended to always set this value to a UUID. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", "location": "query", "type": "string" } @@ -1111,7 +1147,7 @@ "type": "string" }, "requestId": { - "description": "A unique id used to identify the request. If the server receives two requests with the same id, then the second request will be ignored. It is recommended to always set this value to a UUID. The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", + "description": "A unique ID used to identify the request. If the server receives two requests with the same ID, then the second request is ignored. It is recommended to always set this value to a UUID. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", "location": "query", "type": "string" } @@ -1228,7 +1264,7 @@ "type": "string" }, "pageSize": { - "description": "The maximum number of migration jobs to return. The service may return fewer than this value. If unspecified, at most 50 migration jobs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + "description": "The maximum number of migration jobs to return. The service may return fewer than this value. If unspecified, at most 50 migration jobs will be returned. The maximum value is 1000; values above 1000 are coerced to 1000.", "format": "int32", "location": "query", "type": "integer" @@ -1239,7 +1275,7 @@ "type": "string" }, "parent": { - "description": "Required. The parent, which owns this collection of migrationJobs.", + "description": "Required. The parent which owns this collection of migrationJobs.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+$", "required": true, @@ -1271,12 +1307,12 @@ "type": "string" }, "requestId": { - "description": "A unique id used to identify the request. If the server receives two requests with the same id, then the second request will be ignored. It is recommended to always set this value to a UUID. The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", + "description": "A unique ID used to identify the request. If the server receives two requests with the same ID, then the second request is ignored. It is recommended to always set this value to a UUID. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", "location": "query", "type": "string" }, "updateMask": { - "description": "Required. Field mask is used to specify the fields to be overwritten in the migration job resource by the update.", + "description": "Required. Field mask is used to specify the fields to be overwritten by the update in the conversion workspace resource.", "format": "google-fieldmask", "location": "query", "type": "string" @@ -1666,7 +1702,7 @@ "type": "string" }, "requestId": { - "description": "Optional. A unique id used to identify the request. If the server receives two requests with the same id, then the second request will be ignored. It is recommended to always set this value to a UUID. The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", + "description": "Optional. A unique ID used to identify the request. If the server receives two requests with the same ID, then the second request is ignored. It is recommended to always set this value to a UUID. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", "location": "query", "type": "string" }, @@ -1704,7 +1740,7 @@ "type": "string" }, "requestId": { - "description": "Optional. A unique id used to identify the request. If the server receives two requests with the same id, then the second request will be ignored. It is recommended to always set this value to a UUID. The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", + "description": "Optional. A unique ID used to identify the request. If the server receives two requests with the same ID, then the second request is ignored. It is recommended to always set this value to a UUID. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", "location": "query", "type": "string" } @@ -1762,7 +1798,7 @@ "type": "string" }, "pageSize": { - "description": "Maximum number of private connections to return. If unspecified, at most 50 private connections that will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + "description": "Maximum number of private connections to return. If unspecified, at most 50 private connections that are returned. The maximum value is 1000; values above 1000 are coerced to 1000.", "format": "int32", "location": "query", "type": "integer" @@ -1795,7 +1831,7 @@ } } }, - "revision": "20230125", + "revision": "20230215", "rootUrl": "https://datamigration.googleapis.com/", "schemas": { "AlloyDbConnectionProfile": { @@ -1906,7 +1942,7 @@ "id": "BackgroundJobLogEntry", "properties": { "completionComment": { - "description": "Job completion comment, such as how many entities were seeded, how many warnings were found during conversion and similar information.", + "description": "Job completion comment, such as how many entities were seeded, how many warnings were found during conversion, and similar information.", "type": "string" }, "completionState": { @@ -1917,7 +1953,7 @@ "FAILED" ], "enumDescriptions": [ - "The status is not specified. This state will be used when job is not yet finished.", + "The status is not specified. This state is used when job is not yet finished.", "Success.", "Error." ], @@ -1929,12 +1965,12 @@ "type": "string" }, "id": { - "description": "The background job log entry id", + "description": "The background job log entry ID.", "type": "string" }, "importRulesJobDetails": { "$ref": "ImportRulesJobDetails", - "description": "Import rules job details" + "description": "Import rules job details." }, "jobType": { "description": "The type of job that was executed.", @@ -1946,11 +1982,11 @@ "BACKGROUND_JOB_TYPE_IMPORT_RULES_FILE" ], "enumDescriptions": [ - "Unspecified background job type", - "Job to seed from the source database", - "Job to convert the source database into a draft of the destination database", - "Job to apply the draft tree onto the destination", - "Job to import and convert mapping rules from an external source such as an ora2pg config file" + "Unspecified background job type.", + "Job to seed from the source database.", + "Job to convert the source database into a draft of the destination database.", + "Job to apply the draft tree onto the destination.", + "Job to import and convert mapping rules from an external source such as an ora2pg config file." ], "type": "string" }, @@ -1960,7 +1996,7 @@ }, "seedJobDetails": { "$ref": "SeedJobDetails", - "description": "Seed job details" + "description": "Seed job details." }, "startTime": { "description": "The timestamp when the background job was started.", @@ -2176,28 +2212,28 @@ "id": "ColumnEntity", "properties": { "array": { - "description": "Is the column of array type", + "description": "Is the column of array type.", "type": "boolean" }, "arrayLength": { - "description": "If the column is array, of which length", + "description": "If the column is array, of which length.", "format": "int32", "type": "integer" }, "autoGenerated": { - "description": "Is the column auto-generated/identity", + "description": "Is the column auto-generated/identity.", "type": "boolean" }, "charset": { - "description": "Charset override - instead of table level charset", + "description": "Charset override - instead of table level charset.", "type": "string" }, "collation": { - "description": "Collation override - instead of table level collation", + "description": "Collation override - instead of table level collation.", "type": "string" }, "comment": { - "description": "Comment associated with the column", + "description": "Comment associated with the column.", "type": "string" }, "customFeatures": { @@ -2205,59 +2241,59 @@ "description": "Properties of the object.", "type": "any" }, - "description": "Custom engine specific features", + "description": "Custom engine specific features.", "type": "object" }, "dataType": { - "description": "Column data type", + "description": "Column data type.", "type": "string" }, "defaultValue": { - "description": "Default value of the column", + "description": "Default value of the column.", "type": "string" }, "fractionalSecondsPrecision": { - "description": "Column fractional second precision - used for timestamp based datatypes", + "description": "Column fractional second precision - used for timestamp based datatypes.", "format": "int32", "type": "integer" }, "length": { - "description": "Column length - e.g. varchar (50)", + "description": "Column length - e.g. varchar (50).", "format": "int64", "type": "string" }, "name": { - "description": "Column name", + "description": "Column name.", "type": "string" }, "nullable": { - "description": "Is the column nullable", + "description": "Is the column nullable.", "type": "boolean" }, "ordinalPosition": { - "description": "Column order in the table", + "description": "Column order in the table.", "format": "int32", "type": "integer" }, "precision": { - "description": "Column precision - when relevant", + "description": "Column precision - when relevant.", "format": "int32", "type": "integer" }, "scale": { - "description": "Column scale - when relevant", + "description": "Column scale - when relevant.", "format": "int32", "type": "integer" }, "setValues": { - "description": "Specifies the list of values allowed in the column. List is empty if set values is not required", + "description": "Specifies the list of values allowed in the column. List is empty if setValues is not required.", "items": { "type": "string" }, "type": "array" }, "udt": { - "description": "Is the column a UDT", + "description": "Is the column a UDT.", "type": "boolean" } }, @@ -2384,26 +2420,26 @@ "description": "Properties of the object.", "type": "any" }, - "description": "Custom engine specific features", + "description": "Custom engine specific features.", "type": "object" }, "name": { - "description": "The name of the table constraint", + "description": "The name of the table constraint.", "type": "string" }, "referenceColumns": { - "description": "Reference Columns which may be associated with the constraint. eg: if the constraint is a FOREIGN_KEY, this represents the list of full names of referenced columns by the foreign key.", + "description": "Reference columns which may be associated with the constraint. For example, if the constraint is a FOREIGN_KEY, this represents the list of full names of referenced columns by the foreign key.", "items": { "type": "string" }, "type": "array" }, "referenceTable": { - "description": "Reference table which may be associated with the constraint. eg: if the constraint is a FOREIGN_KEY, this represents the list of full name of the referenced table by the foreign key.", + "description": "Reference table which may be associated with the constraint. For example, if the constraint is a FOREIGN_KEY, this represents the list of full name of the referenced table by the foreign key.", "type": "string" }, "tableColumns": { - "description": "Table columns used as part of the Constraint for e.g. primary key constraint should list the columns which constitutes the key", + "description": "Table columns used as part of the Constraint, for example primary key constraint should list the columns which constitutes the key.", "items": { "type": "string" }, @@ -2414,7 +2450,7 @@ "type": "string" }, "type": { - "description": "Type of constraint - e.g. unique, primary key, foreign key (currently only primary key is supported)", + "description": "Type of constraint, for example unique, primary key, foreign key (currently only primary key is supported).", "type": "string" } }, @@ -2435,7 +2471,7 @@ "description": "Required. The destination engine details." }, "displayName": { - "description": "The display name for the workspace", + "description": "The display name for the workspace.", "type": "string" }, "globalSettings": { @@ -2446,12 +2482,12 @@ "type": "object" }, "hasUncommittedChanges": { - "description": "Output only. Whether the workspace has uncommitted changes (changes which were made after the workspace was committed)", + "description": "Output only. Whether the workspace has uncommitted changes (changes which were made after the workspace was committed).", "readOnly": true, "type": "boolean" }, "latestCommitId": { - "description": "Output only. The latest commit id", + "description": "Output only. The latest commit ID.", "readOnly": true, "type": "string" }, @@ -2498,7 +2534,7 @@ "id": "ConvertConversionWorkspaceRequest", "properties": { "autoCommit": { - "description": "Should the conversion workspace be committed automatically after the conversion.", + "description": "Specifies whether the conversion workspace is to be committed automatically after the conversion.", "type": "boolean" }, "filter": { @@ -2509,11 +2545,11 @@ "type": "object" }, "DatabaseEngineInfo": { - "description": "The type and version of a source or destination DB.", + "description": "The type and version of a source or destination database.", "id": "DatabaseEngineInfo", "properties": { "engine": { - "description": "Required. Engine Type.", + "description": "Required. Engine type.", "enum": [ "DATABASE_ENGINE_UNSPECIFIED", "MYSQL", @@ -2524,28 +2560,28 @@ "The source database engine of the migration job is unknown.", "The source engine is MySQL.", "The source engine is PostgreSQL.", - "The source engine is Oracle" + "The source engine is Oracle." ], "type": "string" }, "version": { - "description": "Required. Engine named version, for e.g. 12.c.1", + "description": "Required. Engine named version, for example 12.c.1.", "type": "string" } }, "type": "object" }, "DatabaseEntity": { - "description": "The base entity type for all the database related entities The message contains the entity name, the name of its parent, its type and the specific details per its type", + "description": "The base entity type for all the database related entities. The message contains the entity name, the name of its parent, the entity type, and the specific details per entity type.", "id": "DatabaseEntity", "properties": { "databaseFunction": { "$ref": "FunctionEntity", - "description": "Function" + "description": "Function." }, "databasePackage": { "$ref": "PackageEntity", - "description": "Package" + "description": "Package." }, "entityType": { "description": "The type of the database entity (table, view, index, ...).", @@ -2567,21 +2603,21 @@ "DATABASE_ENTITY_TYPE_MATERIAL_VIEW" ], "enumDescriptions": [ - "Unspecified database entity type", - "Schema", - "Table", - "Column", - "Constraint", - "Index", - "Trigger", - "View", - "Sequence", - "Stored Procedure", - "Function", - "Synonym", - "Package", - "UDT", - "Material View" + "Unspecified database entity type.", + "Schema.", + "Table.", + "Column.", + "Constraint.", + "Index.", + "Trigger.", + "View.", + "Sequence.", + "Stored Procedure.", + "Function.", + "Synonym.", + "Package.", + "UDT.", + "Material View." ], "type": "string" }, @@ -2602,7 +2638,7 @@ }, "sequence": { "$ref": "SequenceEntity", - "description": "Sequence" + "description": "Sequence." }, "shortName": { "description": "The short name (e.g. table name) of the entity.", @@ -2610,11 +2646,11 @@ }, "storedProcedure": { "$ref": "StoredProcedureEntity", - "description": "Stored Procedure" + "description": "Stored procedure." }, "synonym": { "$ref": "SynonymEntity", - "description": "Synonym" + "description": "Synonym." }, "table": { "$ref": "TableEntity", @@ -2629,7 +2665,7 @@ "DESTINATION" ], "enumDescriptions": [ - "Tree Type Unspecified.", + "Tree type unspecified.", "Tree of entities loaded from a source database.", "Tree of entities converted from the source tree using the mapping rules.", "Tree of entities observed on the destination database." @@ -2638,7 +2674,7 @@ }, "view": { "$ref": "ViewEntity", - "description": "View" + "description": "View." } }, "type": "object" @@ -2659,7 +2695,7 @@ "The source database engine of the migration job is unknown.", "The source engine is MySQL.", "The source engine is PostgreSQL.", - "The source engine is Oracle" + "The source engine is Oracle." ], "type": "string" }, @@ -2710,7 +2746,7 @@ "type": "array" }, "nextPageToken": { - "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "description": "A token which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.", "type": "string" } }, @@ -2756,18 +2792,18 @@ "id": "EntityMapping", "properties": { "draftEntity": { - "description": "Target entity full name. The draft entity can also include a column, index or constraint using the same naming notation schema.table.column", + "description": "Target entity full name. The draft entity can also include a column, index or constraint using the same naming notation schema.table.column.", "type": "string" }, "mappingLog": { - "description": "Entity mapping log entries. Multiple rules can be effective and contribute changes to a converted entity such as, a rule can handle the entity name, another rule can handle an entity type. In addition, rules which did not change the entity are also logged along the with the reason preventing them to do so.", + "description": "Entity mapping log entries. Multiple rules can be effective and contribute changes to a converted entity, such as a rule can handle the entity name, another rule can handle an entity type. In addition, rules which did not change the entity are also logged along with the reason preventing them to do so.", "items": { "$ref": "EntityMappingLogEntry" }, "type": "array" }, "sourceEntity": { - "description": "Source entity full name. The source entity can also be a column, index or constraint using the same naming notation schema.table.column", + "description": "Source entity full name. The source entity can also be a column, index or constraint using the same naming notation schema.table.column.", "type": "string" } }, @@ -2782,11 +2818,11 @@ "type": "string" }, "ruleId": { - "description": "Which rule caused it.", + "description": "Which rule caused this log entry.", "type": "string" }, "ruleRevisionId": { - "description": "Rule revision id", + "description": "Rule revision ID.", "type": "string" } }, @@ -2815,6 +2851,24 @@ }, "type": "object" }, + "FetchStaticIpsResponse": { + "description": "Response message for a 'FetchStaticIps' request.", + "id": "FetchStaticIpsResponse", + "properties": { + "nextPageToken": { + "description": "A token that can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "type": "string" + }, + "staticIps": { + "description": "List of static IPs.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, "ForwardSshTunnelConnectivity": { "description": "Forward SSH Tunnel connectivity.", "id": "ForwardSshTunnelConnectivity", @@ -2852,11 +2906,11 @@ "description": "Properties of the object.", "type": "any" }, - "description": "Custom engine specific features", + "description": "Custom engine specific features.", "type": "object" }, "sqlCode": { - "description": "The SQL code which creates the function", + "description": "The SQL code which creates the function.", "type": "string" } }, @@ -2875,7 +2929,7 @@ "description": "The VM creation configuration" }, "vmPort": { - "description": "The port that will be open on the bastion host", + "description": "The port that will be open on the bastion host.", "format": "int32", "type": "integer" }, @@ -2939,7 +2993,7 @@ "type": "boolean" }, "rulesFiles": { - "description": "One or more rules files", + "description": "One or more rules files.", "items": { "$ref": "RulesFile" }, @@ -2953,9 +3007,9 @@ "IMPORT_RULES_FILE_FORMAT_ORATOPG_CONFIG_FILE" ], "enumDescriptions": [ - "Unspecified Rules Format", - "Harbour Bridge Session file", - "ORA2PG config file" + "Unspecified rules format.", + "HarbourBridge session file.", + "Ora2Pg configuration file." ], "type": "string" } @@ -2963,25 +3017,25 @@ "type": "object" }, "ImportRulesJobDetails": { - "description": "Details regarding an Import Rules background job", + "description": "Details regarding an Import Rules background job.", "id": "ImportRulesJobDetails", "properties": { "fileFormat": { - "description": "The requested file format", + "description": "The requested file format.", "enum": [ "IMPORT_RULES_FILE_FORMAT_UNSPECIFIED", "IMPORT_RULES_FILE_FORMAT_HARBOUR_BRIDGE_SESSION_FILE", "IMPORT_RULES_FILE_FORMAT_ORATOPG_CONFIG_FILE" ], "enumDescriptions": [ - "Unspecified Rules Format", - "Harbour Bridge Session file", - "ORA2PG config file" + "Unspecified rules format.", + "HarbourBridge session file.", + "Ora2Pg configuration file." ], "type": "string" }, "files": { - "description": "File names used for the import rules job", + "description": "File names used for the import rules job.", "items": { "type": "string" }, @@ -2999,26 +3053,26 @@ "description": "Properties of the object.", "type": "any" }, - "description": "Custom engine specific features", + "description": "Custom engine specific features.", "type": "object" }, "name": { - "description": "The name of the index", + "description": "The name of the index.", "type": "string" }, "tableColumns": { - "description": "Table columns used as part of the Index for e.g. B-TREE index should list the columns which constitutes the index.", + "description": "Table columns used as part of the Index, for example B-TREE index should list the columns which constitutes the index.", "items": { "type": "string" }, "type": "array" }, "type": { - "description": "Type of index - e.g. B-TREE", + "description": "Type of index, for example B-TREE.", "type": "string" }, "unique": { - "description": "boolean value indicating whether the index is unique", + "description": "Boolean value indicating whether the index is unique.", "type": "boolean" } }, @@ -3036,7 +3090,7 @@ "type": "array" }, "nextPageToken": { - "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "description": "A token which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.", "type": "string" }, "unreachable": { @@ -3061,7 +3115,7 @@ "type": "array" }, "nextPageToken": { - "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "description": "A token which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.", "type": "string" }, "unreachable": { @@ -3104,7 +3158,7 @@ "type": "array" }, "nextPageToken": { - "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "description": "A token which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.", "type": "string" }, "unreachable": { @@ -3140,7 +3194,7 @@ "id": "ListPrivateConnectionsResponse", "properties": { "nextPageToken": { - "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "description": "A token which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.", "type": "string" }, "privateConnections": { @@ -3570,7 +3624,7 @@ "description": "Properties of the object.", "type": "any" }, - "description": "Custom engine specific features", + "description": "Custom engine specific features.", "type": "object" }, "packageBody": { @@ -3578,7 +3632,7 @@ "type": "string" }, "packageSqlCode": { - "description": "The SQL code which creates the package", + "description": "The SQL code which creates the package.", "type": "string" } }, @@ -3736,11 +3790,11 @@ "type": "object" }, "name": { - "description": "The resource's name.", + "description": "The name of the resource.", "type": "string" }, "state": { - "description": "Output only. The state of the Private Connection.", + "description": "Output only. The state of the private connection.", "enum": [ "STATE_UNSPECIFIED", "CREATING", @@ -3770,7 +3824,7 @@ }, "vpcPeeringConfig": { "$ref": "VpcPeeringConfig", - "description": "VPC Peering Config." + "description": "VPC peering configuration." } }, "type": "object" @@ -3846,22 +3900,22 @@ "type": "object" }, "RulesFile": { - "description": "Details of a single rules file", + "description": "Details of a single rules file.", "id": "RulesFile", "properties": { "rulesContent": { - "description": "The text content of the rules that needs to be converted", + "description": "The text content of the rules that needs to be converted.", "type": "string" }, "rulesSourceFilename": { - "description": "The filename of the rules that needs to be converted. This is used mainly so future logs of the import rules job will contain this detail and can therefore be searched by it later", + "description": "The filename of the rules that needs to be converted. The filename is used mainly so that future logs of the import rules job contain it, and can therefore be searched by it.", "type": "string" } }, "type": "object" }, "SchemaEntity": { - "description": "Schema typically has no parent entity, but can have a parent entity DatabaseInstance (for database engines which supports it). For some database engines the term schema and user can be used interchangeably when they refer to a namespace or a collection of other database entities. Can store additional information which is schema specific.", + "description": "Schema typically has no parent entity, but can have a parent entity DatabaseInstance (for database engines which support it). For some database engines, the terms schema and user can be used interchangeably when they refer to a namespace or a collection of other database entities. Can store additional information which is schema specific.", "id": "SchemaEntity", "properties": { "customFeatures": { @@ -3869,7 +3923,7 @@ "description": "Properties of the object.", "type": "any" }, - "description": "Custom engine specific features", + "description": "Custom engine specific features.", "type": "object" } }, @@ -3909,11 +3963,11 @@ "type": "object" }, "SeedJobDetails": { - "description": "Details regarding a Seed background job", + "description": "Details regarding a Seed background job.", "id": "SeedJobDetails", "properties": { "connectionProfile": { - "description": "The connection profile which was used for the seed job", + "description": "The connection profile which was used for the seed job.", "type": "string" } }, @@ -3924,7 +3978,7 @@ "id": "SequenceEntity", "properties": { "cache": { - "description": "Indicates number of entries to cache / precreate", + "description": "Indicates number of entries to cache / precreate.", "format": "int64", "type": "string" }, @@ -3933,30 +3987,30 @@ "description": "Properties of the object.", "type": "any" }, - "description": "Custom engine specific features", + "description": "Custom engine specific features.", "type": "object" }, "cycle": { - "description": "Indicates whether the sequence value should cycle through", + "description": "Indicates whether the sequence value should cycle through.", "type": "boolean" }, "increment": { - "description": "Increment value for the sequence", + "description": "Increment value for the sequence.", "format": "int64", "type": "string" }, "maxValue": { - "description": "Maximum number for the sequence represented as bytes to accommodate large numbers", + "description": "Maximum number for the sequence represented as bytes to accommodate large. numbers", "format": "byte", "type": "string" }, "minValue": { - "description": "Minimum number for the sequence represented as bytes to accommodate large numbers", + "description": "Minimum number for the sequence represented as bytes to accommodate large. numbers", "format": "byte", "type": "string" }, "startValue": { - "description": "Start number for the sequence represented as bytes to accommodate large numbers", + "description": "Start number for the sequence represented as bytes to accommodate large. numbers", "format": "byte", "type": "string" } @@ -4082,7 +4136,7 @@ "type": "object" }, "StaticIpConnectivity": { - "description": "The source database will allow incoming connections from the destination database's public IP. You can retrieve the Cloud SQL instance's public IP from the Cloud SQL console or using Cloud SQL APIs. No additional configuration is required.", + "description": "The source database will allow incoming connections from the public IP of the destination database. You can retrieve the public IP of the Cloud SQL instance from the Cloud SQL console or using Cloud SQL APIs. No additional configuration is required.", "id": "StaticIpConnectivity", "properties": {}, "type": "object" @@ -4135,11 +4189,11 @@ "description": "Properties of the object.", "type": "any" }, - "description": "Custom engine specific features", + "description": "Custom engine specific features.", "type": "object" }, "sqlCode": { - "description": "The SQL code which creates the stored procedure", + "description": "The SQL code which creates the stored procedure.", "type": "string" } }, @@ -4154,15 +4208,15 @@ "description": "Properties of the object.", "type": "any" }, - "description": "Custom engine specific features", + "description": "Custom engine specific features.", "type": "object" }, "sourceEntity": { - "description": "The name of the entity for which the synonym is being created (the source)", + "description": "The name of the entity for which the synonym is being created (the source).", "type": "string" }, "sourceType": { - "description": "The type of the entity for which the synonym is being created (usually a table or a sequence)", + "description": "The type of the entity for which the synonym is being created (usually a table or a sequence).", "enum": [ "DATABASE_ENTITY_TYPE_UNSPECIFIED", "DATABASE_ENTITY_TYPE_SCHEMA", @@ -4181,21 +4235,21 @@ "DATABASE_ENTITY_TYPE_MATERIAL_VIEW" ], "enumDescriptions": [ - "Unspecified database entity type", - "Schema", - "Table", - "Column", - "Constraint", - "Index", - "Trigger", - "View", - "Sequence", - "Stored Procedure", - "Function", - "Synonym", - "Package", - "UDT", - "Material View" + "Unspecified database entity type.", + "Schema.", + "Table.", + "Column.", + "Constraint.", + "Index.", + "Trigger.", + "View.", + "Sequence.", + "Stored Procedure.", + "Function.", + "Synonym.", + "Package.", + "UDT.", + "Material View." ], "type": "string" } @@ -4207,18 +4261,18 @@ "id": "TableEntity", "properties": { "columns": { - "description": "Table Columns.", + "description": "Table columns.", "items": { "$ref": "ColumnEntity" }, "type": "array" }, "comment": { - "description": "Comment associated with the table", + "description": "Comment associated with the table.", "type": "string" }, "constraints": { - "description": "Table Constraints.", + "description": "Table constraints.", "items": { "$ref": "ConstraintEntity" }, @@ -4229,11 +4283,11 @@ "description": "Properties of the object.", "type": "any" }, - "description": "Custom engine specific features", + "description": "Custom engine specific features.", "type": "object" }, "indices": { - "description": "Table Indices.", + "description": "Table indices.", "items": { "$ref": "IndexEntity" }, @@ -4286,23 +4340,23 @@ "description": "Properties of the object.", "type": "any" }, - "description": "Custom engine specific features", + "description": "Custom engine specific features.", "type": "object" }, "name": { - "description": "The name of the trigger", + "description": "The name of the trigger.", "type": "string" }, "sqlCode": { - "description": "The SQL code which creates the trigger", + "description": "The SQL code which creates the trigger.", "type": "string" }, "triggerType": { - "description": "Indicates when the trigger fires, e.g. BEFORE STATEMENT, AFTER EACH ROW", + "description": "Indicates when the trigger fires, for example BEFORE STATEMENT, AFTER EACH ROW.", "type": "string" }, "triggeringEvents": { - "description": "The DML, DDL, or database events that fires the trigger, e.g. INSERT, UPDATE", + "description": "The DML, DDL, or database events that fire the trigger, for example INSERT, UPDATE.", "items": { "type": "string" }, @@ -4342,7 +4396,7 @@ "id": "ViewEntity", "properties": { "constraints": { - "description": "View Constraints.", + "description": "View constraints.", "items": { "$ref": "ConstraintEntity" }, @@ -4353,7 +4407,7 @@ "description": "Properties of the object.", "type": "any" }, - "description": "Custom engine specific features", + "description": "Custom engine specific features.", "type": "object" }, "sqlCode": { @@ -4394,7 +4448,7 @@ "type": "object" }, "VpcPeeringConfig": { - "description": "The VPC Peering configuration is used to create VPC peering with the consumer's VPC.", + "description": "The VPC peering configuration is used to create VPC peering with the consumer's VPC.", "id": "VpcPeeringConfig", "properties": { "subnet": { @@ -4402,7 +4456,7 @@ "type": "string" }, "vpcName": { - "description": "Required. Fully qualified name of the VPC DMS will peer to.", + "description": "Required. Fully qualified name of the VPC that Database Migration Service will peer to.", "type": "string" } }, diff --git a/datamigration/v1/datamigration-gen.go b/datamigration/v1/datamigration-gen.go index 2229cfa02b4..89a430bba3c 100644 --- a/datamigration/v1/datamigration-gen.go +++ b/datamigration/v1/datamigration-gen.go @@ -442,7 +442,7 @@ func (s *AuditLogConfig) MarshalJSON() ([]byte, error) { // BackgroundJobLogEntry: Execution log of a background job. type BackgroundJobLogEntry struct { // CompletionComment: Job completion comment, such as how many entities - // were seeded, how many warnings were found during conversion and + // were seeded, how many warnings were found during conversion, and // similar information. CompletionComment string `json:"completionComment,omitempty"` @@ -451,7 +451,7 @@ type BackgroundJobLogEntry struct { // // Possible values: // "JOB_COMPLETION_STATE_UNSPECIFIED" - The status is not specified. - // This state will be used when job is not yet finished. + // This state is used when job is not yet finished. // "SUCCEEDED" - Success. // "FAILED" - Error. CompletionState string `json:"completionState,omitempty"` @@ -459,31 +459,32 @@ type BackgroundJobLogEntry struct { // FinishTime: The timestamp when the background job was finished. FinishTime string `json:"finishTime,omitempty"` - // Id: The background job log entry id + // Id: The background job log entry ID. Id string `json:"id,omitempty"` - // ImportRulesJobDetails: Import rules job details + // ImportRulesJobDetails: Import rules job details. ImportRulesJobDetails *ImportRulesJobDetails `json:"importRulesJobDetails,omitempty"` // JobType: The type of job that was executed. // // Possible values: - // "BACKGROUND_JOB_TYPE_UNSPECIFIED" - Unspecified background job type + // "BACKGROUND_JOB_TYPE_UNSPECIFIED" - Unspecified background job + // type. // "BACKGROUND_JOB_TYPE_SOURCE_SEED" - Job to seed from the source - // database + // database. // "BACKGROUND_JOB_TYPE_CONVERT" - Job to convert the source database - // into a draft of the destination database + // into a draft of the destination database. // "BACKGROUND_JOB_TYPE_APPLY_DESTINATION" - Job to apply the draft - // tree onto the destination + // tree onto the destination. // "BACKGROUND_JOB_TYPE_IMPORT_RULES_FILE" - Job to import and convert - // mapping rules from an external source such as an ora2pg config file + // mapping rules from an external source such as an ora2pg config file. JobType string `json:"jobType,omitempty"` // RequestAutocommit: Whether the client requested the conversion // workspace to be committed after a successful completion of the job. RequestAutocommit bool `json:"requestAutocommit,omitempty"` - // SeedJobDetails: Seed job details + // SeedJobDetails: Seed job details. SeedJobDetails *SeedJobDetails `json:"seedJobDetails,omitempty"` // StartTime: The timestamp when the background job was started. @@ -789,60 +790,60 @@ func (s *CloudSqlSettings) MarshalJSON() ([]byte, error) { // ColumnEntity: Column is not used as an independent entity, it is // retrieved as part of a Table entity. type ColumnEntity struct { - // Array: Is the column of array type + // Array: Is the column of array type. Array bool `json:"array,omitempty"` - // ArrayLength: If the column is array, of which length + // ArrayLength: If the column is array, of which length. ArrayLength int64 `json:"arrayLength,omitempty"` - // AutoGenerated: Is the column auto-generated/identity + // AutoGenerated: Is the column auto-generated/identity. AutoGenerated bool `json:"autoGenerated,omitempty"` - // Charset: Charset override - instead of table level charset + // Charset: Charset override - instead of table level charset. Charset string `json:"charset,omitempty"` - // Collation: Collation override - instead of table level collation + // Collation: Collation override - instead of table level collation. Collation string `json:"collation,omitempty"` - // Comment: Comment associated with the column + // Comment: Comment associated with the column. Comment string `json:"comment,omitempty"` - // CustomFeatures: Custom engine specific features + // CustomFeatures: Custom engine specific features. CustomFeatures googleapi.RawMessage `json:"customFeatures,omitempty"` - // DataType: Column data type + // DataType: Column data type. DataType string `json:"dataType,omitempty"` - // DefaultValue: Default value of the column + // DefaultValue: Default value of the column. DefaultValue string `json:"defaultValue,omitempty"` // FractionalSecondsPrecision: Column fractional second precision - used - // for timestamp based datatypes + // for timestamp based datatypes. FractionalSecondsPrecision int64 `json:"fractionalSecondsPrecision,omitempty"` - // Length: Column length - e.g. varchar (50) + // Length: Column length - e.g. varchar (50). Length int64 `json:"length,omitempty,string"` - // Name: Column name + // Name: Column name. Name string `json:"name,omitempty"` - // Nullable: Is the column nullable + // Nullable: Is the column nullable. Nullable bool `json:"nullable,omitempty"` - // OrdinalPosition: Column order in the table + // OrdinalPosition: Column order in the table. OrdinalPosition int64 `json:"ordinalPosition,omitempty"` - // Precision: Column precision - when relevant + // Precision: Column precision - when relevant. Precision int64 `json:"precision,omitempty"` - // Scale: Column scale - when relevant + // Scale: Column scale - when relevant. Scale int64 `json:"scale,omitempty"` // SetValues: Specifies the list of values allowed in the column. List - // is empty if set values is not required + // is empty if setValues is not required. SetValues []string `json:"setValues,omitempty"` - // Udt: Is the column a UDT + // Udt: Is the column a UDT. Udt bool `json:"udt,omitempty"` // ForceSendFields is a list of field names (e.g. "Array") to @@ -997,25 +998,27 @@ func (s *ConnectionProfile) MarshalJSON() ([]byte, error) { // ConstraintEntity: Constraint is not used as an independent entity, it // is retrieved as part of another entity such as Table or View. type ConstraintEntity struct { - // CustomFeatures: Custom engine specific features + // CustomFeatures: Custom engine specific features. CustomFeatures googleapi.RawMessage `json:"customFeatures,omitempty"` - // Name: The name of the table constraint + // Name: The name of the table constraint. Name string `json:"name,omitempty"` - // ReferenceColumns: Reference Columns which may be associated with the - // constraint. eg: if the constraint is a FOREIGN_KEY, this represents - // the list of full names of referenced columns by the foreign key. + // ReferenceColumns: Reference columns which may be associated with the + // constraint. For example, if the constraint is a FOREIGN_KEY, this + // represents the list of full names of referenced columns by the + // foreign key. ReferenceColumns []string `json:"referenceColumns,omitempty"` // ReferenceTable: Reference table which may be associated with the - // constraint. eg: if the constraint is a FOREIGN_KEY, this represents - // the list of full name of the referenced table by the foreign key. + // constraint. For example, if the constraint is a FOREIGN_KEY, this + // represents the list of full name of the referenced table by the + // foreign key. ReferenceTable string `json:"referenceTable,omitempty"` - // TableColumns: Table columns used as part of the Constraint for e.g. - // primary key constraint should list the columns which constitutes the - // key + // TableColumns: Table columns used as part of the Constraint, for + // example primary key constraint should list the columns which + // constitutes the key. TableColumns []string `json:"tableColumns,omitempty"` // TableName: Table which is associated with the constraint. In case the @@ -1025,8 +1028,8 @@ type ConstraintEntity struct { // is defined. TableName string `json:"tableName,omitempty"` - // Type: Type of constraint - e.g. unique, primary key, foreign key - // (currently only primary key is supported) + // Type: Type of constraint, for example unique, primary key, foreign + // key (currently only primary key is supported). Type string `json:"type,omitempty"` // ForceSendFields is a list of field names (e.g. "CustomFeatures") to @@ -1062,7 +1065,7 @@ type ConversionWorkspace struct { // Destination: Required. The destination engine details. Destination *DatabaseEngineInfo `json:"destination,omitempty"` - // DisplayName: The display name for the workspace + // DisplayName: The display name for the workspace. DisplayName string `json:"displayName,omitempty"` // GlobalSettings: A generic list of settings for the workspace. The @@ -1075,10 +1078,10 @@ type ConversionWorkspace struct { // HasUncommittedChanges: Output only. Whether the workspace has // uncommitted changes (changes which were made after the workspace was - // committed) + // committed). HasUncommittedChanges bool `json:"hasUncommittedChanges,omitempty"` - // LatestCommitId: Output only. The latest commit id + // LatestCommitId: Output only. The latest commit ID. LatestCommitId string `json:"latestCommitId,omitempty"` // LatestCommitTime: Output only. The timestamp when the workspace was @@ -1158,8 +1161,8 @@ func (s *ConversionWorkspaceInfo) MarshalJSON() ([]byte, error) { // ConvertConversionWorkspaceRequest: Request message for // 'ConvertConversionWorkspace' request. type ConvertConversionWorkspaceRequest struct { - // AutoCommit: Should the conversion workspace be committed - // automatically after the conversion. + // AutoCommit: Specifies whether the conversion workspace is to be + // committed automatically after the conversion. AutoCommit bool `json:"autoCommit,omitempty"` // Filter: Filter the entities to convert. Leaving this field empty will @@ -1190,19 +1193,19 @@ func (s *ConvertConversionWorkspaceRequest) MarshalJSON() ([]byte, error) { } // DatabaseEngineInfo: The type and version of a source or destination -// DB. +// database. type DatabaseEngineInfo struct { - // Engine: Required. Engine Type. + // Engine: Required. Engine type. // // Possible values: // "DATABASE_ENGINE_UNSPECIFIED" - The source database engine of the // migration job is unknown. // "MYSQL" - The source engine is MySQL. // "POSTGRESQL" - The source engine is PostgreSQL. - // "ORACLE" - The source engine is Oracle + // "ORACLE" - The source engine is Oracle. Engine string `json:"engine,omitempty"` - // Version: Required. Engine named version, for e.g. 12.c.1 + // Version: Required. Engine named version, for example 12.c.1. Version string `json:"version,omitempty"` // ForceSendFields is a list of field names (e.g. "Engine") to @@ -1229,13 +1232,13 @@ func (s *DatabaseEngineInfo) MarshalJSON() ([]byte, error) { } // DatabaseEntity: The base entity type for all the database related -// entities The message contains the entity name, the name of its -// parent, its type and the specific details per its type +// entities. The message contains the entity name, the name of its +// parent, the entity type, and the specific details per entity type. type DatabaseEntity struct { - // DatabaseFunction: Function + // DatabaseFunction: Function. DatabaseFunction *FunctionEntity `json:"databaseFunction,omitempty"` - // DatabasePackage: Package + // DatabasePackage: Package. DatabasePackage *PackageEntity `json:"databasePackage,omitempty"` // EntityType: The type of the database entity (table, view, index, @@ -1243,21 +1246,21 @@ type DatabaseEntity struct { // // Possible values: // "DATABASE_ENTITY_TYPE_UNSPECIFIED" - Unspecified database entity - // type - // "DATABASE_ENTITY_TYPE_SCHEMA" - Schema - // "DATABASE_ENTITY_TYPE_TABLE" - Table - // "DATABASE_ENTITY_TYPE_COLUMN" - Column - // "DATABASE_ENTITY_TYPE_CONSTRAINT" - Constraint - // "DATABASE_ENTITY_TYPE_INDEX" - Index - // "DATABASE_ENTITY_TYPE_TRIGGER" - Trigger - // "DATABASE_ENTITY_TYPE_VIEW" - View - // "DATABASE_ENTITY_TYPE_SEQUENCE" - Sequence - // "DATABASE_ENTITY_TYPE_STORED_PROCEDURE" - Stored Procedure - // "DATABASE_ENTITY_TYPE_FUNCTION" - Function - // "DATABASE_ENTITY_TYPE_SYNONYM" - Synonym - // "DATABASE_ENTITY_TYPE_DATABASE_PACKAGE" - Package - // "DATABASE_ENTITY_TYPE_UDT" - UDT - // "DATABASE_ENTITY_TYPE_MATERIAL_VIEW" - Material View + // type. + // "DATABASE_ENTITY_TYPE_SCHEMA" - Schema. + // "DATABASE_ENTITY_TYPE_TABLE" - Table. + // "DATABASE_ENTITY_TYPE_COLUMN" - Column. + // "DATABASE_ENTITY_TYPE_CONSTRAINT" - Constraint. + // "DATABASE_ENTITY_TYPE_INDEX" - Index. + // "DATABASE_ENTITY_TYPE_TRIGGER" - Trigger. + // "DATABASE_ENTITY_TYPE_VIEW" - View. + // "DATABASE_ENTITY_TYPE_SEQUENCE" - Sequence. + // "DATABASE_ENTITY_TYPE_STORED_PROCEDURE" - Stored Procedure. + // "DATABASE_ENTITY_TYPE_FUNCTION" - Function. + // "DATABASE_ENTITY_TYPE_SYNONYM" - Synonym. + // "DATABASE_ENTITY_TYPE_DATABASE_PACKAGE" - Package. + // "DATABASE_ENTITY_TYPE_UDT" - UDT. + // "DATABASE_ENTITY_TYPE_MATERIAL_VIEW" - Material View. EntityType string `json:"entityType,omitempty"` // Mappings: Details about entity mappings. For source tree entities, @@ -1273,16 +1276,16 @@ type DatabaseEntity struct { // Schema: Schema. Schema *SchemaEntity `json:"schema,omitempty"` - // Sequence: Sequence + // Sequence: Sequence. Sequence *SequenceEntity `json:"sequence,omitempty"` // ShortName: The short name (e.g. table name) of the entity. ShortName string `json:"shortName,omitempty"` - // StoredProcedure: Stored Procedure + // StoredProcedure: Stored procedure. StoredProcedure *StoredProcedureEntity `json:"storedProcedure,omitempty"` - // Synonym: Synonym + // Synonym: Synonym. Synonym *SynonymEntity `json:"synonym,omitempty"` // Table: Table. @@ -1291,7 +1294,7 @@ type DatabaseEntity struct { // Tree: The type of tree the entity belongs to. // // Possible values: - // "TREE_TYPE_UNSPECIFIED" - Tree Type Unspecified. + // "TREE_TYPE_UNSPECIFIED" - Tree type unspecified. // "SOURCE" - Tree of entities loaded from a source database. // "DRAFT" - Tree of entities converted from the source tree using the // mapping rules. @@ -1299,7 +1302,7 @@ type DatabaseEntity struct { // database. Tree string `json:"tree,omitempty"` - // View: View + // View: View. View *ViewEntity `json:"view,omitempty"` // ForceSendFields is a list of field names (e.g. "DatabaseFunction") to @@ -1335,7 +1338,7 @@ type DatabaseType struct { // migration job is unknown. // "MYSQL" - The source engine is MySQL. // "POSTGRESQL" - The source engine is PostgreSQL. - // "ORACLE" - The source engine is Oracle + // "ORACLE" - The source engine is Oracle. Engine string `json:"engine,omitempty"` // Provider: The database provider. @@ -1411,7 +1414,7 @@ type DescribeDatabaseEntitiesResponse struct { // workspace. DatabaseEntities []*DatabaseEntity `json:"databaseEntities,omitempty"` - // NextPageToken: A token, which can be sent as `page_token` to retrieve + // NextPageToken: A token which can be sent as `page_token` to retrieve // the next page. If this field is omitted, there are no subsequent // pages. NextPageToken string `json:"nextPageToken,omitempty"` @@ -1518,19 +1521,19 @@ type Empty struct { type EntityMapping struct { // DraftEntity: Target entity full name. The draft entity can also // include a column, index or constraint using the same naming notation - // schema.table.column + // schema.table.column. DraftEntity string `json:"draftEntity,omitempty"` // MappingLog: Entity mapping log entries. Multiple rules can be - // effective and contribute changes to a converted entity such as, a + // effective and contribute changes to a converted entity, such as a // rule can handle the entity name, another rule can handle an entity // type. In addition, rules which did not change the entity are also - // logged along the with the reason preventing them to do so. + // logged along with the reason preventing them to do so. MappingLog []*EntityMappingLogEntry `json:"mappingLog,omitempty"` // SourceEntity: Source entity full name. The source entity can also be // a column, index or constraint using the same naming notation - // schema.table.column + // schema.table.column. SourceEntity string `json:"sourceEntity,omitempty"` // ForceSendFields is a list of field names (e.g. "DraftEntity") to @@ -1562,10 +1565,10 @@ type EntityMappingLogEntry struct { // MappingComment: Comment. MappingComment string `json:"mappingComment,omitempty"` - // RuleId: Which rule caused it. + // RuleId: Which rule caused this log entry. RuleId string `json:"ruleId,omitempty"` - // RuleRevisionId: Rule revision id + // RuleRevisionId: Rule revision ID. RuleRevisionId string `json:"ruleRevisionId,omitempty"` // ForceSendFields is a list of field names (e.g. "MappingComment") to @@ -1652,6 +1655,44 @@ func (s *Expr) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// FetchStaticIpsResponse: Response message for a 'FetchStaticIps' +// request. +type FetchStaticIpsResponse struct { + // NextPageToken: A token that can be sent as `page_token` to retrieve + // the next page. If this field is omitted, there are no subsequent + // pages. + NextPageToken string `json:"nextPageToken,omitempty"` + + // StaticIps: List of static IPs. + StaticIps []string `json:"staticIps,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "NextPageToken") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *FetchStaticIpsResponse) MarshalJSON() ([]byte, error) { + type NoMethod FetchStaticIpsResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // ForwardSshTunnelConnectivity: Forward SSH Tunnel connectivity. type ForwardSshTunnelConnectivity struct { // Hostname: Required. Hostname for the SSH tunnel. @@ -1694,10 +1735,10 @@ func (s *ForwardSshTunnelConnectivity) MarshalJSON() ([]byte, error) { // FunctionEntity: Function's parent is a schema. type FunctionEntity struct { - // CustomFeatures: Custom engine specific features + // CustomFeatures: Custom engine specific features. CustomFeatures googleapi.RawMessage `json:"customFeatures,omitempty"` - // SqlCode: The SQL code which creates the function + // SqlCode: The SQL code which creates the function. SqlCode string `json:"sqlCode,omitempty"` // ForceSendFields is a list of field names (e.g. "CustomFeatures") to @@ -1733,7 +1774,7 @@ type GenerateSshScriptRequest struct { // VmCreationConfig: The VM creation configuration VmCreationConfig *VmCreationConfig `json:"vmCreationConfig,omitempty"` - // VmPort: The port that will be open on the bastion host + // VmPort: The port that will be open on the bastion host. VmPort int64 `json:"vmPort,omitempty"` // VmSelectionConfig: The VM selection configuration @@ -1821,16 +1862,17 @@ type ImportMappingRulesRequest struct { // automatically after the import operation. AutoCommit bool `json:"autoCommit,omitempty"` - // RulesFiles: One or more rules files + // RulesFiles: One or more rules files. RulesFiles []*RulesFile `json:"rulesFiles,omitempty"` // RulesFormat: The format of the rules content file. // // Possible values: - // "IMPORT_RULES_FILE_FORMAT_UNSPECIFIED" - Unspecified Rules Format - // "IMPORT_RULES_FILE_FORMAT_HARBOUR_BRIDGE_SESSION_FILE" - Harbour - // Bridge Session file - // "IMPORT_RULES_FILE_FORMAT_ORATOPG_CONFIG_FILE" - ORA2PG config file + // "IMPORT_RULES_FILE_FORMAT_UNSPECIFIED" - Unspecified rules format. + // "IMPORT_RULES_FILE_FORMAT_HARBOUR_BRIDGE_SESSION_FILE" - + // HarbourBridge session file. + // "IMPORT_RULES_FILE_FORMAT_ORATOPG_CONFIG_FILE" - Ora2Pg + // configuration file. RulesFormat string `json:"rulesFormat,omitempty"` // ForceSendFields is a list of field names (e.g. "AutoCommit") to @@ -1857,18 +1899,19 @@ func (s *ImportMappingRulesRequest) MarshalJSON() ([]byte, error) { } // ImportRulesJobDetails: Details regarding an Import Rules background -// job +// job. type ImportRulesJobDetails struct { - // FileFormat: The requested file format + // FileFormat: The requested file format. // // Possible values: - // "IMPORT_RULES_FILE_FORMAT_UNSPECIFIED" - Unspecified Rules Format - // "IMPORT_RULES_FILE_FORMAT_HARBOUR_BRIDGE_SESSION_FILE" - Harbour - // Bridge Session file - // "IMPORT_RULES_FILE_FORMAT_ORATOPG_CONFIG_FILE" - ORA2PG config file + // "IMPORT_RULES_FILE_FORMAT_UNSPECIFIED" - Unspecified rules format. + // "IMPORT_RULES_FILE_FORMAT_HARBOUR_BRIDGE_SESSION_FILE" - + // HarbourBridge session file. + // "IMPORT_RULES_FILE_FORMAT_ORATOPG_CONFIG_FILE" - Ora2Pg + // configuration file. FileFormat string `json:"fileFormat,omitempty"` - // Files: File names used for the import rules job + // Files: File names used for the import rules job. Files []string `json:"files,omitempty"` // ForceSendFields is a list of field names (e.g. "FileFormat") to @@ -1897,20 +1940,20 @@ func (s *ImportRulesJobDetails) MarshalJSON() ([]byte, error) { // IndexEntity: Index is not used as an independent entity, it is // retrieved as part of a Table entity. type IndexEntity struct { - // CustomFeatures: Custom engine specific features + // CustomFeatures: Custom engine specific features. CustomFeatures googleapi.RawMessage `json:"customFeatures,omitempty"` - // Name: The name of the index + // Name: The name of the index. Name string `json:"name,omitempty"` - // TableColumns: Table columns used as part of the Index for e.g. B-TREE - // index should list the columns which constitutes the index. + // TableColumns: Table columns used as part of the Index, for example + // B-TREE index should list the columns which constitutes the index. TableColumns []string `json:"tableColumns,omitempty"` - // Type: Type of index - e.g. B-TREE + // Type: Type of index, for example B-TREE. Type string `json:"type,omitempty"` - // Unique: boolean value indicating whether the index is unique + // Unique: Boolean value indicating whether the index is unique. Unique bool `json:"unique,omitempty"` // ForceSendFields is a list of field names (e.g. "CustomFeatures") to @@ -1943,7 +1986,7 @@ type ListConnectionProfilesResponse struct { // ConnectionProfiles: The response list of connection profiles. ConnectionProfiles []*ConnectionProfile `json:"connectionProfiles,omitempty"` - // NextPageToken: A token, which can be sent as `page_token` to retrieve + // NextPageToken: A token which can be sent as `page_token` to retrieve // the next page. If this field is omitted, there are no subsequent // pages. NextPageToken string `json:"nextPageToken,omitempty"` @@ -1985,7 +2028,7 @@ type ListConversionWorkspacesResponse struct { // ConversionWorkspaces: The list of conversion workspace objects. ConversionWorkspaces []*ConversionWorkspace `json:"conversionWorkspaces,omitempty"` - // NextPageToken: A token, which can be sent as `page_token` to retrieve + // NextPageToken: A token which can be sent as `page_token` to retrieve // the next page. If this field is omitted, there are no subsequent // pages. NextPageToken string `json:"nextPageToken,omitempty"` @@ -2065,7 +2108,7 @@ type ListMigrationJobsResponse struct { // MigrationJobs: The list of migration jobs objects. MigrationJobs []*MigrationJob `json:"migrationJobs,omitempty"` - // NextPageToken: A token, which can be sent as `page_token` to retrieve + // NextPageToken: A token which can be sent as `page_token` to retrieve // the next page. If this field is omitted, there are no subsequent // pages. NextPageToken string `json:"nextPageToken,omitempty"` @@ -2140,7 +2183,7 @@ func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) { // ListPrivateConnectionsResponse: Response message for // 'ListPrivateConnections' request. type ListPrivateConnectionsResponse struct { - // NextPageToken: A token, which can be sent as `page_token` to retrieve + // NextPageToken: A token which can be sent as `page_token` to retrieve // the next page. If this field is omitted, there are no subsequent // pages. NextPageToken string `json:"nextPageToken,omitempty"` @@ -2672,7 +2715,7 @@ func (s *OracleConnectionProfile) MarshalJSON() ([]byte, error) { // PackageEntity: Package's parent is a schema. type PackageEntity struct { - // CustomFeatures: Custom engine specific features + // CustomFeatures: Custom engine specific features. CustomFeatures googleapi.RawMessage `json:"customFeatures,omitempty"` // PackageBody: The SQL code which creates the package body. If the @@ -2680,7 +2723,7 @@ type PackageEntity struct { // body is mandatory. PackageBody string `json:"packageBody,omitempty"` - // PackageSqlCode: The SQL code which creates the package + // PackageSqlCode: The SQL code which creates the package. PackageSqlCode string `json:"packageSqlCode,omitempty"` // ForceSendFields is a list of field names (e.g. "CustomFeatures") to @@ -2956,10 +2999,10 @@ type PrivateConnection struct { // "name": "wrench", "mass": "1.3kg", "count": "3" }`. Labels map[string]string `json:"labels,omitempty"` - // Name: The resource's name. + // Name: The name of the resource. Name string `json:"name,omitempty"` - // State: Output only. The state of the Private Connection. + // State: Output only. The state of the private connection. // // Possible values: // "STATE_UNSPECIFIED" @@ -2977,7 +3020,7 @@ type PrivateConnection struct { // UpdateTime: Output only. The last update time of the resource. UpdateTime string `json:"updateTime,omitempty"` - // VpcPeeringConfig: VPC Peering Config. + // VpcPeeringConfig: VPC peering configuration. VpcPeeringConfig *VpcPeeringConfig `json:"vpcPeeringConfig,omitempty"` // ServerResponse contains the HTTP response code and headers from the @@ -3137,15 +3180,15 @@ func (s *ReverseSshConnectivity) MarshalJSON() ([]byte, error) { type RollbackConversionWorkspaceRequest struct { } -// RulesFile: Details of a single rules file +// RulesFile: Details of a single rules file. type RulesFile struct { // RulesContent: The text content of the rules that needs to be - // converted + // converted. RulesContent string `json:"rulesContent,omitempty"` // RulesSourceFilename: The filename of the rules that needs to be - // converted. This is used mainly so future logs of the import rules job - // will contain this detail and can therefore be searched by it later + // converted. The filename is used mainly so that future logs of the + // import rules job contain it, and can therefore be searched by it. RulesSourceFilename string `json:"rulesSourceFilename,omitempty"` // ForceSendFields is a list of field names (e.g. "RulesContent") to @@ -3172,13 +3215,13 @@ func (s *RulesFile) MarshalJSON() ([]byte, error) { } // SchemaEntity: Schema typically has no parent entity, but can have a -// parent entity DatabaseInstance (for database engines which supports -// it). For some database engines the term schema and user can be used +// parent entity DatabaseInstance (for database engines which support +// it). For some database engines, the terms schema and user can be used // interchangeably when they refer to a namespace or a collection of // other database entities. Can store additional information which is // schema specific. type SchemaEntity struct { - // CustomFeatures: Custom engine specific features + // CustomFeatures: Custom engine specific features. CustomFeatures googleapi.RawMessage `json:"customFeatures,omitempty"` // ForceSendFields is a list of field names (e.g. "CustomFeatures") to @@ -3276,10 +3319,10 @@ func (s *SeedConversionWorkspaceRequest) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// SeedJobDetails: Details regarding a Seed background job +// SeedJobDetails: Details regarding a Seed background job. type SeedJobDetails struct { // ConnectionProfile: The connection profile which was used for the seed - // job + // job. ConnectionProfile string `json:"connectionProfile,omitempty"` // ForceSendFields is a list of field names (e.g. "ConnectionProfile") @@ -3308,28 +3351,28 @@ func (s *SeedJobDetails) MarshalJSON() ([]byte, error) { // SequenceEntity: Sequence's parent is a schema. type SequenceEntity struct { - // Cache: Indicates number of entries to cache / precreate + // Cache: Indicates number of entries to cache / precreate. Cache int64 `json:"cache,omitempty,string"` - // CustomFeatures: Custom engine specific features + // CustomFeatures: Custom engine specific features. CustomFeatures googleapi.RawMessage `json:"customFeatures,omitempty"` - // Cycle: Indicates whether the sequence value should cycle through + // Cycle: Indicates whether the sequence value should cycle through. Cycle bool `json:"cycle,omitempty"` - // Increment: Increment value for the sequence + // Increment: Increment value for the sequence. Increment int64 `json:"increment,omitempty,string"` // MaxValue: Maximum number for the sequence represented as bytes to - // accommodate large numbers + // accommodate large. numbers MaxValue string `json:"maxValue,omitempty"` // MinValue: Minimum number for the sequence represented as bytes to - // accommodate large numbers + // accommodate large. numbers MinValue string `json:"minValue,omitempty"` // StartValue: Start number for the sequence represented as bytes to - // accommodate large numbers + // accommodate large. numbers StartValue string `json:"startValue,omitempty"` // ForceSendFields is a list of field names (e.g. "Cache") to @@ -3567,8 +3610,8 @@ type StartMigrationJobRequest struct { } // StaticIpConnectivity: The source database will allow incoming -// connections from the destination database's public IP. You can -// retrieve the Cloud SQL instance's public IP from the Cloud SQL +// connections from the public IP of the destination database. You can +// retrieve the public IP of the Cloud SQL instance from the Cloud SQL // console or using Cloud SQL APIs. No additional configuration is // required. type StaticIpConnectivity struct { @@ -3630,10 +3673,10 @@ type StopMigrationJobRequest struct { // StoredProcedureEntity: Stored procedure's parent is a schema. type StoredProcedureEntity struct { - // CustomFeatures: Custom engine specific features + // CustomFeatures: Custom engine specific features. CustomFeatures googleapi.RawMessage `json:"customFeatures,omitempty"` - // SqlCode: The SQL code which creates the stored procedure + // SqlCode: The SQL code which creates the stored procedure. SqlCode string `json:"sqlCode,omitempty"` // ForceSendFields is a list of field names (e.g. "CustomFeatures") to @@ -3662,33 +3705,33 @@ func (s *StoredProcedureEntity) MarshalJSON() ([]byte, error) { // SynonymEntity: Synonym's parent is a schema. type SynonymEntity struct { - // CustomFeatures: Custom engine specific features + // CustomFeatures: Custom engine specific features. CustomFeatures googleapi.RawMessage `json:"customFeatures,omitempty"` // SourceEntity: The name of the entity for which the synonym is being - // created (the source) + // created (the source). SourceEntity string `json:"sourceEntity,omitempty"` // SourceType: The type of the entity for which the synonym is being - // created (usually a table or a sequence) + // created (usually a table or a sequence). // // Possible values: // "DATABASE_ENTITY_TYPE_UNSPECIFIED" - Unspecified database entity - // type - // "DATABASE_ENTITY_TYPE_SCHEMA" - Schema - // "DATABASE_ENTITY_TYPE_TABLE" - Table - // "DATABASE_ENTITY_TYPE_COLUMN" - Column - // "DATABASE_ENTITY_TYPE_CONSTRAINT" - Constraint - // "DATABASE_ENTITY_TYPE_INDEX" - Index - // "DATABASE_ENTITY_TYPE_TRIGGER" - Trigger - // "DATABASE_ENTITY_TYPE_VIEW" - View - // "DATABASE_ENTITY_TYPE_SEQUENCE" - Sequence - // "DATABASE_ENTITY_TYPE_STORED_PROCEDURE" - Stored Procedure - // "DATABASE_ENTITY_TYPE_FUNCTION" - Function - // "DATABASE_ENTITY_TYPE_SYNONYM" - Synonym - // "DATABASE_ENTITY_TYPE_DATABASE_PACKAGE" - Package - // "DATABASE_ENTITY_TYPE_UDT" - UDT - // "DATABASE_ENTITY_TYPE_MATERIAL_VIEW" - Material View + // type. + // "DATABASE_ENTITY_TYPE_SCHEMA" - Schema. + // "DATABASE_ENTITY_TYPE_TABLE" - Table. + // "DATABASE_ENTITY_TYPE_COLUMN" - Column. + // "DATABASE_ENTITY_TYPE_CONSTRAINT" - Constraint. + // "DATABASE_ENTITY_TYPE_INDEX" - Index. + // "DATABASE_ENTITY_TYPE_TRIGGER" - Trigger. + // "DATABASE_ENTITY_TYPE_VIEW" - View. + // "DATABASE_ENTITY_TYPE_SEQUENCE" - Sequence. + // "DATABASE_ENTITY_TYPE_STORED_PROCEDURE" - Stored Procedure. + // "DATABASE_ENTITY_TYPE_FUNCTION" - Function. + // "DATABASE_ENTITY_TYPE_SYNONYM" - Synonym. + // "DATABASE_ENTITY_TYPE_DATABASE_PACKAGE" - Package. + // "DATABASE_ENTITY_TYPE_UDT" - UDT. + // "DATABASE_ENTITY_TYPE_MATERIAL_VIEW" - Material View. SourceType string `json:"sourceType,omitempty"` // ForceSendFields is a list of field names (e.g. "CustomFeatures") to @@ -3717,19 +3760,19 @@ func (s *SynonymEntity) MarshalJSON() ([]byte, error) { // TableEntity: Table's parent is a schema. type TableEntity struct { - // Columns: Table Columns. + // Columns: Table columns. Columns []*ColumnEntity `json:"columns,omitempty"` - // Comment: Comment associated with the table + // Comment: Comment associated with the table. Comment string `json:"comment,omitempty"` - // Constraints: Table Constraints. + // Constraints: Table constraints. Constraints []*ConstraintEntity `json:"constraints,omitempty"` - // CustomFeatures: Custom engine specific features + // CustomFeatures: Custom engine specific features. CustomFeatures googleapi.RawMessage `json:"customFeatures,omitempty"` - // Indices: Table Indices. + // Indices: Table indices. Indices []*IndexEntity `json:"indices,omitempty"` // Triggers: Table triggers. @@ -3827,21 +3870,21 @@ func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) { // TriggerEntity: Trigger is not used as an independent entity, it is // retrieved as part of a Table entity. type TriggerEntity struct { - // CustomFeatures: Custom engine specific features + // CustomFeatures: Custom engine specific features. CustomFeatures googleapi.RawMessage `json:"customFeatures,omitempty"` - // Name: The name of the trigger + // Name: The name of the trigger. Name string `json:"name,omitempty"` - // SqlCode: The SQL code which creates the trigger + // SqlCode: The SQL code which creates the trigger. SqlCode string `json:"sqlCode,omitempty"` - // TriggerType: Indicates when the trigger fires, e.g. BEFORE STATEMENT, - // AFTER EACH ROW + // TriggerType: Indicates when the trigger fires, for example BEFORE + // STATEMENT, AFTER EACH ROW. TriggerType string `json:"triggerType,omitempty"` - // TriggeringEvents: The DML, DDL, or database events that fires the - // trigger, e.g. INSERT, UPDATE + // TriggeringEvents: The DML, DDL, or database events that fire the + // trigger, for example INSERT, UPDATE. TriggeringEvents []string `json:"triggeringEvents,omitempty"` // ForceSendFields is a list of field names (e.g. "CustomFeatures") to @@ -3911,10 +3954,10 @@ type VerifyMigrationJobRequest struct { // ViewEntity: View's parent is a schema. type ViewEntity struct { - // Constraints: View Constraints. + // Constraints: View constraints. Constraints []*ConstraintEntity `json:"constraints,omitempty"` - // CustomFeatures: Custom engine specific features + // CustomFeatures: Custom engine specific features. CustomFeatures googleapi.RawMessage `json:"customFeatures,omitempty"` // SqlCode: The SQL code which creates the view. @@ -4005,13 +4048,14 @@ func (s *VmSelectionConfig) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// VpcPeeringConfig: The VPC Peering configuration is used to create VPC +// VpcPeeringConfig: The VPC peering configuration is used to create VPC // peering with the consumer's VPC. type VpcPeeringConfig struct { // Subnet: Required. A free subnet for peering. (CIDR of /29) Subnet string `json:"subnet,omitempty"` - // VpcName: Required. Fully qualified name of the VPC DMS will peer to. + // VpcName: Required. Fully qualified name of the VPC that Database + // Migration Service will peer to. VpcName string `json:"vpcName,omitempty"` // ForceSendFields is a list of field names (e.g. "Subnet") to @@ -4068,6 +4112,201 @@ func (s *VpcPeeringConnectivity) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// method id "datamigration.projects.locations.fetchStaticIps": + +type ProjectsLocationsFetchStaticIpsCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// FetchStaticIps: Fetches a set of static IP addresses that need to be +// allowlisted by the customer when using the static-IP connectivity +// method. +// +// - name: The resource name for the location for which static IPs +// should be returned. Must be in the format `projects/*/locations/*`. +func (r *ProjectsLocationsService) FetchStaticIps(name string) *ProjectsLocationsFetchStaticIpsCall { + c := &ProjectsLocationsFetchStaticIpsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of +// IPs to return. +func (c *ProjectsLocationsFetchStaticIpsCall) PageSize(pageSize int64) *ProjectsLocationsFetchStaticIpsCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous `FetchStaticIps` call. +func (c *ProjectsLocationsFetchStaticIpsCall) PageToken(pageToken string) *ProjectsLocationsFetchStaticIpsCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsFetchStaticIpsCall) Fields(s ...googleapi.Field) *ProjectsLocationsFetchStaticIpsCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsFetchStaticIpsCall) IfNoneMatch(entityTag string) *ProjectsLocationsFetchStaticIpsCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsFetchStaticIpsCall) Context(ctx context.Context) *ProjectsLocationsFetchStaticIpsCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsFetchStaticIpsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsFetchStaticIpsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + 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}:fetchStaticIps") + 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) +} + +// Do executes the "datamigration.projects.locations.fetchStaticIps" call. +// Exactly one of *FetchStaticIpsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FetchStaticIpsResponse.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 *ProjectsLocationsFetchStaticIpsCall) Do(opts ...googleapi.CallOption) (*FetchStaticIpsResponse, 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 := &FetchStaticIpsResponse{ + 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 + // { + // "description": "Fetches a set of static IP addresses that need to be allowlisted by the customer when using the static-IP connectivity method.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}:fetchStaticIps", + // "httpMethod": "GET", + // "id": "datamigration.projects.locations.fetchStaticIps", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The resource name for the location for which static IPs should be returned. Must be in the format `projects/*/locations/*`.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "pageSize": { + // "description": "Maximum number of IPs to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token, received from a previous `FetchStaticIps` call.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/{+name}:fetchStaticIps", + // "response": { + // "$ref": "FetchStaticIpsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsFetchStaticIpsCall) Pages(ctx context.Context, f func(*FetchStaticIpsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + // method id "datamigration.projects.locations.get": type ProjectsLocationsGetCall struct { @@ -4437,7 +4676,7 @@ type ProjectsLocationsConnectionProfilesCreateCall struct { // Create: Creates a new connection profile in a given project and // location. // -// - parent: The parent, which owns this collection of connection +// - parent: The parent which owns this collection of connection // profiles. func (r *ProjectsLocationsConnectionProfilesService) Create(parent string, connectionprofile *ConnectionProfile) *ProjectsLocationsConnectionProfilesCreateCall { c := &ProjectsLocationsConnectionProfilesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -4453,10 +4692,10 @@ func (c *ProjectsLocationsConnectionProfilesCreateCall) ConnectionProfileId(conn return c } -// RequestId sets the optional parameter "requestId": A unique id used +// RequestId sets the optional parameter "requestId": A unique ID used // to identify the request. If the server receives two requests with the -// same id, then the second request will be ignored. It is recommended -// to always set this value to a UUID. The id must contain only letters +// same ID, then the second request is ignored. It is recommended to +// always set this value to a UUID. The ID must contain only letters // (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The // maximum length is 40 characters. func (c *ProjectsLocationsConnectionProfilesCreateCall) RequestId(requestId string) *ProjectsLocationsConnectionProfilesCreateCall { @@ -4585,14 +4824,14 @@ func (c *ProjectsLocationsConnectionProfilesCreateCall) Do(opts ...googleapi.Cal // "type": "string" // }, // "parent": { - // "description": "Required. The parent, which owns this collection of connection profiles.", + // "description": "Required. The parent which owns this collection of connection profiles.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // }, // "requestId": { - // "description": "Optional. A unique id used to identify the request. If the server receives two requests with the same id, then the second request will be ignored. It is recommended to always set this value to a UUID. The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", + // "description": "Optional. A unique ID used to identify the request. If the server receives two requests with the same ID, then the second request is ignored. It is recommended to always set this value to a UUID. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", // "location": "query", // "type": "string" // }, @@ -4650,10 +4889,10 @@ func (c *ProjectsLocationsConnectionProfilesDeleteCall) Force(force bool) *Proje return c } -// RequestId sets the optional parameter "requestId": A unique id used +// RequestId sets the optional parameter "requestId": A unique ID used // to identify the request. If the server receives two requests with the -// same id, then the second request will be ignored. It is recommended -// to always set this value to a UUID. The id must contain only letters +// same ID, then the second request is ignored. It is recommended to +// always set this value to a UUID. The ID must contain only letters // (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The // maximum length is 40 characters. func (c *ProjectsLocationsConnectionProfilesDeleteCall) RequestId(requestId string) *ProjectsLocationsConnectionProfilesDeleteCall { @@ -4768,7 +5007,7 @@ func (c *ProjectsLocationsConnectionProfilesDeleteCall) Do(opts ...googleapi.Cal // "type": "string" // }, // "requestId": { - // "description": "A unique id used to identify the request. If the server receives two requests with the same id, then the second request will be ignored. It is recommended to always set this value to a UUID. The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", + // "description": "A unique ID used to identify the request. If the server receives two requests with the same ID, then the second request is ignored. It is recommended to always set this value to a UUID. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", // "location": "query", // "type": "string" // } @@ -5119,7 +5358,7 @@ type ProjectsLocationsConnectionProfilesListCall struct { // List: Retrieves a list of all connection profiles in a given project // and location. // -// - parent: The parent, which owns this collection of connection +// - parent: The parent which owns this collection of connection // profiles. func (r *ProjectsLocationsConnectionProfilesService) List(parent string) *ProjectsLocationsConnectionProfilesListCall { c := &ProjectsLocationsConnectionProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -5152,8 +5391,8 @@ func (c *ProjectsLocationsConnectionProfilesListCall) OrderBy(orderBy string) *P // PageSize sets the optional parameter "pageSize": The maximum number // of connection profiles to return. The service may return fewer than // this value. If unspecified, at most 50 connection profiles will be -// returned. The maximum value is 1000; values above 1000 will be -// coerced to 1000. +// returned. The maximum value is 1000; values above 1000 are coerced to +// 1000. func (c *ProjectsLocationsConnectionProfilesListCall) PageSize(pageSize int64) *ProjectsLocationsConnectionProfilesListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c @@ -5287,7 +5526,7 @@ func (c *ProjectsLocationsConnectionProfilesListCall) Do(opts ...googleapi.CallO // "type": "string" // }, // "pageSize": { - // "description": "The maximum number of connection profiles to return. The service may return fewer than this value. If unspecified, at most 50 connection profiles will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + // "description": "The maximum number of connection profiles to return. The service may return fewer than this value. If unspecified, at most 50 connection profiles will be returned. The maximum value is 1000; values above 1000 are coerced to 1000.", // "format": "int32", // "location": "query", // "type": "integer" @@ -5298,7 +5537,7 @@ func (c *ProjectsLocationsConnectionProfilesListCall) Do(opts ...googleapi.CallO // "type": "string" // }, // "parent": { - // "description": "Required. The parent, which owns this collection of connection profiles.", + // "description": "Required. The parent which owns this collection of connection profiles.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+$", // "required": true, @@ -5360,10 +5599,10 @@ func (r *ProjectsLocationsConnectionProfilesService) Patch(name string, connecti return c } -// RequestId sets the optional parameter "requestId": A unique id used +// RequestId sets the optional parameter "requestId": A unique ID used // to identify the request. If the server receives two requests with the -// same id, then the second request will be ignored. It is recommended -// to always set this value to a UUID. The id must contain only letters +// same ID, then the second request is ignored. It is recommended to +// always set this value to a UUID. The ID must contain only letters // (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The // maximum length is 40 characters. func (c *ProjectsLocationsConnectionProfilesPatchCall) RequestId(requestId string) *ProjectsLocationsConnectionProfilesPatchCall { @@ -5380,8 +5619,8 @@ func (c *ProjectsLocationsConnectionProfilesPatchCall) SkipValidation(skipValida } // UpdateMask sets the optional parameter "updateMask": Required. Field -// mask is used to specify the fields to be overwritten in the -// connection profile resource by the update. +// mask is used to specify the fields to be overwritten by the update in +// the conversion workspace resource. func (c *ProjectsLocationsConnectionProfilesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsConnectionProfilesPatchCall { c.urlParams_.Set("updateMask", updateMask) return c @@ -5502,7 +5741,7 @@ func (c *ProjectsLocationsConnectionProfilesPatchCall) Do(opts ...googleapi.Call // "type": "string" // }, // "requestId": { - // "description": "Optional. A unique id used to identify the request. If the server receives two requests with the same id, then the second request will be ignored. It is recommended to always set this value to a UUID. The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", + // "description": "Optional. A unique ID used to identify the request. If the server receives two requests with the same ID, then the second request is ignored. It is recommended to always set this value to a UUID. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", // "location": "query", // "type": "string" // }, @@ -5512,7 +5751,7 @@ func (c *ProjectsLocationsConnectionProfilesPatchCall) Do(opts ...googleapi.Call // "type": "boolean" // }, // "updateMask": { - // "description": "Required. Field mask is used to specify the fields to be overwritten in the connection profile resource by the update.", + // "description": "Required. Field mask is used to specify the fields to be overwritten by the update in the conversion workspace resource.", // "format": "google-fieldmask", // "location": "query", // "type": "string" @@ -5845,10 +6084,10 @@ type ProjectsLocationsConversionWorkspacesApplyCall struct { header_ http.Header } -// Apply: Apply draft tree onto a specific destination database +// Apply: Applies draft tree onto a specific destination database. // -// - name: Name of the conversion workspace resource to apply draft to -// destination for. in the form of: +// - name: The name of the conversion workspace resource for which to +// apply the draft tree. Must be in the form of: // projects/{project}/locations/{location}/conversionWorkspaces/{conver // sion_workspace}. func (r *ProjectsLocationsConversionWorkspacesService) Apply(name string, applyconversionworkspacerequest *ApplyConversionWorkspaceRequest) *ProjectsLocationsConversionWorkspacesApplyCall { @@ -5949,7 +6188,7 @@ func (c *ProjectsLocationsConversionWorkspacesApplyCall) Do(opts ...googleapi.Ca } return ret, nil // { - // "description": "Apply draft tree onto a specific destination database", + // "description": "Applies draft tree onto a specific destination database.", // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/conversionWorkspaces/{conversionWorkspacesId}:apply", // "httpMethod": "POST", // "id": "datamigration.projects.locations.conversionWorkspaces.apply", @@ -5958,7 +6197,7 @@ func (c *ProjectsLocationsConversionWorkspacesApplyCall) Do(opts ...googleapi.Ca // ], // "parameters": { // "name": { - // "description": "Required. Name of the conversion workspace resource to apply draft to destination for. in the form of: projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.", + // "description": "Required. The name of the conversion workspace resource for which to apply the draft tree. Must be in the form of: projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/conversionWorkspaces/[^/]+$", // "required": true, @@ -6280,7 +6519,7 @@ type ProjectsLocationsConversionWorkspacesCreateCall struct { // Create: Creates a new conversion workspace in a given project and // location. // -// - parent: The parent, which owns this collection of conversion +// - parent: The parent which owns this collection of conversion // workspaces. func (r *ProjectsLocationsConversionWorkspacesService) Create(parent string, conversionworkspace *ConversionWorkspace) *ProjectsLocationsConversionWorkspacesCreateCall { c := &ProjectsLocationsConversionWorkspacesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -6297,10 +6536,10 @@ func (c *ProjectsLocationsConversionWorkspacesCreateCall) ConversionWorkspaceId( return c } -// RequestId sets the optional parameter "requestId": A unique id used +// RequestId sets the optional parameter "requestId": A unique ID used // to identify the request. If the server receives two requests with the -// same id, then the second request will be ignored. It is recommended -// to always set this value to a UUID. The id must contain only letters +// same ID, then the second request is ignored. It is recommended to +// always set this value to a UUID. The ID must contain only letters // (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The // maximum length is 40 characters. func (c *ProjectsLocationsConversionWorkspacesCreateCall) RequestId(requestId string) *ProjectsLocationsConversionWorkspacesCreateCall { @@ -6413,14 +6652,14 @@ func (c *ProjectsLocationsConversionWorkspacesCreateCall) Do(opts ...googleapi.C // "type": "string" // }, // "parent": { - // "description": "Required. The parent, which owns this collection of conversion workspaces.", + // "description": "Required. The parent which owns this collection of conversion workspaces.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // }, // "requestId": { - // "description": "A unique id used to identify the request. If the server receives two requests with the same id, then the second request will be ignored. It is recommended to always set this value to a UUID. The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", + // "description": "A unique ID used to identify the request. If the server receives two requests with the same ID, then the second request is ignored. It is recommended to always set this value to a UUID. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", // "location": "query", // "type": "string" // } @@ -6458,10 +6697,10 @@ func (r *ProjectsLocationsConversionWorkspacesService) Delete(name string) *Proj return c } -// RequestId sets the optional parameter "requestId": A unique id used +// RequestId sets the optional parameter "requestId": A unique ID used // to identify the request. If the server receives two requests with the -// same id, then the second request will be ignored. It is recommended -// to always set this value to a UUID. The id must contain only letters +// same ID, then the second request is ignored. It is recommended to +// always set this value to a UUID. The ID must contain only letters // (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The // maximum length is 40 characters. func (c *ProjectsLocationsConversionWorkspacesDeleteCall) RequestId(requestId string) *ProjectsLocationsConversionWorkspacesDeleteCall { @@ -6571,7 +6810,7 @@ func (c *ProjectsLocationsConversionWorkspacesDeleteCall) Do(opts ...googleapi.C // "type": "string" // }, // "requestId": { - // "description": "A unique id used to identify the request. If the server receives two requests with the same id, then the second request will be ignored. It is recommended to always set this value to a UUID. The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", + // "description": "A unique ID used to identify the request. If the server receives two requests with the same ID, then the second request is ignored. It is recommended to always set this value to a UUID. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", // "location": "query", // "type": "string" // } @@ -6602,7 +6841,7 @@ type ProjectsLocationsConversionWorkspacesDescribeConversionWorkspaceRevisionsCa // revisions of a specific conversion workspace. // // - conversionWorkspace: Name of the conversion workspace resource -// whose revisions are listed. in the form of: +// whose revisions are listed. Must be in the form of: // projects/{project}/locations/{location}/conversionWorkspaces/{conver // sion_workspace}. func (r *ProjectsLocationsConversionWorkspacesService) DescribeConversionWorkspaceRevisions(conversionWorkspace string) *ProjectsLocationsConversionWorkspacesDescribeConversionWorkspaceRevisionsCall { @@ -6612,7 +6851,7 @@ func (r *ProjectsLocationsConversionWorkspacesService) DescribeConversionWorkspa } // CommitId sets the optional parameter "commitId": Optional filter to -// request a specific commit id +// request a specific commit ID. func (c *ProjectsLocationsConversionWorkspacesDescribeConversionWorkspaceRevisionsCall) CommitId(commitId string) *ProjectsLocationsConversionWorkspacesDescribeConversionWorkspaceRevisionsCall { c.urlParams_.Set("commitId", commitId) return c @@ -6728,12 +6967,12 @@ func (c *ProjectsLocationsConversionWorkspacesDescribeConversionWorkspaceRevisio // ], // "parameters": { // "commitId": { - // "description": "Optional. Optional filter to request a specific commit id", + // "description": "Optional. Optional filter to request a specific commit ID.", // "location": "query", // "type": "string" // }, // "conversionWorkspace": { - // "description": "Required. Name of the conversion workspace resource whose revisions are listed. in the form of: projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.", + // "description": "Required. Name of the conversion workspace resource whose revisions are listed. Must be in the form of: projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/conversionWorkspaces/[^/]+$", // "required": true, @@ -6762,15 +7001,15 @@ type ProjectsLocationsConversionWorkspacesDescribeDatabaseEntitiesCall struct { header_ http.Header } -// DescribeDatabaseEntities: Use this method to describe the database -// entities tree for a specific conversion workspace and a specific tree -// type. The DB Entities are not a resource like conversion workspace or -// mapping rule, and they can not be created, updated or deleted like -// one. Instead they are simple data objects describing the structure of -// the client database. +// DescribeDatabaseEntities: Describes the database entities tree for a +// specific conversion workspace and a specific tree type. Database +// entities are not resources like conversion workspaces or mapping +// rules, and they can't be created, updated or deleted. Instead, they +// are simple data objects describing the structure of the client +// database. // // - conversionWorkspace: Name of the conversion workspace resource -// whose DB entities are described in the form of: +// whose database entities are described. Must be in the form of: // projects/{project}/locations/{location}/conversionWorkspaces/{conver // sion_workspace}. func (r *ProjectsLocationsConversionWorkspacesService) DescribeDatabaseEntities(conversionWorkspace string) *ProjectsLocationsConversionWorkspacesDescribeDatabaseEntitiesCall { @@ -6780,7 +7019,7 @@ func (r *ProjectsLocationsConversionWorkspacesService) DescribeDatabaseEntities( } // CommitId sets the optional parameter "commitId": Request a specific -// commit id. If not specified, the entities from the latest commit are +// commit ID. If not specified, the entities from the latest commit are // returned. func (c *ProjectsLocationsConversionWorkspacesDescribeDatabaseEntitiesCall) CommitId(commitId string) *ProjectsLocationsConversionWorkspacesDescribeDatabaseEntitiesCall { c.urlParams_.Set("commitId", commitId) @@ -6795,7 +7034,8 @@ func (c *ProjectsLocationsConversionWorkspacesDescribeDatabaseEntitiesCall) Filt } // PageSize sets the optional parameter "pageSize": The maximum number -// of entities to return. The service may return fewer than this value. +// of entities to return. The service may return fewer entities than the +// value specifies. func (c *ProjectsLocationsConversionWorkspacesDescribeDatabaseEntitiesCall) PageSize(pageSize int64) *ProjectsLocationsConversionWorkspacesDescribeDatabaseEntitiesCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c @@ -6817,10 +7057,10 @@ func (c *ProjectsLocationsConversionWorkspacesDescribeDatabaseEntitiesCall) Page // // Possible values: // -// "DB_TREE_TYPE_UNSPECIFIED" - Unspecified tree type -// "SOURCE_TREE" - The source database tree -// "DRAFT_TREE" - The draft database tree -// "DESTINATION_TREE" - The destination database tree +// "DB_TREE_TYPE_UNSPECIFIED" - Unspecified tree type. +// "SOURCE_TREE" - The source database tree. +// "DRAFT_TREE" - The draft database tree. +// "DESTINATION_TREE" - The destination database tree. func (c *ProjectsLocationsConversionWorkspacesDescribeDatabaseEntitiesCall) Tree(tree string) *ProjectsLocationsConversionWorkspacesDescribeDatabaseEntitiesCall { c.urlParams_.Set("tree", tree) return c @@ -6933,7 +7173,7 @@ func (c *ProjectsLocationsConversionWorkspacesDescribeDatabaseEntitiesCall) Do(o } return ret, nil // { - // "description": "Use this method to describe the database entities tree for a specific conversion workspace and a specific tree type. The DB Entities are not a resource like conversion workspace or mapping rule, and they can not be created, updated or deleted like one. Instead they are simple data objects describing the structure of the client database.", + // "description": "Describes the database entities tree for a specific conversion workspace and a specific tree type. Database entities are not resources like conversion workspaces or mapping rules, and they can't be created, updated or deleted. Instead, they are simple data objects describing the structure of the client database.", // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/conversionWorkspaces/{conversionWorkspacesId}:describeDatabaseEntities", // "httpMethod": "GET", // "id": "datamigration.projects.locations.conversionWorkspaces.describeDatabaseEntities", @@ -6942,12 +7182,12 @@ func (c *ProjectsLocationsConversionWorkspacesDescribeDatabaseEntitiesCall) Do(o // ], // "parameters": { // "commitId": { - // "description": "Request a specific commit id. If not specified, the entities from the latest commit are returned.", + // "description": "Request a specific commit ID. If not specified, the entities from the latest commit are returned.", // "location": "query", // "type": "string" // }, // "conversionWorkspace": { - // "description": "Required. Name of the conversion workspace resource whose DB entities are described in the form of: projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.", + // "description": "Required. Name of the conversion workspace resource whose database entities are described. Must be in the form of: projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/conversionWorkspaces/[^/]+$", // "required": true, @@ -6959,7 +7199,7 @@ func (c *ProjectsLocationsConversionWorkspacesDescribeDatabaseEntitiesCall) Do(o // "type": "string" // }, // "pageSize": { - // "description": "The maximum number of entities to return. The service may return fewer than this value.", + // "description": "The maximum number of entities to return. The service may return fewer entities than the value specifies.", // "format": "int32", // "location": "query", // "type": "integer" @@ -6978,10 +7218,10 @@ func (c *ProjectsLocationsConversionWorkspacesDescribeDatabaseEntitiesCall) Do(o // "DESTINATION_TREE" // ], // "enumDescriptions": [ - // "Unspecified tree type", - // "The source database tree", - // "The draft database tree", - // "The destination database tree" + // "Unspecified tree type.", + // "The source database tree.", + // "The draft database tree.", + // "The destination database tree." // ], // "location": "query", // "type": "string" @@ -7358,7 +7598,7 @@ type ProjectsLocationsConversionWorkspacesListCall struct { // List: Lists conversion workspaces in a given project and location. // -// - parent: The parent, which owns this collection of conversion +// - parent: The parent which owns this collection of conversion // workspaces. func (r *ProjectsLocationsConversionWorkspacesService) List(parent string) *ProjectsLocationsConversionWorkspacesListCall { c := &ProjectsLocationsConversionWorkspacesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -7375,7 +7615,7 @@ func (r *ProjectsLocationsConversionWorkspacesService) List(parent string) *Proj // specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** You // can also filter nested fields. For example, you could specify // **source.version = "12.c.1"** to select all conversion workspaces -// with source database version equal to 12.c.1 +// with source database version equal to 12.c.1. func (c *ProjectsLocationsConversionWorkspacesListCall) Filter(filter string) *ProjectsLocationsConversionWorkspacesListCall { c.urlParams_.Set("filter", filter) return c @@ -7383,7 +7623,7 @@ func (c *ProjectsLocationsConversionWorkspacesListCall) Filter(filter string) *P // PageSize sets the optional parameter "pageSize": The maximum number // of conversion workspaces to return. The service may return fewer than -// this value. If unspecified, at most 50 sets will be returned. +// this value. If unspecified, at most 50 sets are returned. func (c *ProjectsLocationsConversionWorkspacesListCall) PageSize(pageSize int64) *ProjectsLocationsConversionWorkspacesListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c @@ -7508,12 +7748,12 @@ func (c *ProjectsLocationsConversionWorkspacesListCall) Do(opts ...googleapi.Cal // ], // "parameters": { // "filter": { - // "description": "A filter expression that filters conversion workspaces listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c. For example, list conversion workspaces created this year by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** You can also filter nested fields. For example, you could specify **source.version = \"12.c.1\"** to select all conversion workspaces with source database version equal to 12.c.1", + // "description": "A filter expression that filters conversion workspaces listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c. For example, list conversion workspaces created this year by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** You can also filter nested fields. For example, you could specify **source.version = \"12.c.1\"** to select all conversion workspaces with source database version equal to 12.c.1.", // "location": "query", // "type": "string" // }, // "pageSize": { - // "description": "The maximum number of conversion workspaces to return. The service may return fewer than this value. If unspecified, at most 50 sets will be returned.", + // "description": "The maximum number of conversion workspaces to return. The service may return fewer than this value. If unspecified, at most 50 sets are returned.", // "format": "int32", // "location": "query", // "type": "integer" @@ -7524,7 +7764,7 @@ func (c *ProjectsLocationsConversionWorkspacesListCall) Do(opts ...googleapi.Cal // "type": "string" // }, // "parent": { - // "description": "Required. The parent, which owns this collection of conversion workspaces.", + // "description": "Required. The parent which owns this collection of conversion workspaces.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+$", // "required": true, @@ -7586,10 +7826,10 @@ func (r *ProjectsLocationsConversionWorkspacesService) Patch(name string, conver return c } -// RequestId sets the optional parameter "requestId": A unique id used +// RequestId sets the optional parameter "requestId": A unique ID used // to identify the request. If the server receives two requests with the -// same id, then the second request will be ignored. It is recommended -// to always set this value to a UUID. The id must contain only letters +// same ID, then the second request is ignored. It is recommended to +// always set this value to a UUID. The ID must contain only letters // (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The // maximum length is 40 characters. func (c *ProjectsLocationsConversionWorkspacesPatchCall) RequestId(requestId string) *ProjectsLocationsConversionWorkspacesPatchCall { @@ -7598,8 +7838,8 @@ func (c *ProjectsLocationsConversionWorkspacesPatchCall) RequestId(requestId str } // UpdateMask sets the optional parameter "updateMask": Required. Field -// mask is used to specify the fields to be overwritten in the -// conversion workspace resource by the update. +// mask is used to specify the fields to be overwritten by the update in +// the conversion workspace resource. func (c *ProjectsLocationsConversionWorkspacesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsConversionWorkspacesPatchCall { c.urlParams_.Set("updateMask", updateMask) return c @@ -7712,12 +7952,12 @@ func (c *ProjectsLocationsConversionWorkspacesPatchCall) Do(opts ...googleapi.Ca // "type": "string" // }, // "requestId": { - // "description": "A unique id used to identify the request. If the server receives two requests with the same id, then the second request will be ignored. It is recommended to always set this value to a UUID. The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", + // "description": "A unique ID used to identify the request. If the server receives two requests with the same ID, then the second request is ignored. It is recommended to always set this value to a UUID. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", // "location": "query", // "type": "string" // }, // "updateMask": { - // "description": "Required. Field mask is used to specify the fields to be overwritten in the conversion workspace resource by the update.", + // "description": "Required. Field mask is used to specify the fields to be overwritten by the update in the conversion workspace resource.", // "format": "google-fieldmask", // "location": "query", // "type": "string" @@ -7748,10 +7988,10 @@ type ProjectsLocationsConversionWorkspacesRollbackCall struct { header_ http.Header } -// Rollback: Rollbacks a conversion workspace to the last committed -// spanshot. +// Rollback: Rolls back a conversion workspace to the last committed +// snapshot. // -// - name: Name of the conversion workspace resource to rollback to. +// - name: Name of the conversion workspace resource to roll back to. func (r *ProjectsLocationsConversionWorkspacesService) Rollback(name string, rollbackconversionworkspacerequest *RollbackConversionWorkspaceRequest) *ProjectsLocationsConversionWorkspacesRollbackCall { c := &ProjectsLocationsConversionWorkspacesRollbackCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name @@ -7850,7 +8090,7 @@ func (c *ProjectsLocationsConversionWorkspacesRollbackCall) Do(opts ...googleapi } return ret, nil // { - // "description": "Rollbacks a conversion workspace to the last committed spanshot.", + // "description": "Rolls back a conversion workspace to the last committed snapshot.", // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/conversionWorkspaces/{conversionWorkspacesId}:rollback", // "httpMethod": "POST", // "id": "datamigration.projects.locations.conversionWorkspaces.rollback", @@ -7859,7 +8099,7 @@ func (c *ProjectsLocationsConversionWorkspacesRollbackCall) Do(opts ...googleapi // ], // "parameters": { // "name": { - // "description": "Required. Name of the conversion workspace resource to rollback to.", + // "description": "Required. Name of the conversion workspace resource to roll back to.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/conversionWorkspaces/[^/]+$", // "required": true, @@ -7891,14 +8131,14 @@ type ProjectsLocationsConversionWorkspacesSearchBackgroundJobsCall struct { header_ http.Header } -// SearchBackgroundJobs: Use this method to search/list the background -// jobs for a specific conversion workspace. The background jobs are not -// a resource like conversion workspace or mapping rule, and they can -// not be created, updated or deleted like one. Instead they are a way -// to expose the data plane jobs log. +// SearchBackgroundJobs: Searches/lists the background jobs for a +// specific conversion workspace. The background jobs are not resources +// like conversion workspaces or mapping rules, and they can't be +// created, updated or deleted. Instead, they are a way to expose the +// data plane jobs log. // -// - conversionWorkspace: Name of the conversion workspace resource whos -// jobs are listed. in the form of: +// - conversionWorkspace: Name of the conversion workspace resource +// whose jobs are listed, in the form of: // projects/{project}/locations/{location}/conversionWorkspaces/{conver // sion_workspace}. func (r *ProjectsLocationsConversionWorkspacesService) SearchBackgroundJobs(conversionWorkspace string) *ProjectsLocationsConversionWorkspacesSearchBackgroundJobsCall { @@ -7908,8 +8148,8 @@ func (r *ProjectsLocationsConversionWorkspacesService) SearchBackgroundJobs(conv } // CompletedUntilTime sets the optional parameter "completedUntilTime": -// If supplied, will only return jobs that completed until (not -// including) the given timestamp. +// If provided, only returns jobs that completed until (not including) +// the given timestamp. func (c *ProjectsLocationsConversionWorkspacesSearchBackgroundJobsCall) CompletedUntilTime(completedUntilTime string) *ProjectsLocationsConversionWorkspacesSearchBackgroundJobsCall { c.urlParams_.Set("completedUntilTime", completedUntilTime) return c @@ -7917,8 +8157,8 @@ func (c *ProjectsLocationsConversionWorkspacesSearchBackgroundJobsCall) Complete // MaxSize sets the optional parameter "maxSize": The maximum number of // jobs to return. The service may return fewer than this value. If -// unspecified, at most 100 jobs will be returned. The maximum value is -// 100; values above 100 will be coerced to 100. +// unspecified, at most 100 jobs are returned. The maximum value is 100; +// values above 100 are coerced to 100. func (c *ProjectsLocationsConversionWorkspacesSearchBackgroundJobsCall) MaxSize(maxSize int64) *ProjectsLocationsConversionWorkspacesSearchBackgroundJobsCall { c.urlParams_.Set("maxSize", fmt.Sprint(maxSize)) return c @@ -7926,7 +8166,7 @@ func (c *ProjectsLocationsConversionWorkspacesSearchBackgroundJobsCall) MaxSize( // ReturnMostRecentPerJobType sets the optional parameter // "returnMostRecentPerJobType": Whether or not to return just the most -// recent job per job type +// recent job per job type, func (c *ProjectsLocationsConversionWorkspacesSearchBackgroundJobsCall) ReturnMostRecentPerJobType(returnMostRecentPerJobType bool) *ProjectsLocationsConversionWorkspacesSearchBackgroundJobsCall { c.urlParams_.Set("returnMostRecentPerJobType", fmt.Sprint(returnMostRecentPerJobType)) return c @@ -8031,7 +8271,7 @@ func (c *ProjectsLocationsConversionWorkspacesSearchBackgroundJobsCall) Do(opts } return ret, nil // { - // "description": "Use this method to search/list the background jobs for a specific conversion workspace. The background jobs are not a resource like conversion workspace or mapping rule, and they can not be created, updated or deleted like one. Instead they are a way to expose the data plane jobs log.", + // "description": "Searches/lists the background jobs for a specific conversion workspace. The background jobs are not resources like conversion workspaces or mapping rules, and they can't be created, updated or deleted. Instead, they are a way to expose the data plane jobs log.", // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/conversionWorkspaces/{conversionWorkspacesId}:searchBackgroundJobs", // "httpMethod": "GET", // "id": "datamigration.projects.locations.conversionWorkspaces.searchBackgroundJobs", @@ -8040,26 +8280,26 @@ func (c *ProjectsLocationsConversionWorkspacesSearchBackgroundJobsCall) Do(opts // ], // "parameters": { // "completedUntilTime": { - // "description": "Optional. If supplied, will only return jobs that completed until (not including) the given timestamp.", + // "description": "Optional. If provided, only returns jobs that completed until (not including) the given timestamp.", // "format": "google-datetime", // "location": "query", // "type": "string" // }, // "conversionWorkspace": { - // "description": "Required. Name of the conversion workspace resource whos jobs are listed. in the form of: projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.", + // "description": "Required. Name of the conversion workspace resource whose jobs are listed, in the form of: projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/conversionWorkspaces/[^/]+$", // "required": true, // "type": "string" // }, // "maxSize": { - // "description": "Optional. The maximum number of jobs to return. The service may return fewer than this value. If unspecified, at most 100 jobs will be returned. The maximum value is 100; values above 100 will be coerced to 100.", + // "description": "Optional. The maximum number of jobs to return. The service may return fewer than this value. If unspecified, at most 100 jobs are returned. The maximum value is 100; values above 100 are coerced to 100.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "returnMostRecentPerJobType": { - // "description": "Optional. Whether or not to return just the most recent job per job type", + // "description": "Optional. Whether or not to return just the most recent job per job type,", // "location": "query", // "type": "boolean" // } @@ -8090,7 +8330,7 @@ type ProjectsLocationsConversionWorkspacesSeedCall struct { // workspace. // // - name: Name of the conversion workspace resource to seed with new -// database structure. in the form of: +// database structure, in the form of: // projects/{project}/locations/{location}/conversionWorkspaces/{conver // sion_workspace}. func (r *ProjectsLocationsConversionWorkspacesService) Seed(name string, seedconversionworkspacerequest *SeedConversionWorkspaceRequest) *ProjectsLocationsConversionWorkspacesSeedCall { @@ -8200,7 +8440,7 @@ func (c *ProjectsLocationsConversionWorkspacesSeedCall) Do(opts ...googleapi.Cal // ], // "parameters": { // "name": { - // "description": "Name of the conversion workspace resource to seed with new database structure. in the form of: projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.", + // "description": "Name of the conversion workspace resource to seed with new database structure, in the form of: projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/conversionWorkspaces/[^/]+$", // "required": true, @@ -8677,7 +8917,7 @@ type ProjectsLocationsMigrationJobsCreateCall struct { // Create: Creates a new migration job in a given project and location. // -// - parent: The parent, which owns this collection of migration jobs. +// - parent: The parent which owns this collection of migration jobs. func (r *ProjectsLocationsMigrationJobsService) Create(parent string, migrationjob *MigrationJob) *ProjectsLocationsMigrationJobsCreateCall { c := &ProjectsLocationsMigrationJobsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent @@ -8692,10 +8932,10 @@ func (c *ProjectsLocationsMigrationJobsCreateCall) MigrationJobId(migrationJobId return c } -// RequestId sets the optional parameter "requestId": A unique id used +// RequestId sets the optional parameter "requestId": A unique ID used // to identify the request. If the server receives two requests with the -// same id, then the second request will be ignored. It is recommended -// to always set this value to a UUID. The id must contain only letters +// same ID, then the second request is ignored. It is recommended to +// always set this value to a UUID. The ID must contain only letters // (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The // maximum length is 40 characters. func (c *ProjectsLocationsMigrationJobsCreateCall) RequestId(requestId string) *ProjectsLocationsMigrationJobsCreateCall { @@ -8808,14 +9048,14 @@ func (c *ProjectsLocationsMigrationJobsCreateCall) Do(opts ...googleapi.CallOpti // "type": "string" // }, // "parent": { - // "description": "Required. The parent, which owns this collection of migration jobs.", + // "description": "Required. The parent which owns this collection of migration jobs.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // }, // "requestId": { - // "description": "A unique id used to identify the request. If the server receives two requests with the same id, then the second request will be ignored. It is recommended to always set this value to a UUID. The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", + // "description": "A unique ID used to identify the request. If the server receives two requests with the same ID, then the second request is ignored. It is recommended to always set this value to a UUID. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", // "location": "query", // "type": "string" // } @@ -8862,10 +9102,10 @@ func (c *ProjectsLocationsMigrationJobsDeleteCall) Force(force bool) *ProjectsLo return c } -// RequestId sets the optional parameter "requestId": A unique id used +// RequestId sets the optional parameter "requestId": A unique ID used // to identify the request. If the server receives two requests with the -// same id, then the second request will be ignored. It is recommended -// to always set this value to a UUID. The id must contain only letters +// same ID, then the second request is ignored. It is recommended to +// always set this value to a UUID. The ID must contain only letters // (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The // maximum length is 40 characters. func (c *ProjectsLocationsMigrationJobsDeleteCall) RequestId(requestId string) *ProjectsLocationsMigrationJobsDeleteCall { @@ -8980,7 +9220,7 @@ func (c *ProjectsLocationsMigrationJobsDeleteCall) Do(opts ...googleapi.CallOpti // "type": "string" // }, // "requestId": { - // "description": "A unique id used to identify the request. If the server receives two requests with the same id, then the second request will be ignored. It is recommended to always set this value to a UUID. The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", + // "description": "A unique ID used to identify the request. If the server receives two requests with the same ID, then the second request is ignored. It is recommended to always set this value to a UUID. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", // "location": "query", // "type": "string" // } @@ -9474,7 +9714,7 @@ type ProjectsLocationsMigrationJobsListCall struct { // List: Lists migration jobs in a given project and location. // -// - parent: The parent, which owns this collection of migrationJobs. +// - parent: The parent which owns this collection of migrationJobs. func (r *ProjectsLocationsMigrationJobsService) List(parent string) *ProjectsLocationsMigrationJobsListCall { c := &ProjectsLocationsMigrationJobsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent @@ -9507,7 +9747,7 @@ func (c *ProjectsLocationsMigrationJobsListCall) OrderBy(orderBy string) *Projec // PageSize sets the optional parameter "pageSize": The maximum number // of migration jobs to return. The service may return fewer than this // value. If unspecified, at most 50 migration jobs will be returned. -// The maximum value is 1000; values above 1000 will be coerced to 1000. +// The maximum value is 1000; values above 1000 are coerced to 1000. func (c *ProjectsLocationsMigrationJobsListCall) PageSize(pageSize int64) *ProjectsLocationsMigrationJobsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c @@ -9642,7 +9882,7 @@ func (c *ProjectsLocationsMigrationJobsListCall) Do(opts ...googleapi.CallOption // "type": "string" // }, // "pageSize": { - // "description": "The maximum number of migration jobs to return. The service may return fewer than this value. If unspecified, at most 50 migration jobs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + // "description": "The maximum number of migration jobs to return. The service may return fewer than this value. If unspecified, at most 50 migration jobs will be returned. The maximum value is 1000; values above 1000 are coerced to 1000.", // "format": "int32", // "location": "query", // "type": "integer" @@ -9653,7 +9893,7 @@ func (c *ProjectsLocationsMigrationJobsListCall) Do(opts ...googleapi.CallOption // "type": "string" // }, // "parent": { - // "description": "Required. The parent, which owns this collection of migrationJobs.", + // "description": "Required. The parent which owns this collection of migrationJobs.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+$", // "required": true, @@ -9716,10 +9956,10 @@ func (r *ProjectsLocationsMigrationJobsService) Patch(name string, migrationjob return c } -// RequestId sets the optional parameter "requestId": A unique id used +// RequestId sets the optional parameter "requestId": A unique ID used // to identify the request. If the server receives two requests with the -// same id, then the second request will be ignored. It is recommended -// to always set this value to a UUID. The id must contain only letters +// same ID, then the second request is ignored. It is recommended to +// always set this value to a UUID. The ID must contain only letters // (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The // maximum length is 40 characters. func (c *ProjectsLocationsMigrationJobsPatchCall) RequestId(requestId string) *ProjectsLocationsMigrationJobsPatchCall { @@ -9728,8 +9968,8 @@ func (c *ProjectsLocationsMigrationJobsPatchCall) RequestId(requestId string) *P } // UpdateMask sets the optional parameter "updateMask": Required. Field -// mask is used to specify the fields to be overwritten in the migration -// job resource by the update. +// mask is used to specify the fields to be overwritten by the update in +// the conversion workspace resource. func (c *ProjectsLocationsMigrationJobsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsMigrationJobsPatchCall { c.urlParams_.Set("updateMask", updateMask) return c @@ -9842,12 +10082,12 @@ func (c *ProjectsLocationsMigrationJobsPatchCall) Do(opts ...googleapi.CallOptio // "type": "string" // }, // "requestId": { - // "description": "A unique id used to identify the request. If the server receives two requests with the same id, then the second request will be ignored. It is recommended to always set this value to a UUID. The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", + // "description": "A unique ID used to identify the request. If the server receives two requests with the same ID, then the second request is ignored. It is recommended to always set this value to a UUID. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", // "location": "query", // "type": "string" // }, // "updateMask": { - // "description": "Required. Field mask is used to specify the fields to be overwritten in the migration job resource by the update.", + // "description": "Required. Field mask is used to specify the fields to be overwritten by the update in the conversion workspace resource.", // "format": "google-fieldmask", // "location": "query", // "type": "string" @@ -11698,10 +11938,10 @@ func (c *ProjectsLocationsPrivateConnectionsCreateCall) PrivateConnectionId(priv return c } -// RequestId sets the optional parameter "requestId": A unique id used +// RequestId sets the optional parameter "requestId": A unique ID used // to identify the request. If the server receives two requests with the -// same id, then the second request will be ignored. It is recommended -// to always set this value to a UUID. The id must contain only letters +// same ID, then the second request is ignored. It is recommended to +// always set this value to a UUID. The ID must contain only letters // (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The // maximum length is 40 characters. func (c *ProjectsLocationsPrivateConnectionsCreateCall) RequestId(requestId string) *ProjectsLocationsPrivateConnectionsCreateCall { @@ -11828,7 +12068,7 @@ func (c *ProjectsLocationsPrivateConnectionsCreateCall) Do(opts ...googleapi.Cal // "type": "string" // }, // "requestId": { - // "description": "Optional. A unique id used to identify the request. If the server receives two requests with the same id, then the second request will be ignored. It is recommended to always set this value to a UUID. The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", + // "description": "Optional. A unique ID used to identify the request. If the server receives two requests with the same ID, then the second request is ignored. It is recommended to always set this value to a UUID. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", // "location": "query", // "type": "string" // }, @@ -11872,10 +12112,10 @@ func (r *ProjectsLocationsPrivateConnectionsService) Delete(name string) *Projec return c } -// RequestId sets the optional parameter "requestId": A unique id used +// RequestId sets the optional parameter "requestId": A unique ID used // to identify the request. If the server receives two requests with the -// same id, then the second request will be ignored. It is recommended -// to always set this value to a UUID. The id must contain only letters +// same ID, then the second request is ignored. It is recommended to +// always set this value to a UUID. The ID must contain only letters // (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The // maximum length is 40 characters. func (c *ProjectsLocationsPrivateConnectionsDeleteCall) RequestId(requestId string) *ProjectsLocationsPrivateConnectionsDeleteCall { @@ -11985,7 +12225,7 @@ func (c *ProjectsLocationsPrivateConnectionsDeleteCall) Do(opts ...googleapi.Cal // "type": "string" // }, // "requestId": { - // "description": "Optional. A unique id used to identify the request. If the server receives two requests with the same id, then the second request will be ignored. It is recommended to always set this value to a UUID. The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", + // "description": "Optional. A unique ID used to identify the request. If the server receives two requests with the same ID, then the second request is ignored. It is recommended to always set this value to a UUID. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", // "location": "query", // "type": "string" // } @@ -12189,8 +12429,8 @@ func (c *ProjectsLocationsPrivateConnectionsListCall) OrderBy(orderBy string) *P // PageSize sets the optional parameter "pageSize": Maximum number of // private connections to return. If unspecified, at most 50 private -// connections that will be returned. The maximum value is 1000; values -// above 1000 will be coerced to 1000. +// connections that are returned. The maximum value is 1000; values +// above 1000 are coerced to 1000. func (c *ProjectsLocationsPrivateConnectionsListCall) PageSize(pageSize int64) *ProjectsLocationsPrivateConnectionsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c @@ -12324,7 +12564,7 @@ func (c *ProjectsLocationsPrivateConnectionsListCall) Do(opts ...googleapi.CallO // "type": "string" // }, // "pageSize": { - // "description": "Maximum number of private connections to return. If unspecified, at most 50 private connections that will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + // "description": "Maximum number of private connections to return. If unspecified, at most 50 private connections that are returned. The maximum value is 1000; values above 1000 are coerced to 1000.", // "format": "int32", // "location": "query", // "type": "integer" diff --git a/dataplex/v1/dataplex-api.json b/dataplex/v1/dataplex-api.json index 2f270904128..1e106318524 100644 --- a/dataplex/v1/dataplex-api.json +++ b/dataplex/v1/dataplex-api.json @@ -468,6 +468,11 @@ "pattern": "^projects/[^/]+/locations/[^/]+$", "required": true, "type": "string" + }, + "validateOnly": { + "description": "Optional. Only validate the request, but do not perform mutations. The default is false.", + "location": "query", + "type": "boolean" } }, "path": "v1/{+parent}/dataScans", @@ -644,6 +649,11 @@ "format": "google-fieldmask", "location": "query", "type": "string" + }, + "validateOnly": { + "description": "Optional. Only validate the request, but do not perform mutations. The default is false.", + "location": "query", + "type": "boolean" } }, "path": "v1/{+name}", @@ -3980,7 +3990,7 @@ } } }, - "revision": "20230125", + "revision": "20230208", "rootUrl": "https://dataplex.googleapis.com/", "schemas": { "Empty": { @@ -4478,6 +4488,11 @@ "description": "Status of the resource referenced by an asset.", "id": "GoogleCloudDataplexV1AssetResourceStatus", "properties": { + "managedAccessIdentity": { + "description": "Output only. Service account associated with the BigQuery Connection.", + "readOnly": true, + "type": "string" + }, "message": { "description": "Additional information about the current state.", "type": "string" @@ -4787,7 +4802,7 @@ "type": "array" }, "resource": { - "description": "Optional. Immutable. The resource name of the resource that is binded to attributes. Presently, only entity resource is supported in the form: projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/entities/{entity_id} Must belong in the same project and region as the attribute binding, and there can only exist one active binding for a resource.", + "description": "Optional. Immutable. The resource name of the resource that is associated to attributes. Presently, only entity resource is supported in the form: projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/entities/{entity_id} Must belong in the same project and region as the attribute binding, and there can only exist one active binding for a resource.", "type": "string" }, "uid": { diff --git a/dataplex/v1/dataplex-gen.go b/dataplex/v1/dataplex-gen.go index 001997a1362..ffa2558173e 100644 --- a/dataplex/v1/dataplex-gen.go +++ b/dataplex/v1/dataplex-gen.go @@ -1074,6 +1074,10 @@ func (s *GoogleCloudDataplexV1AssetResourceSpec) MarshalJSON() ([]byte, error) { // GoogleCloudDataplexV1AssetResourceStatus: Status of the resource // referenced by an asset. type GoogleCloudDataplexV1AssetResourceStatus struct { + // ManagedAccessIdentity: Output only. Service account associated with + // the BigQuery Connection. + ManagedAccessIdentity string `json:"managedAccessIdentity,omitempty"` + // Message: Additional information about the current state. Message string `json:"message,omitempty"` @@ -1088,20 +1092,22 @@ type GoogleCloudDataplexV1AssetResourceStatus struct { // UpdateTime: Last update time of the status. UpdateTime string `json:"updateTime,omitempty"` - // ForceSendFields is a list of field names (e.g. "Message") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. + // ForceSendFields is a list of field names (e.g. + // "ManagedAccessIdentity") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Message") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "ManagedAccessIdentity") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } @@ -1491,8 +1497,8 @@ type GoogleCloudDataplexV1DataAttributeBinding struct { Paths []*GoogleCloudDataplexV1DataAttributeBindingPath `json:"paths,omitempty"` // Resource: Optional. Immutable. The resource name of the resource that - // is binded to attributes. Presently, only entity resource is supported - // in the form: + // is associated to attributes. Presently, only entity resource is + // supported in the form: // projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/enti // ties/{entity_id} Must belong in the same project and region as the // attribute binding, and there can only exist one active binding for a @@ -8708,6 +8714,14 @@ func (c *ProjectsLocationsDataScansCreateCall) DataScanId(dataScanId string) *Pr return c } +// ValidateOnly sets the optional parameter "validateOnly": Only +// validate the request, but do not perform mutations. The default is +// false. +func (c *ProjectsLocationsDataScansCreateCall) ValidateOnly(validateOnly bool) *ProjectsLocationsDataScansCreateCall { + c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly)) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. @@ -8818,6 +8832,11 @@ func (c *ProjectsLocationsDataScansCreateCall) Do(opts ...googleapi.CallOption) // "pattern": "^projects/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" + // }, + // "validateOnly": { + // "description": "Optional. Only validate the request, but do not perform mutations. The default is false.", + // "location": "query", + // "type": "boolean" // } // }, // "path": "v1/{+parent}/dataScans", @@ -9581,6 +9600,14 @@ func (c *ProjectsLocationsDataScansPatchCall) UpdateMask(updateMask string) *Pro return c } +// ValidateOnly sets the optional parameter "validateOnly": Only +// validate the request, but do not perform mutations. The default is +// false. +func (c *ProjectsLocationsDataScansPatchCall) ValidateOnly(validateOnly bool) *ProjectsLocationsDataScansPatchCall { + c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly)) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. @@ -9692,6 +9719,11 @@ func (c *ProjectsLocationsDataScansPatchCall) Do(opts ...googleapi.CallOption) ( // "format": "google-fieldmask", // "location": "query", // "type": "string" + // }, + // "validateOnly": { + // "description": "Optional. Only validate the request, but do not perform mutations. The default is false.", + // "location": "query", + // "type": "boolean" // } // }, // "path": "v1/{+name}", diff --git a/firestore/v1/firestore-api.json b/firestore/v1/firestore-api.json index 57dc59eda07..d0c69d9c3c6 100644 --- a/firestore/v1/firestore-api.json +++ b/firestore/v1/firestore-api.json @@ -997,7 +997,7 @@ ] }, "listen": { - "description": "Listens to changes.", + "description": "Listens to changes. This method is only available via the gRPC API (not REST).", "flatPath": "v1/projects/{projectsId}/databases/{databasesId}/documents:listen", "httpMethod": "POST", "id": "firestore.projects.databases.documents.listen", @@ -1194,7 +1194,7 @@ ] }, "write": { - "description": "Streams batches of document updates and deletes, in order.", + "description": "Streams batches of document updates and deletes, in order. This method is only available via the gRPC API (not REST).", "flatPath": "v1/projects/{projectsId}/databases/{databasesId}/documents:write", "httpMethod": "POST", "id": "firestore.projects.databases.documents.write", @@ -1428,7 +1428,7 @@ } } }, - "revision": "20230118", + "revision": "20230214", "rootUrl": "https://firestore.googleapis.com/", "schemas": { "Aggregation": { @@ -2029,6 +2029,12 @@ ], "type": "string" }, + "createTime": { + "description": "Output only. The timestamp at which this database was created.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, "etag": { "description": "This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.", "type": "string" @@ -2059,6 +2065,17 @@ "Firestore in Datastore Mode." ], "type": "string" + }, + "uid": { + "description": "Output only. The system-generated UUID4 for this Database.", + "readOnly": true, + "type": "string" + }, + "updateTime": { + "description": "Output only. The timestamp at which this database was most recently updated. Note this only includes updates to the database resource and not data contained by the database.", + "format": "google-datetime", + "readOnly": true, + "type": "string" } }, "type": "object" diff --git a/firestore/v1/firestore-gen.go b/firestore/v1/firestore-gen.go index dd2262b67b4..4b67d16c15c 100644 --- a/firestore/v1/firestore-gen.go +++ b/firestore/v1/firestore-gen.go @@ -1375,6 +1375,10 @@ type GoogleFirestoreAdminV1Database struct { // Firestore with Datastore Mode but is not recommended. ConcurrencyMode string `json:"concurrencyMode,omitempty"` + // CreateTime: Output only. The timestamp at which this database was + // created. + CreateTime string `json:"createTime,omitempty"` + // Etag: This checksum is computed by the server based on the value of // other fields, and may be sent on update and delete requests to ensure // the client has an up-to-date value before proceeding. @@ -1407,6 +1411,14 @@ type GoogleFirestoreAdminV1Database struct { // "DATASTORE_MODE" - Firestore in Datastore Mode. Type string `json:"type,omitempty"` + // Uid: Output only. The system-generated UUID4 for this Database. + Uid string `json:"uid,omitempty"` + + // UpdateTime: Output only. The timestamp at which this database was + // most recently updated. Note this only includes updates to the + // database resource and not data contained by the database. + UpdateTime string `json:"updateTime,omitempty"` + // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` @@ -8146,7 +8158,8 @@ type ProjectsDatabasesDocumentsListenCall struct { header_ http.Header } -// Listen: Listens to changes. +// Listen: Listens to changes. This method is only available via the +// gRPC API (not REST). // // - database: The database name. In the format: // `projects/{project_id}/databases/{database_id}`. @@ -8248,7 +8261,7 @@ func (c *ProjectsDatabasesDocumentsListenCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Listens to changes.", + // "description": "Listens to changes. This method is only available via the gRPC API (not REST).", // "flatPath": "v1/projects/{projectsId}/databases/{databasesId}/documents:listen", // "httpMethod": "POST", // "id": "firestore.projects.databases.documents.listen", @@ -9109,6 +9122,7 @@ type ProjectsDatabasesDocumentsWriteCall struct { } // Write: Streams batches of document updates and deletes, in order. +// This method is only available via the gRPC API (not REST). // // - database: The database name. In the format: // `projects/{project_id}/databases/{database_id}`. This is only @@ -9211,7 +9225,7 @@ func (c *ProjectsDatabasesDocumentsWriteCall) Do(opts ...googleapi.CallOption) ( } return ret, nil // { - // "description": "Streams batches of document updates and deletes, in order.", + // "description": "Streams batches of document updates and deletes, in order. This method is only available via the gRPC API (not REST).", // "flatPath": "v1/projects/{projectsId}/databases/{databasesId}/documents:write", // "httpMethod": "POST", // "id": "firestore.projects.databases.documents.write", diff --git a/firestore/v1beta1/firestore-api.json b/firestore/v1beta1/firestore-api.json index d1220c10626..14257013c51 100644 --- a/firestore/v1beta1/firestore-api.json +++ b/firestore/v1beta1/firestore-api.json @@ -592,7 +592,7 @@ ] }, "listen": { - "description": "Listens to changes.", + "description": "Listens to changes. This method is only available via the gRPC API (not REST).", "flatPath": "v1beta1/projects/{projectsId}/databases/{databasesId}/documents:listen", "httpMethod": "POST", "id": "firestore.projects.databases.documents.listen", @@ -789,7 +789,7 @@ ] }, "write": { - "description": "Streams batches of document updates and deletes, in order.", + "description": "Streams batches of document updates and deletes, in order. This method is only available via the gRPC API (not REST).", "flatPath": "v1beta1/projects/{projectsId}/databases/{databasesId}/documents:write", "httpMethod": "POST", "id": "firestore.projects.databases.documents.write", @@ -950,7 +950,7 @@ } } }, - "revision": "20221210", + "revision": "20230214", "rootUrl": "https://firestore.googleapis.com/", "schemas": { "Aggregation": { diff --git a/firestore/v1beta1/firestore-gen.go b/firestore/v1beta1/firestore-gen.go index 44a8ad168bf..441184fb583 100644 --- a/firestore/v1beta1/firestore-gen.go +++ b/firestore/v1beta1/firestore-gen.go @@ -5425,7 +5425,8 @@ type ProjectsDatabasesDocumentsListenCall struct { header_ http.Header } -// Listen: Listens to changes. +// Listen: Listens to changes. This method is only available via the +// gRPC API (not REST). // // - database: The database name. In the format: // `projects/{project_id}/databases/{database_id}`. @@ -5527,7 +5528,7 @@ func (c *ProjectsDatabasesDocumentsListenCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Listens to changes.", + // "description": "Listens to changes. This method is only available via the gRPC API (not REST).", // "flatPath": "v1beta1/projects/{projectsId}/databases/{databasesId}/documents:listen", // "httpMethod": "POST", // "id": "firestore.projects.databases.documents.listen", @@ -6388,6 +6389,7 @@ type ProjectsDatabasesDocumentsWriteCall struct { } // Write: Streams batches of document updates and deletes, in order. +// This method is only available via the gRPC API (not REST). // // - database: The database name. In the format: // `projects/{project_id}/databases/{database_id}`. This is only @@ -6490,7 +6492,7 @@ func (c *ProjectsDatabasesDocumentsWriteCall) Do(opts ...googleapi.CallOption) ( } return ret, nil // { - // "description": "Streams batches of document updates and deletes, in order.", + // "description": "Streams batches of document updates and deletes, in order. This method is only available via the gRPC API (not REST).", // "flatPath": "v1beta1/projects/{projectsId}/databases/{databasesId}/documents:write", // "httpMethod": "POST", // "id": "firestore.projects.databases.documents.write", diff --git a/healthcare/v1/healthcare-api.json b/healthcare/v1/healthcare-api.json index 4d63b042882..f7f3e26bff3 100644 --- a/healthcare/v1/healthcare-api.json +++ b/healthcare/v1/healthcare-api.json @@ -2724,6 +2724,31 @@ "https://www.googleapis.com/auth/cloud-platform" ] }, + "getFHIRStoreMetrics": { + "description": "Gets metrics associated with the FHIR store.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/datasets/{datasetsId}/fhirStores/{fhirStoresId}:getFHIRStoreMetrics", + "httpMethod": "GET", + "id": "healthcare.projects.locations.datasets.fhirStores.getFHIRStoreMetrics", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The resource name of the FHIR store to get metrics for.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/datasets/[^/]+/fhirStores/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}:getFHIRStoreMetrics", + "response": { + "$ref": "FhirStoreMetrics" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "getIamPolicy": { "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/datasets/{datasetsId}/fhirStores/{fhirStoresId}:getIamPolicy", @@ -5161,6 +5186,45 @@ }, "type": "object" }, + "FhirStoreMetric": { + "description": "Count of resources and total storage size by type for a given FHIR store.", + "id": "FhirStoreMetric", + "properties": { + "count": { + "description": "The total count of FHIR resources in the store of this resource type.", + "format": "int64", + "type": "string" + }, + "resourceType": { + "description": "The FHIR resource type this metric applies to.", + "type": "string" + }, + "structuredStorageSizeBytes": { + "description": "The total amount of structured storage used by FHIR resources of this resource type in the store.", + "format": "int64", + "type": "string" + } + }, + "type": "object" + }, + "FhirStoreMetrics": { + "description": "List of metrics for a given FHIR store.", + "id": "FhirStoreMetrics", + "properties": { + "metrics": { + "description": "List of FhirStoreMetric by resource type.", + "items": { + "$ref": "FhirStoreMetric" + }, + "type": "array" + }, + "name": { + "description": "The resource name of the FHIR store to get metrics for, in the format `projects/{project_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`.", + "type": "string" + } + }, + "type": "object" + }, "Field": { "description": "A (sub) field of a type.", "id": "Field", diff --git a/healthcare/v1/healthcare-gen.go b/healthcare/v1/healthcare-gen.go index 042e55c15ad..8aa9752a848 100644 --- a/healthcare/v1/healthcare-gen.go +++ b/healthcare/v1/healthcare-gen.go @@ -2535,6 +2535,81 @@ func (s *FhirStore) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// FhirStoreMetric: Count of resources and total storage size by type +// for a given FHIR store. +type FhirStoreMetric struct { + // Count: The total count of FHIR resources in the store of this + // resource type. + Count int64 `json:"count,omitempty,string"` + + // ResourceType: The FHIR resource type this metric applies to. + ResourceType string `json:"resourceType,omitempty"` + + // StructuredStorageSizeBytes: The total amount of structured storage + // used by FHIR resources of this resource type in the store. + StructuredStorageSizeBytes int64 `json:"structuredStorageSizeBytes,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "Count") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Count") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *FhirStoreMetric) MarshalJSON() ([]byte, error) { + type NoMethod FhirStoreMetric + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// FhirStoreMetrics: List of metrics for a given FHIR store. +type FhirStoreMetrics struct { + // Metrics: List of FhirStoreMetric by resource type. + Metrics []*FhirStoreMetric `json:"metrics,omitempty"` + + // Name: The resource name of the FHIR store to get metrics for, in the + // format + // `projects/{project_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id + // }`. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Metrics") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Metrics") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *FhirStoreMetrics) MarshalJSON() ([]byte, error) { + type NoMethod FhirStoreMetrics + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // Field: A (sub) field of a type. type Field struct { // MaxOccurs: The maximum number of times this field can be repeated. 0 @@ -18910,6 +18985,152 @@ func (c *ProjectsLocationsDatasetsFhirStoresGetCall) Do(opts ...googleapi.CallOp } +// method id "healthcare.projects.locations.datasets.fhirStores.getFHIRStoreMetrics": + +type ProjectsLocationsDatasetsFhirStoresGetFHIRStoreMetricsCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// GetFHIRStoreMetrics: Gets metrics associated with the FHIR store. +// +// - name: The resource name of the FHIR store to get metrics for. +func (r *ProjectsLocationsDatasetsFhirStoresService) GetFHIRStoreMetrics(name string) *ProjectsLocationsDatasetsFhirStoresGetFHIRStoreMetricsCall { + c := &ProjectsLocationsDatasetsFhirStoresGetFHIRStoreMetricsCall{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 information. +func (c *ProjectsLocationsDatasetsFhirStoresGetFHIRStoreMetricsCall) Fields(s ...googleapi.Field) *ProjectsLocationsDatasetsFhirStoresGetFHIRStoreMetricsCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsDatasetsFhirStoresGetFHIRStoreMetricsCall) IfNoneMatch(entityTag string) *ProjectsLocationsDatasetsFhirStoresGetFHIRStoreMetricsCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsDatasetsFhirStoresGetFHIRStoreMetricsCall) Context(ctx context.Context) *ProjectsLocationsDatasetsFhirStoresGetFHIRStoreMetricsCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsDatasetsFhirStoresGetFHIRStoreMetricsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsDatasetsFhirStoresGetFHIRStoreMetricsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + 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}:getFHIRStoreMetrics") + 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) +} + +// Do executes the "healthcare.projects.locations.datasets.fhirStores.getFHIRStoreMetrics" call. +// Exactly one of *FhirStoreMetrics or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FhirStoreMetrics.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 *ProjectsLocationsDatasetsFhirStoresGetFHIRStoreMetricsCall) Do(opts ...googleapi.CallOption) (*FhirStoreMetrics, 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 := &FhirStoreMetrics{ + 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 + // { + // "description": "Gets metrics associated with the FHIR store.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/datasets/{datasetsId}/fhirStores/{fhirStoresId}:getFHIRStoreMetrics", + // "httpMethod": "GET", + // "id": "healthcare.projects.locations.datasets.fhirStores.getFHIRStoreMetrics", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The resource name of the FHIR store to get metrics for.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/datasets/[^/]+/fhirStores/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}:getFHIRStoreMetrics", + // "response": { + // "$ref": "FhirStoreMetrics" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + // method id "healthcare.projects.locations.datasets.fhirStores.getIamPolicy": type ProjectsLocationsDatasetsFhirStoresGetIamPolicyCall struct { diff --git a/healthcare/v1beta1/healthcare-api.json b/healthcare/v1beta1/healthcare-api.json index 9d3bd642aea..8f23798d78b 100644 --- a/healthcare/v1beta1/healthcare-api.json +++ b/healthcare/v1beta1/healthcare-api.json @@ -3259,6 +3259,31 @@ "https://www.googleapis.com/auth/cloud-platform" ] }, + "getFHIRStoreMetrics": { + "description": "Gets metrics associated with the FHIR store.", + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/datasets/{datasetsId}/fhirStores/{fhirStoresId}:getFHIRStoreMetrics", + "httpMethod": "GET", + "id": "healthcare.projects.locations.datasets.fhirStores.getFHIRStoreMetrics", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The resource name of the FHIR store to get metrics for.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/datasets/[^/]+/fhirStores/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta1/{+name}:getFHIRStoreMetrics", + "response": { + "$ref": "FhirStoreMetrics" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "getIamPolicy": { "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/datasets/{datasetsId}/fhirStores/{fhirStoresId}:getIamPolicy", @@ -6417,6 +6442,45 @@ }, "type": "object" }, + "FhirStoreMetric": { + "description": "Count of resources and total storage size by type for a given FHIR store.", + "id": "FhirStoreMetric", + "properties": { + "count": { + "description": "The total count of FHIR resources in the store of this resource type.", + "format": "int64", + "type": "string" + }, + "resourceType": { + "description": "The FHIR resource type this metric applies to.", + "type": "string" + }, + "structuredStorageSizeBytes": { + "description": "The total amount of structured storage used by FHIR resources of this resource type in the store.", + "format": "int64", + "type": "string" + } + }, + "type": "object" + }, + "FhirStoreMetrics": { + "description": "List of metrics for a given FHIR store.", + "id": "FhirStoreMetrics", + "properties": { + "metrics": { + "description": "List of FhirStoreMetric by resource type.", + "items": { + "$ref": "FhirStoreMetric" + }, + "type": "array" + }, + "name": { + "description": "The resource name of the FHIR store to get metrics for, in the format `projects/{project_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`.", + "type": "string" + } + }, + "type": "object" + }, "Field": { "description": "A (sub) field of a type.", "id": "Field", diff --git a/healthcare/v1beta1/healthcare-gen.go b/healthcare/v1beta1/healthcare-gen.go index 43c7e20c173..7b5870de5b2 100644 --- a/healthcare/v1beta1/healthcare-gen.go +++ b/healthcare/v1beta1/healthcare-gen.go @@ -3384,6 +3384,81 @@ func (s *FhirStore) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// FhirStoreMetric: Count of resources and total storage size by type +// for a given FHIR store. +type FhirStoreMetric struct { + // Count: The total count of FHIR resources in the store of this + // resource type. + Count int64 `json:"count,omitempty,string"` + + // ResourceType: The FHIR resource type this metric applies to. + ResourceType string `json:"resourceType,omitempty"` + + // StructuredStorageSizeBytes: The total amount of structured storage + // used by FHIR resources of this resource type in the store. + StructuredStorageSizeBytes int64 `json:"structuredStorageSizeBytes,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "Count") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Count") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *FhirStoreMetric) MarshalJSON() ([]byte, error) { + type NoMethod FhirStoreMetric + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// FhirStoreMetrics: List of metrics for a given FHIR store. +type FhirStoreMetrics struct { + // Metrics: List of FhirStoreMetric by resource type. + Metrics []*FhirStoreMetric `json:"metrics,omitempty"` + + // Name: The resource name of the FHIR store to get metrics for, in the + // format + // `projects/{project_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id + // }`. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Metrics") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Metrics") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *FhirStoreMetrics) MarshalJSON() ([]byte, error) { + type NoMethod FhirStoreMetrics + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // Field: A (sub) field of a type. type Field struct { // MaxOccurs: The maximum number of times this field can be repeated. 0 @@ -23439,6 +23514,152 @@ func (c *ProjectsLocationsDatasetsFhirStoresGetCall) Do(opts ...googleapi.CallOp } +// method id "healthcare.projects.locations.datasets.fhirStores.getFHIRStoreMetrics": + +type ProjectsLocationsDatasetsFhirStoresGetFHIRStoreMetricsCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// GetFHIRStoreMetrics: Gets metrics associated with the FHIR store. +// +// - name: The resource name of the FHIR store to get metrics for. +func (r *ProjectsLocationsDatasetsFhirStoresService) GetFHIRStoreMetrics(name string) *ProjectsLocationsDatasetsFhirStoresGetFHIRStoreMetricsCall { + c := &ProjectsLocationsDatasetsFhirStoresGetFHIRStoreMetricsCall{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 information. +func (c *ProjectsLocationsDatasetsFhirStoresGetFHIRStoreMetricsCall) Fields(s ...googleapi.Field) *ProjectsLocationsDatasetsFhirStoresGetFHIRStoreMetricsCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsDatasetsFhirStoresGetFHIRStoreMetricsCall) IfNoneMatch(entityTag string) *ProjectsLocationsDatasetsFhirStoresGetFHIRStoreMetricsCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsDatasetsFhirStoresGetFHIRStoreMetricsCall) Context(ctx context.Context) *ProjectsLocationsDatasetsFhirStoresGetFHIRStoreMetricsCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsDatasetsFhirStoresGetFHIRStoreMetricsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsDatasetsFhirStoresGetFHIRStoreMetricsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + 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, "v1beta1/{+name}:getFHIRStoreMetrics") + 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) +} + +// Do executes the "healthcare.projects.locations.datasets.fhirStores.getFHIRStoreMetrics" call. +// Exactly one of *FhirStoreMetrics or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FhirStoreMetrics.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 *ProjectsLocationsDatasetsFhirStoresGetFHIRStoreMetricsCall) Do(opts ...googleapi.CallOption) (*FhirStoreMetrics, 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 := &FhirStoreMetrics{ + 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 + // { + // "description": "Gets metrics associated with the FHIR store.", + // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/datasets/{datasetsId}/fhirStores/{fhirStoresId}:getFHIRStoreMetrics", + // "httpMethod": "GET", + // "id": "healthcare.projects.locations.datasets.fhirStores.getFHIRStoreMetrics", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The resource name of the FHIR store to get metrics for.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/datasets/[^/]+/fhirStores/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta1/{+name}:getFHIRStoreMetrics", + // "response": { + // "$ref": "FhirStoreMetrics" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + // method id "healthcare.projects.locations.datasets.fhirStores.getIamPolicy": type ProjectsLocationsDatasetsFhirStoresGetIamPolicyCall struct { diff --git a/identitytoolkit/v1/identitytoolkit-api.json b/identitytoolkit/v1/identitytoolkit-api.json index b924df3da4d..4a337c18141 100644 --- a/identitytoolkit/v1/identitytoolkit-api.json +++ b/identitytoolkit/v1/identitytoolkit-api.json @@ -1237,7 +1237,7 @@ } } }, - "revision": "20230211", + "revision": "20230220", "rootUrl": "https://identitytoolkit.googleapis.com/", "schemas": { "GoogleCloudIdentitytoolkitV1Argon2Parameters": { @@ -2373,6 +2373,10 @@ "description": "The phone number to send the verification code to in E.164 format.", "type": "string" }, + "playIntegrityToken": { + "description": "Android only. Used to assert application identity in place of a recaptcha token (and safety_net_token). At least one of (`ios_receipt` and `ios_secret`), `recaptcha_token`, , or `play_integrity_token` must be specified to verify the verification code is being sent on behalf of a real app and not an emulator. A Play Integrity Token can be generated via the [PlayIntegrity API](https://developer.android.com/google/play/integrity) with applying SHA256 to the `phone_number` field as the nonce.", + "type": "string" + }, "recaptchaToken": { "description": "Recaptcha token for app verification. At least one of (`ios_receipt` and `ios_secret`), `recaptcha_token`, or `safety_net_token` must be specified to verify the verification code is being sent on behalf of a real app and not an emulator. The recaptcha should be generated by calling getRecaptchaParams and the recaptcha token will be generated on user completion of the recaptcha challenge.", "type": "string" diff --git a/identitytoolkit/v1/identitytoolkit-gen.go b/identitytoolkit/v1/identitytoolkit-gen.go index af038740628..a03b1a8c9f9 100644 --- a/identitytoolkit/v1/identitytoolkit-gen.go +++ b/identitytoolkit/v1/identitytoolkit-gen.go @@ -1976,6 +1976,16 @@ type GoogleCloudIdentitytoolkitV1SendVerificationCodeRequest struct { // E.164 format. PhoneNumber string `json:"phoneNumber,omitempty"` + // PlayIntegrityToken: Android only. Used to assert application identity + // in place of a recaptcha token (and safety_net_token). At least one of + // (`ios_receipt` and `ios_secret`), `recaptcha_token`, , or + // `play_integrity_token` must be specified to verify the verification + // code is being sent on behalf of a real app and not an emulator. A + // Play Integrity Token can be generated via the PlayIntegrity API + // (https://developer.android.com/google/play/integrity) with applying + // SHA256 to the `phone_number` field as the nonce. + PlayIntegrityToken string `json:"playIntegrityToken,omitempty"` + // RecaptchaToken: Recaptcha token for app verification. At least one of // (`ios_receipt` and `ios_secret`), `recaptcha_token`, or // `safety_net_token` must be specified to verify the verification code diff --git a/identitytoolkit/v2/identitytoolkit-api.json b/identitytoolkit/v2/identitytoolkit-api.json index 01267bd2204..96f82a2e86f 100644 --- a/identitytoolkit/v2/identitytoolkit-api.json +++ b/identitytoolkit/v2/identitytoolkit-api.json @@ -1559,7 +1559,7 @@ } } }, - "revision": "20230128", + "revision": "20230220", "rootUrl": "https://identitytoolkit.googleapis.com/", "schemas": { "GoogleCloudIdentitytoolkitAdminV2AllowByDefault": { @@ -2893,6 +2893,10 @@ "description": "Required for enrollment. Phone number to be enrolled as MFA.", "type": "string" }, + "playIntegrityToken": { + "description": "Android only. Used to assert application identity in place of a recaptcha token (or safety net token). A Play Integrity Token can be generated via the [PlayIntegrity API] (https://developer.android.com/google/play/integrity) with applying SHA256 to the `phone_number` field as the nonce.", + "type": "string" + }, "recaptchaToken": { "description": "Web only. Recaptcha solution.", "type": "string" diff --git a/identitytoolkit/v2/identitytoolkit-gen.go b/identitytoolkit/v2/identitytoolkit-gen.go index faeba054588..cdae8fe2eed 100644 --- a/identitytoolkit/v2/identitytoolkit-gen.go +++ b/identitytoolkit/v2/identitytoolkit-gen.go @@ -2644,6 +2644,13 @@ type GoogleCloudIdentitytoolkitV2StartMfaPhoneRequestInfo struct { // MFA. PhoneNumber string `json:"phoneNumber,omitempty"` + // PlayIntegrityToken: Android only. Used to assert application identity + // in place of a recaptcha token (or safety net token). A Play Integrity + // Token can be generated via the [PlayIntegrity API] + // (https://developer.android.com/google/play/integrity) with applying + // SHA256 to the `phone_number` field as the nonce. + PlayIntegrityToken string `json:"playIntegrityToken,omitempty"` + // RecaptchaToken: Web only. Recaptcha solution. RecaptchaToken string `json:"recaptchaToken,omitempty"` diff --git a/logging/v2/logging-api.json b/logging/v2/logging-api.json index cc55413b10f..4663b121852 100644 --- a/logging/v2/logging-api.json +++ b/logging/v2/logging-api.json @@ -678,6 +678,137 @@ } }, "resources": { + "links": { + "methods": { + "create": { + "description": "Asynchronously creates linked dataset in BigQuery which makes it possible to use BugQuery to read the logs stored in the bucket. A bucket may currently only contain one link.", + "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/links", + "httpMethod": "POST", + "id": "logging.billingAccounts.locations.buckets.links.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "linkId": { + "description": "Required. The ID to use for the link. The link_id can have up to 100 characters. A valid link_id must only have alphanumeric characters and underscores within it.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The full resource name of the bucket to create a link for. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", + "location": "path", + "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+parent}/links", + "request": { + "$ref": "Link" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + }, + "delete": { + "description": "Deletes a link. This will also delete the corresponding BigQuery linked dataset.", + "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/links/{linksId}", + "httpMethod": "DELETE", + "id": "logging.billingAccounts.locations.buckets.links.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The full resource name of the link to delete.\"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\"", + "location": "path", + "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+/links/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + }, + "get": { + "description": "Gets a link.", + "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/links/{linksId}", + "httpMethod": "GET", + "id": "logging.billingAccounts.locations.buckets.links.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the link:\"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID", + "location": "path", + "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+/links/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "Link" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ] + }, + "list": { + "description": "Lists links.", + "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/links", + "httpMethod": "GET", + "id": "logging.billingAccounts.locations.buckets.links.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of results to return from this request.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The parent resource whose links are to be listed:\"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/\" \"organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/\" \"billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/\" \"folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/", + "location": "path", + "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+parent}/links", + "response": { + "$ref": "ListLinksResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ] + } + } + }, "views": { "methods": { "create": { @@ -2134,6 +2265,137 @@ } }, "resources": { + "links": { + "methods": { + "create": { + "description": "Asynchronously creates linked dataset in BigQuery which makes it possible to use BugQuery to read the logs stored in the bucket. A bucket may currently only contain one link.", + "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/links", + "httpMethod": "POST", + "id": "logging.folders.locations.buckets.links.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "linkId": { + "description": "Required. The ID to use for the link. The link_id can have up to 100 characters. A valid link_id must only have alphanumeric characters and underscores within it.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The full resource name of the bucket to create a link for. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", + "location": "path", + "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+parent}/links", + "request": { + "$ref": "Link" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + }, + "delete": { + "description": "Deletes a link. This will also delete the corresponding BigQuery linked dataset.", + "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/links/{linksId}", + "httpMethod": "DELETE", + "id": "logging.folders.locations.buckets.links.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The full resource name of the link to delete.\"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\"", + "location": "path", + "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+/links/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + }, + "get": { + "description": "Gets a link.", + "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/links/{linksId}", + "httpMethod": "GET", + "id": "logging.folders.locations.buckets.links.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the link:\"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID", + "location": "path", + "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+/links/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "Link" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ] + }, + "list": { + "description": "Lists links.", + "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/links", + "httpMethod": "GET", + "id": "logging.folders.locations.buckets.links.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of results to return from this request.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The parent resource whose links are to be listed:\"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/\" \"organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/\" \"billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/\" \"folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/", + "location": "path", + "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+parent}/links", + "response": { + "$ref": "ListLinksResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ] + } + } + }, "views": { "methods": { "create": { @@ -3088,6 +3350,137 @@ } }, "resources": { + "links": { + "methods": { + "create": { + "description": "Asynchronously creates linked dataset in BigQuery which makes it possible to use BugQuery to read the logs stored in the bucket. A bucket may currently only contain one link.", + "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/links", + "httpMethod": "POST", + "id": "logging.locations.buckets.links.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "linkId": { + "description": "Required. The ID to use for the link. The link_id can have up to 100 characters. A valid link_id must only have alphanumeric characters and underscores within it.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The full resource name of the bucket to create a link for. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", + "location": "path", + "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+parent}/links", + "request": { + "$ref": "Link" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + }, + "delete": { + "description": "Deletes a link. This will also delete the corresponding BigQuery linked dataset.", + "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/links/{linksId}", + "httpMethod": "DELETE", + "id": "logging.locations.buckets.links.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The full resource name of the link to delete.\"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\"", + "location": "path", + "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+/links/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + }, + "get": { + "description": "Gets a link.", + "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/links/{linksId}", + "httpMethod": "GET", + "id": "logging.locations.buckets.links.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the link:\"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID", + "location": "path", + "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+/links/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "Link" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ] + }, + "list": { + "description": "Lists links.", + "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/links", + "httpMethod": "GET", + "id": "logging.locations.buckets.links.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of results to return from this request.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The parent resource whose links are to be listed:\"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/\" \"organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/\" \"billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/\" \"folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/", + "location": "path", + "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+parent}/links", + "response": { + "$ref": "ListLinksResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ] + } + } + }, "views": { "methods": { "create": { @@ -4088,21 +4481,152 @@ "location": "query", "type": "string" } - }, - "path": "v2/{+name}:updateAsync", - "request": { - "$ref": "LogBucket" - }, - "response": { - "$ref": "Operation" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/logging.admin" - ] - } - }, - "resources": { + }, + "path": "v2/{+name}:updateAsync", + "request": { + "$ref": "LogBucket" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + } + }, + "resources": { + "links": { + "methods": { + "create": { + "description": "Asynchronously creates linked dataset in BigQuery which makes it possible to use BugQuery to read the logs stored in the bucket. A bucket may currently only contain one link.", + "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/links", + "httpMethod": "POST", + "id": "logging.organizations.locations.buckets.links.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "linkId": { + "description": "Required. The ID to use for the link. The link_id can have up to 100 characters. A valid link_id must only have alphanumeric characters and underscores within it.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The full resource name of the bucket to create a link for. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", + "location": "path", + "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+parent}/links", + "request": { + "$ref": "Link" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + }, + "delete": { + "description": "Deletes a link. This will also delete the corresponding BigQuery linked dataset.", + "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/links/{linksId}", + "httpMethod": "DELETE", + "id": "logging.organizations.locations.buckets.links.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The full resource name of the link to delete.\"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\"", + "location": "path", + "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+/links/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + }, + "get": { + "description": "Gets a link.", + "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/links/{linksId}", + "httpMethod": "GET", + "id": "logging.organizations.locations.buckets.links.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the link:\"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID", + "location": "path", + "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+/links/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "Link" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ] + }, + "list": { + "description": "Lists links.", + "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/links", + "httpMethod": "GET", + "id": "logging.organizations.locations.buckets.links.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of results to return from this request.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The parent resource whose links are to be listed:\"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/\" \"organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/\" \"billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/\" \"folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/", + "location": "path", + "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+parent}/links", + "response": { + "$ref": "ListLinksResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ] + } + } + }, "views": { "methods": { "create": { @@ -5278,6 +5802,137 @@ } }, "resources": { + "links": { + "methods": { + "create": { + "description": "Asynchronously creates linked dataset in BigQuery which makes it possible to use BugQuery to read the logs stored in the bucket. A bucket may currently only contain one link.", + "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/links", + "httpMethod": "POST", + "id": "logging.projects.locations.buckets.links.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "linkId": { + "description": "Required. The ID to use for the link. The link_id can have up to 100 characters. A valid link_id must only have alphanumeric characters and underscores within it.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The full resource name of the bucket to create a link for. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+parent}/links", + "request": { + "$ref": "Link" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + }, + "delete": { + "description": "Deletes a link. This will also delete the corresponding BigQuery linked dataset.", + "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/links/{linksId}", + "httpMethod": "DELETE", + "id": "logging.projects.locations.buckets.links.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The full resource name of the link to delete.\"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\"", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+/links/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + }, + "get": { + "description": "Gets a link.", + "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/links/{linksId}", + "httpMethod": "GET", + "id": "logging.projects.locations.buckets.links.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the link:\"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+/links/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "Link" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ] + }, + "list": { + "description": "Lists links.", + "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/links", + "httpMethod": "GET", + "id": "logging.projects.locations.buckets.links.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of results to return from this request.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The parent resource whose links are to be listed:\"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/\" \"organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/\" \"billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/\" \"folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+parent}/links", + "response": { + "$ref": "ListLinksResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ] + } + } + }, "views": { "methods": { "create": { @@ -6352,9 +7007,21 @@ } } }, - "revision": "20230211", + "revision": "20230218", "rootUrl": "https://logging.googleapis.com/", "schemas": { + "BigQueryDataset": { + "description": "Describes a BigQuery dataset that was created by a link.", + "id": "BigQueryDataset", + "properties": { + "datasetId": { + "description": "Output only. The full resource name of the BigQuery dataset. The DATASET_ID will match the ID of the link, so the link must match the naming restrictions of BigQuery datasets (alphanumeric characters and underscores only).The dataset will have a resource path of \"bigquery.googleapis.com/projects/PROJECT_ID/datasets/DATASET_ID\"", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, "BigQueryOptions": { "description": "Options that change functionality of a sink exporting data to BigQuery.", "id": "BigQueryOptions", @@ -6574,6 +7241,36 @@ }, "type": "object" }, + "CreateLinkRequest": { + "description": "The parameters to CreateLink.", + "id": "CreateLinkRequest", + "properties": { + "link": { + "$ref": "Link", + "description": "Required. The new link." + }, + "linkId": { + "description": "Required. The ID to use for the link. The link_id can have up to 100 characters. A valid link_id must only have alphanumeric characters and underscores within it.", + "type": "string" + }, + "parent": { + "description": "Required. The full resource name of the bucket to create a link for. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", + "type": "string" + } + }, + "type": "object" + }, + "DeleteLinkRequest": { + "description": "The parameters to DeleteLink.", + "id": "DeleteLinkRequest", + "properties": { + "name": { + "description": "Required. The full resource name of the link to delete.\"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\"", + "type": "string" + } + }, + "type": "object" + }, "Empty": { "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } ", "id": "Empty", @@ -6771,6 +7468,99 @@ }, "type": "object" }, + "Link": { + "description": "Describes a link connected to an analytics enabled bucket.", + "id": "Link", + "properties": { + "bigqueryDataset": { + "$ref": "BigQueryDataset", + "description": "The information of a BigQuery Dataset. When a link is created, a BigQuery dataset is created along with it, in the same project as the LogBucket it's linked to. This dataset will also have BigQuery Views corresponding to the LogViews in the bucket." + }, + "createTime": { + "description": "Output only. The creation timestamp of the link.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "description": { + "description": "Describes this link.The maximum length of the description is 8000 characters.", + "type": "string" + }, + "lifecycleState": { + "description": "Output only. The resource lifecycle state.", + "enum": [ + "LIFECYCLE_STATE_UNSPECIFIED", + "ACTIVE", + "DELETE_REQUESTED", + "UPDATING", + "CREATING", + "FAILED" + ], + "enumDescriptions": [ + "Unspecified state. This is only used/useful for distinguishing unset values.", + "The normal and active state.", + "The resource has been marked for deletion by the user. For some resources (e.g. buckets), this can be reversed by an un-delete operation.", + "The resource has been marked for an update by the user. It will remain in this state until the update is complete.", + "The resource has been marked for creation by the user. It will remain in this state until the creation is complete.", + "The resource is in an INTERNAL error state." + ], + "readOnly": true, + "type": "string" + }, + "name": { + "description": "The resource name of the link. The name can have up to 100 characters. A valid link id (at the end of the link name) must only have alphanumeric characters and underscores within it. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" For example:`projects/my-project/locations/global/buckets/my-bucket/links/my_link", + "type": "string" + } + }, + "type": "object" + }, + "LinkMetadata": { + "description": "Metadata for long running Link operations.", + "id": "LinkMetadata", + "properties": { + "createLinkRequest": { + "$ref": "CreateLinkRequest", + "description": "CreateLink RPC request." + }, + "deleteLinkRequest": { + "$ref": "DeleteLinkRequest", + "description": "DeleteLink RPC request." + }, + "endTime": { + "description": "The end time of an operation.", + "format": "google-datetime", + "type": "string" + }, + "startTime": { + "description": "The start time of an operation.", + "format": "google-datetime", + "type": "string" + }, + "state": { + "description": "State of an operation.", + "enum": [ + "OPERATION_STATE_UNSPECIFIED", + "OPERATION_STATE_SCHEDULED", + "OPERATION_STATE_WAITING_FOR_PERMISSIONS", + "OPERATION_STATE_RUNNING", + "OPERATION_STATE_SUCCEEDED", + "OPERATION_STATE_FAILED", + "OPERATION_STATE_CANCELLED" + ], + "enumDescriptions": [ + "Should not be used.", + "The operation is scheduled.", + "Waiting for necessary permissions.", + "The operation is running.", + "The operation was completed successfully.", + "The operation failed.", + "The operation was cancelled by the user." + ], + "type": "string" + } + }, + "type": "object" + }, "ListBucketsResponse": { "description": "The response from ListBuckets.", "id": "ListBucketsResponse", @@ -6807,6 +7597,24 @@ }, "type": "object" }, + "ListLinksResponse": { + "description": "The response from ListLinks.", + "id": "ListLinksResponse", + "properties": { + "links": { + "description": "A list of links.", + "items": { + "$ref": "Link" + }, + "type": "array" + }, + "nextPageToken": { + "description": "If there might be more results than those appearing in this response, then nextPageToken is included. To get the next set of results, call the same method again using the value of nextPageToken as pageToken.", + "type": "string" + } + }, + "type": "object" + }, "ListLocationsResponse": { "description": "The response message for Locations.ListLocations.", "id": "ListLocationsResponse", @@ -7023,6 +7831,17 @@ }, "type": "object" }, + "LocationMetadata": { + "description": "Cloud Logging specific location metadata.", + "id": "LocationMetadata", + "properties": { + "logAnalyticsEnabled": { + "description": "Indicates whether or not Log Analytics features are supported in the given location.", + "type": "boolean" + } + }, + "type": "object" + }, "LogBucket": { "description": "Describes a repository in which log entries are stored.", "id": "LogBucket", diff --git a/logging/v2/logging-gen.go b/logging/v2/logging-gen.go index 3fe8f4d075a..5e43e93ea56 100644 --- a/logging/v2/logging-gen.go +++ b/logging/v2/logging-gen.go @@ -237,6 +237,7 @@ type BillingAccountsLocationsService struct { func NewBillingAccountsLocationsBucketsService(s *Service) *BillingAccountsLocationsBucketsService { rs := &BillingAccountsLocationsBucketsService{s: s} + rs.Links = NewBillingAccountsLocationsBucketsLinksService(s) rs.Views = NewBillingAccountsLocationsBucketsViewsService(s) return rs } @@ -244,9 +245,20 @@ func NewBillingAccountsLocationsBucketsService(s *Service) *BillingAccountsLocat type BillingAccountsLocationsBucketsService struct { s *Service + Links *BillingAccountsLocationsBucketsLinksService + Views *BillingAccountsLocationsBucketsViewsService } +func NewBillingAccountsLocationsBucketsLinksService(s *Service) *BillingAccountsLocationsBucketsLinksService { + rs := &BillingAccountsLocationsBucketsLinksService{s: s} + return rs +} + +type BillingAccountsLocationsBucketsLinksService struct { + s *Service +} + func NewBillingAccountsLocationsBucketsViewsService(s *Service) *BillingAccountsLocationsBucketsViewsService { rs := &BillingAccountsLocationsBucketsViewsService{s: s} rs.Logs = NewBillingAccountsLocationsBucketsViewsLogsService(s) @@ -360,6 +372,7 @@ type FoldersLocationsService struct { func NewFoldersLocationsBucketsService(s *Service) *FoldersLocationsBucketsService { rs := &FoldersLocationsBucketsService{s: s} + rs.Links = NewFoldersLocationsBucketsLinksService(s) rs.Views = NewFoldersLocationsBucketsViewsService(s) return rs } @@ -367,9 +380,20 @@ func NewFoldersLocationsBucketsService(s *Service) *FoldersLocationsBucketsServi type FoldersLocationsBucketsService struct { s *Service + Links *FoldersLocationsBucketsLinksService + Views *FoldersLocationsBucketsViewsService } +func NewFoldersLocationsBucketsLinksService(s *Service) *FoldersLocationsBucketsLinksService { + rs := &FoldersLocationsBucketsLinksService{s: s} + return rs +} + +type FoldersLocationsBucketsLinksService struct { + s *Service +} + func NewFoldersLocationsBucketsViewsService(s *Service) *FoldersLocationsBucketsViewsService { rs := &FoldersLocationsBucketsViewsService{s: s} rs.Logs = NewFoldersLocationsBucketsViewsLogsService(s) @@ -435,6 +459,7 @@ type LocationsService struct { func NewLocationsBucketsService(s *Service) *LocationsBucketsService { rs := &LocationsBucketsService{s: s} + rs.Links = NewLocationsBucketsLinksService(s) rs.Views = NewLocationsBucketsViewsService(s) return rs } @@ -442,9 +467,20 @@ func NewLocationsBucketsService(s *Service) *LocationsBucketsService { type LocationsBucketsService struct { s *Service + Links *LocationsBucketsLinksService + Views *LocationsBucketsViewsService } +func NewLocationsBucketsLinksService(s *Service) *LocationsBucketsLinksService { + rs := &LocationsBucketsLinksService{s: s} + return rs +} + +type LocationsBucketsLinksService struct { + s *Service +} + func NewLocationsBucketsViewsService(s *Service) *LocationsBucketsViewsService { rs := &LocationsBucketsViewsService{s: s} return rs @@ -528,6 +564,7 @@ type OrganizationsLocationsService struct { func NewOrganizationsLocationsBucketsService(s *Service) *OrganizationsLocationsBucketsService { rs := &OrganizationsLocationsBucketsService{s: s} + rs.Links = NewOrganizationsLocationsBucketsLinksService(s) rs.Views = NewOrganizationsLocationsBucketsViewsService(s) return rs } @@ -535,9 +572,20 @@ func NewOrganizationsLocationsBucketsService(s *Service) *OrganizationsLocations type OrganizationsLocationsBucketsService struct { s *Service + Links *OrganizationsLocationsBucketsLinksService + Views *OrganizationsLocationsBucketsViewsService } +func NewOrganizationsLocationsBucketsLinksService(s *Service) *OrganizationsLocationsBucketsLinksService { + rs := &OrganizationsLocationsBucketsLinksService{s: s} + return rs +} + +type OrganizationsLocationsBucketsLinksService struct { + s *Service +} + func NewOrganizationsLocationsBucketsViewsService(s *Service) *OrganizationsLocationsBucketsViewsService { rs := &OrganizationsLocationsBucketsViewsService{s: s} rs.Logs = NewOrganizationsLocationsBucketsViewsLogsService(s) @@ -636,6 +684,7 @@ type ProjectsLocationsService struct { func NewProjectsLocationsBucketsService(s *Service) *ProjectsLocationsBucketsService { rs := &ProjectsLocationsBucketsService{s: s} + rs.Links = NewProjectsLocationsBucketsLinksService(s) rs.Views = NewProjectsLocationsBucketsViewsService(s) return rs } @@ -643,9 +692,20 @@ func NewProjectsLocationsBucketsService(s *Service) *ProjectsLocationsBucketsSer type ProjectsLocationsBucketsService struct { s *Service + Links *ProjectsLocationsBucketsLinksService + Views *ProjectsLocationsBucketsViewsService } +func NewProjectsLocationsBucketsLinksService(s *Service) *ProjectsLocationsBucketsLinksService { + rs := &ProjectsLocationsBucketsLinksService{s: s} + return rs +} + +type ProjectsLocationsBucketsLinksService struct { + s *Service +} + func NewProjectsLocationsBucketsViewsService(s *Service) *ProjectsLocationsBucketsViewsService { rs := &ProjectsLocationsBucketsViewsService{s: s} rs.Logs = NewProjectsLocationsBucketsViewsLogsService(s) @@ -721,6 +781,40 @@ type V2Service struct { s *Service } +// BigQueryDataset: Describes a BigQuery dataset that was created by a +// link. +type BigQueryDataset struct { + // DatasetId: Output only. The full resource name of the BigQuery + // dataset. The DATASET_ID will match the ID of the link, so the link + // must match the naming restrictions of BigQuery datasets (alphanumeric + // characters and underscores only).The dataset will have a resource + // path of + // "bigquery.googleapis.com/projects/PROJECT_ID/datasets/DATASET_ID" + DatasetId string `json:"datasetId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DatasetId") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "DatasetId") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *BigQueryDataset) MarshalJSON() ([]byte, error) { + type NoMethod BigQueryDataset + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // BigQueryOptions: Options that change functionality of a sink // exporting data to BigQuery. type BigQueryOptions struct { @@ -1131,6 +1225,85 @@ func (s *CreateBucketRequest) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// CreateLinkRequest: The parameters to CreateLink. +type CreateLinkRequest struct { + // Link: Required. The new link. + Link *Link `json:"link,omitempty"` + + // LinkId: Required. The ID to use for the link. The link_id can have up + // to 100 characters. A valid link_id must only have alphanumeric + // characters and underscores within it. + LinkId string `json:"linkId,omitempty"` + + // Parent: Required. The full resource name of the bucket to create a + // link for. + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCK + // ET_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/ + // [BUCKET_ID]" + // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + Parent string `json:"parent,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Link") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Link") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *CreateLinkRequest) MarshalJSON() ([]byte, error) { + type NoMethod CreateLinkRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// DeleteLinkRequest: The parameters to DeleteLink. +type DeleteLinkRequest struct { + // Name: Required. The full resource name of the link to + // delete."projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/li + // nks/LINK_ID" + // "organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID + // /links/LINK_ID" + // "billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCK + // ET_ID/links/LINK_ID" + // "folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ + // ID" + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Name") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *DeleteLinkRequest) MarshalJSON() ([]byte, error) { + type NoMethod DeleteLinkRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // Empty: A generic empty message that you can re-use to avoid defining // duplicated empty messages in your APIs. A typical example is to use // it as the request or the response type of an API method. For @@ -1465,6 +1638,133 @@ func (s *Linear) UnmarshalJSON(data []byte) error { return nil } +// Link: Describes a link connected to an analytics enabled bucket. +type Link struct { + // BigqueryDataset: The information of a BigQuery Dataset. When a link + // is created, a BigQuery dataset is created along with it, in the same + // project as the LogBucket it's linked to. This dataset will also have + // BigQuery Views corresponding to the LogViews in the bucket. + BigqueryDataset *BigQueryDataset `json:"bigqueryDataset,omitempty"` + + // CreateTime: Output only. The creation timestamp of the link. + CreateTime string `json:"createTime,omitempty"` + + // Description: Describes this link.The maximum length of the + // description is 8000 characters. + Description string `json:"description,omitempty"` + + // LifecycleState: Output only. The resource lifecycle state. + // + // Possible values: + // "LIFECYCLE_STATE_UNSPECIFIED" - Unspecified state. This is only + // used/useful for distinguishing unset values. + // "ACTIVE" - The normal and active state. + // "DELETE_REQUESTED" - The resource has been marked for deletion by + // the user. For some resources (e.g. buckets), this can be reversed by + // an un-delete operation. + // "UPDATING" - The resource has been marked for an update by the + // user. It will remain in this state until the update is complete. + // "CREATING" - The resource has been marked for creation by the user. + // It will remain in this state until the creation is complete. + // "FAILED" - The resource is in an INTERNAL error state. + LifecycleState string `json:"lifecycleState,omitempty"` + + // Name: The resource name of the link. The name can have up to 100 + // characters. A valid link id (at the end of the link name) must only + // have alphanumeric characters and underscores within it. + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/lin + // ks/[LINK_ID]" + // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCK + // ET_ID]/links/[LINK_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/ + // [BUCKET_ID]/links/[LINK_ID]" + // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links + // /[LINK_ID]" For + // example:`projects/my-project/locations/global/buckets/my-bucket/links/ + // my_link + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "BigqueryDataset") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "BigqueryDataset") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *Link) MarshalJSON() ([]byte, error) { + type NoMethod Link + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// LinkMetadata: Metadata for long running Link operations. +type LinkMetadata struct { + // CreateLinkRequest: CreateLink RPC request. + CreateLinkRequest *CreateLinkRequest `json:"createLinkRequest,omitempty"` + + // DeleteLinkRequest: DeleteLink RPC request. + DeleteLinkRequest *DeleteLinkRequest `json:"deleteLinkRequest,omitempty"` + + // EndTime: The end time of an operation. + EndTime string `json:"endTime,omitempty"` + + // StartTime: The start time of an operation. + StartTime string `json:"startTime,omitempty"` + + // State: State of an operation. + // + // Possible values: + // "OPERATION_STATE_UNSPECIFIED" - Should not be used. + // "OPERATION_STATE_SCHEDULED" - The operation is scheduled. + // "OPERATION_STATE_WAITING_FOR_PERMISSIONS" - Waiting for necessary + // permissions. + // "OPERATION_STATE_RUNNING" - The operation is running. + // "OPERATION_STATE_SUCCEEDED" - The operation was completed + // successfully. + // "OPERATION_STATE_FAILED" - The operation failed. + // "OPERATION_STATE_CANCELLED" - The operation was cancelled by the + // user. + State string `json:"state,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreateLinkRequest") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CreateLinkRequest") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *LinkMetadata) MarshalJSON() ([]byte, error) { + type NoMethod LinkMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // ListBucketsResponse: The response from ListBuckets. type ListBucketsResponse struct { // Buckets: A list of buckets. @@ -1541,6 +1841,44 @@ func (s *ListExclusionsResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// ListLinksResponse: The response from ListLinks. +type ListLinksResponse struct { + // Links: A list of links. + Links []*Link `json:"links,omitempty"` + + // NextPageToken: If there might be more results than those appearing in + // this response, then nextPageToken is included. To get the next set of + // results, call the same method again using the value of nextPageToken + // as pageToken. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Links") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Links") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ListLinksResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListLinksResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // ListLocationsResponse: The response message for // Locations.ListLocations. type ListLocationsResponse struct { @@ -1980,6 +2318,36 @@ func (s *Location) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// LocationMetadata: Cloud Logging specific location metadata. +type LocationMetadata struct { + // LogAnalyticsEnabled: Indicates whether or not Log Analytics features + // are supported in the given location. + LogAnalyticsEnabled bool `json:"logAnalyticsEnabled,omitempty"` + + // ForceSendFields is a list of field names (e.g. "LogAnalyticsEnabled") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "LogAnalyticsEnabled") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *LocationMetadata) MarshalJSON() ([]byte, error) { + type NoMethod LocationMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // LogBucket: Describes a repository in which log entries are stored. type LogBucket struct { // AnalyticsEnabled: Whether log analytics is enabled for this @@ -6813,44 +7181,48 @@ func (c *BillingAccountsLocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.Ca } -// method id "logging.billingAccounts.locations.buckets.views.create": +// method id "logging.billingAccounts.locations.buckets.links.create": -type BillingAccountsLocationsBucketsViewsCreateCall struct { +type BillingAccountsLocationsBucketsLinksCreateCall struct { s *Service parent string - logview *LogView + link *Link urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Create: Creates a view over log entries in a log bucket. A bucket may -// contain a maximum of 30 views. +// Create: Asynchronously creates linked dataset in BigQuery which makes +// it possible to use BugQuery to read the logs stored in the bucket. A +// bucket may currently only contain one link. // -// - parent: The bucket in which to create the view +// - parent: The full resource name of the bucket to create a link for. // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// ` For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *BillingAccountsLocationsBucketsViewsService) Create(parent string, logview *LogView) *BillingAccountsLocationsBucketsViewsCreateCall { - c := &BillingAccountsLocationsBucketsViewsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.logview = logview +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]". +func (r *BillingAccountsLocationsBucketsLinksService) Create(parent string, link *Link) *BillingAccountsLocationsBucketsLinksCreateCall { + c := &BillingAccountsLocationsBucketsLinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.link = link return c } -// ViewId sets the optional parameter "viewId": Required. A -// client-assigned identifier such as "my-view". Identifiers are limited -// to 100 characters and can include only letters, digits, underscores, -// hyphens, and periods. -func (c *BillingAccountsLocationsBucketsViewsCreateCall) ViewId(viewId string) *BillingAccountsLocationsBucketsViewsCreateCall { - c.urlParams_.Set("viewId", viewId) +// LinkId sets the optional parameter "linkId": Required. The ID to use +// for the link. The link_id can have up to 100 characters. A valid +// link_id must only have alphanumeric characters and underscores within +// it. +func (c *BillingAccountsLocationsBucketsLinksCreateCall) LinkId(linkId string) *BillingAccountsLocationsBucketsLinksCreateCall { + c.urlParams_.Set("linkId", linkId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *BillingAccountsLocationsBucketsViewsCreateCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsViewsCreateCall { +func (c *BillingAccountsLocationsBucketsLinksCreateCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsLinksCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -6858,21 +7230,21 @@ func (c *BillingAccountsLocationsBucketsViewsCreateCall) Fields(s ...googleapi.F // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *BillingAccountsLocationsBucketsViewsCreateCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsViewsCreateCall { +func (c *BillingAccountsLocationsBucketsLinksCreateCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsLinksCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *BillingAccountsLocationsBucketsViewsCreateCall) Header() http.Header { +func (c *BillingAccountsLocationsBucketsLinksCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *BillingAccountsLocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *BillingAccountsLocationsBucketsLinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -6880,14 +7252,14 @@ func (c *BillingAccountsLocationsBucketsViewsCreateCall) doRequest(alt string) ( } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.link) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/links") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -6900,14 +7272,14 @@ func (c *BillingAccountsLocationsBucketsViewsCreateCall) doRequest(alt string) ( return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.billingAccounts.locations.buckets.views.create" call. -// Exactly one of *LogView or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *LogView.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 *BillingAccountsLocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption) (*LogView, error) { +// Do executes the "logging.billingAccounts.locations.buckets.links.create" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.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 *BillingAccountsLocationsBucketsLinksCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -6926,7 +7298,7 @@ func (c *BillingAccountsLocationsBucketsViewsCreateCall) Do(opts ...googleapi.Ca if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogView{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -6938,33 +7310,33 @@ func (c *BillingAccountsLocationsBucketsViewsCreateCall) Do(opts ...googleapi.Ca } return ret, nil // { - // "description": "Creates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.", - // "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/views", + // "description": "Asynchronously creates linked dataset in BigQuery which makes it possible to use BugQuery to read the logs stored in the bucket. A bucket may currently only contain one link.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/links", // "httpMethod": "POST", - // "id": "logging.billingAccounts.locations.buckets.views.create", + // "id": "logging.billingAccounts.locations.buckets.links.create", // "parameterOrder": [ // "parent" // ], // "parameters": { + // "linkId": { + // "description": "Required. The ID to use for the link. The link_id can have up to 100 characters. A valid link_id must only have alphanumeric characters and underscores within it.", + // "location": "query", + // "type": "string" + // }, // "parent": { - // "description": "Required. The bucket in which to create the view `\"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\"` For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "description": "Required. The full resource name of the bucket to create a link for. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", // "location": "path", // "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" - // }, - // "viewId": { - // "description": "Required. A client-assigned identifier such as \"my-view\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+parent}/views", + // "path": "v2/{+parent}/links", // "request": { - // "$ref": "LogView" + // "$ref": "Link" // }, // "response": { - // "$ref": "LogView" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -6974,9 +7346,9 @@ func (c *BillingAccountsLocationsBucketsViewsCreateCall) Do(opts ...googleapi.Ca } -// method id "logging.billingAccounts.locations.buckets.views.delete": +// method id "logging.billingAccounts.locations.buckets.links.delete": -type BillingAccountsLocationsBucketsViewsDeleteCall struct { +type BillingAccountsLocationsBucketsLinksDeleteCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -6984,17 +7356,20 @@ type BillingAccountsLocationsBucketsViewsDeleteCall struct { header_ http.Header } -// Delete: Deletes a view on a log bucket. If an UNAVAILABLE error is -// returned, this indicates that system is not in a state where it can -// delete the view. If this occurs, please try again in a few minutes. +// Delete: Deletes a link. This will also delete the corresponding +// BigQuery linked dataset. // -// - name: The full resource name of the view to delete: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v -// iews/[VIEW_ID]" For -// example:"projects/my-project/locations/global/buckets/my-bucket/view -// s/my-view". -func (r *BillingAccountsLocationsBucketsViewsService) Delete(name string) *BillingAccountsLocationsBucketsViewsDeleteCall { - c := &BillingAccountsLocationsBucketsViewsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The full resource name of the link to +// delete."projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/ +// links/LINK_ID" +// "organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ +// ID/links/LINK_ID" +// "billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BU +// CKET_ID/links/LINK_ID" +// "folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LIN +// K_ID". +func (r *BillingAccountsLocationsBucketsLinksService) Delete(name string) *BillingAccountsLocationsBucketsLinksDeleteCall { + c := &BillingAccountsLocationsBucketsLinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -7002,7 +7377,7 @@ func (r *BillingAccountsLocationsBucketsViewsService) Delete(name string) *Billi // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *BillingAccountsLocationsBucketsViewsDeleteCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsViewsDeleteCall { +func (c *BillingAccountsLocationsBucketsLinksDeleteCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsLinksDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -7010,21 +7385,21 @@ func (c *BillingAccountsLocationsBucketsViewsDeleteCall) Fields(s ...googleapi.F // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *BillingAccountsLocationsBucketsViewsDeleteCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsViewsDeleteCall { +func (c *BillingAccountsLocationsBucketsLinksDeleteCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsLinksDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *BillingAccountsLocationsBucketsViewsDeleteCall) Header() http.Header { +func (c *BillingAccountsLocationsBucketsLinksDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *BillingAccountsLocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *BillingAccountsLocationsBucketsLinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -7047,14 +7422,14 @@ func (c *BillingAccountsLocationsBucketsViewsDeleteCall) doRequest(alt string) ( return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.billingAccounts.locations.buckets.views.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.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 *BillingAccountsLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "logging.billingAccounts.locations.buckets.links.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.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 *BillingAccountsLocationsBucketsLinksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7073,7 +7448,7 @@ func (c *BillingAccountsLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.Ca if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7085,25 +7460,25 @@ func (c *BillingAccountsLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.Ca } return ret, nil // { - // "description": "Deletes a view on a log bucket. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.", - // "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", + // "description": "Deletes a link. This will also delete the corresponding BigQuery linked dataset.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/links/{linksId}", // "httpMethod": "DELETE", - // "id": "logging.billingAccounts.locations.buckets.views.delete", + // "id": "logging.billingAccounts.locations.buckets.links.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The full resource name of the view to delete: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", + // "description": "Required. The full resource name of the link to delete.\"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\"", // "location": "path", - // "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", + // "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+/links/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v2/{+name}", // "response": { - // "$ref": "Empty" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -7113,9 +7488,9 @@ func (c *BillingAccountsLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.Ca } -// method id "logging.billingAccounts.locations.buckets.views.get": +// method id "logging.billingAccounts.locations.buckets.links.get": -type BillingAccountsLocationsBucketsViewsGetCall struct { +type BillingAccountsLocationsBucketsLinksGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -7124,15 +7499,19 @@ type BillingAccountsLocationsBucketsViewsGetCall struct { header_ http.Header } -// Get: Gets a view on a log bucket.. +// Get: Gets a link. // -// - name: The resource name of the policy: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v -// iews/[VIEW_ID]" For -// example:"projects/my-project/locations/global/buckets/my-bucket/view -// s/my-view". -func (r *BillingAccountsLocationsBucketsViewsService) Get(name string) *BillingAccountsLocationsBucketsViewsGetCall { - c := &BillingAccountsLocationsBucketsViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of the +// link:"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/li +// nks/LINK_ID" +// "organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ +// ID/links/LINK_ID" +// "billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BU +// CKET_ID/links/LINK_ID" +// "folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LIN +// K_ID. +func (r *BillingAccountsLocationsBucketsLinksService) Get(name string) *BillingAccountsLocationsBucketsLinksGetCall { + c := &BillingAccountsLocationsBucketsLinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -7140,7 +7519,7 @@ func (r *BillingAccountsLocationsBucketsViewsService) Get(name string) *BillingA // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *BillingAccountsLocationsBucketsViewsGetCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsViewsGetCall { +func (c *BillingAccountsLocationsBucketsLinksGetCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsLinksGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -7150,7 +7529,7 @@ func (c *BillingAccountsLocationsBucketsViewsGetCall) Fields(s ...googleapi.Fiel // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *BillingAccountsLocationsBucketsViewsGetCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsBucketsViewsGetCall { +func (c *BillingAccountsLocationsBucketsLinksGetCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsBucketsLinksGetCall { c.ifNoneMatch_ = entityTag return c } @@ -7158,21 +7537,21 @@ func (c *BillingAccountsLocationsBucketsViewsGetCall) IfNoneMatch(entityTag stri // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *BillingAccountsLocationsBucketsViewsGetCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsViewsGetCall { +func (c *BillingAccountsLocationsBucketsLinksGetCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsLinksGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *BillingAccountsLocationsBucketsViewsGetCall) Header() http.Header { +func (c *BillingAccountsLocationsBucketsLinksGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *BillingAccountsLocationsBucketsViewsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *BillingAccountsLocationsBucketsLinksGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -7198,14 +7577,14 @@ func (c *BillingAccountsLocationsBucketsViewsGetCall) doRequest(alt string) (*ht return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.billingAccounts.locations.buckets.views.get" call. -// Exactly one of *LogView or error will be non-nil. Any non-2xx status +// Do executes the "logging.billingAccounts.locations.buckets.links.get" call. +// Exactly one of *Link or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *LogView.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 *BillingAccountsLocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogView, error) { +// *Link.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 *BillingAccountsLocationsBucketsLinksGetCall) Do(opts ...googleapi.CallOption) (*Link, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7224,7 +7603,7 @@ func (c *BillingAccountsLocationsBucketsViewsGetCall) Do(opts ...googleapi.CallO if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogView{ + ret := &Link{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7236,25 +7615,25 @@ func (c *BillingAccountsLocationsBucketsViewsGetCall) Do(opts ...googleapi.CallO } return ret, nil // { - // "description": "Gets a view on a log bucket..", - // "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", + // "description": "Gets a link.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/links/{linksId}", // "httpMethod": "GET", - // "id": "logging.billingAccounts.locations.buckets.views.get", + // "id": "logging.billingAccounts.locations.buckets.links.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource name of the policy: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", + // "description": "Required. The resource name of the link:\"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID", // "location": "path", - // "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", + // "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+/links/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v2/{+name}", // "response": { - // "$ref": "LogView" + // "$ref": "Link" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -7266,9 +7645,9 @@ func (c *BillingAccountsLocationsBucketsViewsGetCall) Do(opts ...googleapi.CallO } -// method id "logging.billingAccounts.locations.buckets.views.list": +// method id "logging.billingAccounts.locations.buckets.links.list": -type BillingAccountsLocationsBucketsViewsListCall struct { +type BillingAccountsLocationsBucketsLinksListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -7277,21 +7656,25 @@ type BillingAccountsLocationsBucketsViewsListCall struct { header_ http.Header } -// List: Lists views on a log bucket. +// List: Lists links. // -// - parent: The bucket whose views are to be listed: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]". -func (r *BillingAccountsLocationsBucketsViewsService) List(parent string) *BillingAccountsLocationsBucketsViewsListCall { - c := &BillingAccountsLocationsBucketsViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The parent resource whose links are to be +// listed:"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/ +// links/" +// "organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ +// ID/" +// "billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BU +// CKET_ID/" +// "folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/. +func (r *BillingAccountsLocationsBucketsLinksService) List(parent string) *BillingAccountsLocationsBucketsLinksListCall { + c := &BillingAccountsLocationsBucketsLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } // PageSize sets the optional parameter "pageSize": The maximum number -// of results to return from this request.Non-positive values are -// ignored. The presence of nextPageToken in the response indicates that -// more results might be available. -func (c *BillingAccountsLocationsBucketsViewsListCall) PageSize(pageSize int64) *BillingAccountsLocationsBucketsViewsListCall { +// of results to return from this request. +func (c *BillingAccountsLocationsBucketsLinksListCall) PageSize(pageSize int64) *BillingAccountsLocationsBucketsLinksListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } @@ -7299,9 +7682,8 @@ func (c *BillingAccountsLocationsBucketsViewsListCall) PageSize(pageSize int64) // PageToken sets the optional parameter "pageToken": If present, then // retrieve the next batch of results from the preceding call to this // method. pageToken must be the value of nextPageToken from the -// previous response. The values of other method parameters should be -// identical to those in the previous call. -func (c *BillingAccountsLocationsBucketsViewsListCall) PageToken(pageToken string) *BillingAccountsLocationsBucketsViewsListCall { +// previous response. +func (c *BillingAccountsLocationsBucketsLinksListCall) PageToken(pageToken string) *BillingAccountsLocationsBucketsLinksListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -7309,7 +7691,7 @@ func (c *BillingAccountsLocationsBucketsViewsListCall) PageToken(pageToken strin // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *BillingAccountsLocationsBucketsViewsListCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsViewsListCall { +func (c *BillingAccountsLocationsBucketsLinksListCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsLinksListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -7319,7 +7701,7 @@ func (c *BillingAccountsLocationsBucketsViewsListCall) Fields(s ...googleapi.Fie // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *BillingAccountsLocationsBucketsViewsListCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsBucketsViewsListCall { +func (c *BillingAccountsLocationsBucketsLinksListCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsBucketsLinksListCall { c.ifNoneMatch_ = entityTag return c } @@ -7327,21 +7709,21 @@ func (c *BillingAccountsLocationsBucketsViewsListCall) IfNoneMatch(entityTag str // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *BillingAccountsLocationsBucketsViewsListCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsViewsListCall { +func (c *BillingAccountsLocationsBucketsLinksListCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsLinksListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *BillingAccountsLocationsBucketsViewsListCall) Header() http.Header { +func (c *BillingAccountsLocationsBucketsLinksListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *BillingAccountsLocationsBucketsViewsListCall) doRequest(alt string) (*http.Response, error) { +func (c *BillingAccountsLocationsBucketsLinksListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -7354,7 +7736,7 @@ func (c *BillingAccountsLocationsBucketsViewsListCall) doRequest(alt string) (*h var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/links") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -7367,14 +7749,14 @@ func (c *BillingAccountsLocationsBucketsViewsListCall) doRequest(alt string) (*h return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.billingAccounts.locations.buckets.views.list" call. -// Exactly one of *ListViewsResponse or error will be non-nil. Any +// Do executes the "logging.billingAccounts.locations.buckets.links.list" call. +// Exactly one of *ListLinksResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either -// *ListViewsResponse.ServerResponse.Header or (if a response was +// *ListLinksResponse.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 *BillingAccountsLocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) (*ListViewsResponse, error) { +func (c *BillingAccountsLocationsBucketsLinksListCall) Do(opts ...googleapi.CallOption) (*ListLinksResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7393,7 +7775,7 @@ func (c *BillingAccountsLocationsBucketsViewsListCall) Do(opts ...googleapi.Call if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListViewsResponse{ + ret := &ListLinksResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7405,36 +7787,36 @@ func (c *BillingAccountsLocationsBucketsViewsListCall) Do(opts ...googleapi.Call } return ret, nil // { - // "description": "Lists views on a log bucket.", - // "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/views", + // "description": "Lists links.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/links", // "httpMethod": "GET", - // "id": "logging.billingAccounts.locations.buckets.views.list", + // "id": "logging.billingAccounts.locations.buckets.links.list", // "parameterOrder": [ // "parent" // ], // "parameters": { // "pageSize": { - // "description": "Optional. The maximum number of results to return from this request.Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "description": "Optional. The maximum number of results to return from this request.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. The bucket whose views are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", + // "description": "Required. The parent resource whose links are to be listed:\"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/\" \"organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/\" \"billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/\" \"folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/", // "location": "path", // "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/views", + // "path": "v2/{+parent}/links", // "response": { - // "$ref": "ListViewsResponse" + // "$ref": "ListLinksResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -7449,7 +7831,7 @@ func (c *BillingAccountsLocationsBucketsViewsListCall) Do(opts ...googleapi.Call // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *BillingAccountsLocationsBucketsViewsListCall) Pages(ctx context.Context, f func(*ListViewsResponse) error) error { +func (c *BillingAccountsLocationsBucketsLinksListCall) Pages(ctx context.Context, f func(*ListLinksResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -7467,51 +7849,44 @@ func (c *BillingAccountsLocationsBucketsViewsListCall) Pages(ctx context.Context } } -// method id "logging.billingAccounts.locations.buckets.views.patch": +// method id "logging.billingAccounts.locations.buckets.views.create": -type BillingAccountsLocationsBucketsViewsPatchCall struct { +type BillingAccountsLocationsBucketsViewsCreateCall struct { s *Service - name string + parent string logview *LogView urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Patch: Updates a view on a log bucket. This method replaces the -// following fields in the existing view with values from the new view: -// filter. If an UNAVAILABLE error is returned, this indicates that -// system is not in a state where it can update the view. If this -// occurs, please try again in a few minutes. +// Create: Creates a view over log entries in a log bucket. A bucket may +// contain a maximum of 30 views. // -// - name: The full resource name of the view to update -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v -// iews/[VIEW_ID]" For -// example:"projects/my-project/locations/global/buckets/my-bucket/view -// s/my-view". -func (r *BillingAccountsLocationsBucketsViewsService) Patch(name string, logview *LogView) *BillingAccountsLocationsBucketsViewsPatchCall { - c := &BillingAccountsLocationsBucketsViewsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: The bucket in which to create the view +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// ` For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *BillingAccountsLocationsBucketsViewsService) Create(parent string, logview *LogView) *BillingAccountsLocationsBucketsViewsCreateCall { + c := &BillingAccountsLocationsBucketsViewsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent c.logview = logview return c } -// UpdateMask sets the optional parameter "updateMask": Field mask that -// specifies the fields in view that need an update. A field will be -// overwritten if, and only if, it is in the update mask. name and -// output only fields cannot be updated.For a detailed FieldMask -// definition, see -// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor -// example: updateMask=filter -func (c *BillingAccountsLocationsBucketsViewsPatchCall) UpdateMask(updateMask string) *BillingAccountsLocationsBucketsViewsPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// ViewId sets the optional parameter "viewId": Required. A +// client-assigned identifier such as "my-view". Identifiers are limited +// to 100 characters and can include only letters, digits, underscores, +// hyphens, and periods. +func (c *BillingAccountsLocationsBucketsViewsCreateCall) ViewId(viewId string) *BillingAccountsLocationsBucketsViewsCreateCall { + c.urlParams_.Set("viewId", viewId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *BillingAccountsLocationsBucketsViewsPatchCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsViewsPatchCall { +func (c *BillingAccountsLocationsBucketsViewsCreateCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsViewsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -7519,21 +7894,21 @@ func (c *BillingAccountsLocationsBucketsViewsPatchCall) Fields(s ...googleapi.Fi // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *BillingAccountsLocationsBucketsViewsPatchCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsViewsPatchCall { +func (c *BillingAccountsLocationsBucketsViewsCreateCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsViewsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *BillingAccountsLocationsBucketsViewsPatchCall) Header() http.Header { +func (c *BillingAccountsLocationsBucketsViewsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *BillingAccountsLocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *BillingAccountsLocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -7548,27 +7923,27 @@ func (c *BillingAccountsLocationsBucketsViewsPatchCall) doRequest(alt string) (* reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.billingAccounts.locations.buckets.views.patch" call. +// Do executes the "logging.billingAccounts.locations.buckets.views.create" call. // Exactly one of *LogView or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *LogView.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 *BillingAccountsLocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) (*LogView, error) { +func (c *BillingAccountsLocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption) (*LogView, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7599,29 +7974,28 @@ func (c *BillingAccountsLocationsBucketsViewsPatchCall) Do(opts ...googleapi.Cal } return ret, nil // { - // "description": "Updates a view on a log bucket. This method replaces the following fields in the existing view with values from the new view: filter. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can update the view. If this occurs, please try again in a few minutes.", - // "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", - // "httpMethod": "PATCH", - // "id": "logging.billingAccounts.locations.buckets.views.patch", + // "description": "Creates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/views", + // "httpMethod": "POST", + // "id": "logging.billingAccounts.locations.buckets.views.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The full resource name of the view to update \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", + // "parent": { + // "description": "Required. The bucket in which to create the view `\"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\"` For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", - // "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", + // "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" // }, - // "updateMask": { - // "description": "Optional. Field mask that specifies the fields in view that need an update. A field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", - // "format": "google-fieldmask", + // "viewId": { + // "description": "Required. A client-assigned identifier such as \"my-view\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", // "location": "query", // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+parent}/views", // "request": { // "$ref": "LogView" // }, @@ -7636,134 +8010,87 @@ func (c *BillingAccountsLocationsBucketsViewsPatchCall) Do(opts ...googleapi.Cal } -// method id "logging.billingAccounts.locations.buckets.views.logs.list": +// method id "logging.billingAccounts.locations.buckets.views.delete": -type BillingAccountsLocationsBucketsViewsLogsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type BillingAccountsLocationsBucketsViewsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists the logs in projects, organizations, folders, or billing -// accounts. Only logs that have entries are listed. +// Delete: Deletes a view on a log bucket. If an UNAVAILABLE error is +// returned, this indicates that system is not in a state where it can +// delete the view. If this occurs, please try again in a few minutes. // -// - parent: The resource name that owns the logs: projects/[PROJECT_ID] -// organizations/[ORGANIZATION_ID] -// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]. -func (r *BillingAccountsLocationsBucketsViewsLogsService) List(parent string) *BillingAccountsLocationsBucketsViewsLogsListCall { - c := &BillingAccountsLocationsBucketsViewsLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return from this request. Non-positive values are -// ignored. The presence of nextPageToken in the response indicates that -// more results might be available. -func (c *BillingAccountsLocationsBucketsViewsLogsListCall) PageSize(pageSize int64) *BillingAccountsLocationsBucketsViewsLogsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": If present, then -// retrieve the next batch of results from the preceding call to this -// method. pageToken must be the value of nextPageToken from the -// previous response. The values of other method parameters should be -// identical to those in the previous call. -func (c *BillingAccountsLocationsBucketsViewsLogsListCall) PageToken(pageToken string) *BillingAccountsLocationsBucketsViewsLogsListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// ResourceNames sets the optional parameter "resourceNames": The -// resource name that owns the logs: -// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/view -// s/[VIEW_ID] -// organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKE -// T_ID]/views/[VIEW_ID] -// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[ -// BUCKET_ID]/views/[VIEW_ID] -// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/ -// [VIEW_ID]To support legacy queries, it could also be: -// projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] -// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID] -func (c *BillingAccountsLocationsBucketsViewsLogsListCall) ResourceNames(resourceNames ...string) *BillingAccountsLocationsBucketsViewsLogsListCall { - c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...)) +// - name: The full resource name of the view to delete: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v +// iews/[VIEW_ID]" For +// example:"projects/my-project/locations/global/buckets/my-bucket/view +// s/my-view". +func (r *BillingAccountsLocationsBucketsViewsService) Delete(name string) *BillingAccountsLocationsBucketsViewsDeleteCall { + c := &BillingAccountsLocationsBucketsViewsDeleteCall{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 information. -func (c *BillingAccountsLocationsBucketsViewsLogsListCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsViewsLogsListCall { +func (c *BillingAccountsLocationsBucketsViewsDeleteCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsViewsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *BillingAccountsLocationsBucketsViewsLogsListCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsBucketsViewsLogsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *BillingAccountsLocationsBucketsViewsLogsListCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsViewsLogsListCall { +func (c *BillingAccountsLocationsBucketsViewsDeleteCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsViewsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *BillingAccountsLocationsBucketsViewsLogsListCall) Header() http.Header { +func (c *BillingAccountsLocationsBucketsViewsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *BillingAccountsLocationsBucketsViewsLogsListCall) doRequest(alt string) (*http.Response, error) { +func (c *BillingAccountsLocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - 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, "v2/{+parent}/logs") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.billingAccounts.locations.buckets.views.logs.list" call. -// Exactly one of *ListLogsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListLogsResponse.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 *BillingAccountsLocationsBucketsViewsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) { +// Do executes the "logging.billingAccounts.locations.buckets.views.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.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 *BillingAccountsLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7782,7 +8109,7 @@ func (c *BillingAccountsLocationsBucketsViewsLogsListCall) Do(opts ...googleapi. if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListLogsResponse{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7794,147 +8121,109 @@ func (c *BillingAccountsLocationsBucketsViewsLogsListCall) Do(opts ...googleapi. } return ret, nil // { - // "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", - // "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}/logs", - // "httpMethod": "GET", - // "id": "logging.billingAccounts.locations.buckets.views.logs.list", + // "description": "Deletes a view on a log bucket. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", + // "httpMethod": "DELETE", + // "id": "logging.billingAccounts.locations.buckets.views.delete", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "pageSize": { - // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The resource name that owns the logs: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", + // "name": { + // "description": "Required. The full resource name of the view to delete: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", // "location": "path", // "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", // "required": true, // "type": "string" - // }, - // "resourceNames": { - // "description": "Optional. The resource name that owns the logs: projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]To support legacy queries, it could also be: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", - // "location": "query", - // "repeated": true, - // "type": "string" // } // }, - // "path": "v2/{+parent}/logs", + // "path": "v2/{+name}", // "response": { - // "$ref": "ListLogsResponse" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *BillingAccountsLocationsBucketsViewsLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "logging.billingAccounts.locations.operations.cancel": +// method id "logging.billingAccounts.locations.buckets.views.get": -type BillingAccountsLocationsOperationsCancelCall struct { - s *Service - name string - canceloperationrequest *CancelOperationRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type BillingAccountsLocationsBucketsViewsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Cancel: Starts asynchronous cancellation on a long-running operation. -// The server makes a best effort to cancel the operation, but success -// is not guaranteed. If the server doesn't support this method, it -// returns google.rpc.Code.UNIMPLEMENTED. Clients can use -// Operations.GetOperation or other methods to check whether the -// cancellation succeeded or whether the operation completed despite -// cancellation. On successful cancellation, the operation is not -// deleted; instead, it becomes an operation with an Operation.error -// value with a google.rpc.Status.code of 1, corresponding to -// Code.CANCELLED. +// Get: Gets a view on a log bucket.. // -// - name: The name of the operation resource to be cancelled. -func (r *BillingAccountsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *BillingAccountsLocationsOperationsCancelCall { - c := &BillingAccountsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of the policy: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v +// iews/[VIEW_ID]" For +// example:"projects/my-project/locations/global/buckets/my-bucket/view +// s/my-view". +func (r *BillingAccountsLocationsBucketsViewsService) Get(name string) *BillingAccountsLocationsBucketsViewsGetCall { + c := &BillingAccountsLocationsBucketsViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.canceloperationrequest = canceloperationrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *BillingAccountsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsOperationsCancelCall { +func (c *BillingAccountsLocationsBucketsViewsGetCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsViewsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BillingAccountsLocationsBucketsViewsGetCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsBucketsViewsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *BillingAccountsLocationsOperationsCancelCall) Context(ctx context.Context) *BillingAccountsLocationsOperationsCancelCall { +func (c *BillingAccountsLocationsBucketsViewsGetCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsViewsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *BillingAccountsLocationsOperationsCancelCall) Header() http.Header { +func (c *BillingAccountsLocationsBucketsViewsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *BillingAccountsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { +func (c *BillingAccountsLocationsBucketsViewsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:cancel") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -7945,14 +8234,14 @@ func (c *BillingAccountsLocationsOperationsCancelCall) doRequest(alt string) (*h return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.billingAccounts.locations.operations.cancel" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// Do executes the "logging.billingAccounts.locations.buckets.views.get" call. +// Exactly one of *LogView or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) +// *LogView.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 *BillingAccountsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +func (c *BillingAccountsLocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogView, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7971,7 +8260,7 @@ func (c *BillingAccountsLocationsOperationsCancelCall) Do(opts ...googleapi.Call if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &LogView{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7983,63 +8272,80 @@ func (c *BillingAccountsLocationsOperationsCancelCall) Do(opts ...googleapi.Call } return ret, nil // { - // "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.", - // "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/operations/{operationsId}:cancel", - // "httpMethod": "POST", - // "id": "logging.billingAccounts.locations.operations.cancel", + // "description": "Gets a view on a log bucket..", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", + // "httpMethod": "GET", + // "id": "logging.billingAccounts.locations.buckets.views.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "The name of the operation resource to be cancelled.", + // "description": "Required. The resource name of the policy: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", // "location": "path", - // "pattern": "^billingAccounts/[^/]+/locations/[^/]+/operations/[^/]+$", + // "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}:cancel", - // "request": { - // "$ref": "CancelOperationRequest" - // }, + // "path": "v2/{+name}", // "response": { - // "$ref": "Empty" + // "$ref": "LogView" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.billingAccounts.locations.operations.get": +// method id "logging.billingAccounts.locations.buckets.views.list": -type BillingAccountsLocationsOperationsGetCall struct { +type BillingAccountsLocationsBucketsViewsListCall struct { s *Service - name string + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Gets the latest state of a long-running operation. Clients can -// use this method to poll the operation result at intervals as -// recommended by the API service. +// List: Lists views on a log bucket. // -// - name: The name of the operation resource. -func (r *BillingAccountsLocationsOperationsService) Get(name string) *BillingAccountsLocationsOperationsGetCall { - c := &BillingAccountsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: The bucket whose views are to be listed: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]". +func (r *BillingAccountsLocationsBucketsViewsService) List(parent string) *BillingAccountsLocationsBucketsViewsListCall { + c := &BillingAccountsLocationsBucketsViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request.Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *BillingAccountsLocationsBucketsViewsListCall) PageSize(pageSize int64) *BillingAccountsLocationsBucketsViewsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *BillingAccountsLocationsBucketsViewsListCall) PageToken(pageToken string) *BillingAccountsLocationsBucketsViewsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *BillingAccountsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsOperationsGetCall { +func (c *BillingAccountsLocationsBucketsViewsListCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsViewsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -8049,7 +8355,7 @@ func (c *BillingAccountsLocationsOperationsGetCall) Fields(s ...googleapi.Field) // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *BillingAccountsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsOperationsGetCall { +func (c *BillingAccountsLocationsBucketsViewsListCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsBucketsViewsListCall { c.ifNoneMatch_ = entityTag return c } @@ -8057,21 +8363,21 @@ func (c *BillingAccountsLocationsOperationsGetCall) IfNoneMatch(entityTag string // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *BillingAccountsLocationsOperationsGetCall) Context(ctx context.Context) *BillingAccountsLocationsOperationsGetCall { +func (c *BillingAccountsLocationsBucketsViewsListCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsViewsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *BillingAccountsLocationsOperationsGetCall) Header() http.Header { +func (c *BillingAccountsLocationsBucketsViewsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *BillingAccountsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *BillingAccountsLocationsBucketsViewsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -8084,7 +8390,7 @@ func (c *BillingAccountsLocationsOperationsGetCall) doRequest(alt string) (*http var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -8092,19 +8398,19 @@ func (c *BillingAccountsLocationsOperationsGetCall) doRequest(alt string) (*http } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.billingAccounts.locations.operations.get" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Operation.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 *BillingAccountsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// Do executes the "logging.billingAccounts.locations.buckets.views.list" call. +// Exactly one of *ListViewsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListViewsResponse.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 *BillingAccountsLocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) (*ListViewsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8123,7 +8429,7 @@ func (c *BillingAccountsLocationsOperationsGetCall) Do(opts ...googleapi.CallOpt if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &ListViewsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8135,25 +8441,36 @@ func (c *BillingAccountsLocationsOperationsGetCall) Do(opts ...googleapi.CallOpt } return ret, nil // { - // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", - // "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/operations/{operationsId}", + // "description": "Lists views on a log bucket.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/views", // "httpMethod": "GET", - // "id": "logging.billingAccounts.locations.operations.get", + // "id": "logging.billingAccounts.locations.buckets.views.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "The name of the operation resource.", + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request.Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The bucket whose views are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", // "location": "path", - // "pattern": "^billingAccounts/[^/]+/locations/[^/]+/operations/[^/]+$", + // "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+parent}/views", // "response": { - // "$ref": "Operation" + // "$ref": "ListViewsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -8165,107 +8482,111 @@ func (c *BillingAccountsLocationsOperationsGetCall) Do(opts ...googleapi.CallOpt } -// method id "logging.billingAccounts.locations.operations.list": - -type BillingAccountsLocationsOperationsListCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *BillingAccountsLocationsBucketsViewsListCall) Pages(ctx context.Context, f func(*ListViewsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } } -// List: Lists operations that match the specified filter in the -// request. If the server doesn't support this method, it returns -// UNIMPLEMENTED.NOTE: the name binding allows API services to override -// the binding to use different resource name schemes, such as -// users/*/operations. To override the binding, API services can add a -// binding such as "/v1/{name=users/*}/operations" to their service -// configuration. For backwards compatibility, the default name includes -// the operations collection id, however overriding users must ensure -// the name binding is the parent resource, without the operations -// collection id. -// -// - name: The name of the operation's parent resource. -func (r *BillingAccountsLocationsOperationsService) List(name string) *BillingAccountsLocationsOperationsListCall { - c := &BillingAccountsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - return c -} +// method id "logging.billingAccounts.locations.buckets.views.patch": -// Filter sets the optional parameter "filter": The standard list -// filter. -func (c *BillingAccountsLocationsOperationsListCall) Filter(filter string) *BillingAccountsLocationsOperationsListCall { - c.urlParams_.Set("filter", filter) - return c +type BillingAccountsLocationsBucketsViewsPatchCall struct { + s *Service + name string + logview *LogView + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// PageSize sets the optional parameter "pageSize": The standard list -// page size. -func (c *BillingAccountsLocationsOperationsListCall) PageSize(pageSize int64) *BillingAccountsLocationsOperationsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) +// Patch: Updates a view on a log bucket. This method replaces the +// following fields in the existing view with values from the new view: +// filter. If an UNAVAILABLE error is returned, this indicates that +// system is not in a state where it can update the view. If this +// occurs, please try again in a few minutes. +// +// - name: The full resource name of the view to update +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v +// iews/[VIEW_ID]" For +// example:"projects/my-project/locations/global/buckets/my-bucket/view +// s/my-view". +func (r *BillingAccountsLocationsBucketsViewsService) Patch(name string, logview *LogView) *BillingAccountsLocationsBucketsViewsPatchCall { + c := &BillingAccountsLocationsBucketsViewsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.logview = logview return c } -// PageToken sets the optional parameter "pageToken": The standard list -// page token. -func (c *BillingAccountsLocationsOperationsListCall) PageToken(pageToken string) *BillingAccountsLocationsOperationsListCall { - c.urlParams_.Set("pageToken", pageToken) +// UpdateMask sets the optional parameter "updateMask": Field mask that +// specifies the fields in view that need an update. A field will be +// overwritten if, and only if, it is in the update mask. name and +// output only fields cannot be updated.For a detailed FieldMask +// definition, see +// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor +// example: updateMask=filter +func (c *BillingAccountsLocationsBucketsViewsPatchCall) UpdateMask(updateMask string) *BillingAccountsLocationsBucketsViewsPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *BillingAccountsLocationsOperationsListCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsOperationsListCall { +func (c *BillingAccountsLocationsBucketsViewsPatchCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsViewsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *BillingAccountsLocationsOperationsListCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsOperationsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *BillingAccountsLocationsOperationsListCall) Context(ctx context.Context) *BillingAccountsLocationsOperationsListCall { +func (c *BillingAccountsLocationsBucketsViewsPatchCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsViewsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *BillingAccountsLocationsOperationsListCall) Header() http.Header { +func (c *BillingAccountsLocationsBucketsViewsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *BillingAccountsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *BillingAccountsLocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -8276,14 +8597,14 @@ func (c *BillingAccountsLocationsOperationsListCall) doRequest(alt string) (*htt return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.billingAccounts.locations.operations.list" call. -// Exactly one of *ListOperationsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListOperationsResponse.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 *BillingAccountsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { +// Do executes the "logging.billingAccounts.locations.buckets.views.patch" call. +// Exactly one of *LogView or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogView.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 *BillingAccountsLocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) (*LogView, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8302,7 +8623,7 @@ func (c *BillingAccountsLocationsOperationsListCall) Do(opts ...googleapi.CallOp if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListOperationsResponse{ + ret := &LogView{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8314,208 +8635,34 @@ func (c *BillingAccountsLocationsOperationsListCall) Do(opts ...googleapi.CallOp } return ret, nil // { - // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as \"/v1/{name=users/*}/operations\" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.", - // "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/operations", - // "httpMethod": "GET", - // "id": "logging.billingAccounts.locations.operations.list", + // "description": "Updates a view on a log bucket. This method replaces the following fields in the existing view with values from the new view: filter. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can update the view. If this occurs, please try again in a few minutes.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", + // "httpMethod": "PATCH", + // "id": "logging.billingAccounts.locations.buckets.views.patch", // "parameterOrder": [ // "name" // ], // "parameters": { - // "filter": { - // "description": "The standard list filter.", - // "location": "query", - // "type": "string" - // }, // "name": { - // "description": "The name of the operation's parent resource.", + // "description": "Required. The full resource name of the view to update \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", // "location": "path", - // "pattern": "^billingAccounts/[^/]+/locations/[^/]+$", + // "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", // "required": true, // "type": "string" // }, - // "pageSize": { - // "description": "The standard list page size.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The standard list page token.", + // "updateMask": { + // "description": "Optional. Field mask that specifies the fields in view that need an update. A field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", + // "format": "google-fieldmask", // "location": "query", // "type": "string" // } // }, - // "path": "v2/{+name}/operations", - // "response": { - // "$ref": "ListOperationsResponse" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" - // ] - // } - -} - -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *BillingAccountsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "logging.billingAccounts.logs.delete": - -type BillingAccountsLogsDeleteCall struct { - s *Service - logName string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Delete: Deletes all the log entries in a log for the _Default Log -// Bucket. The log reappears if it receives new entries. Log entries -// written shortly before the delete operation might not be deleted. -// Entries received after the delete operation with a timestamp before -// the operation will be deleted. -// -// - logName: The resource name of the log to delete: -// projects/[PROJECT_ID]/logs/[LOG_ID] -// organizations/[ORGANIZATION_ID]/logs/[LOG_ID] -// billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID] -// folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For -// example, "projects/my-project-id/logs/syslog", -// "organizations/123/logs/cloudaudit.googleapis.com%2Factivity".For -// more information about log names, see LogEntry. -func (r *BillingAccountsLogsService) Delete(logName string) *BillingAccountsLogsDeleteCall { - c := &BillingAccountsLogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.logName = logName - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *BillingAccountsLogsDeleteCall) Fields(s ...googleapi.Field) *BillingAccountsLogsDeleteCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *BillingAccountsLogsDeleteCall) Context(ctx context.Context) *BillingAccountsLogsDeleteCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *BillingAccountsLogsDeleteCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *BillingAccountsLogsDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+logName}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "logName": c.logName, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "logging.billingAccounts.logs.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.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 *BillingAccountsLogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, 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 := &Empty{ - 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 - // { - // "description": "Deletes all the log entries in a log for the _Default Log Bucket. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted.", - // "flatPath": "v2/billingAccounts/{billingAccountsId}/logs/{logsId}", - // "httpMethod": "DELETE", - // "id": "logging.billingAccounts.logs.delete", - // "parameterOrder": [ - // "logName" - // ], - // "parameters": { - // "logName": { - // "description": "Required. The resource name of the log to delete: projects/[PROJECT_ID]/logs/[LOG_ID] organizations/[ORGANIZATION_ID]/logs/[LOG_ID] billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID] folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/123/logs/cloudaudit.googleapis.com%2Factivity\".For more information about log names, see LogEntry.", - // "location": "path", - // "pattern": "^billingAccounts/[^/]+/logs/[^/]+$", - // "required": true, - // "type": "string" - // } + // "path": "v2/{+name}", + // "request": { + // "$ref": "LogView" // }, - // "path": "v2/{+logName}", // "response": { - // "$ref": "Empty" + // "$ref": "LogView" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -8525,9 +8672,9 @@ func (c *BillingAccountsLogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty } -// method id "logging.billingAccounts.logs.list": +// method id "logging.billingAccounts.locations.buckets.views.logs.list": -type BillingAccountsLogsListCall struct { +type BillingAccountsLocationsBucketsViewsLogsListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -8542,8 +8689,8 @@ type BillingAccountsLogsListCall struct { // - parent: The resource name that owns the logs: projects/[PROJECT_ID] // organizations/[ORGANIZATION_ID] // billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]. -func (r *BillingAccountsLogsService) List(parent string) *BillingAccountsLogsListCall { - c := &BillingAccountsLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *BillingAccountsLocationsBucketsViewsLogsService) List(parent string) *BillingAccountsLocationsBucketsViewsLogsListCall { + c := &BillingAccountsLocationsBucketsViewsLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } @@ -8552,7 +8699,7 @@ func (r *BillingAccountsLogsService) List(parent string) *BillingAccountsLogsLis // of results to return from this request. Non-positive values are // ignored. The presence of nextPageToken in the response indicates that // more results might be available. -func (c *BillingAccountsLogsListCall) PageSize(pageSize int64) *BillingAccountsLogsListCall { +func (c *BillingAccountsLocationsBucketsViewsLogsListCall) PageSize(pageSize int64) *BillingAccountsLocationsBucketsViewsLogsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } @@ -8562,7 +8709,7 @@ func (c *BillingAccountsLogsListCall) PageSize(pageSize int64) *BillingAccountsL // method. pageToken must be the value of nextPageToken from the // previous response. The values of other method parameters should be // identical to those in the previous call. -func (c *BillingAccountsLogsListCall) PageToken(pageToken string) *BillingAccountsLogsListCall { +func (c *BillingAccountsLocationsBucketsViewsLogsListCall) PageToken(pageToken string) *BillingAccountsLocationsBucketsViewsLogsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -8579,7 +8726,7 @@ func (c *BillingAccountsLogsListCall) PageToken(pageToken string) *BillingAccoun // [VIEW_ID]To support legacy queries, it could also be: // projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] // billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID] -func (c *BillingAccountsLogsListCall) ResourceNames(resourceNames ...string) *BillingAccountsLogsListCall { +func (c *BillingAccountsLocationsBucketsViewsLogsListCall) ResourceNames(resourceNames ...string) *BillingAccountsLocationsBucketsViewsLogsListCall { c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...)) return c } @@ -8587,7 +8734,7 @@ func (c *BillingAccountsLogsListCall) ResourceNames(resourceNames ...string) *Bi // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *BillingAccountsLogsListCall) Fields(s ...googleapi.Field) *BillingAccountsLogsListCall { +func (c *BillingAccountsLocationsBucketsViewsLogsListCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsViewsLogsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -8597,7 +8744,7 @@ func (c *BillingAccountsLogsListCall) Fields(s ...googleapi.Field) *BillingAccou // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *BillingAccountsLogsListCall) IfNoneMatch(entityTag string) *BillingAccountsLogsListCall { +func (c *BillingAccountsLocationsBucketsViewsLogsListCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsBucketsViewsLogsListCall { c.ifNoneMatch_ = entityTag return c } @@ -8605,21 +8752,21 @@ func (c *BillingAccountsLogsListCall) IfNoneMatch(entityTag string) *BillingAcco // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *BillingAccountsLogsListCall) Context(ctx context.Context) *BillingAccountsLogsListCall { +func (c *BillingAccountsLocationsBucketsViewsLogsListCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsViewsLogsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *BillingAccountsLogsListCall) Header() http.Header { +func (c *BillingAccountsLocationsBucketsViewsLogsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *BillingAccountsLogsListCall) doRequest(alt string) (*http.Response, error) { +func (c *BillingAccountsLocationsBucketsViewsLogsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -8645,14 +8792,14 @@ func (c *BillingAccountsLogsListCall) doRequest(alt string) (*http.Response, err return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.billingAccounts.logs.list" call. +// Do executes the "logging.billingAccounts.locations.buckets.views.logs.list" call. // Exactly one of *ListLogsResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either // *ListLogsResponse.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 *BillingAccountsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) { +func (c *BillingAccountsLocationsBucketsViewsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8684,9 +8831,9 @@ func (c *BillingAccountsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLog return ret, nil // { // "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", - // "flatPath": "v2/billingAccounts/{billingAccountsId}/logs", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}/logs", // "httpMethod": "GET", - // "id": "logging.billingAccounts.logs.list", + // "id": "logging.billingAccounts.locations.buckets.views.logs.list", // "parameterOrder": [ // "parent" // ], @@ -8705,7 +8852,7 @@ func (c *BillingAccountsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLog // "parent": { // "description": "Required. The resource name that owns the logs: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", // "location": "path", - // "pattern": "^billingAccounts/[^/]+$", + // "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", // "required": true, // "type": "string" // }, @@ -8733,7 +8880,7 @@ func (c *BillingAccountsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLog // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *BillingAccountsLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error { +func (c *BillingAccountsLocationsBucketsViewsLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -8751,55 +8898,40 @@ func (c *BillingAccountsLogsListCall) Pages(ctx context.Context, f func(*ListLog } } -// method id "logging.billingAccounts.sinks.create": +// method id "logging.billingAccounts.locations.operations.cancel": -type BillingAccountsSinksCreateCall struct { - s *Service - parent string - logsink *LogSink - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type BillingAccountsLocationsOperationsCancelCall struct { + s *Service + name string + canceloperationrequest *CancelOperationRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates a sink that exports specified log entries to a -// destination. The export of newly-ingested log entries begins -// immediately, unless the sink's writer_identity is not permitted to -// write to the destination. A sink can export log entries only from the -// resource owning the sink. +// Cancel: Starts asynchronous cancellation on a long-running operation. +// The server makes a best effort to cancel the operation, but success +// is not guaranteed. If the server doesn't support this method, it +// returns google.rpc.Code.UNIMPLEMENTED. Clients can use +// Operations.GetOperation or other methods to check whether the +// cancellation succeeded or whether the operation completed despite +// cancellation. On successful cancellation, the operation is not +// deleted; instead, it becomes an operation with an Operation.error +// value with a google.rpc.Status.code of 1, corresponding to +// Code.CANCELLED. // -// - parent: The resource in which to create the sink: -// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For -// examples:"projects/my-project" "organizations/123456789". -func (r *BillingAccountsSinksService) Create(parent string, logsink *LogSink) *BillingAccountsSinksCreateCall { - c := &BillingAccountsSinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.logsink = logsink - return c -} - -// UniqueWriterIdentity sets the optional parameter -// "uniqueWriterIdentity": Determines the kind of IAM identity returned -// as writer_identity in the new sink. If this value is omitted or set -// to false, and if the sink's parent is a project, then the value -// returned as writer_identity is the same group or service account used -// by Cloud Logging before the addition of writer identities to this -// API. The sink's destination must be in the same project as the sink -// itself.If this field is set to true, or if the sink is owned by a -// non-project resource such as an organization, then the value of -// writer_identity will be a unique service account used only for -// exports from the new sink. For more information, see writer_identity -// in LogSink. -func (c *BillingAccountsSinksCreateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *BillingAccountsSinksCreateCall { - c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity)) +// - name: The name of the operation resource to be cancelled. +func (r *BillingAccountsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *BillingAccountsLocationsOperationsCancelCall { + c := &BillingAccountsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.canceloperationrequest = canceloperationrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *BillingAccountsSinksCreateCall) Fields(s ...googleapi.Field) *BillingAccountsSinksCreateCall { +func (c *BillingAccountsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsOperationsCancelCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -8807,21 +8939,21 @@ func (c *BillingAccountsSinksCreateCall) Fields(s ...googleapi.Field) *BillingAc // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *BillingAccountsSinksCreateCall) Context(ctx context.Context) *BillingAccountsSinksCreateCall { +func (c *BillingAccountsLocationsOperationsCancelCall) Context(ctx context.Context) *BillingAccountsLocationsOperationsCancelCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *BillingAccountsSinksCreateCall) Header() http.Header { +func (c *BillingAccountsLocationsOperationsCancelCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *BillingAccountsSinksCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *BillingAccountsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -8829,14 +8961,14 @@ func (c *BillingAccountsSinksCreateCall) doRequest(alt string) (*http.Response, } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:cancel") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -8844,19 +8976,19 @@ func (c *BillingAccountsSinksCreateCall) doRequest(alt string) (*http.Response, } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.billingAccounts.sinks.create" call. -// Exactly one of *LogSink or error will be non-nil. Any non-2xx status +// Do executes the "logging.billingAccounts.locations.operations.cancel" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *LogSink.ServerResponse.Header or (if a response was returned at all) +// *Empty.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 *BillingAccountsSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { +func (c *BillingAccountsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8875,7 +9007,7 @@ func (c *BillingAccountsSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogS if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogSink{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8887,33 +9019,28 @@ func (c *BillingAccountsSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogS } return ret, nil // { - // "description": "Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.", - // "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks", + // "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/operations/{operationsId}:cancel", // "httpMethod": "POST", - // "id": "logging.billingAccounts.sinks.create", + // "id": "logging.billingAccounts.locations.operations.cancel", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. The resource in which to create the sink: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-project\" \"organizations/123456789\"", + // "name": { + // "description": "The name of the operation resource to be cancelled.", // "location": "path", - // "pattern": "^billingAccounts/[^/]+$", + // "pattern": "^billingAccounts/[^/]+/locations/[^/]+/operations/[^/]+$", // "required": true, // "type": "string" - // }, - // "uniqueWriterIdentity": { - // "description": "Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Cloud Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink.", - // "location": "query", - // "type": "boolean" // } // }, - // "path": "v2/{+parent}/sinks", + // "path": "v2/{+name}:cancel", // "request": { - // "$ref": "LogSink" + // "$ref": "CancelOperationRequest" // }, // "response": { - // "$ref": "LogSink" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -8923,88 +9050,97 @@ func (c *BillingAccountsSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogS } -// method id "logging.billingAccounts.sinks.delete": +// method id "logging.billingAccounts.locations.operations.get": -type BillingAccountsSinksDeleteCall struct { - s *Service - sinkNameid string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type BillingAccountsLocationsOperationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a sink. If the sink has a unique writer_identity, -// then that service account is also deleted. +// Get: Gets the latest state of a long-running operation. Clients can +// use this method to poll the operation result at intervals as +// recommended by the API service. // -// - sinkName: The full resource name of the sink to delete, including -// the parent resource and the sink identifier: -// "projects/[PROJECT_ID]/sinks/[SINK_ID]" -// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" -// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For -// example:"projects/my-project/sinks/my-sink". -func (r *BillingAccountsSinksService) Delete(sinkNameid string) *BillingAccountsSinksDeleteCall { - c := &BillingAccountsSinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.sinkNameid = sinkNameid +// - name: The name of the operation resource. +func (r *BillingAccountsLocationsOperationsService) Get(name string) *BillingAccountsLocationsOperationsGetCall { + c := &BillingAccountsLocationsOperationsGetCall{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 information. -func (c *BillingAccountsSinksDeleteCall) Fields(s ...googleapi.Field) *BillingAccountsSinksDeleteCall { +func (c *BillingAccountsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsOperationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BillingAccountsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsOperationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *BillingAccountsSinksDeleteCall) Context(ctx context.Context) *BillingAccountsSinksDeleteCall { +func (c *BillingAccountsLocationsOperationsGetCall) Context(ctx context.Context) *BillingAccountsLocationsOperationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *BillingAccountsSinksDeleteCall) Header() http.Header { +func (c *BillingAccountsLocationsOperationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *BillingAccountsSinksDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *BillingAccountsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + 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, "v2/{+sinkName}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "sinkName": c.sinkNameid, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.billingAccounts.sinks.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.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 *BillingAccountsSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "logging.billingAccounts.locations.operations.get" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.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 *BillingAccountsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9023,7 +9159,7 @@ func (c *BillingAccountsSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empt if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9035,63 +9171,90 @@ func (c *BillingAccountsSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empt } return ret, nil // { - // "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.", - // "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}", - // "httpMethod": "DELETE", - // "id": "logging.billingAccounts.sinks.delete", + // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/operations/{operationsId}", + // "httpMethod": "GET", + // "id": "logging.billingAccounts.locations.operations.get", // "parameterOrder": [ - // "sinkName" + // "name" // ], // "parameters": { - // "sinkName": { - // "description": "Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", + // "name": { + // "description": "The name of the operation resource.", // "location": "path", - // "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$", + // "pattern": "^billingAccounts/[^/]+/locations/[^/]+/operations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+sinkName}", + // "path": "v2/{+name}", // "response": { - // "$ref": "Empty" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.billingAccounts.sinks.get": +// method id "logging.billingAccounts.locations.operations.list": -type BillingAccountsSinksGetCall struct { +type BillingAccountsLocationsOperationsListCall struct { s *Service - sinkName string + name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Gets a sink. +// List: Lists operations that match the specified filter in the +// request. If the server doesn't support this method, it returns +// UNIMPLEMENTED.NOTE: the name binding allows API services to override +// the binding to use different resource name schemes, such as +// users/*/operations. To override the binding, API services can add a +// binding such as "/v1/{name=users/*}/operations" to their service +// configuration. For backwards compatibility, the default name includes +// the operations collection id, however overriding users must ensure +// the name binding is the parent resource, without the operations +// collection id. // -// - sinkName: The resource name of the sink: -// "projects/[PROJECT_ID]/sinks/[SINK_ID]" -// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" -// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For -// example:"projects/my-project/sinks/my-sink". -func (r *BillingAccountsSinksService) Get(sinkName string) *BillingAccountsSinksGetCall { - c := &BillingAccountsSinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.sinkName = sinkName +// - name: The name of the operation's parent resource. +func (r *BillingAccountsLocationsOperationsService) List(name string) *BillingAccountsLocationsOperationsListCall { + c := &BillingAccountsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Filter sets the optional parameter "filter": The standard list +// filter. +func (c *BillingAccountsLocationsOperationsListCall) Filter(filter string) *BillingAccountsLocationsOperationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The standard list +// page size. +func (c *BillingAccountsLocationsOperationsListCall) PageSize(pageSize int64) *BillingAccountsLocationsOperationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The standard list +// page token. +func (c *BillingAccountsLocationsOperationsListCall) PageToken(pageToken string) *BillingAccountsLocationsOperationsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *BillingAccountsSinksGetCall) Fields(s ...googleapi.Field) *BillingAccountsSinksGetCall { +func (c *BillingAccountsLocationsOperationsListCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsOperationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -9101,7 +9264,7 @@ func (c *BillingAccountsSinksGetCall) Fields(s ...googleapi.Field) *BillingAccou // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *BillingAccountsSinksGetCall) IfNoneMatch(entityTag string) *BillingAccountsSinksGetCall { +func (c *BillingAccountsLocationsOperationsListCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsOperationsListCall { c.ifNoneMatch_ = entityTag return c } @@ -9109,21 +9272,21 @@ func (c *BillingAccountsSinksGetCall) IfNoneMatch(entityTag string) *BillingAcco // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *BillingAccountsSinksGetCall) Context(ctx context.Context) *BillingAccountsSinksGetCall { +func (c *BillingAccountsLocationsOperationsListCall) Context(ctx context.Context) *BillingAccountsLocationsOperationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *BillingAccountsSinksGetCall) Header() http.Header { +func (c *BillingAccountsLocationsOperationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *BillingAccountsSinksGetCall) doRequest(alt string) (*http.Response, error) { +func (c *BillingAccountsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -9136,7 +9299,7 @@ func (c *BillingAccountsSinksGetCall) doRequest(alt string) (*http.Response, err var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -9144,25 +9307,25 @@ func (c *BillingAccountsSinksGetCall) doRequest(alt string) (*http.Response, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "sinkName": c.sinkName, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.billingAccounts.sinks.get" call. -// Exactly one of *LogSink or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *LogSink.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 *BillingAccountsSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, 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() - } +// Do executes the "logging.billingAccounts.locations.operations.list" call. +// Exactly one of *ListOperationsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListOperationsResponse.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 *BillingAccountsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, 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, @@ -9175,7 +9338,7 @@ func (c *BillingAccountsSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogSink{ + ret := &ListOperationsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9187,25 +9350,41 @@ func (c *BillingAccountsSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink } return ret, nil // { - // "description": "Gets a sink.", - // "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}", + // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as \"/v1/{name=users/*}/operations\" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/operations", // "httpMethod": "GET", - // "id": "logging.billingAccounts.sinks.get", + // "id": "logging.billingAccounts.locations.operations.list", // "parameterOrder": [ - // "sinkName" + // "name" // ], // "parameters": { - // "sinkName": { - // "description": "Required. The resource name of the sink: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", + // "filter": { + // "description": "The standard list filter.", + // "location": "query", + // "type": "string" + // }, + // "name": { + // "description": "The name of the operation's parent resource.", // "location": "path", - // "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$", + // "pattern": "^billingAccounts/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" + // }, + // "pageSize": { + // "description": "The standard list page size.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The standard list page token.", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+sinkName}", + // "path": "v2/{+name}/operations", // "response": { - // "$ref": "LogSink" + // "$ref": "ListOperationsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -9217,116 +9396,113 @@ func (c *BillingAccountsSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink } -// method id "logging.billingAccounts.sinks.list": - -type BillingAccountsSinksListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *BillingAccountsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } } -// List: Lists sinks. -// -// - parent: The parent resource whose sinks are to be listed: -// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]". -func (r *BillingAccountsSinksService) List(parent string) *BillingAccountsSinksListCall { - c := &BillingAccountsSinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} +// method id "logging.billingAccounts.logs.delete": -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return from this request. Non-positive values are -// ignored. The presence of nextPageToken in the response indicates that -// more results might be available. -func (c *BillingAccountsSinksListCall) PageSize(pageSize int64) *BillingAccountsSinksListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c +type BillingAccountsLogsDeleteCall struct { + s *Service + logName string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// PageToken sets the optional parameter "pageToken": If present, then -// retrieve the next batch of results from the preceding call to this -// method. pageToken must be the value of nextPageToken from the -// previous response. The values of other method parameters should be -// identical to those in the previous call. -func (c *BillingAccountsSinksListCall) PageToken(pageToken string) *BillingAccountsSinksListCall { - c.urlParams_.Set("pageToken", pageToken) +// Delete: Deletes all the log entries in a log for the _Default Log +// Bucket. The log reappears if it receives new entries. Log entries +// written shortly before the delete operation might not be deleted. +// Entries received after the delete operation with a timestamp before +// the operation will be deleted. +// +// - logName: The resource name of the log to delete: +// projects/[PROJECT_ID]/logs/[LOG_ID] +// organizations/[ORGANIZATION_ID]/logs/[LOG_ID] +// billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID] +// folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For +// example, "projects/my-project-id/logs/syslog", +// "organizations/123/logs/cloudaudit.googleapis.com%2Factivity".For +// more information about log names, see LogEntry. +func (r *BillingAccountsLogsService) Delete(logName string) *BillingAccountsLogsDeleteCall { + c := &BillingAccountsLogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.logName = logName return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *BillingAccountsSinksListCall) Fields(s ...googleapi.Field) *BillingAccountsSinksListCall { +func (c *BillingAccountsLogsDeleteCall) Fields(s ...googleapi.Field) *BillingAccountsLogsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *BillingAccountsSinksListCall) IfNoneMatch(entityTag string) *BillingAccountsSinksListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *BillingAccountsSinksListCall) Context(ctx context.Context) *BillingAccountsSinksListCall { +func (c *BillingAccountsLogsDeleteCall) Context(ctx context.Context) *BillingAccountsLogsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *BillingAccountsSinksListCall) Header() http.Header { +func (c *BillingAccountsLogsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *BillingAccountsSinksListCall) doRequest(alt string) (*http.Response, error) { +func (c *BillingAccountsLogsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - 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, "v2/{+parent}/sinks") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+logName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "logName": c.logName, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.billingAccounts.sinks.list" call. -// Exactly one of *ListSinksResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListSinksResponse.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 *BillingAccountsSinksListCall) Do(opts ...googleapi.CallOption) (*ListSinksResponse, error) { +// Do executes the "logging.billingAccounts.logs.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.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 *BillingAccountsLogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9345,7 +9521,7 @@ func (c *BillingAccountsSinksListCall) Do(opts ...googleapi.CallOption) (*ListSi if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListSinksResponse{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9357,132 +9533,3200 @@ func (c *BillingAccountsSinksListCall) Do(opts ...googleapi.CallOption) (*ListSi } return ret, nil // { - // "description": "Lists sinks.", - // "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks", - // "httpMethod": "GET", - // "id": "logging.billingAccounts.sinks.list", + // "description": "Deletes all the log entries in a log for the _Default Log Bucket. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/logs/{logsId}", + // "httpMethod": "DELETE", + // "id": "logging.billingAccounts.logs.delete", // "parameterOrder": [ - // "parent" + // "logName" // ], // "parameters": { - // "pageSize": { - // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The parent resource whose sinks are to be listed: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ", + // "logName": { + // "description": "Required. The resource name of the log to delete: projects/[PROJECT_ID]/logs/[LOG_ID] organizations/[ORGANIZATION_ID]/logs/[LOG_ID] billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID] folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/123/logs/cloudaudit.googleapis.com%2Factivity\".For more information about log names, see LogEntry.", // "location": "path", - // "pattern": "^billingAccounts/[^/]+$", + // "pattern": "^billingAccounts/[^/]+/logs/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/sinks", + // "path": "v2/{+logName}", // "response": { - // "$ref": "ListSinksResponse" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *BillingAccountsSinksListCall) Pages(ctx context.Context, f func(*ListSinksResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "logging.billingAccounts.sinks.patch": +// method id "logging.billingAccounts.logs.list": -type BillingAccountsSinksPatchCall struct { - s *Service - sinkNameid string - logsink *LogSink - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type BillingAccountsLogsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Patch: Updates a sink. This method replaces the following fields in -// the existing sink with values from the new sink: destination, and -// filter.The updated sink might also have a new writer_identity; see -// the unique_writer_identity field. +// List: Lists the logs in projects, organizations, folders, or billing +// accounts. Only logs that have entries are listed. // -// - sinkName: The full resource name of the sink to update, including -// the parent resource and the sink identifier: -// "projects/[PROJECT_ID]/sinks/[SINK_ID]" -// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" -// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For -// example:"projects/my-project/sinks/my-sink". -func (r *BillingAccountsSinksService) Patch(sinkNameid string, logsink *LogSink) *BillingAccountsSinksPatchCall { - c := &BillingAccountsSinksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.sinkNameid = sinkNameid +// - parent: The resource name that owns the logs: projects/[PROJECT_ID] +// organizations/[ORGANIZATION_ID] +// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]. +func (r *BillingAccountsLogsService) List(parent string) *BillingAccountsLogsListCall { + c := &BillingAccountsLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request. Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *BillingAccountsLogsListCall) PageSize(pageSize int64) *BillingAccountsLogsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *BillingAccountsLogsListCall) PageToken(pageToken string) *BillingAccountsLogsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ResourceNames sets the optional parameter "resourceNames": The +// resource name that owns the logs: +// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/view +// s/[VIEW_ID] +// organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKE +// T_ID]/views/[VIEW_ID] +// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[ +// BUCKET_ID]/views/[VIEW_ID] +// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/ +// [VIEW_ID]To support legacy queries, it could also be: +// projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] +// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID] +func (c *BillingAccountsLogsListCall) ResourceNames(resourceNames ...string) *BillingAccountsLogsListCall { + c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BillingAccountsLogsListCall) Fields(s ...googleapi.Field) *BillingAccountsLogsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BillingAccountsLogsListCall) IfNoneMatch(entityTag string) *BillingAccountsLogsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *BillingAccountsLogsListCall) Context(ctx context.Context) *BillingAccountsLogsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *BillingAccountsLogsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *BillingAccountsLogsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + 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, "v2/{+parent}/logs") + 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{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "logging.billingAccounts.logs.list" call. +// Exactly one of *ListLogsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListLogsResponse.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 *BillingAccountsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, 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 := &ListLogsResponse{ + 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 + // { + // "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/logs", + // "httpMethod": "GET", + // "id": "logging.billingAccounts.logs.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The resource name that owns the logs: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", + // "location": "path", + // "pattern": "^billingAccounts/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "resourceNames": { + // "description": "Optional. The resource name that owns the logs: projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]To support legacy queries, it could also be: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "v2/{+parent}/logs", + // "response": { + // "$ref": "ListLogsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *BillingAccountsLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "logging.billingAccounts.sinks.create": + +type BillingAccountsSinksCreateCall struct { + s *Service + parent string + logsink *LogSink + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a sink that exports specified log entries to a +// destination. The export of newly-ingested log entries begins +// immediately, unless the sink's writer_identity is not permitted to +// write to the destination. A sink can export log entries only from the +// resource owning the sink. +// +// - parent: The resource in which to create the sink: +// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For +// examples:"projects/my-project" "organizations/123456789". +func (r *BillingAccountsSinksService) Create(parent string, logsink *LogSink) *BillingAccountsSinksCreateCall { + c := &BillingAccountsSinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent c.logsink = logsink return c } -// UniqueWriterIdentity sets the optional parameter -// "uniqueWriterIdentity": See sinks.create for a description of this -// field. When updating a sink, the effect of this field on the value of -// writer_identity in the updated sink depends on both the old and new -// values of this field: If the old and new values of this field are -// both false or both true, then there is no change to the sink's -// writer_identity. If the old value is false and the new value is true, -// then writer_identity is changed to a unique service account. It is an -// error if the old value is true and the new value is set to false or -// defaulted to false. -func (c *BillingAccountsSinksPatchCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *BillingAccountsSinksPatchCall { - c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity)) - return c +// UniqueWriterIdentity sets the optional parameter +// "uniqueWriterIdentity": Determines the kind of IAM identity returned +// as writer_identity in the new sink. If this value is omitted or set +// to false, and if the sink's parent is a project, then the value +// returned as writer_identity is the same group or service account used +// by Cloud Logging before the addition of writer identities to this +// API. The sink's destination must be in the same project as the sink +// itself.If this field is set to true, or if the sink is owned by a +// non-project resource such as an organization, then the value of +// writer_identity will be a unique service account used only for +// exports from the new sink. For more information, see writer_identity +// in LogSink. +func (c *BillingAccountsSinksCreateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *BillingAccountsSinksCreateCall { + c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BillingAccountsSinksCreateCall) Fields(s ...googleapi.Field) *BillingAccountsSinksCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *BillingAccountsSinksCreateCall) Context(ctx context.Context) *BillingAccountsSinksCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *BillingAccountsSinksCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *BillingAccountsSinksCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "logging.billingAccounts.sinks.create" call. +// Exactly one of *LogSink or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogSink.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 *BillingAccountsSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, 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 := &LogSink{ + 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 + // { + // "description": "Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks", + // "httpMethod": "POST", + // "id": "logging.billingAccounts.sinks.create", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. The resource in which to create the sink: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-project\" \"organizations/123456789\"", + // "location": "path", + // "pattern": "^billingAccounts/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "uniqueWriterIdentity": { + // "description": "Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Cloud Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "v2/{+parent}/sinks", + // "request": { + // "$ref": "LogSink" + // }, + // "response": { + // "$ref": "LogSink" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.billingAccounts.sinks.delete": + +type BillingAccountsSinksDeleteCall struct { + s *Service + sinkNameid string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a sink. If the sink has a unique writer_identity, +// then that service account is also deleted. +// +// - sinkName: The full resource name of the sink to delete, including +// the parent resource and the sink identifier: +// "projects/[PROJECT_ID]/sinks/[SINK_ID]" +// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" +// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For +// example:"projects/my-project/sinks/my-sink". +func (r *BillingAccountsSinksService) Delete(sinkNameid string) *BillingAccountsSinksDeleteCall { + c := &BillingAccountsSinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.sinkNameid = sinkNameid + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BillingAccountsSinksDeleteCall) Fields(s ...googleapi.Field) *BillingAccountsSinksDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *BillingAccountsSinksDeleteCall) Context(ctx context.Context) *BillingAccountsSinksDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *BillingAccountsSinksDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *BillingAccountsSinksDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "sinkName": c.sinkNameid, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "logging.billingAccounts.sinks.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.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 *BillingAccountsSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, 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 := &Empty{ + 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 + // { + // "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}", + // "httpMethod": "DELETE", + // "id": "logging.billingAccounts.sinks.delete", + // "parameterOrder": [ + // "sinkName" + // ], + // "parameters": { + // "sinkName": { + // "description": "Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", + // "location": "path", + // "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+sinkName}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.billingAccounts.sinks.get": + +type BillingAccountsSinksGetCall struct { + s *Service + sinkName string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets a sink. +// +// - sinkName: The resource name of the sink: +// "projects/[PROJECT_ID]/sinks/[SINK_ID]" +// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" +// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For +// example:"projects/my-project/sinks/my-sink". +func (r *BillingAccountsSinksService) Get(sinkName string) *BillingAccountsSinksGetCall { + c := &BillingAccountsSinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.sinkName = sinkName + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BillingAccountsSinksGetCall) Fields(s ...googleapi.Field) *BillingAccountsSinksGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BillingAccountsSinksGetCall) IfNoneMatch(entityTag string) *BillingAccountsSinksGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *BillingAccountsSinksGetCall) Context(ctx context.Context) *BillingAccountsSinksGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *BillingAccountsSinksGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *BillingAccountsSinksGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + 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, "v2/{+sinkName}") + 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{ + "sinkName": c.sinkName, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "logging.billingAccounts.sinks.get" call. +// Exactly one of *LogSink or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogSink.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 *BillingAccountsSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, 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 := &LogSink{ + 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 + // { + // "description": "Gets a sink.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}", + // "httpMethod": "GET", + // "id": "logging.billingAccounts.sinks.get", + // "parameterOrder": [ + // "sinkName" + // ], + // "parameters": { + // "sinkName": { + // "description": "Required. The resource name of the sink: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", + // "location": "path", + // "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+sinkName}", + // "response": { + // "$ref": "LogSink" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" + // ] + // } + +} + +// method id "logging.billingAccounts.sinks.list": + +type BillingAccountsSinksListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists sinks. +// +// - parent: The parent resource whose sinks are to be listed: +// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]". +func (r *BillingAccountsSinksService) List(parent string) *BillingAccountsSinksListCall { + c := &BillingAccountsSinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request. Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *BillingAccountsSinksListCall) PageSize(pageSize int64) *BillingAccountsSinksListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *BillingAccountsSinksListCall) PageToken(pageToken string) *BillingAccountsSinksListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BillingAccountsSinksListCall) Fields(s ...googleapi.Field) *BillingAccountsSinksListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BillingAccountsSinksListCall) IfNoneMatch(entityTag string) *BillingAccountsSinksListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *BillingAccountsSinksListCall) Context(ctx context.Context) *BillingAccountsSinksListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *BillingAccountsSinksListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *BillingAccountsSinksListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + 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, "v2/{+parent}/sinks") + 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{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "logging.billingAccounts.sinks.list" call. +// Exactly one of *ListSinksResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListSinksResponse.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 *BillingAccountsSinksListCall) Do(opts ...googleapi.CallOption) (*ListSinksResponse, 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 := &ListSinksResponse{ + 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 + // { + // "description": "Lists sinks.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks", + // "httpMethod": "GET", + // "id": "logging.billingAccounts.sinks.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent resource whose sinks are to be listed: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ", + // "location": "path", + // "pattern": "^billingAccounts/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+parent}/sinks", + // "response": { + // "$ref": "ListSinksResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *BillingAccountsSinksListCall) Pages(ctx context.Context, f func(*ListSinksResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "logging.billingAccounts.sinks.patch": + +type BillingAccountsSinksPatchCall struct { + s *Service + sinkNameid string + logsink *LogSink + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates a sink. This method replaces the following fields in +// the existing sink with values from the new sink: destination, and +// filter.The updated sink might also have a new writer_identity; see +// the unique_writer_identity field. +// +// - sinkName: The full resource name of the sink to update, including +// the parent resource and the sink identifier: +// "projects/[PROJECT_ID]/sinks/[SINK_ID]" +// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" +// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For +// example:"projects/my-project/sinks/my-sink". +func (r *BillingAccountsSinksService) Patch(sinkNameid string, logsink *LogSink) *BillingAccountsSinksPatchCall { + c := &BillingAccountsSinksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.sinkNameid = sinkNameid + c.logsink = logsink + return c +} + +// UniqueWriterIdentity sets the optional parameter +// "uniqueWriterIdentity": See sinks.create for a description of this +// field. When updating a sink, the effect of this field on the value of +// writer_identity in the updated sink depends on both the old and new +// values of this field: If the old and new values of this field are +// both false or both true, then there is no change to the sink's +// writer_identity. If the old value is false and the new value is true, +// then writer_identity is changed to a unique service account. It is an +// error if the old value is true and the new value is set to false or +// defaulted to false. +func (c *BillingAccountsSinksPatchCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *BillingAccountsSinksPatchCall { + c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity)) + return c +} + +// UpdateMask sets the optional parameter "updateMask": Field mask that +// specifies the fields in sink that need an update. A sink field will +// be overwritten if, and only if, it is in the update mask. name and +// output only fields cannot be updated.An empty updateMask is +// temporarily treated as using the following mask for backwards +// compatibility purposes:destination,filter,includeChildrenAt some +// point in the future, behavior will be removed and specifying an empty +// updateMask will be an error.For a detailed FieldMask definition, see +// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor +// example: updateMask=filter +func (c *BillingAccountsSinksPatchCall) UpdateMask(updateMask string) *BillingAccountsSinksPatchCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BillingAccountsSinksPatchCall) Fields(s ...googleapi.Field) *BillingAccountsSinksPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *BillingAccountsSinksPatchCall) Context(ctx context.Context) *BillingAccountsSinksPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *BillingAccountsSinksPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *BillingAccountsSinksPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "sinkName": c.sinkNameid, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "logging.billingAccounts.sinks.patch" call. +// Exactly one of *LogSink or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogSink.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 *BillingAccountsSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink, 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 := &LogSink{ + 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 + // { + // "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}", + // "httpMethod": "PATCH", + // "id": "logging.billingAccounts.sinks.patch", + // "parameterOrder": [ + // "sinkName" + // ], + // "parameters": { + // "sinkName": { + // "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", + // "location": "path", + // "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "uniqueWriterIdentity": { + // "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a unique service account. It is an error if the old value is true and the new value is set to false or defaulted to false.", + // "location": "query", + // "type": "boolean" + // }, + // "updateMask": { + // "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes:destination,filter,includeChildrenAt some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v2/{+sinkName}", + // "request": { + // "$ref": "LogSink" + // }, + // "response": { + // "$ref": "LogSink" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.billingAccounts.sinks.update": + +type BillingAccountsSinksUpdateCall struct { + s *Service + sinkNameid string + logsink *LogSink + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Update: Updates a sink. This method replaces the following fields in +// the existing sink with values from the new sink: destination, and +// filter.The updated sink might also have a new writer_identity; see +// the unique_writer_identity field. +// +// - sinkName: The full resource name of the sink to update, including +// the parent resource and the sink identifier: +// "projects/[PROJECT_ID]/sinks/[SINK_ID]" +// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" +// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For +// example:"projects/my-project/sinks/my-sink". +func (r *BillingAccountsSinksService) Update(sinkNameid string, logsink *LogSink) *BillingAccountsSinksUpdateCall { + c := &BillingAccountsSinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.sinkNameid = sinkNameid + c.logsink = logsink + return c +} + +// UniqueWriterIdentity sets the optional parameter +// "uniqueWriterIdentity": See sinks.create for a description of this +// field. When updating a sink, the effect of this field on the value of +// writer_identity in the updated sink depends on both the old and new +// values of this field: If the old and new values of this field are +// both false or both true, then there is no change to the sink's +// writer_identity. If the old value is false and the new value is true, +// then writer_identity is changed to a unique service account. It is an +// error if the old value is true and the new value is set to false or +// defaulted to false. +func (c *BillingAccountsSinksUpdateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *BillingAccountsSinksUpdateCall { + c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity)) + return c +} + +// UpdateMask sets the optional parameter "updateMask": Field mask that +// specifies the fields in sink that need an update. A sink field will +// be overwritten if, and only if, it is in the update mask. name and +// output only fields cannot be updated.An empty updateMask is +// temporarily treated as using the following mask for backwards +// compatibility purposes:destination,filter,includeChildrenAt some +// point in the future, behavior will be removed and specifying an empty +// updateMask will be an error.For a detailed FieldMask definition, see +// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor +// example: updateMask=filter +func (c *BillingAccountsSinksUpdateCall) UpdateMask(updateMask string) *BillingAccountsSinksUpdateCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BillingAccountsSinksUpdateCall) Fields(s ...googleapi.Field) *BillingAccountsSinksUpdateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *BillingAccountsSinksUpdateCall) Context(ctx context.Context) *BillingAccountsSinksUpdateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *BillingAccountsSinksUpdateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *BillingAccountsSinksUpdateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PUT", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "sinkName": c.sinkNameid, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "logging.billingAccounts.sinks.update" call. +// Exactly one of *LogSink or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogSink.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 *BillingAccountsSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, 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 := &LogSink{ + 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 + // { + // "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}", + // "httpMethod": "PUT", + // "id": "logging.billingAccounts.sinks.update", + // "parameterOrder": [ + // "sinkName" + // ], + // "parameters": { + // "sinkName": { + // "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", + // "location": "path", + // "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "uniqueWriterIdentity": { + // "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a unique service account. It is an error if the old value is true and the new value is set to false or defaulted to false.", + // "location": "query", + // "type": "boolean" + // }, + // "updateMask": { + // "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes:destination,filter,includeChildrenAt some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v2/{+sinkName}", + // "request": { + // "$ref": "LogSink" + // }, + // "response": { + // "$ref": "LogSink" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.entries.copy": + +type EntriesCopyCall struct { + s *Service + copylogentriesrequest *CopyLogEntriesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Copy: Copies a set of log entries from a log bucket to a Cloud +// Storage bucket. +func (r *EntriesService) Copy(copylogentriesrequest *CopyLogEntriesRequest) *EntriesCopyCall { + c := &EntriesCopyCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.copylogentriesrequest = copylogentriesrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EntriesCopyCall) Fields(s ...googleapi.Field) *EntriesCopyCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *EntriesCopyCall) Context(ctx context.Context) *EntriesCopyCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *EntriesCopyCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *EntriesCopyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.copylogentriesrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/entries:copy") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "logging.entries.copy" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.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 *EntriesCopyCall) Do(opts ...googleapi.CallOption) (*Operation, 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 := &Operation{ + 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 + // { + // "description": "Copies a set of log entries from a log bucket to a Cloud Storage bucket.", + // "flatPath": "v2/entries:copy", + // "httpMethod": "POST", + // "id": "logging.entries.copy", + // "parameterOrder": [], + // "parameters": {}, + // "path": "v2/entries:copy", + // "request": { + // "$ref": "CopyLogEntriesRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.entries.list": + +type EntriesListCall struct { + s *Service + listlogentriesrequest *ListLogEntriesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// List: Lists log entries. Use this method to retrieve log entries that +// originated from a project/folder/organization/billing account. For +// ways to export log entries, see Exporting Logs +// (https://cloud.google.com/logging/docs/export). +func (r *EntriesService) List(listlogentriesrequest *ListLogEntriesRequest) *EntriesListCall { + c := &EntriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.listlogentriesrequest = listlogentriesrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EntriesListCall) Fields(s ...googleapi.Field) *EntriesListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *EntriesListCall) Context(ctx context.Context) *EntriesListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *EntriesListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *EntriesListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.listlogentriesrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/entries:list") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "logging.entries.list" call. +// Exactly one of *ListLogEntriesResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListLogEntriesResponse.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 *EntriesListCall) Do(opts ...googleapi.CallOption) (*ListLogEntriesResponse, 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 := &ListLogEntriesResponse{ + 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 + // { + // "description": "Lists log entries. Use this method to retrieve log entries that originated from a project/folder/organization/billing account. For ways to export log entries, see Exporting Logs (https://cloud.google.com/logging/docs/export).", + // "flatPath": "v2/entries:list", + // "httpMethod": "POST", + // "id": "logging.entries.list", + // "parameterOrder": [], + // "parameters": {}, + // "path": "v2/entries:list", + // "request": { + // "$ref": "ListLogEntriesRequest" + // }, + // "response": { + // "$ref": "ListLogEntriesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *EntriesListCall) Pages(ctx context.Context, f func(*ListLogEntriesResponse) error) error { + c.ctx_ = ctx + defer func(pt string) { c.listlogentriesrequest.PageToken = pt }(c.listlogentriesrequest.PageToken) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.listlogentriesrequest.PageToken = x.NextPageToken + } +} + +// method id "logging.entries.tail": + +type EntriesTailCall struct { + s *Service + taillogentriesrequest *TailLogEntriesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Tail: Streaming read of log entries as they are ingested. Until the +// stream is terminated, it will continue reading logs. +func (r *EntriesService) Tail(taillogentriesrequest *TailLogEntriesRequest) *EntriesTailCall { + c := &EntriesTailCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.taillogentriesrequest = taillogentriesrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EntriesTailCall) Fields(s ...googleapi.Field) *EntriesTailCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *EntriesTailCall) Context(ctx context.Context) *EntriesTailCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *EntriesTailCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *EntriesTailCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.taillogentriesrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/entries:tail") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "logging.entries.tail" call. +// Exactly one of *TailLogEntriesResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TailLogEntriesResponse.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 *EntriesTailCall) Do(opts ...googleapi.CallOption) (*TailLogEntriesResponse, 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 := &TailLogEntriesResponse{ + 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 + // { + // "description": "Streaming read of log entries as they are ingested. Until the stream is terminated, it will continue reading logs.", + // "flatPath": "v2/entries:tail", + // "httpMethod": "POST", + // "id": "logging.entries.tail", + // "parameterOrder": [], + // "parameters": {}, + // "path": "v2/entries:tail", + // "request": { + // "$ref": "TailLogEntriesRequest" + // }, + // "response": { + // "$ref": "TailLogEntriesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" + // ] + // } + +} + +// method id "logging.entries.write": + +type EntriesWriteCall struct { + s *Service + writelogentriesrequest *WriteLogEntriesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Write: Writes log entries to Logging. This API method is the only way +// to send log entries to Logging. This method is used, directly or +// indirectly, by the Logging agent (fluentd) and all logging libraries +// configured to use Logging. A single request may contain log entries +// for a maximum of 1000 different resources (projects, organizations, +// billing accounts or folders) +func (r *EntriesService) Write(writelogentriesrequest *WriteLogEntriesRequest) *EntriesWriteCall { + c := &EntriesWriteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.writelogentriesrequest = writelogentriesrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EntriesWriteCall) Fields(s ...googleapi.Field) *EntriesWriteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *EntriesWriteCall) Context(ctx context.Context) *EntriesWriteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *EntriesWriteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *EntriesWriteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.writelogentriesrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/entries:write") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "logging.entries.write" call. +// Exactly one of *WriteLogEntriesResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *WriteLogEntriesResponse.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 *EntriesWriteCall) Do(opts ...googleapi.CallOption) (*WriteLogEntriesResponse, 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 := &WriteLogEntriesResponse{ + 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 + // { + // "description": "Writes log entries to Logging. This API method is the only way to send log entries to Logging. This method is used, directly or indirectly, by the Logging agent (fluentd) and all logging libraries configured to use Logging. A single request may contain log entries for a maximum of 1000 different resources (projects, organizations, billing accounts or folders)", + // "flatPath": "v2/entries:write", + // "httpMethod": "POST", + // "id": "logging.entries.write", + // "parameterOrder": [], + // "parameters": {}, + // "path": "v2/entries:write", + // "request": { + // "$ref": "WriteLogEntriesRequest" + // }, + // "response": { + // "$ref": "WriteLogEntriesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.write" + // ] + // } + +} + +// method id "logging.exclusions.create": + +type ExclusionsCreateCall struct { + s *Service + parent string + logexclusion *LogExclusion + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a new exclusion in the _Default sink in a specified +// parent resource. Only log entries belonging to that resource can be +// excluded. You can have up to 10 exclusions in a resource. +// +// - parent: The parent resource in which to create the exclusion: +// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For +// examples:"projects/my-logging-project" "organizations/123456789". +func (r *ExclusionsService) Create(parent string, logexclusion *LogExclusion) *ExclusionsCreateCall { + c := &ExclusionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.logexclusion = logexclusion + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ExclusionsCreateCall) Fields(s ...googleapi.Field) *ExclusionsCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ExclusionsCreateCall) Context(ctx context.Context) *ExclusionsCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ExclusionsCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ExclusionsCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "logging.exclusions.create" call. +// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LogExclusion.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 *ExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, 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 := &LogExclusion{ + 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 + // { + // "description": "Creates a new exclusion in the _Default sink in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.", + // "flatPath": "v2/{v2Id}/{v2Id1}/exclusions", + // "httpMethod": "POST", + // "id": "logging.exclusions.create", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. The parent resource in which to create the exclusion: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-logging-project\" \"organizations/123456789\"", + // "location": "path", + // "pattern": "^[^/]+/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+parent}/exclusions", + // "request": { + // "$ref": "LogExclusion" + // }, + // "response": { + // "$ref": "LogExclusion" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.exclusions.delete": + +type ExclusionsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes an exclusion in the _Default sink. +// +// - name: The resource name of an existing exclusion to delete: +// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" +// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" +// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For +// example:"projects/my-project/exclusions/my-exclusion". +func (r *ExclusionsService) Delete(name string) *ExclusionsDeleteCall { + c := &ExclusionsDeleteCall{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 information. +func (c *ExclusionsDeleteCall) Fields(s ...googleapi.Field) *ExclusionsDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ExclusionsDeleteCall) Context(ctx context.Context) *ExclusionsDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ExclusionsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", 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) +} + +// Do executes the "logging.exclusions.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.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 *ExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, 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 := &Empty{ + 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 + // { + // "description": "Deletes an exclusion in the _Default sink.", + // "flatPath": "v2/{v2Id}/{v2Id1}/exclusions/{exclusionsId}", + // "httpMethod": "DELETE", + // "id": "logging.exclusions.delete", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The resource name of an existing exclusion to delete: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", + // "location": "path", + // "pattern": "^[^/]+/[^/]+/exclusions/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+name}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.exclusions.get": + +type ExclusionsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets the description of an exclusion in the _Default sink. +// +// - name: The resource name of an existing exclusion: +// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" +// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" +// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For +// example:"projects/my-project/exclusions/my-exclusion". +func (r *ExclusionsService) Get(name string) *ExclusionsGetCall { + c := &ExclusionsGetCall{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 information. +func (c *ExclusionsGetCall) Fields(s ...googleapi.Field) *ExclusionsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ExclusionsGetCall) IfNoneMatch(entityTag string) *ExclusionsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ExclusionsGetCall) Context(ctx context.Context) *ExclusionsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ExclusionsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ExclusionsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + 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, "v2/{+name}") + 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) +} + +// Do executes the "logging.exclusions.get" call. +// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LogExclusion.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 *ExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, 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 := &LogExclusion{ + 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 + // { + // "description": "Gets the description of an exclusion in the _Default sink.", + // "flatPath": "v2/{v2Id}/{v2Id1}/exclusions/{exclusionsId}", + // "httpMethod": "GET", + // "id": "logging.exclusions.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The resource name of an existing exclusion: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", + // "location": "path", + // "pattern": "^[^/]+/[^/]+/exclusions/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+name}", + // "response": { + // "$ref": "LogExclusion" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" + // ] + // } + +} + +// method id "logging.exclusions.list": + +type ExclusionsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists all the exclusions on the _Default sink in a parent +// resource. +// +// - parent: The parent resource whose exclusions are to be listed. +// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]". +func (r *ExclusionsService) List(parent string) *ExclusionsListCall { + c := &ExclusionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request. Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *ExclusionsListCall) PageSize(pageSize int64) *ExclusionsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *ExclusionsListCall) PageToken(pageToken string) *ExclusionsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ExclusionsListCall) Fields(s ...googleapi.Field) *ExclusionsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ExclusionsListCall) IfNoneMatch(entityTag string) *ExclusionsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ExclusionsListCall) Context(ctx context.Context) *ExclusionsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ExclusionsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ExclusionsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + 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, "v2/{+parent}/exclusions") + 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{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "logging.exclusions.list" call. +// Exactly one of *ListExclusionsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListExclusionsResponse.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 *ExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsResponse, 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 := &ListExclusionsResponse{ + 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 + // { + // "description": "Lists all the exclusions on the _Default sink in a parent resource.", + // "flatPath": "v2/{v2Id}/{v2Id1}/exclusions", + // "httpMethod": "GET", + // "id": "logging.exclusions.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent resource whose exclusions are to be listed. \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ", + // "location": "path", + // "pattern": "^[^/]+/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+parent}/exclusions", + // "response": { + // "$ref": "ListExclusionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ExclusionsListCall) Pages(ctx context.Context, f func(*ListExclusionsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "logging.exclusions.patch": + +type ExclusionsPatchCall struct { + s *Service + name string + logexclusion *LogExclusion + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Changes one or more properties of an existing exclusion in the +// _Default sink. +// +// - name: The resource name of the exclusion to update: +// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" +// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" +// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For +// example:"projects/my-project/exclusions/my-exclusion". +func (r *ExclusionsService) Patch(name string, logexclusion *LogExclusion) *ExclusionsPatchCall { + c := &ExclusionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.logexclusion = logexclusion + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. A +// non-empty list of fields to change in the existing exclusion. New +// values for the fields are taken from the corresponding fields in the +// LogExclusion included in this request. Fields not mentioned in +// update_mask are not changed and are ignored in the request.For +// example, to change the filter and description of an exclusion, +// specify an update_mask of "filter,description". +func (c *ExclusionsPatchCall) UpdateMask(updateMask string) *ExclusionsPatchCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ExclusionsPatchCall) Fields(s ...googleapi.Field) *ExclusionsPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ExclusionsPatchCall) Context(ctx context.Context) *ExclusionsPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ExclusionsPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ExclusionsPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", 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) +} + +// Do executes the "logging.exclusions.patch" call. +// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LogExclusion.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 *ExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclusion, 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 := &LogExclusion{ + 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 + // { + // "description": "Changes one or more properties of an existing exclusion in the _Default sink.", + // "flatPath": "v2/{v2Id}/{v2Id1}/exclusions/{exclusionsId}", + // "httpMethod": "PATCH", + // "id": "logging.exclusions.patch", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The resource name of the exclusion to update: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", + // "location": "path", + // "pattern": "^[^/]+/[^/]+/exclusions/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "updateMask": { + // "description": "Required. A non-empty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of \"filter,description\".", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v2/{+name}", + // "request": { + // "$ref": "LogExclusion" + // }, + // "response": { + // "$ref": "LogExclusion" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.folders.getCmekSettings": + +type FoldersGetCmekSettingsCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// GetCmekSettings: Gets the Logging CMEK settings for the given +// resource.Note: CMEK for the Log Router can be configured for Google +// Cloud projects, folders, organizations and billing accounts. Once +// configured for an organization, it applies to all projects and +// folders in the Google Cloud organization.See Enabling CMEK for Log +// Router +// (https://cloud.google.com/logging/docs/routing/managed-encryption) +// for more information. +// +// - name: The resource for which to retrieve CMEK settings. +// "projects/[PROJECT_ID]/cmekSettings" +// "organizations/[ORGANIZATION_ID]/cmekSettings" +// "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" +// "folders/[FOLDER_ID]/cmekSettings" For +// example:"organizations/12345/cmekSettings"Note: CMEK for the Log +// Router can be configured for Google Cloud projects, folders, +// organizations and billing accounts. Once configured for an +// organization, it applies to all projects and folders in the Google +// Cloud organization. +func (r *FoldersService) GetCmekSettings(name string) *FoldersGetCmekSettingsCall { + c := &FoldersGetCmekSettingsCall{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 information. +func (c *FoldersGetCmekSettingsCall) Fields(s ...googleapi.Field) *FoldersGetCmekSettingsCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FoldersGetCmekSettingsCall) IfNoneMatch(entityTag string) *FoldersGetCmekSettingsCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *FoldersGetCmekSettingsCall) Context(ctx context.Context) *FoldersGetCmekSettingsCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *FoldersGetCmekSettingsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *FoldersGetCmekSettingsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + 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, "v2/{+name}/cmekSettings") + 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) +} + +// Do executes the "logging.folders.getCmekSettings" call. +// Exactly one of *CmekSettings or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CmekSettings.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 *FoldersGetCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSettings, 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 := &CmekSettings{ + 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 + // { + // "description": "Gets the Logging CMEK settings for the given resource.Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", + // "flatPath": "v2/folders/{foldersId}/cmekSettings", + // "httpMethod": "GET", + // "id": "logging.folders.getCmekSettings", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The resource for which to retrieve CMEK settings. \"projects/[PROJECT_ID]/cmekSettings\" \"organizations/[ORGANIZATION_ID]/cmekSettings\" \"billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings\" \"folders/[FOLDER_ID]/cmekSettings\" For example:\"organizations/12345/cmekSettings\"Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.", + // "location": "path", + // "pattern": "^folders/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+name}/cmekSettings", + // "response": { + // "$ref": "CmekSettings" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" + // ] + // } + +} + +// method id "logging.folders.getSettings": + +type FoldersGetSettingsCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// GetSettings: Gets the Log Router settings for the given +// resource.Note: Settings for the Log Router can be get for Google +// Cloud projects, folders, organizations and billing accounts. +// Currently it can only be configured for organizations. Once +// configured for an organization, it applies to all projects and +// folders in the Google Cloud organization.See Enabling CMEK for Log +// Router +// (https://cloud.google.com/logging/docs/routing/managed-encryption) +// for more information. +// +// - name: The resource for which to retrieve settings. +// "projects/[PROJECT_ID]/settings" +// "organizations/[ORGANIZATION_ID]/settings" +// "billingAccounts/[BILLING_ACCOUNT_ID]/settings" +// "folders/[FOLDER_ID]/settings" For +// example:"organizations/12345/settings"Note: Settings for the Log +// Router can be get for Google Cloud projects, folders, organizations +// and billing accounts. Currently it can only be configured for +// organizations. Once configured for an organization, it applies to +// all projects and folders in the Google Cloud organization. +func (r *FoldersService) GetSettings(name string) *FoldersGetSettingsCall { + c := &FoldersGetSettingsCall{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 information. +func (c *FoldersGetSettingsCall) Fields(s ...googleapi.Field) *FoldersGetSettingsCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FoldersGetSettingsCall) IfNoneMatch(entityTag string) *FoldersGetSettingsCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *FoldersGetSettingsCall) Context(ctx context.Context) *FoldersGetSettingsCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *FoldersGetSettingsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *FoldersGetSettingsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + 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, "v2/{+name}/settings") + 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) +} + +// Do executes the "logging.folders.getSettings" call. +// Exactly one of *Settings or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Settings.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 *FoldersGetSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, 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 := &Settings{ + 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 + // { + // "description": "Gets the Log Router settings for the given resource.Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", + // "flatPath": "v2/folders/{foldersId}/settings", + // "httpMethod": "GET", + // "id": "logging.folders.getSettings", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The resource for which to retrieve settings. \"projects/[PROJECT_ID]/settings\" \"organizations/[ORGANIZATION_ID]/settings\" \"billingAccounts/[BILLING_ACCOUNT_ID]/settings\" \"folders/[FOLDER_ID]/settings\" For example:\"organizations/12345/settings\"Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.", + // "location": "path", + // "pattern": "^folders/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+name}/settings", + // "response": { + // "$ref": "Settings" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" + // ] + // } + +} + +// method id "logging.folders.updateSettings": + +type FoldersUpdateSettingsCall struct { + s *Service + name string + settings *Settings + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// UpdateSettings: Updates the Log Router settings for the given +// resource.Note: Settings for the Log Router can currently only be +// configured for Google Cloud organizations. Once configured, it +// applies to all projects and folders in the Google Cloud +// organization.UpdateSettings will fail if 1) kms_key_name is invalid, +// or 2) the associated service account does not have the required +// roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, +// or 3) access to the key is disabled. 4) location_id is not supported +// by Logging. 5) location_id violate OrgPolicy.See Enabling CMEK for +// Log Router +// (https://cloud.google.com/logging/docs/routing/managed-encryption) +// for more information. +// +// - name: The resource name for the settings to update. +// "organizations/[ORGANIZATION_ID]/settings" For +// example:"organizations/12345/settings"Note: Settings for the Log +// Router can currently only be configured for Google Cloud +// organizations. Once configured, it applies to all projects and +// folders in the Google Cloud organization. +func (r *FoldersService) UpdateSettings(name string, settings *Settings) *FoldersUpdateSettingsCall { + c := &FoldersUpdateSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.settings = settings + return c +} + +// UpdateMask sets the optional parameter "updateMask": Field mask +// identifying which fields from settings should be updated. A field +// will be overwritten if and only if it is in the update mask. Output +// only fields cannot be updated.See FieldMask for more information.For +// example: "updateMask=kmsKeyName" +func (c *FoldersUpdateSettingsCall) UpdateMask(updateMask string) *FoldersUpdateSettingsCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FoldersUpdateSettingsCall) Fields(s ...googleapi.Field) *FoldersUpdateSettingsCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *FoldersUpdateSettingsCall) Context(ctx context.Context) *FoldersUpdateSettingsCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *FoldersUpdateSettingsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *FoldersUpdateSettingsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.settings) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/settings") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", 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) +} + +// Do executes the "logging.folders.updateSettings" call. +// Exactly one of *Settings or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Settings.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 *FoldersUpdateSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, 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 := &Settings{ + 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 + // { + // "description": "Updates the Log Router settings for the given resource.Note: Settings for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.UpdateSettings will fail if 1) kms_key_name is invalid, or 2) the associated service account does not have the required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, or 3) access to the key is disabled. 4) location_id is not supported by Logging. 5) location_id violate OrgPolicy.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", + // "flatPath": "v2/folders/{foldersId}/settings", + // "httpMethod": "PATCH", + // "id": "logging.folders.updateSettings", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The resource name for the settings to update. \"organizations/[ORGANIZATION_ID]/settings\" For example:\"organizations/12345/settings\"Note: Settings for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.", + // "location": "path", + // "pattern": "^folders/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "updateMask": { + // "description": "Optional. Field mask identifying which fields from settings should be updated. A field will be overwritten if and only if it is in the update mask. Output only fields cannot be updated.See FieldMask for more information.For example: \"updateMask=kmsKeyName\"", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v2/{+name}/settings", + // "request": { + // "$ref": "Settings" + // }, + // "response": { + // "$ref": "Settings" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.folders.exclusions.create": + +type FoldersExclusionsCreateCall struct { + s *Service + parent string + logexclusion *LogExclusion + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// UpdateMask sets the optional parameter "updateMask": Field mask that -// specifies the fields in sink that need an update. A sink field will -// be overwritten if, and only if, it is in the update mask. name and -// output only fields cannot be updated.An empty updateMask is -// temporarily treated as using the following mask for backwards -// compatibility purposes:destination,filter,includeChildrenAt some -// point in the future, behavior will be removed and specifying an empty -// updateMask will be an error.For a detailed FieldMask definition, see -// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor -// example: updateMask=filter -func (c *BillingAccountsSinksPatchCall) UpdateMask(updateMask string) *BillingAccountsSinksPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// Create: Creates a new exclusion in the _Default sink in a specified +// parent resource. Only log entries belonging to that resource can be +// excluded. You can have up to 10 exclusions in a resource. +// +// - parent: The parent resource in which to create the exclusion: +// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For +// examples:"projects/my-logging-project" "organizations/123456789". +func (r *FoldersExclusionsService) Create(parent string, logexclusion *LogExclusion) *FoldersExclusionsCreateCall { + c := &FoldersExclusionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.logexclusion = logexclusion return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *BillingAccountsSinksPatchCall) Fields(s ...googleapi.Field) *BillingAccountsSinksPatchCall { +func (c *FoldersExclusionsCreateCall) Fields(s ...googleapi.Field) *FoldersExclusionsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -9490,21 +12734,21 @@ func (c *BillingAccountsSinksPatchCall) Fields(s ...googleapi.Field) *BillingAcc // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *BillingAccountsSinksPatchCall) Context(ctx context.Context) *BillingAccountsSinksPatchCall { +func (c *FoldersExclusionsCreateCall) Context(ctx context.Context) *FoldersExclusionsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *BillingAccountsSinksPatchCall) Header() http.Header { +func (c *FoldersExclusionsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *BillingAccountsSinksPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersExclusionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -9512,34 +12756,175 @@ func (c *BillingAccountsSinksPatchCall) doRequest(alt string) (*http.Response, e } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "sinkName": c.sinkNameid, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.billingAccounts.sinks.patch" call. -// Exactly one of *LogSink or error will be non-nil. Any non-2xx status +// Do executes the "logging.folders.exclusions.create" call. +// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LogExclusion.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 *FoldersExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, 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 := &LogExclusion{ + 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 + // { + // "description": "Creates a new exclusion in the _Default sink in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.", + // "flatPath": "v2/folders/{foldersId}/exclusions", + // "httpMethod": "POST", + // "id": "logging.folders.exclusions.create", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. The parent resource in which to create the exclusion: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-logging-project\" \"organizations/123456789\"", + // "location": "path", + // "pattern": "^folders/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+parent}/exclusions", + // "request": { + // "$ref": "LogExclusion" + // }, + // "response": { + // "$ref": "LogExclusion" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.folders.exclusions.delete": + +type FoldersExclusionsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes an exclusion in the _Default sink. +// +// - name: The resource name of an existing exclusion to delete: +// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" +// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" +// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For +// example:"projects/my-project/exclusions/my-exclusion". +func (r *FoldersExclusionsService) Delete(name string) *FoldersExclusionsDeleteCall { + c := &FoldersExclusionsDeleteCall{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 information. +func (c *FoldersExclusionsDeleteCall) Fields(s ...googleapi.Field) *FoldersExclusionsDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *FoldersExclusionsDeleteCall) Context(ctx context.Context) *FoldersExclusionsDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *FoldersExclusionsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *FoldersExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", 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) +} + +// Do executes the "logging.folders.exclusions.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *LogSink.ServerResponse.Header or (if a response was returned at all) +// *Empty.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 *BillingAccountsSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { +func (c *FoldersExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9558,7 +12943,7 @@ func (c *BillingAccountsSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSi if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogSink{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9570,39 +12955,25 @@ func (c *BillingAccountsSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSi } return ret, nil // { - // "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field.", - // "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}", - // "httpMethod": "PATCH", - // "id": "logging.billingAccounts.sinks.patch", + // "description": "Deletes an exclusion in the _Default sink.", + // "flatPath": "v2/folders/{foldersId}/exclusions/{exclusionsId}", + // "httpMethod": "DELETE", + // "id": "logging.folders.exclusions.delete", // "parameterOrder": [ - // "sinkName" + // "name" // ], // "parameters": { - // "sinkName": { - // "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", + // "name": { + // "description": "Required. The resource name of an existing exclusion to delete: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", // "location": "path", - // "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$", + // "pattern": "^folders/[^/]+/exclusions/[^/]+$", // "required": true, // "type": "string" - // }, - // "uniqueWriterIdentity": { - // "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a unique service account. It is an error if the old value is true and the new value is set to false or defaulted to false.", - // "location": "query", - // "type": "boolean" - // }, - // "updateMask": { - // "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes:destination,filter,includeChildrenAt some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+sinkName}", - // "request": { - // "$ref": "LogSink" - // }, + // "path": "v2/{+name}", // "response": { - // "$ref": "LogSink" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -9612,127 +12983,100 @@ func (c *BillingAccountsSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSi } -// method id "logging.billingAccounts.sinks.update": +// method id "logging.folders.exclusions.get": -type BillingAccountsSinksUpdateCall struct { - s *Service - sinkNameid string - logsink *LogSink - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersExclusionsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Update: Updates a sink. This method replaces the following fields in -// the existing sink with values from the new sink: destination, and -// filter.The updated sink might also have a new writer_identity; see -// the unique_writer_identity field. +// Get: Gets the description of an exclusion in the _Default sink. // -// - sinkName: The full resource name of the sink to update, including -// the parent resource and the sink identifier: -// "projects/[PROJECT_ID]/sinks/[SINK_ID]" -// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" -// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For -// example:"projects/my-project/sinks/my-sink". -func (r *BillingAccountsSinksService) Update(sinkNameid string, logsink *LogSink) *BillingAccountsSinksUpdateCall { - c := &BillingAccountsSinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.sinkNameid = sinkNameid - c.logsink = logsink - return c -} - -// UniqueWriterIdentity sets the optional parameter -// "uniqueWriterIdentity": See sinks.create for a description of this -// field. When updating a sink, the effect of this field on the value of -// writer_identity in the updated sink depends on both the old and new -// values of this field: If the old and new values of this field are -// both false or both true, then there is no change to the sink's -// writer_identity. If the old value is false and the new value is true, -// then writer_identity is changed to a unique service account. It is an -// error if the old value is true and the new value is set to false or -// defaulted to false. -func (c *BillingAccountsSinksUpdateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *BillingAccountsSinksUpdateCall { - c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity)) - return c -} - -// UpdateMask sets the optional parameter "updateMask": Field mask that -// specifies the fields in sink that need an update. A sink field will -// be overwritten if, and only if, it is in the update mask. name and -// output only fields cannot be updated.An empty updateMask is -// temporarily treated as using the following mask for backwards -// compatibility purposes:destination,filter,includeChildrenAt some -// point in the future, behavior will be removed and specifying an empty -// updateMask will be an error.For a detailed FieldMask definition, see -// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor -// example: updateMask=filter -func (c *BillingAccountsSinksUpdateCall) UpdateMask(updateMask string) *BillingAccountsSinksUpdateCall { - c.urlParams_.Set("updateMask", updateMask) +// - name: The resource name of an existing exclusion: +// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" +// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" +// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For +// example:"projects/my-project/exclusions/my-exclusion". +func (r *FoldersExclusionsService) Get(name string) *FoldersExclusionsGetCall { + c := &FoldersExclusionsGetCall{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 information. -func (c *BillingAccountsSinksUpdateCall) Fields(s ...googleapi.Field) *BillingAccountsSinksUpdateCall { +func (c *FoldersExclusionsGetCall) Fields(s ...googleapi.Field) *FoldersExclusionsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FoldersExclusionsGetCall) IfNoneMatch(entityTag string) *FoldersExclusionsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *BillingAccountsSinksUpdateCall) Context(ctx context.Context) *BillingAccountsSinksUpdateCall { +func (c *FoldersExclusionsGetCall) Context(ctx context.Context) *FoldersExclusionsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *BillingAccountsSinksUpdateCall) Header() http.Header { +func (c *FoldersExclusionsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *BillingAccountsSinksUpdateCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersExclusionsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "sinkName": c.sinkNameid, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.billingAccounts.sinks.update" call. -// Exactly one of *LogSink or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *LogSink.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 *BillingAccountsSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { +// Do executes the "logging.folders.exclusions.get" call. +// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LogExclusion.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 *FoldersExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9751,7 +13095,7 @@ func (c *BillingAccountsSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogS if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogSink{ + ret := &LogExclusion{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9763,124 +13107,147 @@ func (c *BillingAccountsSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogS } return ret, nil // { - // "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field.", - // "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}", - // "httpMethod": "PUT", - // "id": "logging.billingAccounts.sinks.update", + // "description": "Gets the description of an exclusion in the _Default sink.", + // "flatPath": "v2/folders/{foldersId}/exclusions/{exclusionsId}", + // "httpMethod": "GET", + // "id": "logging.folders.exclusions.get", // "parameterOrder": [ - // "sinkName" + // "name" // ], // "parameters": { - // "sinkName": { - // "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", + // "name": { + // "description": "Required. The resource name of an existing exclusion: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", // "location": "path", - // "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$", + // "pattern": "^folders/[^/]+/exclusions/[^/]+$", // "required": true, // "type": "string" - // }, - // "uniqueWriterIdentity": { - // "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a unique service account. It is an error if the old value is true and the new value is set to false or defaulted to false.", - // "location": "query", - // "type": "boolean" - // }, - // "updateMask": { - // "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes:destination,filter,includeChildrenAt some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+sinkName}", - // "request": { - // "$ref": "LogSink" - // }, + // "path": "v2/{+name}", // "response": { - // "$ref": "LogSink" + // "$ref": "LogExclusion" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.entries.copy": +// method id "logging.folders.exclusions.list": -type EntriesCopyCall struct { - s *Service - copylogentriesrequest *CopyLogEntriesRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersExclusionsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Copy: Copies a set of log entries from a log bucket to a Cloud -// Storage bucket. -func (r *EntriesService) Copy(copylogentriesrequest *CopyLogEntriesRequest) *EntriesCopyCall { - c := &EntriesCopyCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.copylogentriesrequest = copylogentriesrequest +// List: Lists all the exclusions on the _Default sink in a parent +// resource. +// +// - parent: The parent resource whose exclusions are to be listed. +// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]". +func (r *FoldersExclusionsService) List(parent string) *FoldersExclusionsListCall { + c := &FoldersExclusionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request. Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *FoldersExclusionsListCall) PageSize(pageSize int64) *FoldersExclusionsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *FoldersExclusionsListCall) PageToken(pageToken string) *FoldersExclusionsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EntriesCopyCall) Fields(s ...googleapi.Field) *EntriesCopyCall { +func (c *FoldersExclusionsListCall) Fields(s ...googleapi.Field) *FoldersExclusionsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FoldersExclusionsListCall) IfNoneMatch(entityTag string) *FoldersExclusionsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EntriesCopyCall) Context(ctx context.Context) *EntriesCopyCall { +func (c *FoldersExclusionsListCall) Context(ctx context.Context) *FoldersExclusionsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EntriesCopyCall) Header() http.Header { +func (c *FoldersExclusionsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EntriesCopyCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersExclusionsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.copylogentriesrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/entries:copy") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } - -// Do executes the "logging.entries.copy" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Operation.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 *EntriesCopyCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + +// Do executes the "logging.folders.exclusions.list" call. +// Exactly one of *ListExclusionsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListExclusionsResponse.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 *FoldersExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9899,7 +13266,7 @@ func (c *EntriesCopyCall) Do(opts ...googleapi.CallOption) (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &ListExclusionsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9911,51 +13278,111 @@ func (c *EntriesCopyCall) Do(opts ...googleapi.CallOption) (*Operation, error) { } return ret, nil // { - // "description": "Copies a set of log entries from a log bucket to a Cloud Storage bucket.", - // "flatPath": "v2/entries:copy", - // "httpMethod": "POST", - // "id": "logging.entries.copy", - // "parameterOrder": [], - // "parameters": {}, - // "path": "v2/entries:copy", - // "request": { - // "$ref": "CopyLogEntriesRequest" + // "description": "Lists all the exclusions on the _Default sink in a parent resource.", + // "flatPath": "v2/folders/{foldersId}/exclusions", + // "httpMethod": "GET", + // "id": "logging.folders.exclusions.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent resource whose exclusions are to be listed. \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ", + // "location": "path", + // "pattern": "^folders/[^/]+$", + // "required": true, + // "type": "string" + // } // }, + // "path": "v2/{+parent}/exclusions", // "response": { - // "$ref": "Operation" + // "$ref": "ListExclusionsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.entries.list": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *FoldersExclusionsListCall) Pages(ctx context.Context, f func(*ListExclusionsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type EntriesListCall struct { - s *Service - listlogentriesrequest *ListLogEntriesRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "logging.folders.exclusions.patch": + +type FoldersExclusionsPatchCall struct { + s *Service + name string + logexclusion *LogExclusion + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists log entries. Use this method to retrieve log entries that -// originated from a project/folder/organization/billing account. For -// ways to export log entries, see Exporting Logs -// (https://cloud.google.com/logging/docs/export). -func (r *EntriesService) List(listlogentriesrequest *ListLogEntriesRequest) *EntriesListCall { - c := &EntriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.listlogentriesrequest = listlogentriesrequest +// Patch: Changes one or more properties of an existing exclusion in the +// _Default sink. +// +// - name: The resource name of the exclusion to update: +// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" +// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" +// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For +// example:"projects/my-project/exclusions/my-exclusion". +func (r *FoldersExclusionsService) Patch(name string, logexclusion *LogExclusion) *FoldersExclusionsPatchCall { + c := &FoldersExclusionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.logexclusion = logexclusion + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. A +// non-empty list of fields to change in the existing exclusion. New +// values for the fields are taken from the corresponding fields in the +// LogExclusion included in this request. Fields not mentioned in +// update_mask are not changed and are ignored in the request.For +// example, to change the filter and description of an exclusion, +// specify an update_mask of "filter,description". +func (c *FoldersExclusionsPatchCall) UpdateMask(updateMask string) *FoldersExclusionsPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EntriesListCall) Fields(s ...googleapi.Field) *EntriesListCall { +func (c *FoldersExclusionsPatchCall) Fields(s ...googleapi.Field) *FoldersExclusionsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -9963,21 +13390,21 @@ func (c *EntriesListCall) Fields(s ...googleapi.Field) *EntriesListCall { // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EntriesListCall) Context(ctx context.Context) *EntriesListCall { +func (c *FoldersExclusionsPatchCall) Context(ctx context.Context) *FoldersExclusionsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EntriesListCall) Header() http.Header { +func (c *FoldersExclusionsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EntriesListCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersExclusionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -9985,31 +13412,34 @@ func (c *EntriesListCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.listlogentriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/entries:list") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", 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) } -// Do executes the "logging.entries.list" call. -// Exactly one of *ListLogEntriesResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListLogEntriesResponse.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 *EntriesListCall) Do(opts ...googleapi.CallOption) (*ListLogEntriesResponse, error) { +// Do executes the "logging.folders.exclusions.patch" call. +// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LogExclusion.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 *FoldersExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10028,7 +13458,7 @@ func (c *EntriesListCall) Do(opts ...googleapi.CallOption) (*ListLogEntriesRespo if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListLogEntriesResponse{ + ret := &LogExclusion{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10040,126 +13470,132 @@ func (c *EntriesListCall) Do(opts ...googleapi.CallOption) (*ListLogEntriesRespo } return ret, nil // { - // "description": "Lists log entries. Use this method to retrieve log entries that originated from a project/folder/organization/billing account. For ways to export log entries, see Exporting Logs (https://cloud.google.com/logging/docs/export).", - // "flatPath": "v2/entries:list", - // "httpMethod": "POST", - // "id": "logging.entries.list", - // "parameterOrder": [], - // "parameters": {}, - // "path": "v2/entries:list", + // "description": "Changes one or more properties of an existing exclusion in the _Default sink.", + // "flatPath": "v2/folders/{foldersId}/exclusions/{exclusionsId}", + // "httpMethod": "PATCH", + // "id": "logging.folders.exclusions.patch", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The resource name of the exclusion to update: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", + // "location": "path", + // "pattern": "^folders/[^/]+/exclusions/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "updateMask": { + // "description": "Required. A non-empty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of \"filter,description\".", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v2/{+name}", // "request": { - // "$ref": "ListLogEntriesRequest" + // "$ref": "LogExclusion" // }, // "response": { - // "$ref": "ListLogEntriesResponse" + // "$ref": "LogExclusion" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *EntriesListCall) Pages(ctx context.Context, f func(*ListLogEntriesResponse) error) error { - c.ctx_ = ctx - defer func(pt string) { c.listlogentriesrequest.PageToken = pt }(c.listlogentriesrequest.PageToken) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.listlogentriesrequest.PageToken = x.NextPageToken - } -} - -// method id "logging.entries.tail": +// method id "logging.folders.locations.get": -type EntriesTailCall struct { - s *Service - taillogentriesrequest *TailLogEntriesRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersLocationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Tail: Streaming read of log entries as they are ingested. Until the -// stream is terminated, it will continue reading logs. -func (r *EntriesService) Tail(taillogentriesrequest *TailLogEntriesRequest) *EntriesTailCall { - c := &EntriesTailCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.taillogentriesrequest = taillogentriesrequest +// Get: Gets information about a location. +// +// - name: Resource name for the location. +func (r *FoldersLocationsService) Get(name string) *FoldersLocationsGetCall { + c := &FoldersLocationsGetCall{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 information. -func (c *EntriesTailCall) Fields(s ...googleapi.Field) *EntriesTailCall { +func (c *FoldersLocationsGetCall) Fields(s ...googleapi.Field) *FoldersLocationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FoldersLocationsGetCall) IfNoneMatch(entityTag string) *FoldersLocationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EntriesTailCall) Context(ctx context.Context) *EntriesTailCall { +func (c *FoldersLocationsGetCall) Context(ctx context.Context) *FoldersLocationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EntriesTailCall) Header() http.Header { +func (c *FoldersLocationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EntriesTailCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.taillogentriesrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/entries:tail") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + 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) } -// Do executes the "logging.entries.tail" call. -// Exactly one of *TailLogEntriesResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *TailLogEntriesResponse.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 *EntriesTailCall) Do(opts ...googleapi.CallOption) (*TailLogEntriesResponse, error) { +// Do executes the "logging.folders.locations.get" call. +// Exactly one of *Location or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Location.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 *FoldersLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10178,7 +13614,7 @@ func (c *EntriesTailCall) Do(opts ...googleapi.CallOption) (*TailLogEntriesRespo if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &TailLogEntriesResponse{ + ret := &Location{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10190,18 +13626,25 @@ func (c *EntriesTailCall) Do(opts ...googleapi.CallOption) (*TailLogEntriesRespo } return ret, nil // { - // "description": "Streaming read of log entries as they are ingested. Until the stream is terminated, it will continue reading logs.", - // "flatPath": "v2/entries:tail", - // "httpMethod": "POST", - // "id": "logging.entries.tail", - // "parameterOrder": [], - // "parameters": {}, - // "path": "v2/entries:tail", - // "request": { - // "$ref": "TailLogEntriesRequest" + // "description": "Gets information about a location.", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}", + // "httpMethod": "GET", + // "id": "logging.folders.locations.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Resource name for the location.", + // "location": "path", + // "pattern": "^folders/[^/]+/locations/[^/]+$", + // "required": true, + // "type": "string" + // } // }, + // "path": "v2/{+name}", // "response": { - // "$ref": "TailLogEntriesResponse" + // "$ref": "Location" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -10213,86 +13656,121 @@ func (c *EntriesTailCall) Do(opts ...googleapi.CallOption) (*TailLogEntriesRespo } -// method id "logging.entries.write": +// method id "logging.folders.locations.list": -type EntriesWriteCall struct { - s *Service - writelogentriesrequest *WriteLogEntriesRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersLocationsListCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Write: Writes log entries to Logging. This API method is the only way -// to send log entries to Logging. This method is used, directly or -// indirectly, by the Logging agent (fluentd) and all logging libraries -// configured to use Logging. A single request may contain log entries -// for a maximum of 1000 different resources (projects, organizations, -// billing accounts or folders) -func (r *EntriesService) Write(writelogentriesrequest *WriteLogEntriesRequest) *EntriesWriteCall { - c := &EntriesWriteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.writelogentriesrequest = writelogentriesrequest +// List: Lists information about the supported locations for this +// service. +// +// - name: The resource that owns the locations collection, if +// applicable. +func (r *FoldersLocationsService) List(name string) *FoldersLocationsListCall { + c := &FoldersLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Filter sets the optional parameter "filter": A filter to narrow down +// results to a preferred subset. The filtering language accepts strings +// like "displayName=tokyo", and is documented in more detail in AIP-160 +// (https://google.aip.dev/160). +func (c *FoldersLocationsListCall) Filter(filter string) *FoldersLocationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return. If not set, the service selects a default. +func (c *FoldersLocationsListCall) PageSize(pageSize int64) *FoldersLocationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token +// received from the next_page_token field in the response. Send that +// page token to receive the subsequent page. +func (c *FoldersLocationsListCall) PageToken(pageToken string) *FoldersLocationsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EntriesWriteCall) Fields(s ...googleapi.Field) *EntriesWriteCall { +func (c *FoldersLocationsListCall) Fields(s ...googleapi.Field) *FoldersLocationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FoldersLocationsListCall) IfNoneMatch(entityTag string) *FoldersLocationsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EntriesWriteCall) Context(ctx context.Context) *EntriesWriteCall { +func (c *FoldersLocationsListCall) Context(ctx context.Context) *FoldersLocationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EntriesWriteCall) Header() http.Header { +func (c *FoldersLocationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EntriesWriteCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.writelogentriesrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/entries:write") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + 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) } -// Do executes the "logging.entries.write" call. -// Exactly one of *WriteLogEntriesResponse or error will be non-nil. Any +// Do executes the "logging.folders.locations.list" call. +// Exactly one of *ListLocationsResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either -// *WriteLogEntriesResponse.ServerResponse.Header or (if a response was +// *ListLocationsResponse.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 *EntriesWriteCall) Do(opts ...googleapi.CallOption) (*WriteLogEntriesResponse, error) { +func (c *FoldersLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10311,7 +13789,7 @@ func (c *EntriesWriteCall) Do(opts ...googleapi.CallOption) (*WriteLogEntriesRes if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &WriteLogEntriesResponse{ + ret := &ListLocationsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10323,58 +13801,111 @@ func (c *EntriesWriteCall) Do(opts ...googleapi.CallOption) (*WriteLogEntriesRes } return ret, nil // { - // "description": "Writes log entries to Logging. This API method is the only way to send log entries to Logging. This method is used, directly or indirectly, by the Logging agent (fluentd) and all logging libraries configured to use Logging. A single request may contain log entries for a maximum of 1000 different resources (projects, organizations, billing accounts or folders)", - // "flatPath": "v2/entries:write", - // "httpMethod": "POST", - // "id": "logging.entries.write", - // "parameterOrder": [], - // "parameters": {}, - // "path": "v2/entries:write", - // "request": { - // "$ref": "WriteLogEntriesRequest" + // "description": "Lists information about the supported locations for this service.", + // "flatPath": "v2/folders/{foldersId}/locations", + // "httpMethod": "GET", + // "id": "logging.folders.locations.list", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "filter": { + // "description": "A filter to narrow down results to a preferred subset. The filtering language accepts strings like \"displayName=tokyo\", and is documented in more detail in AIP-160 (https://google.aip.dev/160).", + // "location": "query", + // "type": "string" + // }, + // "name": { + // "description": "The resource that owns the locations collection, if applicable.", + // "location": "path", + // "pattern": "^folders/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of results to return. If not set, the service selects a default.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token received from the next_page_token field in the response. Send that page token to receive the subsequent page.", + // "location": "query", + // "type": "string" + // } // }, + // "path": "v2/{+name}/locations", // "response": { - // "$ref": "WriteLogEntriesResponse" + // "$ref": "ListLocationsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.write" + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.exclusions.create": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *FoldersLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type ExclusionsCreateCall struct { - s *Service - parent string - logexclusion *LogExclusion - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "logging.folders.locations.buckets.create": + +type FoldersLocationsBucketsCreateCall struct { + s *Service + parent string + logbucket *LogBucket + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a log bucket that can be used to store log entries. +// After a bucket has been created, the bucket's location cannot be +// changed. +// +// - parent: The resource in which to create the log bucket: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For +// example:"projects/my-project/locations/global". +func (r *FoldersLocationsBucketsService) Create(parent string, logbucket *LogBucket) *FoldersLocationsBucketsCreateCall { + c := &FoldersLocationsBucketsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.logbucket = logbucket + return c } -// Create: Creates a new exclusion in the _Default sink in a specified -// parent resource. Only log entries belonging to that resource can be -// excluded. You can have up to 10 exclusions in a resource. -// -// - parent: The parent resource in which to create the exclusion: -// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For -// examples:"projects/my-logging-project" "organizations/123456789". -func (r *ExclusionsService) Create(parent string, logexclusion *LogExclusion) *ExclusionsCreateCall { - c := &ExclusionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.logexclusion = logexclusion +// BucketId sets the optional parameter "bucketId": Required. A +// client-assigned identifier such as "my-bucket". Identifiers are +// limited to 100 characters and can include only letters, digits, +// underscores, hyphens, and periods. +func (c *FoldersLocationsBucketsCreateCall) BucketId(bucketId string) *FoldersLocationsBucketsCreateCall { + c.urlParams_.Set("bucketId", bucketId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ExclusionsCreateCall) Fields(s ...googleapi.Field) *ExclusionsCreateCall { +func (c *FoldersLocationsBucketsCreateCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -10382,21 +13913,21 @@ func (c *ExclusionsCreateCall) Fields(s ...googleapi.Field) *ExclusionsCreateCal // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ExclusionsCreateCall) Context(ctx context.Context) *ExclusionsCreateCall { +func (c *FoldersLocationsBucketsCreateCall) Context(ctx context.Context) *FoldersLocationsBucketsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ExclusionsCreateCall) Header() http.Header { +func (c *FoldersLocationsBucketsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ExclusionsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -10404,14 +13935,14 @@ func (c *ExclusionsCreateCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -10424,14 +13955,14 @@ func (c *ExclusionsCreateCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.exclusions.create" call. -// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx +// Do executes the "logging.folders.locations.buckets.create" call. +// Exactly one of *LogBucket or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either -// *LogExclusion.ServerResponse.Header or (if a response was returned at +// *LogBucket.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 *ExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { +func (c *FoldersLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10450,7 +13981,7 @@ func (c *ExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogExclusion{ + ret := &LogBucket{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10462,28 +13993,33 @@ func (c *ExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, } return ret, nil // { - // "description": "Creates a new exclusion in the _Default sink in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.", - // "flatPath": "v2/{v2Id}/{v2Id1}/exclusions", + // "description": "Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed.", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets", // "httpMethod": "POST", - // "id": "logging.exclusions.create", + // "id": "logging.folders.locations.buckets.create", // "parameterOrder": [ // "parent" // ], // "parameters": { + // "bucketId": { + // "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", + // "location": "query", + // "type": "string" + // }, // "parent": { - // "description": "Required. The parent resource in which to create the exclusion: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-logging-project\" \"organizations/123456789\"", + // "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"", // "location": "path", - // "pattern": "^[^/]+/[^/]+$", + // "pattern": "^folders/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/exclusions", + // "path": "v2/{+parent}/buckets", // "request": { - // "$ref": "LogExclusion" + // "$ref": "LogBucket" // }, // "response": { - // "$ref": "LogExclusion" + // "$ref": "LogBucket" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -10493,34 +14029,44 @@ func (c *ExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, } -// method id "logging.exclusions.delete": +// method id "logging.folders.locations.buckets.createAsync": -type ExclusionsDeleteCall struct { +type FoldersLocationsBucketsCreateAsyncCall struct { s *Service - name string + parent string + logbucket *LogBucket urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Delete: Deletes an exclusion in the _Default sink. +// CreateAsync: Creates a log bucket asynchronously that can be used to +// store log entries.After a bucket has been created, the bucket's +// location cannot be changed. // -// - name: The resource name of an existing exclusion to delete: -// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" -// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" -// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For -// example:"projects/my-project/exclusions/my-exclusion". -func (r *ExclusionsService) Delete(name string) *ExclusionsDeleteCall { - c := &ExclusionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: The resource in which to create the log bucket: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For +// example:"projects/my-project/locations/global". +func (r *FoldersLocationsBucketsService) CreateAsync(parent string, logbucket *LogBucket) *FoldersLocationsBucketsCreateAsyncCall { + c := &FoldersLocationsBucketsCreateAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.logbucket = logbucket + return c +} + +// BucketId sets the optional parameter "bucketId": Required. A +// client-assigned identifier such as "my-bucket". Identifiers are +// limited to 100 characters and can include only letters, digits, +// underscores, hyphens, and periods. +func (c *FoldersLocationsBucketsCreateAsyncCall) BucketId(bucketId string) *FoldersLocationsBucketsCreateAsyncCall { + c.urlParams_.Set("bucketId", bucketId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ExclusionsDeleteCall) Fields(s ...googleapi.Field) *ExclusionsDeleteCall { +func (c *FoldersLocationsBucketsCreateAsyncCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsCreateAsyncCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -10528,21 +14074,21 @@ func (c *ExclusionsDeleteCall) Fields(s ...googleapi.Field) *ExclusionsDeleteCal // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ExclusionsDeleteCall) Context(ctx context.Context) *ExclusionsDeleteCall { +func (c *FoldersLocationsBucketsCreateAsyncCall) Context(ctx context.Context) *FoldersLocationsBucketsCreateAsyncCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ExclusionsDeleteCall) Header() http.Header { +func (c *FoldersLocationsBucketsCreateAsyncCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsBucketsCreateAsyncCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -10550,29 +14096,34 @@ func (c *ExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets:createAsync") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.exclusions.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.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 *ExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "logging.folders.locations.buckets.createAsync" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.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 *FoldersLocationsBucketsCreateAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10591,7 +14142,7 @@ func (c *ExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10603,25 +14154,33 @@ func (c *ExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) } return ret, nil // { - // "description": "Deletes an exclusion in the _Default sink.", - // "flatPath": "v2/{v2Id}/{v2Id1}/exclusions/{exclusionsId}", - // "httpMethod": "DELETE", - // "id": "logging.exclusions.delete", + // "description": "Creates a log bucket asynchronously that can be used to store log entries.After a bucket has been created, the bucket's location cannot be changed.", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets:createAsync", + // "httpMethod": "POST", + // "id": "logging.folders.locations.buckets.createAsync", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The resource name of an existing exclusion to delete: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", + // "bucketId": { + // "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"", // "location": "path", - // "pattern": "^[^/]+/[^/]+/exclusions/[^/]+$", + // "pattern": "^folders/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+parent}/buckets:createAsync", + // "request": { + // "$ref": "LogBucket" + // }, // "response": { - // "$ref": "Empty" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -10631,27 +14190,31 @@ func (c *ExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) } -// method id "logging.exclusions.get": +// method id "logging.folders.locations.buckets.delete": -type ExclusionsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type FoldersLocationsBucketsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets the description of an exclusion in the _Default sink. +// Delete: Deletes a log bucket.Changes the bucket's lifecycle_state to +// the DELETE_REQUESTED state. After 7 days, the bucket will be purged +// and all log entries in the bucket will be permanently deleted. // -// - name: The resource name of an existing exclusion: -// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" -// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" -// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For -// example:"projects/my-project/exclusions/my-exclusion". -func (r *ExclusionsService) Get(name string) *ExclusionsGetCall { - c := &ExclusionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The full resource name of the bucket to delete. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *FoldersLocationsBucketsService) Delete(name string) *FoldersLocationsBucketsDeleteCall { + c := &FoldersLocationsBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -10659,54 +14222,41 @@ func (r *ExclusionsService) Get(name string) *ExclusionsGetCall { // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ExclusionsGetCall) Fields(s ...googleapi.Field) *ExclusionsGetCall { +func (c *FoldersLocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ExclusionsGetCall) IfNoneMatch(entityTag string) *ExclusionsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ExclusionsGetCall) Context(ctx context.Context) *ExclusionsGetCall { +func (c *FoldersLocationsBucketsDeleteCall) Context(ctx context.Context) *FoldersLocationsBucketsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ExclusionsGetCall) Header() http.Header { +func (c *FoldersLocationsBucketsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ExclusionsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - 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, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -10717,14 +14267,14 @@ func (c *ExclusionsGetCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.exclusions.get" call. -// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *LogExclusion.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 *ExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { +// Do executes the "logging.folders.locations.buckets.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.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 *FoldersLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10743,7 +14293,7 @@ func (c *ExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, err if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogExclusion{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10755,82 +14305,66 @@ func (c *ExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, err } return ret, nil // { - // "description": "Gets the description of an exclusion in the _Default sink.", - // "flatPath": "v2/{v2Id}/{v2Id1}/exclusions/{exclusionsId}", - // "httpMethod": "GET", - // "id": "logging.exclusions.get", + // "description": "Deletes a log bucket.Changes the bucket's lifecycle_state to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted.", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}", + // "httpMethod": "DELETE", + // "id": "logging.folders.locations.buckets.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource name of an existing exclusion: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", + // "description": "Required. The full resource name of the bucket to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", - // "pattern": "^[^/]+/[^/]+/exclusions/[^/]+$", + // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v2/{+name}", // "response": { - // "$ref": "LogExclusion" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// method id "logging.exclusions.list": +// method id "logging.folders.locations.buckets.get": -type ExclusionsListCall struct { +type FoldersLocationsBucketsGetCall struct { s *Service - parent string + name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists all the exclusions on the _Default sink in a parent -// resource. +// Get: Gets a log bucket. // -// - parent: The parent resource whose exclusions are to be listed. -// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]". -func (r *ExclusionsService) List(parent string) *ExclusionsListCall { - c := &ExclusionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return from this request. Non-positive values are -// ignored. The presence of nextPageToken in the response indicates that -// more results might be available. -func (c *ExclusionsListCall) PageSize(pageSize int64) *ExclusionsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": If present, then -// retrieve the next batch of results from the preceding call to this -// method. pageToken must be the value of nextPageToken from the -// previous response. The values of other method parameters should be -// identical to those in the previous call. -func (c *ExclusionsListCall) PageToken(pageToken string) *ExclusionsListCall { - c.urlParams_.Set("pageToken", pageToken) +// - name: The resource name of the bucket: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *FoldersLocationsBucketsService) Get(name string) *FoldersLocationsBucketsGetCall { + c := &FoldersLocationsBucketsGetCall{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 information. -func (c *ExclusionsListCall) Fields(s ...googleapi.Field) *ExclusionsListCall { +func (c *FoldersLocationsBucketsGetCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -10840,7 +14374,7 @@ func (c *ExclusionsListCall) Fields(s ...googleapi.Field) *ExclusionsListCall { // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ExclusionsListCall) IfNoneMatch(entityTag string) *ExclusionsListCall { +func (c *FoldersLocationsBucketsGetCall) IfNoneMatch(entityTag string) *FoldersLocationsBucketsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -10848,21 +14382,21 @@ func (c *ExclusionsListCall) IfNoneMatch(entityTag string) *ExclusionsListCall { // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ExclusionsListCall) Context(ctx context.Context) *ExclusionsListCall { +func (c *FoldersLocationsBucketsGetCall) Context(ctx context.Context) *FoldersLocationsBucketsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ExclusionsListCall) Header() http.Header { +func (c *FoldersLocationsBucketsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ExclusionsListCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsBucketsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -10875,7 +14409,7 @@ func (c *ExclusionsListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -10883,19 +14417,19 @@ func (c *ExclusionsListCall) doRequest(alt string) (*http.Response, error) { } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.exclusions.list" call. -// Exactly one of *ListExclusionsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListExclusionsResponse.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 *ExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsResponse, error) { +// Do executes the "logging.folders.locations.buckets.get" call. +// Exactly one of *LogBucket or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LogBucket.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 *FoldersLocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10914,7 +14448,7 @@ func (c *ExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsRe if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListExclusionsResponse{ + ret := &LogBucket{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10926,36 +14460,25 @@ func (c *ExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsRe } return ret, nil // { - // "description": "Lists all the exclusions on the _Default sink in a parent resource.", - // "flatPath": "v2/{v2Id}/{v2Id1}/exclusions", + // "description": "Gets a log bucket.", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}", // "httpMethod": "GET", - // "id": "logging.exclusions.list", + // "id": "logging.folders.locations.buckets.get", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "pageSize": { - // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The parent resource whose exclusions are to be listed. \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ", + // "name": { + // "description": "Required. The resource name of the bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", - // "pattern": "^[^/]+/[^/]+$", + // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/exclusions", + // "path": "v2/{+name}", // "response": { - // "$ref": "ListExclusionsResponse" + // "$ref": "LogBucket" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -10967,127 +14490,120 @@ func (c *ExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsRe } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ExclusionsListCall) Pages(ctx context.Context, f func(*ListExclusionsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "logging.exclusions.patch": +// method id "logging.folders.locations.buckets.list": -type ExclusionsPatchCall struct { +type FoldersLocationsBucketsListCall struct { s *Service - name string - logexclusion *LogExclusion + parent string urlParams_ gensupport.URLParams + ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Patch: Changes one or more properties of an existing exclusion in the -// _Default sink. +// List: Lists log buckets. // -// - name: The resource name of the exclusion to update: -// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" -// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" -// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For -// example:"projects/my-project/exclusions/my-exclusion". -func (r *ExclusionsService) Patch(name string, logexclusion *LogExclusion) *ExclusionsPatchCall { - c := &ExclusionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.logexclusion = logexclusion +// - parent: The parent resource whose buckets are to be listed: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" Note: The locations +// portion of the resource must be specified, but supplying the +// character - in place of LOCATION_ID will return all buckets. +func (r *FoldersLocationsBucketsService) List(parent string) *FoldersLocationsBucketsListCall { + c := &FoldersLocationsBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent return c } -// UpdateMask sets the optional parameter "updateMask": Required. A -// non-empty list of fields to change in the existing exclusion. New -// values for the fields are taken from the corresponding fields in the -// LogExclusion included in this request. Fields not mentioned in -// update_mask are not changed and are ignored in the request.For -// example, to change the filter and description of an exclusion, -// specify an update_mask of "filter,description". -func (c *ExclusionsPatchCall) UpdateMask(updateMask string) *ExclusionsPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request. Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *FoldersLocationsBucketsListCall) PageSize(pageSize int64) *FoldersLocationsBucketsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *FoldersLocationsBucketsListCall) PageToken(pageToken string) *FoldersLocationsBucketsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ExclusionsPatchCall) Fields(s ...googleapi.Field) *ExclusionsPatchCall { +func (c *FoldersLocationsBucketsListCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FoldersLocationsBucketsListCall) IfNoneMatch(entityTag string) *FoldersLocationsBucketsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ExclusionsPatchCall) Context(ctx context.Context) *ExclusionsPatchCall { +func (c *FoldersLocationsBucketsListCall) Context(ctx context.Context) *FoldersLocationsBucketsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ExclusionsPatchCall) Header() http.Header { +func (c *FoldersLocationsBucketsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ExclusionsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsBucketsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + 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, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.exclusions.patch" call. -// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *LogExclusion.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 *ExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { +// Do executes the "logging.folders.locations.buckets.list" call. +// Exactly one of *ListBucketsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListBucketsResponse.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 *FoldersLocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucketsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -11106,7 +14622,7 @@ func (c *ExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclusion, e if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogExclusion{ + ret := &ListBucketsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11118,130 +14634,154 @@ func (c *ExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclusion, e } return ret, nil // { - // "description": "Changes one or more properties of an existing exclusion in the _Default sink.", - // "flatPath": "v2/{v2Id}/{v2Id1}/exclusions/{exclusionsId}", - // "httpMethod": "PATCH", - // "id": "logging.exclusions.patch", + // "description": "Lists log buckets.", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets", + // "httpMethod": "GET", + // "id": "logging.folders.locations.buckets.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The resource name of the exclusion to update: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", - // "location": "path", - // "pattern": "^[^/]+/[^/]+/exclusions/[^/]+$", - // "required": true, - // "type": "string" + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "format": "int32", + // "location": "query", + // "type": "integer" // }, - // "updateMask": { - // "description": "Required. A non-empty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of \"filter,description\".", - // "format": "google-fieldmask", + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", // "location": "query", // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent resource whose buckets are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets.", + // "location": "path", + // "pattern": "^folders/[^/]+/locations/[^/]+$", + // "required": true, + // "type": "string" // } // }, - // "path": "v2/{+name}", - // "request": { - // "$ref": "LogExclusion" - // }, + // "path": "v2/{+parent}/buckets", // "response": { - // "$ref": "LogExclusion" + // "$ref": "ListBucketsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.folders.getCmekSettings": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *FoldersLocationsBucketsListCall) Pages(ctx context.Context, f func(*ListBucketsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type FoldersGetCmekSettingsCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// method id "logging.folders.locations.buckets.patch": + +type FoldersLocationsBucketsPatchCall struct { + s *Service + name string + logbucket *LogBucket + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// GetCmekSettings: Gets the Logging CMEK settings for the given -// resource.Note: CMEK for the Log Router can be configured for Google -// Cloud projects, folders, organizations and billing accounts. Once -// configured for an organization, it applies to all projects and -// folders in the Google Cloud organization.See Enabling CMEK for Log -// Router -// (https://cloud.google.com/logging/docs/routing/managed-encryption) -// for more information. +// Patch: Updates a log bucket.If the bucket has a lifecycle_state of +// DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a +// bucket has been created, the bucket's location cannot be changed. // -// - name: The resource for which to retrieve CMEK settings. -// "projects/[PROJECT_ID]/cmekSettings" -// "organizations/[ORGANIZATION_ID]/cmekSettings" -// "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" -// "folders/[FOLDER_ID]/cmekSettings" For -// example:"organizations/12345/cmekSettings"Note: CMEK for the Log -// Router can be configured for Google Cloud projects, folders, -// organizations and billing accounts. Once configured for an -// organization, it applies to all projects and folders in the Google -// Cloud organization. -func (r *FoldersService) GetCmekSettings(name string) *FoldersGetCmekSettingsCall { - c := &FoldersGetCmekSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The full resource name of the bucket to update. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *FoldersLocationsBucketsService) Patch(name string, logbucket *LogBucket) *FoldersLocationsBucketsPatchCall { + c := &FoldersLocationsBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.logbucket = logbucket + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. Field +// mask that specifies the fields in bucket that need an update. A +// bucket field will be overwritten if, and only if, it is in the update +// mask. name and output only fields cannot be updated.For a detailed +// FieldMask definition, see: +// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor +// example: updateMask=retention_days +func (c *FoldersLocationsBucketsPatchCall) UpdateMask(updateMask string) *FoldersLocationsBucketsPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersGetCmekSettingsCall) Fields(s ...googleapi.Field) *FoldersGetCmekSettingsCall { +func (c *FoldersLocationsBucketsPatchCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *FoldersGetCmekSettingsCall) IfNoneMatch(entityTag string) *FoldersGetCmekSettingsCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersGetCmekSettingsCall) Context(ctx context.Context) *FoldersGetCmekSettingsCall { +func (c *FoldersLocationsBucketsPatchCall) Context(ctx context.Context) *FoldersLocationsBucketsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersGetCmekSettingsCall) Header() http.Header { +func (c *FoldersLocationsBucketsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersGetCmekSettingsCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/cmekSettings") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -11252,14 +14792,14 @@ func (c *FoldersGetCmekSettingsCall) doRequest(alt string) (*http.Response, erro return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.getCmekSettings" call. -// Exactly one of *CmekSettings or error will be non-nil. Any non-2xx +// Do executes the "logging.folders.locations.buckets.patch" call. +// Exactly one of *LogBucket or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either -// *CmekSettings.ServerResponse.Header or (if a response was returned at +// *LogBucket.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 *FoldersGetCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSettings, error) { +func (c *FoldersLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -11278,7 +14818,7 @@ func (c *FoldersGetCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSett if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &CmekSettings{ + ret := &LogBucket{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11290,124 +14830,116 @@ func (c *FoldersGetCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSett } return ret, nil // { - // "description": "Gets the Logging CMEK settings for the given resource.Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", - // "flatPath": "v2/folders/{foldersId}/cmekSettings", - // "httpMethod": "GET", - // "id": "logging.folders.getCmekSettings", + // "description": "Updates a log bucket.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}", + // "httpMethod": "PATCH", + // "id": "logging.folders.locations.buckets.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource for which to retrieve CMEK settings. \"projects/[PROJECT_ID]/cmekSettings\" \"organizations/[ORGANIZATION_ID]/cmekSettings\" \"billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings\" \"folders/[FOLDER_ID]/cmekSettings\" For example:\"organizations/12345/cmekSettings\"Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.", + // "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", - // "pattern": "^folders/[^/]+$", + // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=retention_days", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+name}/cmekSettings", + // "path": "v2/{+name}", + // "request": { + // "$ref": "LogBucket" + // }, // "response": { - // "$ref": "CmekSettings" + // "$ref": "LogBucket" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// method id "logging.folders.getSettings": +// method id "logging.folders.locations.buckets.undelete": -type FoldersGetSettingsCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type FoldersLocationsBucketsUndeleteCall struct { + s *Service + name string + undeletebucketrequest *UndeleteBucketRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// GetSettings: Gets the Log Router settings for the given -// resource.Note: Settings for the Log Router can be get for Google -// Cloud projects, folders, organizations and billing accounts. -// Currently it can only be configured for organizations. Once -// configured for an organization, it applies to all projects and -// folders in the Google Cloud organization.See Enabling CMEK for Log -// Router -// (https://cloud.google.com/logging/docs/routing/managed-encryption) -// for more information. +// Undelete: Undeletes a log bucket. A bucket that has been deleted can +// be undeleted within the grace period of 7 days. // -// - name: The resource for which to retrieve settings. -// "projects/[PROJECT_ID]/settings" -// "organizations/[ORGANIZATION_ID]/settings" -// "billingAccounts/[BILLING_ACCOUNT_ID]/settings" -// "folders/[FOLDER_ID]/settings" For -// example:"organizations/12345/settings"Note: Settings for the Log -// Router can be get for Google Cloud projects, folders, organizations -// and billing accounts. Currently it can only be configured for -// organizations. Once configured for an organization, it applies to -// all projects and folders in the Google Cloud organization. -func (r *FoldersService) GetSettings(name string) *FoldersGetSettingsCall { - c := &FoldersGetSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The full resource name of the bucket to undelete. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *FoldersLocationsBucketsService) Undelete(name string, undeletebucketrequest *UndeleteBucketRequest) *FoldersLocationsBucketsUndeleteCall { + c := &FoldersLocationsBucketsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.undeletebucketrequest = undeletebucketrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersGetSettingsCall) Fields(s ...googleapi.Field) *FoldersGetSettingsCall { +func (c *FoldersLocationsBucketsUndeleteCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsUndeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *FoldersGetSettingsCall) IfNoneMatch(entityTag string) *FoldersGetSettingsCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersGetSettingsCall) Context(ctx context.Context) *FoldersGetSettingsCall { +func (c *FoldersLocationsBucketsUndeleteCall) Context(ctx context.Context) *FoldersLocationsBucketsUndeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersGetSettingsCall) Header() http.Header { +func (c *FoldersLocationsBucketsUndeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersGetSettingsCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest) + if err != nil { + return nil, err } - var body io.Reader = nil + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/settings") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:undelete") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -11418,14 +14950,14 @@ func (c *FoldersGetSettingsCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.getSettings" call. -// Exactly one of *Settings or error will be non-nil. Any non-2xx status +// Do executes the "logging.folders.locations.buckets.undelete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *Settings.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 *FoldersGetSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, error) { +// *Empty.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 *FoldersLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -11444,7 +14976,7 @@ func (c *FoldersGetSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, er if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Settings{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11456,79 +14988,77 @@ func (c *FoldersGetSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, er } return ret, nil // { - // "description": "Gets the Log Router settings for the given resource.Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", - // "flatPath": "v2/folders/{foldersId}/settings", - // "httpMethod": "GET", - // "id": "logging.folders.getSettings", + // "description": "Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period of 7 days.", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}:undelete", + // "httpMethod": "POST", + // "id": "logging.folders.locations.buckets.undelete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource for which to retrieve settings. \"projects/[PROJECT_ID]/settings\" \"organizations/[ORGANIZATION_ID]/settings\" \"billingAccounts/[BILLING_ACCOUNT_ID]/settings\" \"folders/[FOLDER_ID]/settings\" For example:\"organizations/12345/settings\"Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.", + // "description": "Required. The full resource name of the bucket to undelete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", - // "pattern": "^folders/[^/]+$", + // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}/settings", + // "path": "v2/{+name}:undelete", + // "request": { + // "$ref": "UndeleteBucketRequest" + // }, // "response": { - // "$ref": "Settings" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// method id "logging.folders.updateSettings": +// method id "logging.folders.locations.buckets.updateAsync": -type FoldersUpdateSettingsCall struct { +type FoldersLocationsBucketsUpdateAsyncCall struct { s *Service name string - settings *Settings + logbucket *LogBucket urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// UpdateSettings: Updates the Log Router settings for the given -// resource.Note: Settings for the Log Router can currently only be -// configured for Google Cloud organizations. Once configured, it -// applies to all projects and folders in the Google Cloud -// organization.UpdateSettings will fail if 1) kms_key_name is invalid, -// or 2) the associated service account does not have the required -// roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, -// or 3) access to the key is disabled. 4) location_id is not supported -// by Logging. 5) location_id violate OrgPolicy.See Enabling CMEK for -// Log Router -// (https://cloud.google.com/logging/docs/routing/managed-encryption) -// for more information. +// UpdateAsync: Updates a log bucket asynchronously.If the bucket has a +// lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be +// returned.After a bucket has been created, the bucket's location +// cannot be changed. // -// - name: The resource name for the settings to update. -// "organizations/[ORGANIZATION_ID]/settings" For -// example:"organizations/12345/settings"Note: Settings for the Log -// Router can currently only be configured for Google Cloud -// organizations. Once configured, it applies to all projects and -// folders in the Google Cloud organization. -func (r *FoldersService) UpdateSettings(name string, settings *Settings) *FoldersUpdateSettingsCall { - c := &FoldersUpdateSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The full resource name of the bucket to update. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *FoldersLocationsBucketsService) UpdateAsync(name string, logbucket *LogBucket) *FoldersLocationsBucketsUpdateAsyncCall { + c := &FoldersLocationsBucketsUpdateAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.settings = settings + c.logbucket = logbucket return c } -// UpdateMask sets the optional parameter "updateMask": Field mask -// identifying which fields from settings should be updated. A field -// will be overwritten if and only if it is in the update mask. Output -// only fields cannot be updated.See FieldMask for more information.For -// example: "updateMask=kmsKeyName" -func (c *FoldersUpdateSettingsCall) UpdateMask(updateMask string) *FoldersUpdateSettingsCall { +// UpdateMask sets the optional parameter "updateMask": Required. Field +// mask that specifies the fields in bucket that need an update. A +// bucket field will be overwritten if, and only if, it is in the update +// mask. name and output only fields cannot be updated.For a detailed +// FieldMask definition, see: +// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor +// example: updateMask=retention_days +func (c *FoldersLocationsBucketsUpdateAsyncCall) UpdateMask(updateMask string) *FoldersLocationsBucketsUpdateAsyncCall { c.urlParams_.Set("updateMask", updateMask) return c } @@ -11536,7 +15066,7 @@ func (c *FoldersUpdateSettingsCall) UpdateMask(updateMask string) *FoldersUpdate // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersUpdateSettingsCall) Fields(s ...googleapi.Field) *FoldersUpdateSettingsCall { +func (c *FoldersLocationsBucketsUpdateAsyncCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsUpdateAsyncCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -11544,21 +15074,21 @@ func (c *FoldersUpdateSettingsCall) Fields(s ...googleapi.Field) *FoldersUpdateS // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersUpdateSettingsCall) Context(ctx context.Context) *FoldersUpdateSettingsCall { +func (c *FoldersLocationsBucketsUpdateAsyncCall) Context(ctx context.Context) *FoldersLocationsBucketsUpdateAsyncCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersUpdateSettingsCall) Header() http.Header { +func (c *FoldersLocationsBucketsUpdateAsyncCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersUpdateSettingsCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsBucketsUpdateAsyncCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -11566,16 +15096,16 @@ func (c *FoldersUpdateSettingsCall) doRequest(alt string) (*http.Response, error } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.settings) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/settings") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:updateAsync") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -11586,14 +15116,14 @@ func (c *FoldersUpdateSettingsCall) doRequest(alt string) (*http.Response, error return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.updateSettings" call. -// Exactly one of *Settings or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Settings.ServerResponse.Header or (if a response was returned at +// Do executes the "logging.folders.locations.buckets.updateAsync" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.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 *FoldersUpdateSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, error) { +func (c *FoldersLocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -11612,7 +15142,7 @@ func (c *FoldersUpdateSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Settings{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11624,34 +15154,34 @@ func (c *FoldersUpdateSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, } return ret, nil // { - // "description": "Updates the Log Router settings for the given resource.Note: Settings for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.UpdateSettings will fail if 1) kms_key_name is invalid, or 2) the associated service account does not have the required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, or 3) access to the key is disabled. 4) location_id is not supported by Logging. 5) location_id violate OrgPolicy.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", - // "flatPath": "v2/folders/{foldersId}/settings", - // "httpMethod": "PATCH", - // "id": "logging.folders.updateSettings", + // "description": "Updates a log bucket asynchronously.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}:updateAsync", + // "httpMethod": "POST", + // "id": "logging.folders.locations.buckets.updateAsync", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource name for the settings to update. \"organizations/[ORGANIZATION_ID]/settings\" For example:\"organizations/12345/settings\"Note: Settings for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.", + // "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", - // "pattern": "^folders/[^/]+$", + // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" // }, // "updateMask": { - // "description": "Optional. Field mask identifying which fields from settings should be updated. A field will be overwritten if and only if it is in the update mask. Output only fields cannot be updated.See FieldMask for more information.For example: \"updateMask=kmsKeyName\"", + // "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=retention_days", // "format": "google-fieldmask", // "location": "query", // "type": "string" // } // }, - // "path": "v2/{+name}/settings", + // "path": "v2/{+name}:updateAsync", // "request": { - // "$ref": "Settings" + // "$ref": "LogBucket" // }, // "response": { - // "$ref": "Settings" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -11661,36 +15191,48 @@ func (c *FoldersUpdateSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, } -// method id "logging.folders.exclusions.create": +// method id "logging.folders.locations.buckets.links.create": -type FoldersExclusionsCreateCall struct { - s *Service - parent string - logexclusion *LogExclusion - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersLocationsBucketsLinksCreateCall struct { + s *Service + parent string + link *Link + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates a new exclusion in the _Default sink in a specified -// parent resource. Only log entries belonging to that resource can be -// excluded. You can have up to 10 exclusions in a resource. +// Create: Asynchronously creates linked dataset in BigQuery which makes +// it possible to use BugQuery to read the logs stored in the bucket. A +// bucket may currently only contain one link. // -// - parent: The parent resource in which to create the exclusion: -// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For -// examples:"projects/my-logging-project" "organizations/123456789". -func (r *FoldersExclusionsService) Create(parent string, logexclusion *LogExclusion) *FoldersExclusionsCreateCall { - c := &FoldersExclusionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The full resource name of the bucket to create a link for. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]". +func (r *FoldersLocationsBucketsLinksService) Create(parent string, link *Link) *FoldersLocationsBucketsLinksCreateCall { + c := &FoldersLocationsBucketsLinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.logexclusion = logexclusion + c.link = link + return c +} + +// LinkId sets the optional parameter "linkId": Required. The ID to use +// for the link. The link_id can have up to 100 characters. A valid +// link_id must only have alphanumeric characters and underscores within +// it. +func (c *FoldersLocationsBucketsLinksCreateCall) LinkId(linkId string) *FoldersLocationsBucketsLinksCreateCall { + c.urlParams_.Set("linkId", linkId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersExclusionsCreateCall) Fields(s ...googleapi.Field) *FoldersExclusionsCreateCall { +func (c *FoldersLocationsBucketsLinksCreateCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsLinksCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -11698,21 +15240,21 @@ func (c *FoldersExclusionsCreateCall) Fields(s ...googleapi.Field) *FoldersExclu // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersExclusionsCreateCall) Context(ctx context.Context) *FoldersExclusionsCreateCall { +func (c *FoldersLocationsBucketsLinksCreateCall) Context(ctx context.Context) *FoldersLocationsBucketsLinksCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersExclusionsCreateCall) Header() http.Header { +func (c *FoldersLocationsBucketsLinksCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersExclusionsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsBucketsLinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -11720,14 +15262,14 @@ func (c *FoldersExclusionsCreateCall) doRequest(alt string) (*http.Response, err } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.link) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/links") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -11740,14 +15282,14 @@ func (c *FoldersExclusionsCreateCall) doRequest(alt string) (*http.Response, err return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.exclusions.create" call. -// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx +// Do executes the "logging.folders.locations.buckets.links.create" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either -// *LogExclusion.ServerResponse.Header or (if a response was returned at +// *Operation.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 *FoldersExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { +func (c *FoldersLocationsBucketsLinksCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -11766,7 +15308,7 @@ func (c *FoldersExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExcl if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogExclusion{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11778,28 +15320,33 @@ func (c *FoldersExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExcl } return ret, nil // { - // "description": "Creates a new exclusion in the _Default sink in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.", - // "flatPath": "v2/folders/{foldersId}/exclusions", + // "description": "Asynchronously creates linked dataset in BigQuery which makes it possible to use BugQuery to read the logs stored in the bucket. A bucket may currently only contain one link.", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/links", // "httpMethod": "POST", - // "id": "logging.folders.exclusions.create", + // "id": "logging.folders.locations.buckets.links.create", // "parameterOrder": [ // "parent" // ], // "parameters": { + // "linkId": { + // "description": "Required. The ID to use for the link. The link_id can have up to 100 characters. A valid link_id must only have alphanumeric characters and underscores within it.", + // "location": "query", + // "type": "string" + // }, // "parent": { - // "description": "Required. The parent resource in which to create the exclusion: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-logging-project\" \"organizations/123456789\"", + // "description": "Required. The full resource name of the bucket to create a link for. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", // "location": "path", - // "pattern": "^folders/[^/]+$", + // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/exclusions", + // "path": "v2/{+parent}/links", // "request": { - // "$ref": "LogExclusion" + // "$ref": "Link" // }, // "response": { - // "$ref": "LogExclusion" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -11809,9 +15356,9 @@ func (c *FoldersExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExcl } -// method id "logging.folders.exclusions.delete": +// method id "logging.folders.locations.buckets.links.delete": -type FoldersExclusionsDeleteCall struct { +type FoldersLocationsBucketsLinksDeleteCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -11819,16 +15366,20 @@ type FoldersExclusionsDeleteCall struct { header_ http.Header } -// Delete: Deletes an exclusion in the _Default sink. +// Delete: Deletes a link. This will also delete the corresponding +// BigQuery linked dataset. // -// - name: The resource name of an existing exclusion to delete: -// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" -// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" -// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For -// example:"projects/my-project/exclusions/my-exclusion". -func (r *FoldersExclusionsService) Delete(name string) *FoldersExclusionsDeleteCall { - c := &FoldersExclusionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The full resource name of the link to +// delete."projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/ +// links/LINK_ID" +// "organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ +// ID/links/LINK_ID" +// "billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BU +// CKET_ID/links/LINK_ID" +// "folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LIN +// K_ID". +func (r *FoldersLocationsBucketsLinksService) Delete(name string) *FoldersLocationsBucketsLinksDeleteCall { + c := &FoldersLocationsBucketsLinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -11836,7 +15387,7 @@ func (r *FoldersExclusionsService) Delete(name string) *FoldersExclusionsDeleteC // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersExclusionsDeleteCall) Fields(s ...googleapi.Field) *FoldersExclusionsDeleteCall { +func (c *FoldersLocationsBucketsLinksDeleteCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsLinksDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -11844,21 +15395,21 @@ func (c *FoldersExclusionsDeleteCall) Fields(s ...googleapi.Field) *FoldersExclu // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersExclusionsDeleteCall) Context(ctx context.Context) *FoldersExclusionsDeleteCall { +func (c *FoldersLocationsBucketsLinksDeleteCall) Context(ctx context.Context) *FoldersLocationsBucketsLinksDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersExclusionsDeleteCall) Header() http.Header { +func (c *FoldersLocationsBucketsLinksDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsBucketsLinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -11881,14 +15432,14 @@ func (c *FoldersExclusionsDeleteCall) doRequest(alt string) (*http.Response, err return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.exclusions.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.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 *FoldersExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "logging.folders.locations.buckets.links.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.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 *FoldersLocationsBucketsLinksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -11907,7 +15458,7 @@ func (c *FoldersExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11919,25 +15470,25 @@ func (c *FoldersExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, } return ret, nil // { - // "description": "Deletes an exclusion in the _Default sink.", - // "flatPath": "v2/folders/{foldersId}/exclusions/{exclusionsId}", + // "description": "Deletes a link. This will also delete the corresponding BigQuery linked dataset.", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/links/{linksId}", // "httpMethod": "DELETE", - // "id": "logging.folders.exclusions.delete", + // "id": "logging.folders.locations.buckets.links.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource name of an existing exclusion to delete: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", + // "description": "Required. The full resource name of the link to delete.\"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\"", // "location": "path", - // "pattern": "^folders/[^/]+/exclusions/[^/]+$", + // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+/links/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v2/{+name}", // "response": { - // "$ref": "Empty" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -11947,9 +15498,9 @@ func (c *FoldersExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, } -// method id "logging.folders.exclusions.get": +// method id "logging.folders.locations.buckets.links.get": -type FoldersExclusionsGetCall struct { +type FoldersLocationsBucketsLinksGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -11958,16 +15509,19 @@ type FoldersExclusionsGetCall struct { header_ http.Header } -// Get: Gets the description of an exclusion in the _Default sink. +// Get: Gets a link. // -// - name: The resource name of an existing exclusion: -// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" -// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" -// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For -// example:"projects/my-project/exclusions/my-exclusion". -func (r *FoldersExclusionsService) Get(name string) *FoldersExclusionsGetCall { - c := &FoldersExclusionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of the +// link:"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/li +// nks/LINK_ID" +// "organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ +// ID/links/LINK_ID" +// "billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BU +// CKET_ID/links/LINK_ID" +// "folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LIN +// K_ID. +func (r *FoldersLocationsBucketsLinksService) Get(name string) *FoldersLocationsBucketsLinksGetCall { + c := &FoldersLocationsBucketsLinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -11975,7 +15529,7 @@ func (r *FoldersExclusionsService) Get(name string) *FoldersExclusionsGetCall { // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersExclusionsGetCall) Fields(s ...googleapi.Field) *FoldersExclusionsGetCall { +func (c *FoldersLocationsBucketsLinksGetCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsLinksGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -11985,7 +15539,7 @@ func (c *FoldersExclusionsGetCall) Fields(s ...googleapi.Field) *FoldersExclusio // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *FoldersExclusionsGetCall) IfNoneMatch(entityTag string) *FoldersExclusionsGetCall { +func (c *FoldersLocationsBucketsLinksGetCall) IfNoneMatch(entityTag string) *FoldersLocationsBucketsLinksGetCall { c.ifNoneMatch_ = entityTag return c } @@ -11993,21 +15547,21 @@ func (c *FoldersExclusionsGetCall) IfNoneMatch(entityTag string) *FoldersExclusi // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersExclusionsGetCall) Context(ctx context.Context) *FoldersExclusionsGetCall { +func (c *FoldersLocationsBucketsLinksGetCall) Context(ctx context.Context) *FoldersLocationsBucketsLinksGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersExclusionsGetCall) Header() http.Header { +func (c *FoldersLocationsBucketsLinksGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersExclusionsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsBucketsLinksGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -12033,14 +15587,14 @@ func (c *FoldersExclusionsGetCall) doRequest(alt string) (*http.Response, error) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.exclusions.get" call. -// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *LogExclusion.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 *FoldersExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { +// Do executes the "logging.folders.locations.buckets.links.get" call. +// Exactly one of *Link or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Link.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 *FoldersLocationsBucketsLinksGetCall) Do(opts ...googleapi.CallOption) (*Link, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12059,7 +15613,7 @@ func (c *FoldersExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusi if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogExclusion{ + ret := &Link{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12071,25 +15625,25 @@ func (c *FoldersExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusi } return ret, nil // { - // "description": "Gets the description of an exclusion in the _Default sink.", - // "flatPath": "v2/folders/{foldersId}/exclusions/{exclusionsId}", + // "description": "Gets a link.", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/links/{linksId}", // "httpMethod": "GET", - // "id": "logging.folders.exclusions.get", + // "id": "logging.folders.locations.buckets.links.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource name of an existing exclusion: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", + // "description": "Required. The resource name of the link:\"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID", // "location": "path", - // "pattern": "^folders/[^/]+/exclusions/[^/]+$", + // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+/links/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v2/{+name}", // "response": { - // "$ref": "LogExclusion" + // "$ref": "Link" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -12101,9 +15655,9 @@ func (c *FoldersExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusi } -// method id "logging.folders.exclusions.list": +// method id "logging.folders.locations.buckets.links.list": -type FoldersExclusionsListCall struct { +type FoldersLocationsBucketsLinksListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -12112,23 +15666,25 @@ type FoldersExclusionsListCall struct { header_ http.Header } -// List: Lists all the exclusions on the _Default sink in a parent -// resource. +// List: Lists links. // -// - parent: The parent resource whose exclusions are to be listed. -// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]". -func (r *FoldersExclusionsService) List(parent string) *FoldersExclusionsListCall { - c := &FoldersExclusionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The parent resource whose links are to be +// listed:"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/ +// links/" +// "organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ +// ID/" +// "billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BU +// CKET_ID/" +// "folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/. +func (r *FoldersLocationsBucketsLinksService) List(parent string) *FoldersLocationsBucketsLinksListCall { + c := &FoldersLocationsBucketsLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } // PageSize sets the optional parameter "pageSize": The maximum number -// of results to return from this request. Non-positive values are -// ignored. The presence of nextPageToken in the response indicates that -// more results might be available. -func (c *FoldersExclusionsListCall) PageSize(pageSize int64) *FoldersExclusionsListCall { +// of results to return from this request. +func (c *FoldersLocationsBucketsLinksListCall) PageSize(pageSize int64) *FoldersLocationsBucketsLinksListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } @@ -12136,9 +15692,8 @@ func (c *FoldersExclusionsListCall) PageSize(pageSize int64) *FoldersExclusionsL // PageToken sets the optional parameter "pageToken": If present, then // retrieve the next batch of results from the preceding call to this // method. pageToken must be the value of nextPageToken from the -// previous response. The values of other method parameters should be -// identical to those in the previous call. -func (c *FoldersExclusionsListCall) PageToken(pageToken string) *FoldersExclusionsListCall { +// previous response. +func (c *FoldersLocationsBucketsLinksListCall) PageToken(pageToken string) *FoldersLocationsBucketsLinksListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -12146,7 +15701,7 @@ func (c *FoldersExclusionsListCall) PageToken(pageToken string) *FoldersExclusio // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersExclusionsListCall) Fields(s ...googleapi.Field) *FoldersExclusionsListCall { +func (c *FoldersLocationsBucketsLinksListCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsLinksListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -12156,7 +15711,7 @@ func (c *FoldersExclusionsListCall) Fields(s ...googleapi.Field) *FoldersExclusi // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *FoldersExclusionsListCall) IfNoneMatch(entityTag string) *FoldersExclusionsListCall { +func (c *FoldersLocationsBucketsLinksListCall) IfNoneMatch(entityTag string) *FoldersLocationsBucketsLinksListCall { c.ifNoneMatch_ = entityTag return c } @@ -12164,21 +15719,21 @@ func (c *FoldersExclusionsListCall) IfNoneMatch(entityTag string) *FoldersExclus // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersExclusionsListCall) Context(ctx context.Context) *FoldersExclusionsListCall { +func (c *FoldersLocationsBucketsLinksListCall) Context(ctx context.Context) *FoldersLocationsBucketsLinksListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersExclusionsListCall) Header() http.Header { +func (c *FoldersLocationsBucketsLinksListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersExclusionsListCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsBucketsLinksListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -12191,7 +15746,7 @@ func (c *FoldersExclusionsListCall) doRequest(alt string) (*http.Response, error var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/links") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -12204,14 +15759,14 @@ func (c *FoldersExclusionsListCall) doRequest(alt string) (*http.Response, error return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.exclusions.list" call. -// Exactly one of *ListExclusionsResponse or error will be non-nil. Any +// Do executes the "logging.folders.locations.buckets.links.list" call. +// Exactly one of *ListLinksResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either -// *ListExclusionsResponse.ServerResponse.Header or (if a response was +// *ListLinksResponse.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 *FoldersExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsResponse, error) { +func (c *FoldersLocationsBucketsLinksListCall) Do(opts ...googleapi.CallOption) (*ListLinksResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12230,7 +15785,7 @@ func (c *FoldersExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclu if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListExclusionsResponse{ + ret := &ListLinksResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12242,36 +15797,36 @@ func (c *FoldersExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclu } return ret, nil // { - // "description": "Lists all the exclusions on the _Default sink in a parent resource.", - // "flatPath": "v2/folders/{foldersId}/exclusions", + // "description": "Lists links.", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/links", // "httpMethod": "GET", - // "id": "logging.folders.exclusions.list", + // "id": "logging.folders.locations.buckets.links.list", // "parameterOrder": [ // "parent" // ], // "parameters": { // "pageSize": { - // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "description": "Optional. The maximum number of results to return from this request.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. The parent resource whose exclusions are to be listed. \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ", + // "description": "Required. The parent resource whose links are to be listed:\"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/\" \"organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/\" \"billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/\" \"folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/", // "location": "path", - // "pattern": "^folders/[^/]+$", + // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/exclusions", + // "path": "v2/{+parent}/links", // "response": { - // "$ref": "ListExclusionsResponse" + // "$ref": "ListLinksResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -12286,7 +15841,7 @@ func (c *FoldersExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclu // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *FoldersExclusionsListCall) Pages(ctx context.Context, f func(*ListExclusionsResponse) error) error { +func (c *FoldersLocationsBucketsLinksListCall) Pages(ctx context.Context, f func(*ListLinksResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -12304,49 +15859,196 @@ func (c *FoldersExclusionsListCall) Pages(ctx context.Context, f func(*ListExclu } } -// method id "logging.folders.exclusions.patch": +// method id "logging.folders.locations.buckets.views.create": -type FoldersExclusionsPatchCall struct { - s *Service - name string - logexclusion *LogExclusion - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersLocationsBucketsViewsCreateCall struct { + s *Service + parent string + logview *LogView + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Changes one or more properties of an existing exclusion in the -// _Default sink. +// Create: Creates a view over log entries in a log bucket. A bucket may +// contain a maximum of 30 views. // -// - name: The resource name of the exclusion to update: -// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" -// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" -// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For -// example:"projects/my-project/exclusions/my-exclusion". -func (r *FoldersExclusionsService) Patch(name string, logexclusion *LogExclusion) *FoldersExclusionsPatchCall { - c := &FoldersExclusionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The bucket in which to create the view +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// ` For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *FoldersLocationsBucketsViewsService) Create(parent string, logview *LogView) *FoldersLocationsBucketsViewsCreateCall { + c := &FoldersLocationsBucketsViewsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.logview = logview + return c +} + +// ViewId sets the optional parameter "viewId": Required. A +// client-assigned identifier such as "my-view". Identifiers are limited +// to 100 characters and can include only letters, digits, underscores, +// hyphens, and periods. +func (c *FoldersLocationsBucketsViewsCreateCall) ViewId(viewId string) *FoldersLocationsBucketsViewsCreateCall { + c.urlParams_.Set("viewId", viewId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FoldersLocationsBucketsViewsCreateCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsViewsCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *FoldersLocationsBucketsViewsCreateCall) Context(ctx context.Context) *FoldersLocationsBucketsViewsCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *FoldersLocationsBucketsViewsCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *FoldersLocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "logging.folders.locations.buckets.views.create" call. +// Exactly one of *LogView or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogView.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 *FoldersLocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption) (*LogView, 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 := &LogView{ + 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 + // { + // "description": "Creates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/views", + // "httpMethod": "POST", + // "id": "logging.folders.locations.buckets.views.create", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. The bucket in which to create the view `\"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\"` For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "location": "path", + // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "viewId": { + // "description": "Required. A client-assigned identifier such as \"my-view\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v2/{+parent}/views", + // "request": { + // "$ref": "LogView" + // }, + // "response": { + // "$ref": "LogView" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.folders.locations.buckets.views.delete": + +type FoldersLocationsBucketsViewsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a view on a log bucket. If an UNAVAILABLE error is +// returned, this indicates that system is not in a state where it can +// delete the view. If this occurs, please try again in a few minutes. +// +// - name: The full resource name of the view to delete: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v +// iews/[VIEW_ID]" For +// example:"projects/my-project/locations/global/buckets/my-bucket/view +// s/my-view". +func (r *FoldersLocationsBucketsViewsService) Delete(name string) *FoldersLocationsBucketsViewsDeleteCall { + c := &FoldersLocationsBucketsViewsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.logexclusion = logexclusion - return c -} - -// UpdateMask sets the optional parameter "updateMask": Required. A -// non-empty list of fields to change in the existing exclusion. New -// values for the fields are taken from the corresponding fields in the -// LogExclusion included in this request. Fields not mentioned in -// update_mask are not changed and are ignored in the request.For -// example, to change the filter and description of an exclusion, -// specify an update_mask of "filter,description". -func (c *FoldersExclusionsPatchCall) UpdateMask(updateMask string) *FoldersExclusionsPatchCall { - c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersExclusionsPatchCall) Fields(s ...googleapi.Field) *FoldersExclusionsPatchCall { +func (c *FoldersLocationsBucketsViewsDeleteCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsViewsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -12354,21 +16056,21 @@ func (c *FoldersExclusionsPatchCall) Fields(s ...googleapi.Field) *FoldersExclus // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersExclusionsPatchCall) Context(ctx context.Context) *FoldersExclusionsPatchCall { +func (c *FoldersLocationsBucketsViewsDeleteCall) Context(ctx context.Context) *FoldersLocationsBucketsViewsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersExclusionsPatchCall) Header() http.Header { +func (c *FoldersLocationsBucketsViewsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersExclusionsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -12376,16 +16078,11 @@ func (c *FoldersExclusionsPatchCall) doRequest(alt string) (*http.Response, erro } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -12396,14 +16093,14 @@ func (c *FoldersExclusionsPatchCall) doRequest(alt string) (*http.Response, erro return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.exclusions.patch" call. -// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *LogExclusion.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 *FoldersExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { +// Do executes the "logging.folders.locations.buckets.views.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.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 *FoldersLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12422,7 +16119,7 @@ func (c *FoldersExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclu if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogExclusion{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12434,34 +16131,25 @@ func (c *FoldersExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclu } return ret, nil // { - // "description": "Changes one or more properties of an existing exclusion in the _Default sink.", - // "flatPath": "v2/folders/{foldersId}/exclusions/{exclusionsId}", - // "httpMethod": "PATCH", - // "id": "logging.folders.exclusions.patch", + // "description": "Deletes a view on a log bucket. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", + // "httpMethod": "DELETE", + // "id": "logging.folders.locations.buckets.views.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource name of the exclusion to update: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", + // "description": "Required. The full resource name of the view to delete: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", // "location": "path", - // "pattern": "^folders/[^/]+/exclusions/[^/]+$", + // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "Required. A non-empty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of \"filter,description\".", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, // "path": "v2/{+name}", - // "request": { - // "$ref": "LogExclusion" - // }, // "response": { - // "$ref": "LogExclusion" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -12471,9 +16159,9 @@ func (c *FoldersExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclu } -// method id "logging.folders.locations.get": +// method id "logging.folders.locations.buckets.views.get": -type FoldersLocationsGetCall struct { +type FoldersLocationsBucketsViewsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -12482,11 +16170,15 @@ type FoldersLocationsGetCall struct { header_ http.Header } -// Get: Gets information about a location. +// Get: Gets a view on a log bucket.. // -// - name: Resource name for the location. -func (r *FoldersLocationsService) Get(name string) *FoldersLocationsGetCall { - c := &FoldersLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of the policy: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v +// iews/[VIEW_ID]" For +// example:"projects/my-project/locations/global/buckets/my-bucket/view +// s/my-view". +func (r *FoldersLocationsBucketsViewsService) Get(name string) *FoldersLocationsBucketsViewsGetCall { + c := &FoldersLocationsBucketsViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -12494,7 +16186,7 @@ func (r *FoldersLocationsService) Get(name string) *FoldersLocationsGetCall { // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersLocationsGetCall) Fields(s ...googleapi.Field) *FoldersLocationsGetCall { +func (c *FoldersLocationsBucketsViewsGetCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsViewsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -12504,7 +16196,7 @@ func (c *FoldersLocationsGetCall) Fields(s ...googleapi.Field) *FoldersLocations // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *FoldersLocationsGetCall) IfNoneMatch(entityTag string) *FoldersLocationsGetCall { +func (c *FoldersLocationsBucketsViewsGetCall) IfNoneMatch(entityTag string) *FoldersLocationsBucketsViewsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -12512,21 +16204,21 @@ func (c *FoldersLocationsGetCall) IfNoneMatch(entityTag string) *FoldersLocation // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLocationsGetCall) Context(ctx context.Context) *FoldersLocationsGetCall { +func (c *FoldersLocationsBucketsViewsGetCall) Context(ctx context.Context) *FoldersLocationsBucketsViewsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLocationsGetCall) Header() http.Header { +func (c *FoldersLocationsBucketsViewsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLocationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsBucketsViewsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -12552,14 +16244,14 @@ func (c *FoldersLocationsGetCall) doRequest(alt string) (*http.Response, error) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.locations.get" call. -// Exactly one of *Location or error will be non-nil. Any non-2xx status +// Do executes the "logging.folders.locations.buckets.views.get" call. +// Exactly one of *LogView or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *Location.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 *FoldersLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) { +// *LogView.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 *FoldersLocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogView, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12578,7 +16270,7 @@ func (c *FoldersLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, e if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Location{ + ret := &LogView{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12590,25 +16282,25 @@ func (c *FoldersLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, e } return ret, nil // { - // "description": "Gets information about a location.", - // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}", + // "description": "Gets a view on a log bucket..", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", // "httpMethod": "GET", - // "id": "logging.folders.locations.get", + // "id": "logging.folders.locations.buckets.views.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Resource name for the location.", + // "description": "Required. The resource name of the policy: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", // "location": "path", - // "pattern": "^folders/[^/]+/locations/[^/]+$", + // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v2/{+name}", // "response": { - // "$ref": "Location" + // "$ref": "LogView" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -12620,48 +16312,42 @@ func (c *FoldersLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, e } -// method id "logging.folders.locations.list": +// method id "logging.folders.locations.buckets.views.list": -type FoldersLocationsListCall struct { +type FoldersLocationsBucketsViewsListCall struct { s *Service - name string + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists information about the supported locations for this -// service. +// List: Lists views on a log bucket. // -// - name: The resource that owns the locations collection, if -// applicable. -func (r *FoldersLocationsService) List(name string) *FoldersLocationsListCall { - c := &FoldersLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - return c -} - -// Filter sets the optional parameter "filter": A filter to narrow down -// results to a preferred subset. The filtering language accepts strings -// like "displayName=tokyo", and is documented in more detail in AIP-160 -// (https://google.aip.dev/160). -func (c *FoldersLocationsListCall) Filter(filter string) *FoldersLocationsListCall { - c.urlParams_.Set("filter", filter) +// - parent: The bucket whose views are to be listed: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]". +func (r *FoldersLocationsBucketsViewsService) List(parent string) *FoldersLocationsBucketsViewsListCall { + c := &FoldersLocationsBucketsViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent return c } // PageSize sets the optional parameter "pageSize": The maximum number -// of results to return. If not set, the service selects a default. -func (c *FoldersLocationsListCall) PageSize(pageSize int64) *FoldersLocationsListCall { +// of results to return from this request.Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *FoldersLocationsBucketsViewsListCall) PageSize(pageSize int64) *FoldersLocationsBucketsViewsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } -// PageToken sets the optional parameter "pageToken": A page token -// received from the next_page_token field in the response. Send that -// page token to receive the subsequent page. -func (c *FoldersLocationsListCall) PageToken(pageToken string) *FoldersLocationsListCall { +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *FoldersLocationsBucketsViewsListCall) PageToken(pageToken string) *FoldersLocationsBucketsViewsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -12669,7 +16355,7 @@ func (c *FoldersLocationsListCall) PageToken(pageToken string) *FoldersLocations // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersLocationsListCall) Fields(s ...googleapi.Field) *FoldersLocationsListCall { +func (c *FoldersLocationsBucketsViewsListCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsViewsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -12679,7 +16365,7 @@ func (c *FoldersLocationsListCall) Fields(s ...googleapi.Field) *FoldersLocation // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *FoldersLocationsListCall) IfNoneMatch(entityTag string) *FoldersLocationsListCall { +func (c *FoldersLocationsBucketsViewsListCall) IfNoneMatch(entityTag string) *FoldersLocationsBucketsViewsListCall { c.ifNoneMatch_ = entityTag return c } @@ -12687,21 +16373,21 @@ func (c *FoldersLocationsListCall) IfNoneMatch(entityTag string) *FoldersLocatio // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLocationsListCall) Context(ctx context.Context) *FoldersLocationsListCall { +func (c *FoldersLocationsBucketsViewsListCall) Context(ctx context.Context) *FoldersLocationsBucketsViewsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLocationsListCall) Header() http.Header { +func (c *FoldersLocationsBucketsViewsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLocationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsBucketsViewsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -12714,7 +16400,7 @@ func (c *FoldersLocationsListCall) doRequest(alt string) (*http.Response, error) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -12722,19 +16408,19 @@ func (c *FoldersLocationsListCall) doRequest(alt string) (*http.Response, error) } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.locations.list" call. -// Exactly one of *ListLocationsResponse or error will be non-nil. Any +// Do executes the "logging.folders.locations.buckets.views.list" call. +// Exactly one of *ListViewsResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either -// *ListLocationsResponse.ServerResponse.Header or (if a response was +// *ListViewsResponse.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 *FoldersLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) { +func (c *FoldersLocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) (*ListViewsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12753,7 +16439,7 @@ func (c *FoldersLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocati if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListLocationsResponse{ + ret := &ListViewsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12765,41 +16451,36 @@ func (c *FoldersLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocati } return ret, nil // { - // "description": "Lists information about the supported locations for this service.", - // "flatPath": "v2/folders/{foldersId}/locations", + // "description": "Lists views on a log bucket.", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/views", // "httpMethod": "GET", - // "id": "logging.folders.locations.list", + // "id": "logging.folders.locations.buckets.views.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "filter": { - // "description": "A filter to narrow down results to a preferred subset. The filtering language accepts strings like \"displayName=tokyo\", and is documented in more detail in AIP-160 (https://google.aip.dev/160).", - // "location": "query", - // "type": "string" - // }, - // "name": { - // "description": "The resource that owns the locations collection, if applicable.", - // "location": "path", - // "pattern": "^folders/[^/]+$", - // "required": true, - // "type": "string" - // }, // "pageSize": { - // "description": "The maximum number of results to return. If not set, the service selects a default.", + // "description": "Optional. The maximum number of results to return from this request.Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "A page token received from the next_page_token field in the response. Send that page token to receive the subsequent page.", + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", // "location": "query", // "type": "string" + // }, + // "parent": { + // "description": "Required. The bucket whose views are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", + // "location": "path", + // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "required": true, + // "type": "string" // } // }, - // "path": "v2/{+name}/locations", + // "path": "v2/{+parent}/views", // "response": { - // "$ref": "ListLocationsResponse" + // "$ref": "ListViewsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -12814,7 +16495,7 @@ func (c *FoldersLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocati // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *FoldersLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error { +func (c *FoldersLocationsBucketsViewsListCall) Pages(ctx context.Context, f func(*ListViewsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -12832,44 +16513,51 @@ func (c *FoldersLocationsListCall) Pages(ctx context.Context, f func(*ListLocati } } -// method id "logging.folders.locations.buckets.create": +// method id "logging.folders.locations.buckets.views.patch": -type FoldersLocationsBucketsCreateCall struct { +type FoldersLocationsBucketsViewsPatchCall struct { s *Service - parent string - logbucket *LogBucket + name string + logview *LogView urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Create: Creates a log bucket that can be used to store log entries. -// After a bucket has been created, the bucket's location cannot be -// changed. +// Patch: Updates a view on a log bucket. This method replaces the +// following fields in the existing view with values from the new view: +// filter. If an UNAVAILABLE error is returned, this indicates that +// system is not in a state where it can update the view. If this +// occurs, please try again in a few minutes. // -// - parent: The resource in which to create the log bucket: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For -// example:"projects/my-project/locations/global". -func (r *FoldersLocationsBucketsService) Create(parent string, logbucket *LogBucket) *FoldersLocationsBucketsCreateCall { - c := &FoldersLocationsBucketsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.logbucket = logbucket +// - name: The full resource name of the view to update +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v +// iews/[VIEW_ID]" For +// example:"projects/my-project/locations/global/buckets/my-bucket/view +// s/my-view". +func (r *FoldersLocationsBucketsViewsService) Patch(name string, logview *LogView) *FoldersLocationsBucketsViewsPatchCall { + c := &FoldersLocationsBucketsViewsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.logview = logview return c } -// BucketId sets the optional parameter "bucketId": Required. A -// client-assigned identifier such as "my-bucket". Identifiers are -// limited to 100 characters and can include only letters, digits, -// underscores, hyphens, and periods. -func (c *FoldersLocationsBucketsCreateCall) BucketId(bucketId string) *FoldersLocationsBucketsCreateCall { - c.urlParams_.Set("bucketId", bucketId) +// UpdateMask sets the optional parameter "updateMask": Field mask that +// specifies the fields in view that need an update. A field will be +// overwritten if, and only if, it is in the update mask. name and +// output only fields cannot be updated.For a detailed FieldMask +// definition, see +// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor +// example: updateMask=filter +func (c *FoldersLocationsBucketsViewsPatchCall) UpdateMask(updateMask string) *FoldersLocationsBucketsViewsPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersLocationsBucketsCreateCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsCreateCall { +func (c *FoldersLocationsBucketsViewsPatchCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsViewsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -12877,21 +16565,21 @@ func (c *FoldersLocationsBucketsCreateCall) Fields(s ...googleapi.Field) *Folder // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLocationsBucketsCreateCall) Context(ctx context.Context) *FoldersLocationsBucketsCreateCall { +func (c *FoldersLocationsBucketsViewsPatchCall) Context(ctx context.Context) *FoldersLocationsBucketsViewsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLocationsBucketsCreateCall) Header() http.Header { +func (c *FoldersLocationsBucketsViewsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -12899,34 +16587,34 @@ func (c *FoldersLocationsBucketsCreateCall) doRequest(alt string) (*http.Respons } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.locations.buckets.create" call. -// Exactly one of *LogBucket or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *LogBucket.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 *FoldersLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { +// Do executes the "logging.folders.locations.buckets.views.patch" call. +// Exactly one of *LogView or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogView.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 *FoldersLocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) (*LogView, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12945,7 +16633,7 @@ func (c *FoldersLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*L if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogBucket{ + ret := &LogView{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12957,33 +16645,34 @@ func (c *FoldersLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*L } return ret, nil // { - // "description": "Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed.", - // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets", - // "httpMethod": "POST", - // "id": "logging.folders.locations.buckets.create", + // "description": "Updates a view on a log bucket. This method replaces the following fields in the existing view with values from the new view: filter. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can update the view. If this occurs, please try again in a few minutes.", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", + // "httpMethod": "PATCH", + // "id": "logging.folders.locations.buckets.views.patch", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "bucketId": { - // "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"", + // "name": { + // "description": "Required. The full resource name of the view to update \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", // "location": "path", - // "pattern": "^folders/[^/]+/locations/[^/]+$", + // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "Optional. Field mask that specifies the fields in view that need an update. A field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+parent}/buckets", + // "path": "v2/{+name}", // "request": { - // "$ref": "LogBucket" + // "$ref": "LogView" // }, // "response": { - // "$ref": "LogBucket" + // "$ref": "LogView" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -12993,83 +16682,116 @@ func (c *FoldersLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*L } -// method id "logging.folders.locations.buckets.createAsync": +// method id "logging.folders.locations.buckets.views.logs.list": -type FoldersLocationsBucketsCreateAsyncCall struct { - s *Service - parent string - logbucket *LogBucket - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersLocationsBucketsViewsLogsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// CreateAsync: Creates a log bucket asynchronously that can be used to -// store log entries.After a bucket has been created, the bucket's -// location cannot be changed. +// List: Lists the logs in projects, organizations, folders, or billing +// accounts. Only logs that have entries are listed. // -// - parent: The resource in which to create the log bucket: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For -// example:"projects/my-project/locations/global". -func (r *FoldersLocationsBucketsService) CreateAsync(parent string, logbucket *LogBucket) *FoldersLocationsBucketsCreateAsyncCall { - c := &FoldersLocationsBucketsCreateAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The resource name that owns the logs: projects/[PROJECT_ID] +// organizations/[ORGANIZATION_ID] +// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]. +func (r *FoldersLocationsBucketsViewsLogsService) List(parent string) *FoldersLocationsBucketsViewsLogsListCall { + c := &FoldersLocationsBucketsViewsLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.logbucket = logbucket return c } -// BucketId sets the optional parameter "bucketId": Required. A -// client-assigned identifier such as "my-bucket". Identifiers are -// limited to 100 characters and can include only letters, digits, -// underscores, hyphens, and periods. -func (c *FoldersLocationsBucketsCreateAsyncCall) BucketId(bucketId string) *FoldersLocationsBucketsCreateAsyncCall { - c.urlParams_.Set("bucketId", bucketId) +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request. Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *FoldersLocationsBucketsViewsLogsListCall) PageSize(pageSize int64) *FoldersLocationsBucketsViewsLogsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *FoldersLocationsBucketsViewsLogsListCall) PageToken(pageToken string) *FoldersLocationsBucketsViewsLogsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ResourceNames sets the optional parameter "resourceNames": The +// resource name that owns the logs: +// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/view +// s/[VIEW_ID] +// organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKE +// T_ID]/views/[VIEW_ID] +// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[ +// BUCKET_ID]/views/[VIEW_ID] +// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/ +// [VIEW_ID]To support legacy queries, it could also be: +// projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] +// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID] +func (c *FoldersLocationsBucketsViewsLogsListCall) ResourceNames(resourceNames ...string) *FoldersLocationsBucketsViewsLogsListCall { + c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersLocationsBucketsCreateAsyncCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsCreateAsyncCall { +func (c *FoldersLocationsBucketsViewsLogsListCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsViewsLogsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FoldersLocationsBucketsViewsLogsListCall) IfNoneMatch(entityTag string) *FoldersLocationsBucketsViewsLogsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLocationsBucketsCreateAsyncCall) Context(ctx context.Context) *FoldersLocationsBucketsCreateAsyncCall { +func (c *FoldersLocationsBucketsViewsLogsListCall) Context(ctx context.Context) *FoldersLocationsBucketsViewsLogsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLocationsBucketsCreateAsyncCall) Header() http.Header { +func (c *FoldersLocationsBucketsViewsLogsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLocationsBucketsCreateAsyncCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsBucketsViewsLogsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets:createAsync") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -13080,14 +16802,14 @@ func (c *FoldersLocationsBucketsCreateAsyncCall) doRequest(alt string) (*http.Re return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.locations.buckets.createAsync" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Operation.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 *FoldersLocationsBucketsCreateAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// Do executes the "logging.folders.locations.buckets.views.logs.list" call. +// Exactly one of *ListLogsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListLogsResponse.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 *FoldersLocationsBucketsViewsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13106,7 +16828,7 @@ func (c *FoldersLocationsBucketsCreateAsyncCall) Do(opts ...googleapi.CallOption if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &ListLogsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13118,75 +16840,108 @@ func (c *FoldersLocationsBucketsCreateAsyncCall) Do(opts ...googleapi.CallOption } return ret, nil // { - // "description": "Creates a log bucket asynchronously that can be used to store log entries.After a bucket has been created, the bucket's location cannot be changed.", - // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets:createAsync", - // "httpMethod": "POST", - // "id": "logging.folders.locations.buckets.createAsync", + // "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}/logs", + // "httpMethod": "GET", + // "id": "logging.folders.locations.buckets.views.logs.list", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "bucketId": { - // "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"", + // "description": "Required. The resource name that owns the logs: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", // "location": "path", - // "pattern": "^folders/[^/]+/locations/[^/]+$", + // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", // "required": true, // "type": "string" + // }, + // "resourceNames": { + // "description": "Optional. The resource name that owns the logs: projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]To support legacy queries, it could also be: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", + // "location": "query", + // "repeated": true, + // "type": "string" // } // }, - // "path": "v2/{+parent}/buckets:createAsync", - // "request": { - // "$ref": "LogBucket" - // }, + // "path": "v2/{+parent}/logs", // "response": { - // "$ref": "Operation" + // "$ref": "ListLogsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.folders.locations.buckets.delete": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *FoldersLocationsBucketsViewsLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "logging.folders.locations.operations.cancel": -type FoldersLocationsBucketsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersLocationsOperationsCancelCall struct { + s *Service + name string + canceloperationrequest *CancelOperationRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a log bucket.Changes the bucket's lifecycle_state to -// the DELETE_REQUESTED state. After 7 days, the bucket will be purged -// and all log entries in the bucket will be permanently deleted. +// Cancel: Starts asynchronous cancellation on a long-running operation. +// The server makes a best effort to cancel the operation, but success +// is not guaranteed. If the server doesn't support this method, it +// returns google.rpc.Code.UNIMPLEMENTED. Clients can use +// Operations.GetOperation or other methods to check whether the +// cancellation succeeded or whether the operation completed despite +// cancellation. On successful cancellation, the operation is not +// deleted; instead, it becomes an operation with an Operation.error +// value with a google.rpc.Status.code of 1, corresponding to +// Code.CANCELLED. // -// - name: The full resource name of the bucket to delete. -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *FoldersLocationsBucketsService) Delete(name string) *FoldersLocationsBucketsDeleteCall { - c := &FoldersLocationsBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the operation resource to be cancelled. +func (r *FoldersLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *FoldersLocationsOperationsCancelCall { + c := &FoldersLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.canceloperationrequest = canceloperationrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersLocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsDeleteCall { +func (c *FoldersLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *FoldersLocationsOperationsCancelCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -13194,21 +16949,21 @@ func (c *FoldersLocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *Folder // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLocationsBucketsDeleteCall) Context(ctx context.Context) *FoldersLocationsBucketsDeleteCall { +func (c *FoldersLocationsOperationsCancelCall) Context(ctx context.Context) *FoldersLocationsOperationsCancelCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLocationsBucketsDeleteCall) Header() http.Header { +func (c *FoldersLocationsOperationsCancelCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -13216,11 +16971,16 @@ func (c *FoldersLocationsBucketsDeleteCall) doRequest(alt string) (*http.Respons } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -13231,14 +16991,14 @@ func (c *FoldersLocationsBucketsDeleteCall) doRequest(alt string) (*http.Respons return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.locations.buckets.delete" call. +// Do executes the "logging.folders.locations.operations.cancel" call. // Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *Empty.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 *FoldersLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +func (c *FoldersLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13269,23 +17029,26 @@ func (c *FoldersLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*E } return ret, nil // { - // "description": "Deletes a log bucket.Changes the bucket's lifecycle_state to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted.", - // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}", - // "httpMethod": "DELETE", - // "id": "logging.folders.locations.buckets.delete", + // "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/operations/{operationsId}:cancel", + // "httpMethod": "POST", + // "id": "logging.folders.locations.operations.cancel", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The full resource name of the bucket to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "description": "The name of the operation resource to be cancelled.", // "location": "path", - // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "pattern": "^folders/[^/]+/locations/[^/]+/operations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+name}:cancel", + // "request": { + // "$ref": "CancelOperationRequest" + // }, // "response": { // "$ref": "Empty" // }, @@ -13297,9 +17060,9 @@ func (c *FoldersLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*E } -// method id "logging.folders.locations.buckets.get": +// method id "logging.folders.locations.operations.get": -type FoldersLocationsBucketsGetCall struct { +type FoldersLocationsOperationsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -13308,19 +17071,13 @@ type FoldersLocationsBucketsGetCall struct { header_ http.Header } -// Get: Gets a log bucket. +// Get: Gets the latest state of a long-running operation. Clients can +// use this method to poll the operation result at intervals as +// recommended by the API service. // -// - name: The resource name of the bucket: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *FoldersLocationsBucketsService) Get(name string) *FoldersLocationsBucketsGetCall { - c := &FoldersLocationsBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the operation resource. +func (r *FoldersLocationsOperationsService) Get(name string) *FoldersLocationsOperationsGetCall { + c := &FoldersLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -13328,7 +17085,7 @@ func (r *FoldersLocationsBucketsService) Get(name string) *FoldersLocationsBucke // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersLocationsBucketsGetCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsGetCall { +func (c *FoldersLocationsOperationsGetCall) Fields(s ...googleapi.Field) *FoldersLocationsOperationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -13338,7 +17095,7 @@ func (c *FoldersLocationsBucketsGetCall) Fields(s ...googleapi.Field) *FoldersLo // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *FoldersLocationsBucketsGetCall) IfNoneMatch(entityTag string) *FoldersLocationsBucketsGetCall { +func (c *FoldersLocationsOperationsGetCall) IfNoneMatch(entityTag string) *FoldersLocationsOperationsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -13346,21 +17103,21 @@ func (c *FoldersLocationsBucketsGetCall) IfNoneMatch(entityTag string) *FoldersL // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLocationsBucketsGetCall) Context(ctx context.Context) *FoldersLocationsBucketsGetCall { +func (c *FoldersLocationsOperationsGetCall) Context(ctx context.Context) *FoldersLocationsOperationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLocationsBucketsGetCall) Header() http.Header { +func (c *FoldersLocationsOperationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLocationsBucketsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -13386,14 +17143,14 @@ func (c *FoldersLocationsBucketsGetCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.locations.buckets.get" call. -// Exactly one of *LogBucket or error will be non-nil. Any non-2xx +// Do executes the "logging.folders.locations.operations.get" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either -// *LogBucket.ServerResponse.Header or (if a response was returned at +// *Operation.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 *FoldersLocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { +func (c *FoldersLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13412,7 +17169,7 @@ func (c *FoldersLocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogB if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogBucket{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13424,25 +17181,25 @@ func (c *FoldersLocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogB } return ret, nil // { - // "description": "Gets a log bucket.", - // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}", + // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/operations/{operationsId}", // "httpMethod": "GET", - // "id": "logging.folders.locations.buckets.get", + // "id": "logging.folders.locations.operations.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource name of the bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "description": "The name of the operation resource.", // "location": "path", - // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "pattern": "^folders/[^/]+/locations/[^/]+/operations/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v2/{+name}", // "response": { - // "$ref": "LogBucket" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -13454,47 +17211,52 @@ func (c *FoldersLocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogB } -// method id "logging.folders.locations.buckets.list": +// method id "logging.folders.locations.operations.list": -type FoldersLocationsBucketsListCall struct { +type FoldersLocationsOperationsListCall struct { s *Service - parent string + name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists log buckets. +// List: Lists operations that match the specified filter in the +// request. If the server doesn't support this method, it returns +// UNIMPLEMENTED.NOTE: the name binding allows API services to override +// the binding to use different resource name schemes, such as +// users/*/operations. To override the binding, API services can add a +// binding such as "/v1/{name=users/*}/operations" to their service +// configuration. For backwards compatibility, the default name includes +// the operations collection id, however overriding users must ensure +// the name binding is the parent resource, without the operations +// collection id. // -// - parent: The parent resource whose buckets are to be listed: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" Note: The locations -// portion of the resource must be specified, but supplying the -// character - in place of LOCATION_ID will return all buckets. -func (r *FoldersLocationsBucketsService) List(parent string) *FoldersLocationsBucketsListCall { - c := &FoldersLocationsBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent +// - name: The name of the operation's parent resource. +func (r *FoldersLocationsOperationsService) List(name string) *FoldersLocationsOperationsListCall { + c := &FoldersLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return from this request. Non-positive values are -// ignored. The presence of nextPageToken in the response indicates that -// more results might be available. -func (c *FoldersLocationsBucketsListCall) PageSize(pageSize int64) *FoldersLocationsBucketsListCall { +// Filter sets the optional parameter "filter": The standard list +// filter. +func (c *FoldersLocationsOperationsListCall) Filter(filter string) *FoldersLocationsOperationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The standard list +// page size. +func (c *FoldersLocationsOperationsListCall) PageSize(pageSize int64) *FoldersLocationsOperationsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } -// PageToken sets the optional parameter "pageToken": If present, then -// retrieve the next batch of results from the preceding call to this -// method. pageToken must be the value of nextPageToken from the -// previous response. The values of other method parameters should be -// identical to those in the previous call. -func (c *FoldersLocationsBucketsListCall) PageToken(pageToken string) *FoldersLocationsBucketsListCall { +// PageToken sets the optional parameter "pageToken": The standard list +// page token. +func (c *FoldersLocationsOperationsListCall) PageToken(pageToken string) *FoldersLocationsOperationsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -13502,7 +17264,7 @@ func (c *FoldersLocationsBucketsListCall) PageToken(pageToken string) *FoldersLo // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersLocationsBucketsListCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsListCall { +func (c *FoldersLocationsOperationsListCall) Fields(s ...googleapi.Field) *FoldersLocationsOperationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -13512,7 +17274,7 @@ func (c *FoldersLocationsBucketsListCall) Fields(s ...googleapi.Field) *FoldersL // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *FoldersLocationsBucketsListCall) IfNoneMatch(entityTag string) *FoldersLocationsBucketsListCall { +func (c *FoldersLocationsOperationsListCall) IfNoneMatch(entityTag string) *FoldersLocationsOperationsListCall { c.ifNoneMatch_ = entityTag return c } @@ -13520,21 +17282,21 @@ func (c *FoldersLocationsBucketsListCall) IfNoneMatch(entityTag string) *Folders // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLocationsBucketsListCall) Context(ctx context.Context) *FoldersLocationsBucketsListCall { +func (c *FoldersLocationsOperationsListCall) Context(ctx context.Context) *FoldersLocationsOperationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLocationsBucketsListCall) Header() http.Header { +func (c *FoldersLocationsOperationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLocationsBucketsListCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -13547,7 +17309,7 @@ func (c *FoldersLocationsBucketsListCall) doRequest(alt string) (*http.Response, var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -13555,19 +17317,19 @@ func (c *FoldersLocationsBucketsListCall) doRequest(alt string) (*http.Response, } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.locations.buckets.list" call. -// Exactly one of *ListBucketsResponse or error will be non-nil. Any +// Do executes the "logging.folders.locations.operations.list" call. +// Exactly one of *ListOperationsResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either -// *ListBucketsResponse.ServerResponse.Header or (if a response was +// *ListOperationsResponse.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 *FoldersLocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucketsResponse, error) { +func (c *FoldersLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13586,7 +17348,7 @@ func (c *FoldersLocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*Lis if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListBucketsResponse{ + ret := &ListOperationsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13598,36 +17360,41 @@ func (c *FoldersLocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*Lis } return ret, nil // { - // "description": "Lists log buckets.", - // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets", + // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as \"/v1/{name=users/*}/operations\" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/operations", // "httpMethod": "GET", - // "id": "logging.folders.locations.buckets.list", + // "id": "logging.folders.locations.operations.list", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { + // "filter": { + // "description": "The standard list filter.", + // "location": "query", + // "type": "string" + // }, + // "name": { + // "description": "The name of the operation's parent resource.", + // "location": "path", + // "pattern": "^folders/[^/]+/locations/[^/]+$", + // "required": true, + // "type": "string" + // }, // "pageSize": { - // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "description": "The standard list page size.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "description": "The standard list page token.", // "location": "query", // "type": "string" - // }, - // "parent": { - // "description": "Required. The parent resource whose buckets are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets.", - // "location": "path", - // "pattern": "^folders/[^/]+/locations/[^/]+$", - // "required": true, - // "type": "string" // } // }, - // "path": "v2/{+parent}/buckets", + // "path": "v2/{+name}/operations", // "response": { - // "$ref": "ListBucketsResponse" + // "$ref": "ListOperationsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -13642,7 +17409,7 @@ func (c *FoldersLocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*Lis // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *FoldersLocationsBucketsListCall) Pages(ctx context.Context, f func(*ListBucketsResponse) error) error { +func (c *FoldersLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -13660,53 +17427,40 @@ func (c *FoldersLocationsBucketsListCall) Pages(ctx context.Context, f func(*Lis } } -// method id "logging.folders.locations.buckets.patch": +// method id "logging.folders.logs.delete": -type FoldersLocationsBucketsPatchCall struct { +type FoldersLogsDeleteCall struct { s *Service - name string - logbucket *LogBucket + logName string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Patch: Updates a log bucket.If the bucket has a lifecycle_state of -// DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a -// bucket has been created, the bucket's location cannot be changed. +// Delete: Deletes all the log entries in a log for the _Default Log +// Bucket. The log reappears if it receives new entries. Log entries +// written shortly before the delete operation might not be deleted. +// Entries received after the delete operation with a timestamp before +// the operation will be deleted. // -// - name: The full resource name of the bucket to update. -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *FoldersLocationsBucketsService) Patch(name string, logbucket *LogBucket) *FoldersLocationsBucketsPatchCall { - c := &FoldersLocationsBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.logbucket = logbucket - return c -} - -// UpdateMask sets the optional parameter "updateMask": Required. Field -// mask that specifies the fields in bucket that need an update. A -// bucket field will be overwritten if, and only if, it is in the update -// mask. name and output only fields cannot be updated.For a detailed -// FieldMask definition, see: -// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor -// example: updateMask=retention_days -func (c *FoldersLocationsBucketsPatchCall) UpdateMask(updateMask string) *FoldersLocationsBucketsPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// - logName: The resource name of the log to delete: +// projects/[PROJECT_ID]/logs/[LOG_ID] +// organizations/[ORGANIZATION_ID]/logs/[LOG_ID] +// billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID] +// folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For +// example, "projects/my-project-id/logs/syslog", +// "organizations/123/logs/cloudaudit.googleapis.com%2Factivity".For +// more information about log names, see LogEntry. +func (r *FoldersLogsService) Delete(logName string) *FoldersLogsDeleteCall { + c := &FoldersLogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.logName = logName return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersLocationsBucketsPatchCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsPatchCall { +func (c *FoldersLogsDeleteCall) Fields(s ...googleapi.Field) *FoldersLogsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -13714,21 +17468,21 @@ func (c *FoldersLocationsBucketsPatchCall) Fields(s ...googleapi.Field) *Folders // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLocationsBucketsPatchCall) Context(ctx context.Context) *FoldersLocationsBucketsPatchCall { +func (c *FoldersLogsDeleteCall) Context(ctx context.Context) *FoldersLogsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLocationsBucketsPatchCall) Header() http.Header { +func (c *FoldersLogsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLogsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -13736,34 +17490,29 @@ func (c *FoldersLocationsBucketsPatchCall) doRequest(alt string) (*http.Response } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+logName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "logName": c.logName, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.locations.buckets.patch" call. -// Exactly one of *LogBucket or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *LogBucket.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 *FoldersLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { +// Do executes the "logging.folders.logs.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.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 *FoldersLogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13782,7 +17531,7 @@ func (c *FoldersLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*Lo if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogBucket{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13794,34 +17543,25 @@ func (c *FoldersLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*Lo } return ret, nil // { - // "description": "Updates a log bucket.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.", - // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}", - // "httpMethod": "PATCH", - // "id": "logging.folders.locations.buckets.patch", + // "description": "Deletes all the log entries in a log for the _Default Log Bucket. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted.", + // "flatPath": "v2/folders/{foldersId}/logs/{logsId}", + // "httpMethod": "DELETE", + // "id": "logging.folders.logs.delete", // "parameterOrder": [ - // "name" + // "logName" // ], // "parameters": { - // "name": { - // "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "logName": { + // "description": "Required. The resource name of the log to delete: projects/[PROJECT_ID]/logs/[LOG_ID] organizations/[ORGANIZATION_ID]/logs/[LOG_ID] billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID] folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/123/logs/cloudaudit.googleapis.com%2Factivity\".For more information about log names, see LogEntry.", // "location": "path", - // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "pattern": "^folders/[^/]+/logs/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=retention_days", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+name}", - // "request": { - // "$ref": "LogBucket" - // }, + // "path": "v2/{+logName}", // "response": { - // "$ref": "LogBucket" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -13831,97 +17571,134 @@ func (c *FoldersLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*Lo } -// method id "logging.folders.locations.buckets.undelete": +// method id "logging.folders.logs.list": -type FoldersLocationsBucketsUndeleteCall struct { - s *Service - name string - undeletebucketrequest *UndeleteBucketRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersLogsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Undelete: Undeletes a log bucket. A bucket that has been deleted can -// be undeleted within the grace period of 7 days. +// List: Lists the logs in projects, organizations, folders, or billing +// accounts. Only logs that have entries are listed. // -// - name: The full resource name of the bucket to undelete. -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *FoldersLocationsBucketsService) Undelete(name string, undeletebucketrequest *UndeleteBucketRequest) *FoldersLocationsBucketsUndeleteCall { - c := &FoldersLocationsBucketsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.undeletebucketrequest = undeletebucketrequest +// - parent: The resource name that owns the logs: projects/[PROJECT_ID] +// organizations/[ORGANIZATION_ID] +// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]. +func (r *FoldersLogsService) List(parent string) *FoldersLogsListCall { + c := &FoldersLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request. Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *FoldersLogsListCall) PageSize(pageSize int64) *FoldersLogsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *FoldersLogsListCall) PageToken(pageToken string) *FoldersLogsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ResourceNames sets the optional parameter "resourceNames": The +// resource name that owns the logs: +// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/view +// s/[VIEW_ID] +// organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKE +// T_ID]/views/[VIEW_ID] +// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[ +// BUCKET_ID]/views/[VIEW_ID] +// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/ +// [VIEW_ID]To support legacy queries, it could also be: +// projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] +// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID] +func (c *FoldersLogsListCall) ResourceNames(resourceNames ...string) *FoldersLogsListCall { + c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersLocationsBucketsUndeleteCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsUndeleteCall { +func (c *FoldersLogsListCall) Fields(s ...googleapi.Field) *FoldersLogsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FoldersLogsListCall) IfNoneMatch(entityTag string) *FoldersLogsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLocationsBucketsUndeleteCall) Context(ctx context.Context) *FoldersLocationsBucketsUndeleteCall { +func (c *FoldersLogsListCall) Context(ctx context.Context) *FoldersLogsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLocationsBucketsUndeleteCall) Header() http.Header { +func (c *FoldersLogsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLogsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:undelete") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + 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, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.locations.buckets.undelete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.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 *FoldersLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "logging.folders.logs.list" call. +// Exactly one of *ListLogsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListLogsResponse.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 *FoldersLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13940,7 +17717,7 @@ func (c *FoldersLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) ( if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &ListLogsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13952,85 +17729,123 @@ func (c *FoldersLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) ( } return ret, nil // { - // "description": "Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period of 7 days.", - // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}:undelete", - // "httpMethod": "POST", - // "id": "logging.folders.locations.buckets.undelete", + // "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", + // "flatPath": "v2/folders/{foldersId}/logs", + // "httpMethod": "GET", + // "id": "logging.folders.logs.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The full resource name of the bucket to undelete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The resource name that owns the logs: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", // "location": "path", - // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "pattern": "^folders/[^/]+$", // "required": true, // "type": "string" + // }, + // "resourceNames": { + // "description": "Optional. The resource name that owns the logs: projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]To support legacy queries, it could also be: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", + // "location": "query", + // "repeated": true, + // "type": "string" // } // }, - // "path": "v2/{+name}:undelete", - // "request": { - // "$ref": "UndeleteBucketRequest" - // }, + // "path": "v2/{+parent}/logs", // "response": { - // "$ref": "Empty" + // "$ref": "ListLogsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.folders.locations.buckets.updateAsync": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *FoldersLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type FoldersLocationsBucketsUpdateAsyncCall struct { +// method id "logging.folders.sinks.create": + +type FoldersSinksCreateCall struct { s *Service - name string - logbucket *LogBucket + parent string + logsink *LogSink urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// UpdateAsync: Updates a log bucket asynchronously.If the bucket has a -// lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be -// returned.After a bucket has been created, the bucket's location -// cannot be changed. +// Create: Creates a sink that exports specified log entries to a +// destination. The export of newly-ingested log entries begins +// immediately, unless the sink's writer_identity is not permitted to +// write to the destination. A sink can export log entries only from the +// resource owning the sink. // -// - name: The full resource name of the bucket to update. -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *FoldersLocationsBucketsService) UpdateAsync(name string, logbucket *LogBucket) *FoldersLocationsBucketsUpdateAsyncCall { - c := &FoldersLocationsBucketsUpdateAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.logbucket = logbucket +// - parent: The resource in which to create the sink: +// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For +// examples:"projects/my-project" "organizations/123456789". +func (r *FoldersSinksService) Create(parent string, logsink *LogSink) *FoldersSinksCreateCall { + c := &FoldersSinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.logsink = logsink return c } -// UpdateMask sets the optional parameter "updateMask": Required. Field -// mask that specifies the fields in bucket that need an update. A -// bucket field will be overwritten if, and only if, it is in the update -// mask. name and output only fields cannot be updated.For a detailed -// FieldMask definition, see: -// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor -// example: updateMask=retention_days -func (c *FoldersLocationsBucketsUpdateAsyncCall) UpdateMask(updateMask string) *FoldersLocationsBucketsUpdateAsyncCall { - c.urlParams_.Set("updateMask", updateMask) +// UniqueWriterIdentity sets the optional parameter +// "uniqueWriterIdentity": Determines the kind of IAM identity returned +// as writer_identity in the new sink. If this value is omitted or set +// to false, and if the sink's parent is a project, then the value +// returned as writer_identity is the same group or service account used +// by Cloud Logging before the addition of writer identities to this +// API. The sink's destination must be in the same project as the sink +// itself.If this field is set to true, or if the sink is owned by a +// non-project resource such as an organization, then the value of +// writer_identity will be a unique service account used only for +// exports from the new sink. For more information, see writer_identity +// in LogSink. +func (c *FoldersSinksCreateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *FoldersSinksCreateCall { + c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersLocationsBucketsUpdateAsyncCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsUpdateAsyncCall { +func (c *FoldersSinksCreateCall) Fields(s ...googleapi.Field) *FoldersSinksCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -14038,21 +17853,21 @@ func (c *FoldersLocationsBucketsUpdateAsyncCall) Fields(s ...googleapi.Field) *F // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLocationsBucketsUpdateAsyncCall) Context(ctx context.Context) *FoldersLocationsBucketsUpdateAsyncCall { +func (c *FoldersSinksCreateCall) Context(ctx context.Context) *FoldersSinksCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLocationsBucketsUpdateAsyncCall) Header() http.Header { +func (c *FoldersSinksCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLocationsBucketsUpdateAsyncCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -14060,14 +17875,14 @@ func (c *FoldersLocationsBucketsUpdateAsyncCall) doRequest(alt string) (*http.Re } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:updateAsync") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -14075,19 +17890,19 @@ func (c *FoldersLocationsBucketsUpdateAsyncCall) doRequest(alt string) (*http.Re } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.locations.buckets.updateAsync" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Operation.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 *FoldersLocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// Do executes the "logging.folders.sinks.create" call. +// Exactly one of *LogSink or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogSink.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 *FoldersSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14106,7 +17921,7 @@ func (c *FoldersLocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.CallOption if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &LogSink{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14118,34 +17933,33 @@ func (c *FoldersLocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.CallOption } return ret, nil // { - // "description": "Updates a log bucket asynchronously.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.", - // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}:updateAsync", + // "description": "Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.", + // "flatPath": "v2/folders/{foldersId}/sinks", // "httpMethod": "POST", - // "id": "logging.folders.locations.buckets.updateAsync", + // "id": "logging.folders.sinks.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "parent": { + // "description": "Required. The resource in which to create the sink: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-project\" \"organizations/123456789\"", // "location": "path", - // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "pattern": "^folders/[^/]+$", // "required": true, // "type": "string" // }, - // "updateMask": { - // "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=retention_days", - // "format": "google-fieldmask", + // "uniqueWriterIdentity": { + // "description": "Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Cloud Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink.", // "location": "query", - // "type": "string" + // "type": "boolean" // } // }, - // "path": "v2/{+name}:updateAsync", + // "path": "v2/{+parent}/sinks", // "request": { - // "$ref": "LogBucket" + // "$ref": "LogSink" // }, // "response": { - // "$ref": "Operation" + // "$ref": "LogSink" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -14155,44 +17969,36 @@ func (c *FoldersLocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.CallOption } -// method id "logging.folders.locations.buckets.views.create": +// method id "logging.folders.sinks.delete": -type FoldersLocationsBucketsViewsCreateCall struct { +type FoldersSinksDeleteCall struct { s *Service - parent string - logview *LogView + sinkNameid string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Create: Creates a view over log entries in a log bucket. A bucket may -// contain a maximum of 30 views. +// Delete: Deletes a sink. If the sink has a unique writer_identity, +// then that service account is also deleted. // -// - parent: The bucket in which to create the view -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// ` For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *FoldersLocationsBucketsViewsService) Create(parent string, logview *LogView) *FoldersLocationsBucketsViewsCreateCall { - c := &FoldersLocationsBucketsViewsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.logview = logview - return c -} - -// ViewId sets the optional parameter "viewId": Required. A -// client-assigned identifier such as "my-view". Identifiers are limited -// to 100 characters and can include only letters, digits, underscores, -// hyphens, and periods. -func (c *FoldersLocationsBucketsViewsCreateCall) ViewId(viewId string) *FoldersLocationsBucketsViewsCreateCall { - c.urlParams_.Set("viewId", viewId) +// - sinkName: The full resource name of the sink to delete, including +// the parent resource and the sink identifier: +// "projects/[PROJECT_ID]/sinks/[SINK_ID]" +// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" +// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For +// example:"projects/my-project/sinks/my-sink". +func (r *FoldersSinksService) Delete(sinkNameid string) *FoldersSinksDeleteCall { + c := &FoldersSinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.sinkNameid = sinkNameid return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersLocationsBucketsViewsCreateCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsViewsCreateCall { +func (c *FoldersSinksDeleteCall) Fields(s ...googleapi.Field) *FoldersSinksDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -14200,21 +18006,21 @@ func (c *FoldersLocationsBucketsViewsCreateCall) Fields(s ...googleapi.Field) *F // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLocationsBucketsViewsCreateCall) Context(ctx context.Context) *FoldersLocationsBucketsViewsCreateCall { +func (c *FoldersSinksDeleteCall) Context(ctx context.Context) *FoldersSinksDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLocationsBucketsViewsCreateCall) Header() http.Header { +func (c *FoldersSinksDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -14222,34 +18028,29 @@ func (c *FoldersLocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Re } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "sinkName": c.sinkNameid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.locations.buckets.views.create" call. -// Exactly one of *LogView or error will be non-nil. Any non-2xx status +// Do executes the "logging.folders.sinks.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *LogView.ServerResponse.Header or (if a response was returned at all) +// *Empty.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 *FoldersLocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption) (*LogView, error) { +func (c *FoldersSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14268,7 +18069,7 @@ func (c *FoldersLocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogView{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14280,33 +18081,25 @@ func (c *FoldersLocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption } return ret, nil // { - // "description": "Creates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.", - // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/views", - // "httpMethod": "POST", - // "id": "logging.folders.locations.buckets.views.create", + // "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.", + // "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}", + // "httpMethod": "DELETE", + // "id": "logging.folders.sinks.delete", // "parameterOrder": [ - // "parent" + // "sinkName" // ], - // "parameters": { - // "parent": { - // "description": "Required. The bucket in which to create the view `\"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\"` For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "parameters": { + // "sinkName": { + // "description": "Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", // "location": "path", - // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "pattern": "^folders/[^/]+/sinks/[^/]+$", // "required": true, // "type": "string" - // }, - // "viewId": { - // "description": "Required. A client-assigned identifier such as \"my-view\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+parent}/views", - // "request": { - // "$ref": "LogView" - // }, + // "path": "v2/{+sinkName}", // "response": { - // "$ref": "LogView" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -14316,87 +18109,100 @@ func (c *FoldersLocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption } -// method id "logging.folders.locations.buckets.views.delete": +// method id "logging.folders.sinks.get": -type FoldersLocationsBucketsViewsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersSinksGetCall struct { + s *Service + sinkName string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a view on a log bucket. If an UNAVAILABLE error is -// returned, this indicates that system is not in a state where it can -// delete the view. If this occurs, please try again in a few minutes. +// Get: Gets a sink. // -// - name: The full resource name of the view to delete: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v -// iews/[VIEW_ID]" For -// example:"projects/my-project/locations/global/buckets/my-bucket/view -// s/my-view". -func (r *FoldersLocationsBucketsViewsService) Delete(name string) *FoldersLocationsBucketsViewsDeleteCall { - c := &FoldersLocationsBucketsViewsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - sinkName: The resource name of the sink: +// "projects/[PROJECT_ID]/sinks/[SINK_ID]" +// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" +// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For +// example:"projects/my-project/sinks/my-sink". +func (r *FoldersSinksService) Get(sinkName string) *FoldersSinksGetCall { + c := &FoldersSinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.sinkName = sinkName return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersLocationsBucketsViewsDeleteCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsViewsDeleteCall { +func (c *FoldersSinksGetCall) Fields(s ...googleapi.Field) *FoldersSinksGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FoldersSinksGetCall) IfNoneMatch(entityTag string) *FoldersSinksGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLocationsBucketsViewsDeleteCall) Context(ctx context.Context) *FoldersLocationsBucketsViewsDeleteCall { +func (c *FoldersSinksGetCall) Context(ctx context.Context) *FoldersSinksGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLocationsBucketsViewsDeleteCall) Header() http.Header { +func (c *FoldersSinksGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSinksGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + 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, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + 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, + "sinkName": c.sinkName, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.locations.buckets.views.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// Do executes the "logging.folders.sinks.get" call. +// Exactly one of *LogSink or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) +// *LogSink.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 *FoldersLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +func (c *FoldersSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14415,7 +18221,7 @@ func (c *FoldersLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &LogSink{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14427,62 +18233,81 @@ func (c *FoldersLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption } return ret, nil // { - // "description": "Deletes a view on a log bucket. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.", - // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", - // "httpMethod": "DELETE", - // "id": "logging.folders.locations.buckets.views.delete", + // "description": "Gets a sink.", + // "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}", + // "httpMethod": "GET", + // "id": "logging.folders.sinks.get", // "parameterOrder": [ - // "name" + // "sinkName" // ], // "parameters": { - // "name": { - // "description": "Required. The full resource name of the view to delete: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", + // "sinkName": { + // "description": "Required. The resource name of the sink: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", // "location": "path", - // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", + // "pattern": "^folders/[^/]+/sinks/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+sinkName}", // "response": { - // "$ref": "Empty" + // "$ref": "LogSink" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.folders.locations.buckets.views.get": +// method id "logging.folders.sinks.list": -type FoldersLocationsBucketsViewsGetCall struct { +type FoldersSinksListCall struct { s *Service - name string + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Gets a view on a log bucket.. +// List: Lists sinks. // -// - name: The resource name of the policy: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v -// iews/[VIEW_ID]" For -// example:"projects/my-project/locations/global/buckets/my-bucket/view -// s/my-view". -func (r *FoldersLocationsBucketsViewsService) Get(name string) *FoldersLocationsBucketsViewsGetCall { - c := &FoldersLocationsBucketsViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: The parent resource whose sinks are to be listed: +// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]". +func (r *FoldersSinksService) List(parent string) *FoldersSinksListCall { + c := &FoldersSinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request. Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *FoldersSinksListCall) PageSize(pageSize int64) *FoldersSinksListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *FoldersSinksListCall) PageToken(pageToken string) *FoldersSinksListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersLocationsBucketsViewsGetCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsViewsGetCall { +func (c *FoldersSinksListCall) Fields(s ...googleapi.Field) *FoldersSinksListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -14492,7 +18317,7 @@ func (c *FoldersLocationsBucketsViewsGetCall) Fields(s ...googleapi.Field) *Fold // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *FoldersLocationsBucketsViewsGetCall) IfNoneMatch(entityTag string) *FoldersLocationsBucketsViewsGetCall { +func (c *FoldersSinksListCall) IfNoneMatch(entityTag string) *FoldersSinksListCall { c.ifNoneMatch_ = entityTag return c } @@ -14500,21 +18325,21 @@ func (c *FoldersLocationsBucketsViewsGetCall) IfNoneMatch(entityTag string) *Fol // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLocationsBucketsViewsGetCall) Context(ctx context.Context) *FoldersLocationsBucketsViewsGetCall { +func (c *FoldersSinksListCall) Context(ctx context.Context) *FoldersSinksListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLocationsBucketsViewsGetCall) Header() http.Header { +func (c *FoldersSinksListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLocationsBucketsViewsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSinksListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -14527,7 +18352,7 @@ func (c *FoldersLocationsBucketsViewsGetCall) doRequest(alt string) (*http.Respo var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -14535,19 +18360,19 @@ func (c *FoldersLocationsBucketsViewsGetCall) doRequest(alt string) (*http.Respo } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.locations.buckets.views.get" call. -// Exactly one of *LogView or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *LogView.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 *FoldersLocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogView, error) { +// Do executes the "logging.folders.sinks.list" call. +// Exactly one of *ListSinksResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListSinksResponse.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 *FoldersSinksListCall) Do(opts ...googleapi.CallOption) (*ListSinksResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14566,7 +18391,7 @@ func (c *FoldersLocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) ( if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogView{ + ret := &ListSinksResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14578,25 +18403,36 @@ func (c *FoldersLocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) ( } return ret, nil // { - // "description": "Gets a view on a log bucket..", - // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", + // "description": "Lists sinks.", + // "flatPath": "v2/folders/{foldersId}/sinks", // "httpMethod": "GET", - // "id": "logging.folders.locations.buckets.views.get", + // "id": "logging.folders.sinks.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The resource name of the policy: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent resource whose sinks are to be listed: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ", // "location": "path", - // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", + // "pattern": "^folders/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+parent}/sinks", // "response": { - // "$ref": "LogView" + // "$ref": "ListSinksResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -14608,115 +18444,148 @@ func (c *FoldersLocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) ( } -// method id "logging.folders.locations.buckets.views.list": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *FoldersSinksListCall) Pages(ctx context.Context, f func(*ListSinksResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type FoldersLocationsBucketsViewsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// method id "logging.folders.sinks.patch": + +type FoldersSinksPatchCall struct { + s *Service + sinkNameid string + logsink *LogSink + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists views on a log bucket. +// Patch: Updates a sink. This method replaces the following fields in +// the existing sink with values from the new sink: destination, and +// filter.The updated sink might also have a new writer_identity; see +// the unique_writer_identity field. // -// - parent: The bucket whose views are to be listed: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]". -func (r *FoldersLocationsBucketsViewsService) List(parent string) *FoldersLocationsBucketsViewsListCall { - c := &FoldersLocationsBucketsViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent +// - sinkName: The full resource name of the sink to update, including +// the parent resource and the sink identifier: +// "projects/[PROJECT_ID]/sinks/[SINK_ID]" +// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" +// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For +// example:"projects/my-project/sinks/my-sink". +func (r *FoldersSinksService) Patch(sinkNameid string, logsink *LogSink) *FoldersSinksPatchCall { + c := &FoldersSinksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.sinkNameid = sinkNameid + c.logsink = logsink return c } -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return from this request.Non-positive values are -// ignored. The presence of nextPageToken in the response indicates that -// more results might be available. -func (c *FoldersLocationsBucketsViewsListCall) PageSize(pageSize int64) *FoldersLocationsBucketsViewsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) +// UniqueWriterIdentity sets the optional parameter +// "uniqueWriterIdentity": See sinks.create for a description of this +// field. When updating a sink, the effect of this field on the value of +// writer_identity in the updated sink depends on both the old and new +// values of this field: If the old and new values of this field are +// both false or both true, then there is no change to the sink's +// writer_identity. If the old value is false and the new value is true, +// then writer_identity is changed to a unique service account. It is an +// error if the old value is true and the new value is set to false or +// defaulted to false. +func (c *FoldersSinksPatchCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *FoldersSinksPatchCall { + c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity)) return c } -// PageToken sets the optional parameter "pageToken": If present, then -// retrieve the next batch of results from the preceding call to this -// method. pageToken must be the value of nextPageToken from the -// previous response. The values of other method parameters should be -// identical to those in the previous call. -func (c *FoldersLocationsBucketsViewsListCall) PageToken(pageToken string) *FoldersLocationsBucketsViewsListCall { - c.urlParams_.Set("pageToken", pageToken) +// UpdateMask sets the optional parameter "updateMask": Field mask that +// specifies the fields in sink that need an update. A sink field will +// be overwritten if, and only if, it is in the update mask. name and +// output only fields cannot be updated.An empty updateMask is +// temporarily treated as using the following mask for backwards +// compatibility purposes:destination,filter,includeChildrenAt some +// point in the future, behavior will be removed and specifying an empty +// updateMask will be an error.For a detailed FieldMask definition, see +// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor +// example: updateMask=filter +func (c *FoldersSinksPatchCall) UpdateMask(updateMask string) *FoldersSinksPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersLocationsBucketsViewsListCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsViewsListCall { +func (c *FoldersSinksPatchCall) Fields(s ...googleapi.Field) *FoldersSinksPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *FoldersLocationsBucketsViewsListCall) IfNoneMatch(entityTag string) *FoldersLocationsBucketsViewsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLocationsBucketsViewsListCall) Context(ctx context.Context) *FoldersLocationsBucketsViewsListCall { +func (c *FoldersSinksPatchCall) Context(ctx context.Context) *FoldersSinksPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLocationsBucketsViewsListCall) Header() http.Header { +func (c *FoldersSinksPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLocationsBucketsViewsListCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSinksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "sinkName": c.sinkNameid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.locations.buckets.views.list" call. -// Exactly one of *ListViewsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListViewsResponse.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 *FoldersLocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) (*ListViewsResponse, error) { +// Do executes the "logging.folders.sinks.patch" call. +// Exactly one of *LogSink or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogSink.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 *FoldersSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14735,7 +18604,7 @@ func (c *FoldersLocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListViewsResponse{ + ret := &LogSink{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14747,105 +18616,104 @@ func (c *FoldersLocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Lists views on a log bucket.", - // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/views", - // "httpMethod": "GET", - // "id": "logging.folders.locations.buckets.views.list", + // "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field.", + // "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}", + // "httpMethod": "PATCH", + // "id": "logging.folders.sinks.patch", // "parameterOrder": [ - // "parent" + // "sinkName" // ], // "parameters": { - // "pageSize": { - // "description": "Optional. The maximum number of results to return from this request.Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - // "format": "int32", - // "location": "query", - // "type": "integer" + // "sinkName": { + // "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", + // "location": "path", + // "pattern": "^folders/[^/]+/sinks/[^/]+$", + // "required": true, + // "type": "string" // }, - // "pageToken": { - // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "uniqueWriterIdentity": { + // "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a unique service account. It is an error if the old value is true and the new value is set to false or defaulted to false.", // "location": "query", - // "type": "string" + // "type": "boolean" // }, - // "parent": { - // "description": "Required. The bucket whose views are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", - // "location": "path", - // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$", - // "required": true, + // "updateMask": { + // "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes:destination,filter,includeChildrenAt some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", + // "format": "google-fieldmask", + // "location": "query", // "type": "string" // } // }, - // "path": "v2/{+parent}/views", + // "path": "v2/{+sinkName}", + // "request": { + // "$ref": "LogSink" + // }, // "response": { - // "$ref": "ListViewsResponse" + // "$ref": "LogSink" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *FoldersLocationsBucketsViewsListCall) Pages(ctx context.Context, f func(*ListViewsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "logging.folders.locations.buckets.views.patch": +// method id "logging.folders.sinks.update": -type FoldersLocationsBucketsViewsPatchCall struct { +type FoldersSinksUpdateCall struct { s *Service - name string - logview *LogView + sinkNameid string + logsink *LogSink urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Patch: Updates a view on a log bucket. This method replaces the -// following fields in the existing view with values from the new view: -// filter. If an UNAVAILABLE error is returned, this indicates that -// system is not in a state where it can update the view. If this -// occurs, please try again in a few minutes. +// Update: Updates a sink. This method replaces the following fields in +// the existing sink with values from the new sink: destination, and +// filter.The updated sink might also have a new writer_identity; see +// the unique_writer_identity field. // -// - name: The full resource name of the view to update -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v -// iews/[VIEW_ID]" For -// example:"projects/my-project/locations/global/buckets/my-bucket/view -// s/my-view". -func (r *FoldersLocationsBucketsViewsService) Patch(name string, logview *LogView) *FoldersLocationsBucketsViewsPatchCall { - c := &FoldersLocationsBucketsViewsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.logview = logview +// - sinkName: The full resource name of the sink to update, including +// the parent resource and the sink identifier: +// "projects/[PROJECT_ID]/sinks/[SINK_ID]" +// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" +// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For +// example:"projects/my-project/sinks/my-sink". +func (r *FoldersSinksService) Update(sinkNameid string, logsink *LogSink) *FoldersSinksUpdateCall { + c := &FoldersSinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.sinkNameid = sinkNameid + c.logsink = logsink + return c +} + +// UniqueWriterIdentity sets the optional parameter +// "uniqueWriterIdentity": See sinks.create for a description of this +// field. When updating a sink, the effect of this field on the value of +// writer_identity in the updated sink depends on both the old and new +// values of this field: If the old and new values of this field are +// both false or both true, then there is no change to the sink's +// writer_identity. If the old value is false and the new value is true, +// then writer_identity is changed to a unique service account. It is an +// error if the old value is true and the new value is set to false or +// defaulted to false. +func (c *FoldersSinksUpdateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *FoldersSinksUpdateCall { + c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity)) return c } // UpdateMask sets the optional parameter "updateMask": Field mask that -// specifies the fields in view that need an update. A field will be -// overwritten if, and only if, it is in the update mask. name and -// output only fields cannot be updated.For a detailed FieldMask -// definition, see +// specifies the fields in sink that need an update. A sink field will +// be overwritten if, and only if, it is in the update mask. name and +// output only fields cannot be updated.An empty updateMask is +// temporarily treated as using the following mask for backwards +// compatibility purposes:destination,filter,includeChildrenAt some +// point in the future, behavior will be removed and specifying an empty +// updateMask will be an error.For a detailed FieldMask definition, see // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor // example: updateMask=filter -func (c *FoldersLocationsBucketsViewsPatchCall) UpdateMask(updateMask string) *FoldersLocationsBucketsViewsPatchCall { +func (c *FoldersSinksUpdateCall) UpdateMask(updateMask string) *FoldersSinksUpdateCall { c.urlParams_.Set("updateMask", updateMask) return c } @@ -14853,7 +18721,7 @@ func (c *FoldersLocationsBucketsViewsPatchCall) UpdateMask(updateMask string) *F // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersLocationsBucketsViewsPatchCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsViewsPatchCall { +func (c *FoldersSinksUpdateCall) Fields(s ...googleapi.Field) *FoldersSinksUpdateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -14861,21 +18729,21 @@ func (c *FoldersLocationsBucketsViewsPatchCall) Fields(s ...googleapi.Field) *Fo // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLocationsBucketsViewsPatchCall) Context(ctx context.Context) *FoldersLocationsBucketsViewsPatchCall { +func (c *FoldersSinksUpdateCall) Context(ctx context.Context) *FoldersSinksUpdateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLocationsBucketsViewsPatchCall) Header() http.Header { +func (c *FoldersSinksUpdateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSinksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -14883,34 +18751,34 @@ func (c *FoldersLocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Res } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("PUT", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "sinkName": c.sinkNameid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.locations.buckets.views.patch" call. -// Exactly one of *LogView or error will be non-nil. Any non-2xx status +// Do executes the "logging.folders.sinks.update" call. +// Exactly one of *LogSink or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *LogView.ServerResponse.Header or (if a response was returned at all) +// *LogSink.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 *FoldersLocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) (*LogView, error) { +func (c *FoldersSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14929,7 +18797,7 @@ func (c *FoldersLocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogView{ + ret := &LogSink{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14941,34 +18809,39 @@ func (c *FoldersLocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Updates a view on a log bucket. This method replaces the following fields in the existing view with values from the new view: filter. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can update the view. If this occurs, please try again in a few minutes.", - // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", - // "httpMethod": "PATCH", - // "id": "logging.folders.locations.buckets.views.patch", + // "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field.", + // "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}", + // "httpMethod": "PUT", + // "id": "logging.folders.sinks.update", // "parameterOrder": [ - // "name" + // "sinkName" // ], // "parameters": { - // "name": { - // "description": "Required. The full resource name of the view to update \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", + // "sinkName": { + // "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", // "location": "path", - // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", + // "pattern": "^folders/[^/]+/sinks/[^/]+$", // "required": true, // "type": "string" // }, + // "uniqueWriterIdentity": { + // "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a unique service account. It is an error if the old value is true and the new value is set to false or defaulted to false.", + // "location": "query", + // "type": "boolean" + // }, // "updateMask": { - // "description": "Optional. Field mask that specifies the fields in view that need an update. A field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", + // "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes:destination,filter,includeChildrenAt some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", // "format": "google-fieldmask", // "location": "query", // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+sinkName}", // "request": { - // "$ref": "LogView" + // "$ref": "LogSink" // }, // "response": { - // "$ref": "LogView" + // "$ref": "LogSink" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -14978,69 +18851,30 @@ func (c *FoldersLocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) } -// method id "logging.folders.locations.buckets.views.logs.list": +// method id "logging.locations.get": -type FoldersLocationsBucketsViewsLogsListCall struct { +type LocationsGetCall struct { s *Service - parent string + name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists the logs in projects, organizations, folders, or billing -// accounts. Only logs that have entries are listed. +// Get: Gets information about a location. // -// - parent: The resource name that owns the logs: projects/[PROJECT_ID] -// organizations/[ORGANIZATION_ID] -// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]. -func (r *FoldersLocationsBucketsViewsLogsService) List(parent string) *FoldersLocationsBucketsViewsLogsListCall { - c := &FoldersLocationsBucketsViewsLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return from this request. Non-positive values are -// ignored. The presence of nextPageToken in the response indicates that -// more results might be available. -func (c *FoldersLocationsBucketsViewsLogsListCall) PageSize(pageSize int64) *FoldersLocationsBucketsViewsLogsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": If present, then -// retrieve the next batch of results from the preceding call to this -// method. pageToken must be the value of nextPageToken from the -// previous response. The values of other method parameters should be -// identical to those in the previous call. -func (c *FoldersLocationsBucketsViewsLogsListCall) PageToken(pageToken string) *FoldersLocationsBucketsViewsLogsListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// ResourceNames sets the optional parameter "resourceNames": The -// resource name that owns the logs: -// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/view -// s/[VIEW_ID] -// organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKE -// T_ID]/views/[VIEW_ID] -// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[ -// BUCKET_ID]/views/[VIEW_ID] -// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/ -// [VIEW_ID]To support legacy queries, it could also be: -// projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] -// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID] -func (c *FoldersLocationsBucketsViewsLogsListCall) ResourceNames(resourceNames ...string) *FoldersLocationsBucketsViewsLogsListCall { - c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...)) +// - name: Resource name for the location. +func (r *LocationsService) Get(name string) *LocationsGetCall { + c := &LocationsGetCall{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 information. -func (c *FoldersLocationsBucketsViewsLogsListCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsViewsLogsListCall { +func (c *LocationsGetCall) Fields(s ...googleapi.Field) *LocationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -15050,7 +18884,7 @@ func (c *FoldersLocationsBucketsViewsLogsListCall) Fields(s ...googleapi.Field) // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *FoldersLocationsBucketsViewsLogsListCall) IfNoneMatch(entityTag string) *FoldersLocationsBucketsViewsLogsListCall { +func (c *LocationsGetCall) IfNoneMatch(entityTag string) *LocationsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -15058,21 +18892,21 @@ func (c *FoldersLocationsBucketsViewsLogsListCall) IfNoneMatch(entityTag string) // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLocationsBucketsViewsLogsListCall) Context(ctx context.Context) *FoldersLocationsBucketsViewsLogsListCall { +func (c *LocationsGetCall) Context(ctx context.Context) *LocationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLocationsBucketsViewsLogsListCall) Header() http.Header { +func (c *LocationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLocationsBucketsViewsLogsListCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -15085,7 +18919,7 @@ func (c *FoldersLocationsBucketsViewsLogsListCall) doRequest(alt string) (*http. var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -15093,19 +18927,19 @@ func (c *FoldersLocationsBucketsViewsLogsListCall) doRequest(alt string) (*http. } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.locations.buckets.views.logs.list" call. -// Exactly one of *ListLogsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListLogsResponse.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 *FoldersLocationsBucketsViewsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) { +// Do executes the "logging.locations.get" call. +// Exactly one of *Location or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Location.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 *LocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15124,7 +18958,7 @@ func (c *FoldersLocationsBucketsViewsLogsListCall) Do(opts ...googleapi.CallOpti if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListLogsResponse{ + ret := &Location{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -15136,42 +18970,25 @@ func (c *FoldersLocationsBucketsViewsLogsListCall) Do(opts ...googleapi.CallOpti } return ret, nil // { - // "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", - // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}/logs", + // "description": "Gets information about a location.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}", // "httpMethod": "GET", - // "id": "logging.folders.locations.buckets.views.logs.list", + // "id": "logging.locations.get", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "pageSize": { - // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The resource name that owns the logs: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", + // "name": { + // "description": "Resource name for the location.", // "location": "path", - // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" - // }, - // "resourceNames": { - // "description": "Optional. The resource name that owns the logs: projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]To support legacy queries, it could also be: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", - // "location": "query", - // "repeated": true, - // "type": "string" // } // }, - // "path": "v2/{+parent}/logs", + // "path": "v2/{+name}", // "response": { - // "$ref": "ListLogsResponse" + // "$ref": "Location" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -15183,100 +19000,103 @@ func (c *FoldersLocationsBucketsViewsLogsListCall) Do(opts ...googleapi.CallOpti } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *FoldersLocationsBucketsViewsLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "logging.folders.locations.operations.cancel": +// method id "logging.locations.list": -type FoldersLocationsOperationsCancelCall struct { - s *Service - name string - canceloperationrequest *CancelOperationRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type LocationsListCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Cancel: Starts asynchronous cancellation on a long-running operation. -// The server makes a best effort to cancel the operation, but success -// is not guaranteed. If the server doesn't support this method, it -// returns google.rpc.Code.UNIMPLEMENTED. Clients can use -// Operations.GetOperation or other methods to check whether the -// cancellation succeeded or whether the operation completed despite -// cancellation. On successful cancellation, the operation is not -// deleted; instead, it becomes an operation with an Operation.error -// value with a google.rpc.Status.code of 1, corresponding to -// Code.CANCELLED. +// List: Lists information about the supported locations for this +// service. // -// - name: The name of the operation resource to be cancelled. -func (r *FoldersLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *FoldersLocationsOperationsCancelCall { - c := &FoldersLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource that owns the locations collection, if +// applicable. +func (r *LocationsService) List(name string) *LocationsListCall { + c := &LocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.canceloperationrequest = canceloperationrequest + return c +} + +// Filter sets the optional parameter "filter": A filter to narrow down +// results to a preferred subset. The filtering language accepts strings +// like "displayName=tokyo", and is documented in more detail in AIP-160 +// (https://google.aip.dev/160). +func (c *LocationsListCall) Filter(filter string) *LocationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return. If not set, the service selects a default. +func (c *LocationsListCall) PageSize(pageSize int64) *LocationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token +// received from the next_page_token field in the response. Send that +// page token to receive the subsequent page. +func (c *LocationsListCall) PageToken(pageToken string) *LocationsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *FoldersLocationsOperationsCancelCall { +func (c *LocationsListCall) Fields(s ...googleapi.Field) *LocationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LocationsListCall) IfNoneMatch(entityTag string) *LocationsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLocationsOperationsCancelCall) Context(ctx context.Context) *FoldersLocationsOperationsCancelCall { +func (c *LocationsListCall) Context(ctx context.Context) *LocationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLocationsOperationsCancelCall) Header() http.Header { +func (c *LocationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:cancel") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -15287,14 +19107,14 @@ func (c *FoldersLocationsOperationsCancelCall) doRequest(alt string) (*http.Resp return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.locations.operations.cancel" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.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 *FoldersLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "logging.locations.list" call. +// Exactly one of *ListLocationsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListLocationsResponse.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 *LocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15313,7 +19133,7 @@ func (c *FoldersLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &ListLocationsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -15325,128 +19145,168 @@ func (c *FoldersLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.", - // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/operations/{operationsId}:cancel", - // "httpMethod": "POST", - // "id": "logging.folders.locations.operations.cancel", + // "description": "Lists information about the supported locations for this service.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations", + // "httpMethod": "GET", + // "id": "logging.locations.list", // "parameterOrder": [ // "name" // ], // "parameters": { + // "filter": { + // "description": "A filter to narrow down results to a preferred subset. The filtering language accepts strings like \"displayName=tokyo\", and is documented in more detail in AIP-160 (https://google.aip.dev/160).", + // "location": "query", + // "type": "string" + // }, // "name": { - // "description": "The name of the operation resource to be cancelled.", + // "description": "The resource that owns the locations collection, if applicable.", // "location": "path", - // "pattern": "^folders/[^/]+/locations/[^/]+/operations/[^/]+$", + // "pattern": "^[^/]+/[^/]+$", // "required": true, // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of results to return. If not set, the service selects a default.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token received from the next_page_token field in the response. Send that page token to receive the subsequent page.", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+name}:cancel", - // "request": { - // "$ref": "CancelOperationRequest" - // }, + // "path": "v2/{+name}/locations", // "response": { - // "$ref": "Empty" + // "$ref": "ListLocationsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.folders.locations.operations.get": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *LocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type FoldersLocationsOperationsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// method id "logging.locations.buckets.create": + +type LocationsBucketsCreateCall struct { + s *Service + parent string + logbucket *LogBucket + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets the latest state of a long-running operation. Clients can -// use this method to poll the operation result at intervals as -// recommended by the API service. +// Create: Creates a log bucket that can be used to store log entries. +// After a bucket has been created, the bucket's location cannot be +// changed. // -// - name: The name of the operation resource. -func (r *FoldersLocationsOperationsService) Get(name string) *FoldersLocationsOperationsGetCall { - c := &FoldersLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: The resource in which to create the log bucket: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For +// example:"projects/my-project/locations/global". +func (r *LocationsBucketsService) Create(parent string, logbucket *LogBucket) *LocationsBucketsCreateCall { + c := &LocationsBucketsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.logbucket = logbucket + return c +} + +// BucketId sets the optional parameter "bucketId": Required. A +// client-assigned identifier such as "my-bucket". Identifiers are +// limited to 100 characters and can include only letters, digits, +// underscores, hyphens, and periods. +func (c *LocationsBucketsCreateCall) BucketId(bucketId string) *LocationsBucketsCreateCall { + c.urlParams_.Set("bucketId", bucketId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersLocationsOperationsGetCall) Fields(s ...googleapi.Field) *FoldersLocationsOperationsGetCall { +func (c *LocationsBucketsCreateCall) Fields(s ...googleapi.Field) *LocationsBucketsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *FoldersLocationsOperationsGetCall) IfNoneMatch(entityTag string) *FoldersLocationsOperationsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLocationsOperationsGetCall) Context(ctx context.Context) *FoldersLocationsOperationsGetCall { +func (c *LocationsBucketsCreateCall) Context(ctx context.Context) *LocationsBucketsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLocationsOperationsGetCall) Header() http.Header { +func (c *LocationsBucketsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.locations.operations.get" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx +// Do executes the "logging.locations.buckets.create" call. +// Exactly one of *LogBucket or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at +// *LogBucket.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 *FoldersLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *LocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15465,7 +19325,7 @@ func (c *FoldersLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*O if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &LogBucket{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -15477,155 +19337,137 @@ func (c *FoldersLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*O } return ret, nil // { - // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", - // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/operations/{operationsId}", - // "httpMethod": "GET", - // "id": "logging.folders.locations.operations.get", + // "description": "Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets", + // "httpMethod": "POST", + // "id": "logging.locations.buckets.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "The name of the operation resource.", + // "bucketId": { + // "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"", // "location": "path", - // "pattern": "^folders/[^/]+/locations/[^/]+/operations/[^/]+$", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+parent}/buckets", + // "request": { + // "$ref": "LogBucket" + // }, // "response": { - // "$ref": "Operation" + // "$ref": "LogBucket" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// method id "logging.folders.locations.operations.list": - -type FoldersLocationsOperationsListCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// List: Lists operations that match the specified filter in the -// request. If the server doesn't support this method, it returns -// UNIMPLEMENTED.NOTE: the name binding allows API services to override -// the binding to use different resource name schemes, such as -// users/*/operations. To override the binding, API services can add a -// binding such as "/v1/{name=users/*}/operations" to their service -// configuration. For backwards compatibility, the default name includes -// the operations collection id, however overriding users must ensure -// the name binding is the parent resource, without the operations -// collection id. -// -// - name: The name of the operation's parent resource. -func (r *FoldersLocationsOperationsService) List(name string) *FoldersLocationsOperationsListCall { - c := &FoldersLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - return c -} +// method id "logging.locations.buckets.createAsync": -// Filter sets the optional parameter "filter": The standard list -// filter. -func (c *FoldersLocationsOperationsListCall) Filter(filter string) *FoldersLocationsOperationsListCall { - c.urlParams_.Set("filter", filter) - return c +type LocationsBucketsCreateAsyncCall struct { + s *Service + parent string + logbucket *LogBucket + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// PageSize sets the optional parameter "pageSize": The standard list -// page size. -func (c *FoldersLocationsOperationsListCall) PageSize(pageSize int64) *FoldersLocationsOperationsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) +// CreateAsync: Creates a log bucket asynchronously that can be used to +// store log entries.After a bucket has been created, the bucket's +// location cannot be changed. +// +// - parent: The resource in which to create the log bucket: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For +// example:"projects/my-project/locations/global". +func (r *LocationsBucketsService) CreateAsync(parent string, logbucket *LogBucket) *LocationsBucketsCreateAsyncCall { + c := &LocationsBucketsCreateAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.logbucket = logbucket return c } -// PageToken sets the optional parameter "pageToken": The standard list -// page token. -func (c *FoldersLocationsOperationsListCall) PageToken(pageToken string) *FoldersLocationsOperationsListCall { - c.urlParams_.Set("pageToken", pageToken) +// BucketId sets the optional parameter "bucketId": Required. A +// client-assigned identifier such as "my-bucket". Identifiers are +// limited to 100 characters and can include only letters, digits, +// underscores, hyphens, and periods. +func (c *LocationsBucketsCreateAsyncCall) BucketId(bucketId string) *LocationsBucketsCreateAsyncCall { + c.urlParams_.Set("bucketId", bucketId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersLocationsOperationsListCall) Fields(s ...googleapi.Field) *FoldersLocationsOperationsListCall { +func (c *LocationsBucketsCreateAsyncCall) Fields(s ...googleapi.Field) *LocationsBucketsCreateAsyncCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *FoldersLocationsOperationsListCall) IfNoneMatch(entityTag string) *FoldersLocationsOperationsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLocationsOperationsListCall) Context(ctx context.Context) *FoldersLocationsOperationsListCall { +func (c *LocationsBucketsCreateAsyncCall) Context(ctx context.Context) *LocationsBucketsCreateAsyncCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLocationsOperationsListCall) Header() http.Header { +func (c *LocationsBucketsCreateAsyncCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsBucketsCreateAsyncCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets:createAsync") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.locations.operations.list" call. -// Exactly one of *ListOperationsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListOperationsResponse.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 *FoldersLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { +// Do executes the "logging.locations.buckets.createAsync" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.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 *LocationsBucketsCreateAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15644,7 +19486,7 @@ func (c *FoldersLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListOperationsResponse{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -15656,107 +19498,75 @@ func (c *FoldersLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (* } return ret, nil // { - // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as \"/v1/{name=users/*}/operations\" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.", - // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/operations", - // "httpMethod": "GET", - // "id": "logging.folders.locations.operations.list", + // "description": "Creates a log bucket asynchronously that can be used to store log entries.After a bucket has been created, the bucket's location cannot be changed.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets:createAsync", + // "httpMethod": "POST", + // "id": "logging.locations.buckets.createAsync", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "filter": { - // "description": "The standard list filter.", + // "bucketId": { + // "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", // "location": "query", // "type": "string" // }, - // "name": { - // "description": "The name of the operation's parent resource.", + // "parent": { + // "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"", // "location": "path", - // "pattern": "^folders/[^/]+/locations/[^/]+$", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" - // }, - // "pageSize": { - // "description": "The standard list page size.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The standard list page token.", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+name}/operations", + // "path": "v2/{+parent}/buckets:createAsync", + // "request": { + // "$ref": "LogBucket" + // }, // "response": { - // "$ref": "ListOperationsResponse" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *FoldersLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "logging.folders.logs.delete": +// method id "logging.locations.buckets.delete": -type FoldersLogsDeleteCall struct { +type LocationsBucketsDeleteCall struct { s *Service - logName string + name string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Delete: Deletes all the log entries in a log for the _Default Log -// Bucket. The log reappears if it receives new entries. Log entries -// written shortly before the delete operation might not be deleted. -// Entries received after the delete operation with a timestamp before -// the operation will be deleted. +// Delete: Deletes a log bucket.Changes the bucket's lifecycle_state to +// the DELETE_REQUESTED state. After 7 days, the bucket will be purged +// and all log entries in the bucket will be permanently deleted. // -// - logName: The resource name of the log to delete: -// projects/[PROJECT_ID]/logs/[LOG_ID] -// organizations/[ORGANIZATION_ID]/logs/[LOG_ID] -// billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID] -// folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For -// example, "projects/my-project-id/logs/syslog", -// "organizations/123/logs/cloudaudit.googleapis.com%2Factivity".For -// more information about log names, see LogEntry. -func (r *FoldersLogsService) Delete(logName string) *FoldersLogsDeleteCall { - c := &FoldersLogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.logName = logName +// - name: The full resource name of the bucket to delete. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *LocationsBucketsService) Delete(name string) *LocationsBucketsDeleteCall { + c := &LocationsBucketsDeleteCall{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 information. -func (c *FoldersLogsDeleteCall) Fields(s ...googleapi.Field) *FoldersLogsDeleteCall { +func (c *LocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *LocationsBucketsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -15764,21 +19574,21 @@ func (c *FoldersLogsDeleteCall) Fields(s ...googleapi.Field) *FoldersLogsDeleteC // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLogsDeleteCall) Context(ctx context.Context) *FoldersLogsDeleteCall { +func (c *LocationsBucketsDeleteCall) Context(ctx context.Context) *LocationsBucketsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLogsDeleteCall) Header() http.Header { +func (c *LocationsBucketsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLogsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -15788,7 +19598,7 @@ func (c *FoldersLogsDeleteCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+logName}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("DELETE", urls, body) if err != nil { @@ -15796,19 +19606,19 @@ func (c *FoldersLogsDeleteCall) doRequest(alt string) (*http.Response, error) { } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "logName": c.logName, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.logs.delete" call. +// Do executes the "logging.locations.buckets.delete" call. // Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *Empty.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 *FoldersLogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +func (c *LocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15839,23 +19649,23 @@ func (c *FoldersLogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) } return ret, nil // { - // "description": "Deletes all the log entries in a log for the _Default Log Bucket. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted.", - // "flatPath": "v2/folders/{foldersId}/logs/{logsId}", + // "description": "Deletes a log bucket.Changes the bucket's lifecycle_state to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}", // "httpMethod": "DELETE", - // "id": "logging.folders.logs.delete", + // "id": "logging.locations.buckets.delete", // "parameterOrder": [ - // "logName" + // "name" // ], // "parameters": { - // "logName": { - // "description": "Required. The resource name of the log to delete: projects/[PROJECT_ID]/logs/[LOG_ID] organizations/[ORGANIZATION_ID]/logs/[LOG_ID] billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID] folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/123/logs/cloudaudit.googleapis.com%2Factivity\".For more information about log names, see LogEntry.", + // "name": { + // "description": "Required. The full resource name of the bucket to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", - // "pattern": "^folders/[^/]+/logs/[^/]+$", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+logName}", + // "path": "v2/{+name}", // "response": { // "$ref": "Empty" // }, @@ -15867,69 +19677,38 @@ func (c *FoldersLogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) } -// method id "logging.folders.logs.list": - -type FoldersLogsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// List: Lists the logs in projects, organizations, folders, or billing -// accounts. Only logs that have entries are listed. -// -// - parent: The resource name that owns the logs: projects/[PROJECT_ID] -// organizations/[ORGANIZATION_ID] -// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]. -func (r *FoldersLogsService) List(parent string) *FoldersLogsListCall { - c := &FoldersLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return from this request. Non-positive values are -// ignored. The presence of nextPageToken in the response indicates that -// more results might be available. -func (c *FoldersLogsListCall) PageSize(pageSize int64) *FoldersLogsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": If present, then -// retrieve the next batch of results from the preceding call to this -// method. pageToken must be the value of nextPageToken from the -// previous response. The values of other method parameters should be -// identical to those in the previous call. -func (c *FoldersLogsListCall) PageToken(pageToken string) *FoldersLogsListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} +// method id "logging.locations.buckets.get": -// ResourceNames sets the optional parameter "resourceNames": The -// resource name that owns the logs: -// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/view -// s/[VIEW_ID] -// organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKE -// T_ID]/views/[VIEW_ID] -// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[ -// BUCKET_ID]/views/[VIEW_ID] -// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/ -// [VIEW_ID]To support legacy queries, it could also be: -// projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] -// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID] -func (c *FoldersLogsListCall) ResourceNames(resourceNames ...string) *FoldersLogsListCall { - c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...)) +type LocationsBucketsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets a log bucket. +// +// - name: The resource name of the bucket: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *LocationsBucketsService) Get(name string) *LocationsBucketsGetCall { + c := &LocationsBucketsGetCall{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 information. -func (c *FoldersLogsListCall) Fields(s ...googleapi.Field) *FoldersLogsListCall { +func (c *LocationsBucketsGetCall) Fields(s ...googleapi.Field) *LocationsBucketsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -15939,7 +19718,7 @@ func (c *FoldersLogsListCall) Fields(s ...googleapi.Field) *FoldersLogsListCall // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *FoldersLogsListCall) IfNoneMatch(entityTag string) *FoldersLogsListCall { +func (c *LocationsBucketsGetCall) IfNoneMatch(entityTag string) *LocationsBucketsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -15947,21 +19726,21 @@ func (c *FoldersLogsListCall) IfNoneMatch(entityTag string) *FoldersLogsListCall // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLogsListCall) Context(ctx context.Context) *FoldersLogsListCall { +func (c *LocationsBucketsGetCall) Context(ctx context.Context) *LocationsBucketsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLogsListCall) Header() http.Header { +func (c *LocationsBucketsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLogsListCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsBucketsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -15974,7 +19753,7 @@ func (c *FoldersLogsListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -15982,19 +19761,19 @@ func (c *FoldersLogsListCall) doRequest(alt string) (*http.Response, error) { } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.logs.list" call. -// Exactly one of *ListLogsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListLogsResponse.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 *FoldersLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) { +// Do executes the "logging.locations.buckets.get" call. +// Exactly one of *LogBucket or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LogBucket.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 *LocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -16013,7 +19792,7 @@ func (c *FoldersLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsRespons if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListLogsResponse{ + ret := &LogBucket{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -16025,42 +19804,25 @@ func (c *FoldersLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsRespons } return ret, nil // { - // "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", - // "flatPath": "v2/folders/{foldersId}/logs", + // "description": "Gets a log bucket.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}", // "httpMethod": "GET", - // "id": "logging.folders.logs.list", + // "id": "logging.locations.buckets.get", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "pageSize": { - // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The resource name that owns the logs: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", + // "name": { + // "description": "Required. The resource name of the bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", - // "pattern": "^folders/[^/]+$", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" - // }, - // "resourceNames": { - // "description": "Optional. The resource name that owns the logs: projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]To support legacy queries, it could also be: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", - // "location": "query", - // "repeated": true, - // "type": "string" // } // }, - // "path": "v2/{+parent}/logs", + // "path": "v2/{+name}", // "response": { - // "$ref": "ListLogsResponse" + // "$ref": "LogBucket" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -16072,115 +19834,102 @@ func (c *FoldersLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsRespons } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *FoldersLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "logging.folders.sinks.create": +// method id "logging.locations.buckets.list": -type FoldersSinksCreateCall struct { - s *Service - parent string - logsink *LogSink - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type LocationsBucketsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Create: Creates a sink that exports specified log entries to a -// destination. The export of newly-ingested log entries begins -// immediately, unless the sink's writer_identity is not permitted to -// write to the destination. A sink can export log entries only from the -// resource owning the sink. +// List: Lists log buckets. // -// - parent: The resource in which to create the sink: -// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For -// examples:"projects/my-project" "organizations/123456789". -func (r *FoldersSinksService) Create(parent string, logsink *LogSink) *FoldersSinksCreateCall { - c := &FoldersSinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The parent resource whose buckets are to be listed: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" Note: The locations +// portion of the resource must be specified, but supplying the +// character - in place of LOCATION_ID will return all buckets. +func (r *LocationsBucketsService) List(parent string) *LocationsBucketsListCall { + c := &LocationsBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.logsink = logsink return c } -// UniqueWriterIdentity sets the optional parameter -// "uniqueWriterIdentity": Determines the kind of IAM identity returned -// as writer_identity in the new sink. If this value is omitted or set -// to false, and if the sink's parent is a project, then the value -// returned as writer_identity is the same group or service account used -// by Cloud Logging before the addition of writer identities to this -// API. The sink's destination must be in the same project as the sink -// itself.If this field is set to true, or if the sink is owned by a -// non-project resource such as an organization, then the value of -// writer_identity will be a unique service account used only for -// exports from the new sink. For more information, see writer_identity -// in LogSink. -func (c *FoldersSinksCreateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *FoldersSinksCreateCall { - c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity)) +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request. Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *LocationsBucketsListCall) PageSize(pageSize int64) *LocationsBucketsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *LocationsBucketsListCall) PageToken(pageToken string) *LocationsBucketsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersSinksCreateCall) Fields(s ...googleapi.Field) *FoldersSinksCreateCall { +func (c *LocationsBucketsListCall) Fields(s ...googleapi.Field) *LocationsBucketsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LocationsBucketsListCall) IfNoneMatch(entityTag string) *LocationsBucketsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersSinksCreateCall) Context(ctx context.Context) *FoldersSinksCreateCall { +func (c *LocationsBucketsListCall) Context(ctx context.Context) *LocationsBucketsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersSinksCreateCall) Header() http.Header { +func (c *LocationsBucketsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSinksCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsBucketsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -16191,14 +19940,14 @@ func (c *FoldersSinksCreateCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.sinks.create" call. -// Exactly one of *LogSink or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *LogSink.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 *FoldersSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { +// Do executes the "logging.locations.buckets.list" call. +// Exactly one of *ListBucketsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListBucketsResponse.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 *LocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucketsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -16217,7 +19966,7 @@ func (c *FoldersSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, err if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogSink{ + ret := &ListBucketsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -16229,72 +19978,115 @@ func (c *FoldersSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, err } return ret, nil // { - // "description": "Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.", - // "flatPath": "v2/folders/{foldersId}/sinks", - // "httpMethod": "POST", - // "id": "logging.folders.sinks.create", + // "description": "Lists log buckets.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets", + // "httpMethod": "GET", + // "id": "logging.locations.buckets.list", // "parameterOrder": [ // "parent" // ], // "parameters": { + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "location": "query", + // "type": "string" + // }, // "parent": { - // "description": "Required. The resource in which to create the sink: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-project\" \"organizations/123456789\"", + // "description": "Required. The parent resource whose buckets are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets.", // "location": "path", - // "pattern": "^folders/[^/]+$", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+$", // "required": true, - // "type": "string" - // }, - // "uniqueWriterIdentity": { - // "description": "Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Cloud Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink.", - // "location": "query", - // "type": "boolean" + // "type": "string" // } // }, - // "path": "v2/{+parent}/sinks", - // "request": { - // "$ref": "LogSink" - // }, + // "path": "v2/{+parent}/buckets", // "response": { - // "$ref": "LogSink" + // "$ref": "ListBucketsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.folders.sinks.delete": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *LocationsBucketsListCall) Pages(ctx context.Context, f func(*ListBucketsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type FoldersSinksDeleteCall struct { +// method id "logging.locations.buckets.patch": + +type LocationsBucketsPatchCall struct { s *Service - sinkNameid string + name string + logbucket *LogBucket urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Delete: Deletes a sink. If the sink has a unique writer_identity, -// then that service account is also deleted. +// Patch: Updates a log bucket.If the bucket has a lifecycle_state of +// DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a +// bucket has been created, the bucket's location cannot be changed. // -// - sinkName: The full resource name of the sink to delete, including -// the parent resource and the sink identifier: -// "projects/[PROJECT_ID]/sinks/[SINK_ID]" -// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" -// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For -// example:"projects/my-project/sinks/my-sink". -func (r *FoldersSinksService) Delete(sinkNameid string) *FoldersSinksDeleteCall { - c := &FoldersSinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.sinkNameid = sinkNameid +// - name: The full resource name of the bucket to update. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *LocationsBucketsService) Patch(name string, logbucket *LogBucket) *LocationsBucketsPatchCall { + c := &LocationsBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.logbucket = logbucket + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. Field +// mask that specifies the fields in bucket that need an update. A +// bucket field will be overwritten if, and only if, it is in the update +// mask. name and output only fields cannot be updated.For a detailed +// FieldMask definition, see: +// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor +// example: updateMask=retention_days +func (c *LocationsBucketsPatchCall) UpdateMask(updateMask string) *LocationsBucketsPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersSinksDeleteCall) Fields(s ...googleapi.Field) *FoldersSinksDeleteCall { +func (c *LocationsBucketsPatchCall) Fields(s ...googleapi.Field) *LocationsBucketsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -16302,21 +20094,21 @@ func (c *FoldersSinksDeleteCall) Fields(s ...googleapi.Field) *FoldersSinksDelet // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersSinksDeleteCall) Context(ctx context.Context) *FoldersSinksDeleteCall { +func (c *LocationsBucketsPatchCall) Context(ctx context.Context) *LocationsBucketsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersSinksDeleteCall) Header() http.Header { +func (c *LocationsBucketsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSinksDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -16324,29 +20116,34 @@ func (c *FoldersSinksDeleteCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "sinkName": c.sinkNameid, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.sinks.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.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 *FoldersSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "logging.locations.buckets.patch" call. +// Exactly one of *LogBucket or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LogBucket.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 *LocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -16365,7 +20162,7 @@ func (c *FoldersSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &LogBucket{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -16377,25 +20174,34 @@ func (c *FoldersSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error } return ret, nil // { - // "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.", - // "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}", - // "httpMethod": "DELETE", - // "id": "logging.folders.sinks.delete", + // "description": "Updates a log bucket.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}", + // "httpMethod": "PATCH", + // "id": "logging.locations.buckets.patch", // "parameterOrder": [ - // "sinkName" + // "name" // ], // "parameters": { - // "sinkName": { - // "description": "Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", + // "name": { + // "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", - // "pattern": "^folders/[^/]+/sinks/[^/]+$", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=retention_days", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+sinkName}", + // "path": "v2/{+name}", + // "request": { + // "$ref": "LogBucket" + // }, // "response": { - // "$ref": "Empty" + // "$ref": "LogBucket" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -16405,100 +20211,97 @@ func (c *FoldersSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error } -// method id "logging.folders.sinks.get": +// method id "logging.locations.buckets.undelete": -type FoldersSinksGetCall struct { - s *Service - sinkName string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type LocationsBucketsUndeleteCall struct { + s *Service + name string + undeletebucketrequest *UndeleteBucketRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a sink. +// Undelete: Undeletes a log bucket. A bucket that has been deleted can +// be undeleted within the grace period of 7 days. // -// - sinkName: The resource name of the sink: -// "projects/[PROJECT_ID]/sinks/[SINK_ID]" -// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" -// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For -// example:"projects/my-project/sinks/my-sink". -func (r *FoldersSinksService) Get(sinkName string) *FoldersSinksGetCall { - c := &FoldersSinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.sinkName = sinkName +// - name: The full resource name of the bucket to undelete. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *LocationsBucketsService) Undelete(name string, undeletebucketrequest *UndeleteBucketRequest) *LocationsBucketsUndeleteCall { + c := &LocationsBucketsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.undeletebucketrequest = undeletebucketrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersSinksGetCall) Fields(s ...googleapi.Field) *FoldersSinksGetCall { +func (c *LocationsBucketsUndeleteCall) Fields(s ...googleapi.Field) *LocationsBucketsUndeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *FoldersSinksGetCall) IfNoneMatch(entityTag string) *FoldersSinksGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersSinksGetCall) Context(ctx context.Context) *FoldersSinksGetCall { +func (c *LocationsBucketsUndeleteCall) Context(ctx context.Context) *LocationsBucketsUndeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersSinksGetCall) Header() http.Header { +func (c *LocationsBucketsUndeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSinksGetCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:undelete") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "sinkName": c.sinkName, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.sinks.get" call. -// Exactly one of *LogSink or error will be non-nil. Any non-2xx status +// Do executes the "logging.locations.buckets.undelete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *LogSink.ServerResponse.Header or (if a response was returned at all) +// *Empty.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 *FoldersSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { +func (c *LocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -16517,7 +20320,7 @@ func (c *FoldersSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, error) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogSink{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -16529,146 +20332,142 @@ func (c *FoldersSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, error) } return ret, nil // { - // "description": "Gets a sink.", - // "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}", - // "httpMethod": "GET", - // "id": "logging.folders.sinks.get", + // "description": "Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period of 7 days.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}:undelete", + // "httpMethod": "POST", + // "id": "logging.locations.buckets.undelete", // "parameterOrder": [ - // "sinkName" + // "name" // ], // "parameters": { - // "sinkName": { - // "description": "Required. The resource name of the sink: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", + // "name": { + // "description": "Required. The full resource name of the bucket to undelete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", - // "pattern": "^folders/[^/]+/sinks/[^/]+$", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+sinkName}", + // "path": "v2/{+name}:undelete", + // "request": { + // "$ref": "UndeleteBucketRequest" + // }, // "response": { - // "$ref": "LogSink" + // "$ref": "Empty" // }, // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// method id "logging.folders.sinks.list": +// method id "logging.locations.buckets.updateAsync": -type FoldersSinksListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type LocationsBucketsUpdateAsyncCall struct { + s *Service + name string + logbucket *LogBucket + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists sinks. +// UpdateAsync: Updates a log bucket asynchronously.If the bucket has a +// lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be +// returned.After a bucket has been created, the bucket's location +// cannot be changed. // -// - parent: The parent resource whose sinks are to be listed: -// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]". -func (r *FoldersSinksService) List(parent string) *FoldersSinksListCall { - c := &FoldersSinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return from this request. Non-positive values are -// ignored. The presence of nextPageToken in the response indicates that -// more results might be available. -func (c *FoldersSinksListCall) PageSize(pageSize int64) *FoldersSinksListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) +// - name: The full resource name of the bucket to update. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *LocationsBucketsService) UpdateAsync(name string, logbucket *LogBucket) *LocationsBucketsUpdateAsyncCall { + c := &LocationsBucketsUpdateAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.logbucket = logbucket return c } -// PageToken sets the optional parameter "pageToken": If present, then -// retrieve the next batch of results from the preceding call to this -// method. pageToken must be the value of nextPageToken from the -// previous response. The values of other method parameters should be -// identical to those in the previous call. -func (c *FoldersSinksListCall) PageToken(pageToken string) *FoldersSinksListCall { - c.urlParams_.Set("pageToken", pageToken) +// UpdateMask sets the optional parameter "updateMask": Required. Field +// mask that specifies the fields in bucket that need an update. A +// bucket field will be overwritten if, and only if, it is in the update +// mask. name and output only fields cannot be updated.For a detailed +// FieldMask definition, see: +// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor +// example: updateMask=retention_days +func (c *LocationsBucketsUpdateAsyncCall) UpdateMask(updateMask string) *LocationsBucketsUpdateAsyncCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersSinksListCall) Fields(s ...googleapi.Field) *FoldersSinksListCall { +func (c *LocationsBucketsUpdateAsyncCall) Fields(s ...googleapi.Field) *LocationsBucketsUpdateAsyncCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *FoldersSinksListCall) IfNoneMatch(entityTag string) *FoldersSinksListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersSinksListCall) Context(ctx context.Context) *FoldersSinksListCall { +func (c *LocationsBucketsUpdateAsyncCall) Context(ctx context.Context) *LocationsBucketsUpdateAsyncCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersSinksListCall) Header() http.Header { +func (c *LocationsBucketsUpdateAsyncCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSinksListCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsBucketsUpdateAsyncCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:updateAsync") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.sinks.list" call. -// Exactly one of *ListSinksResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListSinksResponse.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 *FoldersSinksListCall) Do(opts ...googleapi.CallOption) (*ListSinksResponse, error) { +// Do executes the "logging.locations.buckets.updateAsync" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.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 *LocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -16687,7 +20486,7 @@ func (c *FoldersSinksListCall) Do(opts ...googleapi.CallOption) (*ListSinksRespo if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListSinksResponse{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -16699,132 +20498,85 @@ func (c *FoldersSinksListCall) Do(opts ...googleapi.CallOption) (*ListSinksRespo } return ret, nil // { - // "description": "Lists sinks.", - // "flatPath": "v2/folders/{foldersId}/sinks", - // "httpMethod": "GET", - // "id": "logging.folders.sinks.list", + // "description": "Updates a log bucket asynchronously.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}:updateAsync", + // "httpMethod": "POST", + // "id": "logging.locations.buckets.updateAsync", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "pageSize": { - // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The parent resource whose sinks are to be listed: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ", + // "name": { + // "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", - // "pattern": "^folders/[^/]+$", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=retention_days", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+parent}/sinks", + // "path": "v2/{+name}:updateAsync", + // "request": { + // "$ref": "LogBucket" + // }, // "response": { - // "$ref": "ListSinksResponse" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *FoldersSinksListCall) Pages(ctx context.Context, f func(*ListSinksResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "logging.folders.sinks.patch": +// method id "logging.locations.buckets.links.create": -type FoldersSinksPatchCall struct { +type LocationsBucketsLinksCreateCall struct { s *Service - sinkNameid string - logsink *LogSink + parent string + link *Link urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Patch: Updates a sink. This method replaces the following fields in -// the existing sink with values from the new sink: destination, and -// filter.The updated sink might also have a new writer_identity; see -// the unique_writer_identity field. +// Create: Asynchronously creates linked dataset in BigQuery which makes +// it possible to use BugQuery to read the logs stored in the bucket. A +// bucket may currently only contain one link. // -// - sinkName: The full resource name of the sink to update, including -// the parent resource and the sink identifier: -// "projects/[PROJECT_ID]/sinks/[SINK_ID]" -// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" -// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For -// example:"projects/my-project/sinks/my-sink". -func (r *FoldersSinksService) Patch(sinkNameid string, logsink *LogSink) *FoldersSinksPatchCall { - c := &FoldersSinksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.sinkNameid = sinkNameid - c.logsink = logsink - return c -} - -// UniqueWriterIdentity sets the optional parameter -// "uniqueWriterIdentity": See sinks.create for a description of this -// field. When updating a sink, the effect of this field on the value of -// writer_identity in the updated sink depends on both the old and new -// values of this field: If the old and new values of this field are -// both false or both true, then there is no change to the sink's -// writer_identity. If the old value is false and the new value is true, -// then writer_identity is changed to a unique service account. It is an -// error if the old value is true and the new value is set to false or -// defaulted to false. -func (c *FoldersSinksPatchCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *FoldersSinksPatchCall { - c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity)) +// - parent: The full resource name of the bucket to create a link for. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]". +func (r *LocationsBucketsLinksService) Create(parent string, link *Link) *LocationsBucketsLinksCreateCall { + c := &LocationsBucketsLinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.link = link return c } -// UpdateMask sets the optional parameter "updateMask": Field mask that -// specifies the fields in sink that need an update. A sink field will -// be overwritten if, and only if, it is in the update mask. name and -// output only fields cannot be updated.An empty updateMask is -// temporarily treated as using the following mask for backwards -// compatibility purposes:destination,filter,includeChildrenAt some -// point in the future, behavior will be removed and specifying an empty -// updateMask will be an error.For a detailed FieldMask definition, see -// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor -// example: updateMask=filter -func (c *FoldersSinksPatchCall) UpdateMask(updateMask string) *FoldersSinksPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// LinkId sets the optional parameter "linkId": Required. The ID to use +// for the link. The link_id can have up to 100 characters. A valid +// link_id must only have alphanumeric characters and underscores within +// it. +func (c *LocationsBucketsLinksCreateCall) LinkId(linkId string) *LocationsBucketsLinksCreateCall { + c.urlParams_.Set("linkId", linkId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersSinksPatchCall) Fields(s ...googleapi.Field) *FoldersSinksPatchCall { +func (c *LocationsBucketsLinksCreateCall) Fields(s ...googleapi.Field) *LocationsBucketsLinksCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -16832,21 +20584,21 @@ func (c *FoldersSinksPatchCall) Fields(s ...googleapi.Field) *FoldersSinksPatchC // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersSinksPatchCall) Context(ctx context.Context) *FoldersSinksPatchCall { +func (c *LocationsBucketsLinksCreateCall) Context(ctx context.Context) *LocationsBucketsLinksCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersSinksPatchCall) Header() http.Header { +func (c *LocationsBucketsLinksCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSinksPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsBucketsLinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -16854,34 +20606,34 @@ func (c *FoldersSinksPatchCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.link) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/links") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "sinkName": c.sinkNameid, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "logging.folders.sinks.patch" call. -// Exactly one of *LogSink or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *LogSink.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 *FoldersSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "logging.locations.buckets.links.create" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.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 *LocationsBucketsLinksCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -16900,7 +20652,7 @@ func (c *FoldersSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink, erro if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogSink{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -16912,39 +20664,33 @@ func (c *FoldersSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink, erro } return ret, nil // { - // "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field.", - // "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}", - // "httpMethod": "PATCH", - // "id": "logging.folders.sinks.patch", + // "description": "Asynchronously creates linked dataset in BigQuery which makes it possible to use BugQuery to read the logs stored in the bucket. A bucket may currently only contain one link.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/links", + // "httpMethod": "POST", + // "id": "logging.locations.buckets.links.create", // "parameterOrder": [ - // "sinkName" + // "parent" // ], // "parameters": { - // "sinkName": { - // "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", - // "location": "path", - // "pattern": "^folders/[^/]+/sinks/[^/]+$", - // "required": true, - // "type": "string" - // }, - // "uniqueWriterIdentity": { - // "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a unique service account. It is an error if the old value is true and the new value is set to false or defaulted to false.", + // "linkId": { + // "description": "Required. The ID to use for the link. The link_id can have up to 100 characters. A valid link_id must only have alphanumeric characters and underscores within it.", // "location": "query", - // "type": "boolean" + // "type": "string" // }, - // "updateMask": { - // "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes:destination,filter,includeChildrenAt some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", - // "format": "google-fieldmask", - // "location": "query", + // "parent": { + // "description": "Required. The full resource name of the bucket to create a link for. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", + // "location": "path", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "required": true, // "type": "string" // } // }, - // "path": "v2/{+sinkName}", + // "path": "v2/{+parent}/links", // "request": { - // "$ref": "LogSink" + // "$ref": "Link" // }, // "response": { - // "$ref": "LogSink" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -16954,70 +20700,38 @@ func (c *FoldersSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink, erro } -// method id "logging.folders.sinks.update": +// method id "logging.locations.buckets.links.delete": -type FoldersSinksUpdateCall struct { +type LocationsBucketsLinksDeleteCall struct { s *Service - sinkNameid string - logsink *LogSink + name string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Update: Updates a sink. This method replaces the following fields in -// the existing sink with values from the new sink: destination, and -// filter.The updated sink might also have a new writer_identity; see -// the unique_writer_identity field. +// Delete: Deletes a link. This will also delete the corresponding +// BigQuery linked dataset. // -// - sinkName: The full resource name of the sink to update, including -// the parent resource and the sink identifier: -// "projects/[PROJECT_ID]/sinks/[SINK_ID]" -// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" -// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For -// example:"projects/my-project/sinks/my-sink". -func (r *FoldersSinksService) Update(sinkNameid string, logsink *LogSink) *FoldersSinksUpdateCall { - c := &FoldersSinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.sinkNameid = sinkNameid - c.logsink = logsink - return c -} - -// UniqueWriterIdentity sets the optional parameter -// "uniqueWriterIdentity": See sinks.create for a description of this -// field. When updating a sink, the effect of this field on the value of -// writer_identity in the updated sink depends on both the old and new -// values of this field: If the old and new values of this field are -// both false or both true, then there is no change to the sink's -// writer_identity. If the old value is false and the new value is true, -// then writer_identity is changed to a unique service account. It is an -// error if the old value is true and the new value is set to false or -// defaulted to false. -func (c *FoldersSinksUpdateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *FoldersSinksUpdateCall { - c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity)) - return c -} - -// UpdateMask sets the optional parameter "updateMask": Field mask that -// specifies the fields in sink that need an update. A sink field will -// be overwritten if, and only if, it is in the update mask. name and -// output only fields cannot be updated.An empty updateMask is -// temporarily treated as using the following mask for backwards -// compatibility purposes:destination,filter,includeChildrenAt some -// point in the future, behavior will be removed and specifying an empty -// updateMask will be an error.For a detailed FieldMask definition, see -// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor -// example: updateMask=filter -func (c *FoldersSinksUpdateCall) UpdateMask(updateMask string) *FoldersSinksUpdateCall { - c.urlParams_.Set("updateMask", updateMask) +// - name: The full resource name of the link to +// delete."projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/ +// links/LINK_ID" +// "organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ +// ID/links/LINK_ID" +// "billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BU +// CKET_ID/links/LINK_ID" +// "folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LIN +// K_ID". +func (r *LocationsBucketsLinksService) Delete(name string) *LocationsBucketsLinksDeleteCall { + c := &LocationsBucketsLinksDeleteCall{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 information. -func (c *FoldersSinksUpdateCall) Fields(s ...googleapi.Field) *FoldersSinksUpdateCall { +func (c *LocationsBucketsLinksDeleteCall) Fields(s ...googleapi.Field) *LocationsBucketsLinksDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -17025,21 +20739,21 @@ func (c *FoldersSinksUpdateCall) Fields(s ...googleapi.Field) *FoldersSinksUpdat // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersSinksUpdateCall) Context(ctx context.Context) *FoldersSinksUpdateCall { +func (c *LocationsBucketsLinksDeleteCall) Context(ctx context.Context) *LocationsBucketsLinksDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersSinksUpdateCall) Header() http.Header { +func (c *LocationsBucketsLinksDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSinksUpdateCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsBucketsLinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -17047,34 +20761,29 @@ func (c *FoldersSinksUpdateCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "sinkName": c.sinkNameid, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.sinks.update" call. -// Exactly one of *LogSink or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *LogSink.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 *FoldersSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { +// Do executes the "logging.locations.buckets.links.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.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 *LocationsBucketsLinksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -17093,7 +20802,7 @@ func (c *FoldersSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, err if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogSink{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -17105,39 +20814,25 @@ func (c *FoldersSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, err } return ret, nil // { - // "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field.", - // "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}", - // "httpMethod": "PUT", - // "id": "logging.folders.sinks.update", + // "description": "Deletes a link. This will also delete the corresponding BigQuery linked dataset.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/links/{linksId}", + // "httpMethod": "DELETE", + // "id": "logging.locations.buckets.links.delete", // "parameterOrder": [ - // "sinkName" + // "name" // ], // "parameters": { - // "sinkName": { - // "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", + // "name": { + // "description": "Required. The full resource name of the link to delete.\"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\"", // "location": "path", - // "pattern": "^folders/[^/]+/sinks/[^/]+$", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+/links/[^/]+$", // "required": true, // "type": "string" - // }, - // "uniqueWriterIdentity": { - // "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a unique service account. It is an error if the old value is true and the new value is set to false or defaulted to false.", - // "location": "query", - // "type": "boolean" - // }, - // "updateMask": { - // "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes:destination,filter,includeChildrenAt some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+sinkName}", - // "request": { - // "$ref": "LogSink" - // }, + // "path": "v2/{+name}", // "response": { - // "$ref": "LogSink" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -17147,9 +20842,9 @@ func (c *FoldersSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, err } -// method id "logging.locations.get": +// method id "logging.locations.buckets.links.get": -type LocationsGetCall struct { +type LocationsBucketsLinksGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -17158,11 +20853,19 @@ type LocationsGetCall struct { header_ http.Header } -// Get: Gets information about a location. +// Get: Gets a link. // -// - name: Resource name for the location. -func (r *LocationsService) Get(name string) *LocationsGetCall { - c := &LocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of the +// link:"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/li +// nks/LINK_ID" +// "organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ +// ID/links/LINK_ID" +// "billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BU +// CKET_ID/links/LINK_ID" +// "folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LIN +// K_ID. +func (r *LocationsBucketsLinksService) Get(name string) *LocationsBucketsLinksGetCall { + c := &LocationsBucketsLinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -17170,7 +20873,7 @@ func (r *LocationsService) Get(name string) *LocationsGetCall { // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsGetCall) Fields(s ...googleapi.Field) *LocationsGetCall { +func (c *LocationsBucketsLinksGetCall) Fields(s ...googleapi.Field) *LocationsBucketsLinksGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -17180,7 +20883,7 @@ func (c *LocationsGetCall) Fields(s ...googleapi.Field) *LocationsGetCall { // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *LocationsGetCall) IfNoneMatch(entityTag string) *LocationsGetCall { +func (c *LocationsBucketsLinksGetCall) IfNoneMatch(entityTag string) *LocationsBucketsLinksGetCall { c.ifNoneMatch_ = entityTag return c } @@ -17188,21 +20891,21 @@ func (c *LocationsGetCall) IfNoneMatch(entityTag string) *LocationsGetCall { // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsGetCall) Context(ctx context.Context) *LocationsGetCall { +func (c *LocationsBucketsLinksGetCall) Context(ctx context.Context) *LocationsBucketsLinksGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsGetCall) Header() http.Header { +func (c *LocationsBucketsLinksGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsBucketsLinksGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -17228,14 +20931,14 @@ func (c *LocationsGetCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.get" call. -// Exactly one of *Location or error will be non-nil. Any non-2xx status +// Do executes the "logging.locations.buckets.links.get" call. +// Exactly one of *Link or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *Location.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 *LocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) { +// *Link.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 *LocationsBucketsLinksGetCall) Do(opts ...googleapi.CallOption) (*Link, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -17254,7 +20957,7 @@ func (c *LocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Location{ + ret := &Link{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -17266,25 +20969,25 @@ func (c *LocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) { } return ret, nil // { - // "description": "Gets information about a location.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}", + // "description": "Gets a link.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/links/{linksId}", // "httpMethod": "GET", - // "id": "logging.locations.get", + // "id": "logging.locations.buckets.links.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Resource name for the location.", + // "description": "Required. The resource name of the link:\"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID", // "location": "path", - // "pattern": "^[^/]+/[^/]+/locations/[^/]+$", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+/links/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v2/{+name}", // "response": { - // "$ref": "Location" + // "$ref": "Link" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -17296,48 +20999,45 @@ func (c *LocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) { } -// method id "logging.locations.list": +// method id "logging.locations.buckets.links.list": -type LocationsListCall struct { +type LocationsBucketsLinksListCall struct { s *Service - name string + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists information about the supported locations for this -// service. +// List: Lists links. // -// - name: The resource that owns the locations collection, if -// applicable. -func (r *LocationsService) List(name string) *LocationsListCall { - c := &LocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - return c -} - -// Filter sets the optional parameter "filter": A filter to narrow down -// results to a preferred subset. The filtering language accepts strings -// like "displayName=tokyo", and is documented in more detail in AIP-160 -// (https://google.aip.dev/160). -func (c *LocationsListCall) Filter(filter string) *LocationsListCall { - c.urlParams_.Set("filter", filter) +// - parent: The parent resource whose links are to be +// listed:"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/ +// links/" +// "organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ +// ID/" +// "billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BU +// CKET_ID/" +// "folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/. +func (r *LocationsBucketsLinksService) List(parent string) *LocationsBucketsLinksListCall { + c := &LocationsBucketsLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent return c } // PageSize sets the optional parameter "pageSize": The maximum number -// of results to return. If not set, the service selects a default. -func (c *LocationsListCall) PageSize(pageSize int64) *LocationsListCall { +// of results to return from this request. +func (c *LocationsBucketsLinksListCall) PageSize(pageSize int64) *LocationsBucketsLinksListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } -// PageToken sets the optional parameter "pageToken": A page token -// received from the next_page_token field in the response. Send that -// page token to receive the subsequent page. -func (c *LocationsListCall) PageToken(pageToken string) *LocationsListCall { +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. +func (c *LocationsBucketsLinksListCall) PageToken(pageToken string) *LocationsBucketsLinksListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -17345,7 +21045,7 @@ func (c *LocationsListCall) PageToken(pageToken string) *LocationsListCall { // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsListCall) Fields(s ...googleapi.Field) *LocationsListCall { +func (c *LocationsBucketsLinksListCall) Fields(s ...googleapi.Field) *LocationsBucketsLinksListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -17355,7 +21055,7 @@ func (c *LocationsListCall) Fields(s ...googleapi.Field) *LocationsListCall { // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *LocationsListCall) IfNoneMatch(entityTag string) *LocationsListCall { +func (c *LocationsBucketsLinksListCall) IfNoneMatch(entityTag string) *LocationsBucketsLinksListCall { c.ifNoneMatch_ = entityTag return c } @@ -17363,21 +21063,21 @@ func (c *LocationsListCall) IfNoneMatch(entityTag string) *LocationsListCall { // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsListCall) Context(ctx context.Context) *LocationsListCall { +func (c *LocationsBucketsLinksListCall) Context(ctx context.Context) *LocationsBucketsLinksListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsListCall) Header() http.Header { +func (c *LocationsBucketsLinksListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsBucketsLinksListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -17390,7 +21090,7 @@ func (c *LocationsListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/links") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -17398,19 +21098,19 @@ func (c *LocationsListCall) doRequest(alt string) (*http.Response, error) { } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.list" call. -// Exactly one of *ListLocationsResponse or error will be non-nil. Any +// Do executes the "logging.locations.buckets.links.list" call. +// Exactly one of *ListLinksResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either -// *ListLocationsResponse.ServerResponse.Header or (if a response was +// *ListLinksResponse.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 *LocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) { +func (c *LocationsBucketsLinksListCall) Do(opts ...googleapi.CallOption) (*ListLinksResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -17429,7 +21129,7 @@ func (c *LocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResp if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListLocationsResponse{ + ret := &ListLinksResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -17441,41 +21141,36 @@ func (c *LocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResp } return ret, nil // { - // "description": "Lists information about the supported locations for this service.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations", + // "description": "Lists links.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/links", // "httpMethod": "GET", - // "id": "logging.locations.list", + // "id": "logging.locations.buckets.links.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "filter": { - // "description": "A filter to narrow down results to a preferred subset. The filtering language accepts strings like \"displayName=tokyo\", and is documented in more detail in AIP-160 (https://google.aip.dev/160).", - // "location": "query", - // "type": "string" - // }, - // "name": { - // "description": "The resource that owns the locations collection, if applicable.", - // "location": "path", - // "pattern": "^[^/]+/[^/]+$", - // "required": true, - // "type": "string" - // }, // "pageSize": { - // "description": "The maximum number of results to return. If not set, the service selects a default.", + // "description": "Optional. The maximum number of results to return from this request.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "A page token received from the next_page_token field in the response. Send that page token to receive the subsequent page.", + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response.", // "location": "query", // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent resource whose links are to be listed:\"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/\" \"organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/\" \"billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/\" \"folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/", + // "location": "path", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "required": true, + // "type": "string" // } // }, - // "path": "v2/{+name}/locations", + // "path": "v2/{+parent}/links", // "response": { - // "$ref": "ListLocationsResponse" + // "$ref": "ListLinksResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -17490,7 +21185,7 @@ func (c *LocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResp // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *LocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error { +func (c *LocationsBucketsLinksListCall) Pages(ctx context.Context, f func(*ListLinksResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -17508,44 +21203,44 @@ func (c *LocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResp } } -// method id "logging.locations.buckets.create": +// method id "logging.locations.buckets.views.create": -type LocationsBucketsCreateCall struct { +type LocationsBucketsViewsCreateCall struct { s *Service parent string - logbucket *LogBucket + logview *LogView urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Create: Creates a log bucket that can be used to store log entries. -// After a bucket has been created, the bucket's location cannot be -// changed. +// Create: Creates a view over log entries in a log bucket. A bucket may +// contain a maximum of 30 views. // -// - parent: The resource in which to create the log bucket: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For -// example:"projects/my-project/locations/global". -func (r *LocationsBucketsService) Create(parent string, logbucket *LogBucket) *LocationsBucketsCreateCall { - c := &LocationsBucketsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The bucket in which to create the view +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// ` For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *LocationsBucketsViewsService) Create(parent string, logview *LogView) *LocationsBucketsViewsCreateCall { + c := &LocationsBucketsViewsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.logbucket = logbucket + c.logview = logview return c } -// BucketId sets the optional parameter "bucketId": Required. A -// client-assigned identifier such as "my-bucket". Identifiers are -// limited to 100 characters and can include only letters, digits, -// underscores, hyphens, and periods. -func (c *LocationsBucketsCreateCall) BucketId(bucketId string) *LocationsBucketsCreateCall { - c.urlParams_.Set("bucketId", bucketId) +// ViewId sets the optional parameter "viewId": Required. A +// client-assigned identifier such as "my-view". Identifiers are limited +// to 100 characters and can include only letters, digits, underscores, +// hyphens, and periods. +func (c *LocationsBucketsViewsCreateCall) ViewId(viewId string) *LocationsBucketsViewsCreateCall { + c.urlParams_.Set("viewId", viewId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsBucketsCreateCall) Fields(s ...googleapi.Field) *LocationsBucketsCreateCall { +func (c *LocationsBucketsViewsCreateCall) Fields(s ...googleapi.Field) *LocationsBucketsViewsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -17553,21 +21248,21 @@ func (c *LocationsBucketsCreateCall) Fields(s ...googleapi.Field) *LocationsBuck // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsBucketsCreateCall) Context(ctx context.Context) *LocationsBucketsCreateCall { +func (c *LocationsBucketsViewsCreateCall) Context(ctx context.Context) *LocationsBucketsViewsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsBucketsCreateCall) Header() http.Header { +func (c *LocationsBucketsViewsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -17575,14 +21270,14 @@ func (c *LocationsBucketsCreateCall) doRequest(alt string) (*http.Response, erro } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -17595,14 +21290,14 @@ func (c *LocationsBucketsCreateCall) doRequest(alt string) (*http.Response, erro return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.buckets.create" call. -// Exactly one of *LogBucket or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *LogBucket.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 *LocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { +// Do executes the "logging.locations.buckets.views.create" call. +// Exactly one of *LogView or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogView.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 *LocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption) (*LogView, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -17621,7 +21316,7 @@ func (c *LocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucke if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogBucket{ + ret := &LogView{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -17633,33 +21328,33 @@ func (c *LocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucke } return ret, nil // { - // "description": "Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets", + // "description": "Creates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/views", // "httpMethod": "POST", - // "id": "logging.locations.buckets.create", + // "id": "logging.locations.buckets.views.create", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "bucketId": { - // "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", - // "location": "query", - // "type": "string" - // }, // "parent": { - // "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"", + // "description": "Required. The bucket in which to create the view `\"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\"` For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", - // "pattern": "^[^/]+/[^/]+/locations/[^/]+$", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" + // }, + // "viewId": { + // "description": "Required. A client-assigned identifier such as \"my-view\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+parent}/buckets", + // "path": "v2/{+parent}/views", // "request": { - // "$ref": "LogBucket" + // "$ref": "LogView" // }, // "response": { - // "$ref": "LogBucket" + // "$ref": "LogView" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -17669,44 +21364,35 @@ func (c *LocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucke } -// method id "logging.locations.buckets.createAsync": +// method id "logging.locations.buckets.views.delete": -type LocationsBucketsCreateAsyncCall struct { +type LocationsBucketsViewsDeleteCall struct { s *Service - parent string - logbucket *LogBucket + name string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// CreateAsync: Creates a log bucket asynchronously that can be used to -// store log entries.After a bucket has been created, the bucket's -// location cannot be changed. +// Delete: Deletes a view on a log bucket. If an UNAVAILABLE error is +// returned, this indicates that system is not in a state where it can +// delete the view. If this occurs, please try again in a few minutes. // -// - parent: The resource in which to create the log bucket: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For -// example:"projects/my-project/locations/global". -func (r *LocationsBucketsService) CreateAsync(parent string, logbucket *LogBucket) *LocationsBucketsCreateAsyncCall { - c := &LocationsBucketsCreateAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.logbucket = logbucket - return c -} - -// BucketId sets the optional parameter "bucketId": Required. A -// client-assigned identifier such as "my-bucket". Identifiers are -// limited to 100 characters and can include only letters, digits, -// underscores, hyphens, and periods. -func (c *LocationsBucketsCreateAsyncCall) BucketId(bucketId string) *LocationsBucketsCreateAsyncCall { - c.urlParams_.Set("bucketId", bucketId) +// - name: The full resource name of the view to delete: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v +// iews/[VIEW_ID]" For +// example:"projects/my-project/locations/global/buckets/my-bucket/view +// s/my-view". +func (r *LocationsBucketsViewsService) Delete(name string) *LocationsBucketsViewsDeleteCall { + c := &LocationsBucketsViewsDeleteCall{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 information. -func (c *LocationsBucketsCreateAsyncCall) Fields(s ...googleapi.Field) *LocationsBucketsCreateAsyncCall { +func (c *LocationsBucketsViewsDeleteCall) Fields(s ...googleapi.Field) *LocationsBucketsViewsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -17714,21 +21400,21 @@ func (c *LocationsBucketsCreateAsyncCall) Fields(s ...googleapi.Field) *Location // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsBucketsCreateAsyncCall) Context(ctx context.Context) *LocationsBucketsCreateAsyncCall { +func (c *LocationsBucketsViewsDeleteCall) Context(ctx context.Context) *LocationsBucketsViewsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsBucketsCreateAsyncCall) Header() http.Header { +func (c *LocationsBucketsViewsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsBucketsCreateAsyncCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -17736,34 +21422,29 @@ func (c *LocationsBucketsCreateAsyncCall) doRequest(alt string) (*http.Response, } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets:createAsync") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.buckets.createAsync" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Operation.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 *LocationsBucketsCreateAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// Do executes the "logging.locations.buckets.views.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.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 *LocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -17782,7 +21463,7 @@ func (c *LocationsBucketsCreateAsyncCall) Do(opts ...googleapi.CallOption) (*Ope if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -17794,33 +21475,25 @@ func (c *LocationsBucketsCreateAsyncCall) Do(opts ...googleapi.CallOption) (*Ope } return ret, nil // { - // "description": "Creates a log bucket asynchronously that can be used to store log entries.After a bucket has been created, the bucket's location cannot be changed.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets:createAsync", - // "httpMethod": "POST", - // "id": "logging.locations.buckets.createAsync", + // "description": "Deletes a view on a log bucket. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", + // "httpMethod": "DELETE", + // "id": "logging.locations.buckets.views.delete", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "bucketId": { - // "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"", + // "name": { + // "description": "Required. The full resource name of the view to delete: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", // "location": "path", - // "pattern": "^[^/]+/[^/]+/locations/[^/]+$", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/buckets:createAsync", - // "request": { - // "$ref": "LogBucket" - // }, + // "path": "v2/{+name}", // "response": { - // "$ref": "Operation" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -17830,31 +21503,26 @@ func (c *LocationsBucketsCreateAsyncCall) Do(opts ...googleapi.CallOption) (*Ope } -// method id "logging.locations.buckets.delete": +// method id "logging.locations.buckets.views.get": -type LocationsBucketsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type LocationsBucketsViewsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a log bucket.Changes the bucket's lifecycle_state to -// the DELETE_REQUESTED state. After 7 days, the bucket will be purged -// and all log entries in the bucket will be permanently deleted. +// Get: Gets a view on a log bucket.. // -// - name: The full resource name of the bucket to delete. -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *LocationsBucketsService) Delete(name string) *LocationsBucketsDeleteCall { - c := &LocationsBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of the policy: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v +// iews/[VIEW_ID]" For +// example:"projects/my-project/locations/global/buckets/my-bucket/view +// s/my-view". +func (r *LocationsBucketsViewsService) Get(name string) *LocationsBucketsViewsGetCall { + c := &LocationsBucketsViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -17862,41 +21530,54 @@ func (r *LocationsBucketsService) Delete(name string) *LocationsBucketsDeleteCal // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *LocationsBucketsDeleteCall { +func (c *LocationsBucketsViewsGetCall) Fields(s ...googleapi.Field) *LocationsBucketsViewsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LocationsBucketsViewsGetCall) IfNoneMatch(entityTag string) *LocationsBucketsViewsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsBucketsDeleteCall) Context(ctx context.Context) *LocationsBucketsDeleteCall { +func (c *LocationsBucketsViewsGetCall) Context(ctx context.Context) *LocationsBucketsViewsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsBucketsDeleteCall) Header() http.Header { +func (c *LocationsBucketsViewsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsBucketsViewsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + 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, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -17907,14 +21588,14 @@ func (c *LocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, erro return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.buckets.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// Do executes the "logging.locations.buckets.views.get" call. +// Exactly one of *LogView or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) +// *LogView.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 *LocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +func (c *LocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogView, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -17933,7 +21614,7 @@ func (c *LocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, e if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &LogView{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -17945,66 +21626,80 @@ func (c *LocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, e } return ret, nil // { - // "description": "Deletes a log bucket.Changes the bucket's lifecycle_state to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}", - // "httpMethod": "DELETE", - // "id": "logging.locations.buckets.delete", + // "description": "Gets a view on a log bucket..", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", + // "httpMethod": "GET", + // "id": "logging.locations.buckets.views.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The full resource name of the bucket to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "description": "Required. The resource name of the policy: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", // "location": "path", - // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v2/{+name}", // "response": { - // "$ref": "Empty" + // "$ref": "LogView" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.locations.buckets.get": +// method id "logging.locations.buckets.views.list": -type LocationsBucketsGetCall struct { +type LocationsBucketsViewsListCall struct { s *Service - name string + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Gets a log bucket. +// List: Lists views on a log bucket. // -// - name: The resource name of the bucket: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *LocationsBucketsService) Get(name string) *LocationsBucketsGetCall { - c := &LocationsBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: The bucket whose views are to be listed: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]". +func (r *LocationsBucketsViewsService) List(parent string) *LocationsBucketsViewsListCall { + c := &LocationsBucketsViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request.Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *LocationsBucketsViewsListCall) PageSize(pageSize int64) *LocationsBucketsViewsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *LocationsBucketsViewsListCall) PageToken(pageToken string) *LocationsBucketsViewsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsBucketsGetCall) Fields(s ...googleapi.Field) *LocationsBucketsGetCall { +func (c *LocationsBucketsViewsListCall) Fields(s ...googleapi.Field) *LocationsBucketsViewsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -18014,7 +21709,7 @@ func (c *LocationsBucketsGetCall) Fields(s ...googleapi.Field) *LocationsBuckets // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *LocationsBucketsGetCall) IfNoneMatch(entityTag string) *LocationsBucketsGetCall { +func (c *LocationsBucketsViewsListCall) IfNoneMatch(entityTag string) *LocationsBucketsViewsListCall { c.ifNoneMatch_ = entityTag return c } @@ -18022,21 +21717,21 @@ func (c *LocationsBucketsGetCall) IfNoneMatch(entityTag string) *LocationsBucket // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsBucketsGetCall) Context(ctx context.Context) *LocationsBucketsGetCall { +func (c *LocationsBucketsViewsListCall) Context(ctx context.Context) *LocationsBucketsViewsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsBucketsGetCall) Header() http.Header { +func (c *LocationsBucketsViewsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsBucketsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsBucketsViewsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -18049,7 +21744,7 @@ func (c *LocationsBucketsGetCall) doRequest(alt string) (*http.Response, error) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -18057,19 +21752,19 @@ func (c *LocationsBucketsGetCall) doRequest(alt string) (*http.Response, error) } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.buckets.get" call. -// Exactly one of *LogBucket or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *LogBucket.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 *LocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { +// Do executes the "logging.locations.buckets.views.list" call. +// Exactly one of *ListViewsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListViewsResponse.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 *LocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) (*ListViewsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18088,7 +21783,7 @@ func (c *LocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogBucket{ + ret := &ListViewsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -18100,25 +21795,36 @@ func (c *LocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, } return ret, nil // { - // "description": "Gets a log bucket.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}", + // "description": "Lists views on a log bucket.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/views", // "httpMethod": "GET", - // "id": "logging.locations.buckets.get", + // "id": "logging.locations.buckets.views.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The resource name of the bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request.Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The bucket whose views are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", // "location": "path", // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+parent}/views", // "response": { - // "$ref": "LogBucket" + // "$ref": "ListViewsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -18130,120 +21836,129 @@ func (c *LocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, } -// method id "logging.locations.buckets.list": - -type LocationsBucketsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *LocationsBucketsViewsListCall) Pages(ctx context.Context, f func(*ListViewsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } } -// List: Lists log buckets. -// -// - parent: The parent resource whose buckets are to be listed: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" Note: The locations -// portion of the resource must be specified, but supplying the -// character - in place of LOCATION_ID will return all buckets. -func (r *LocationsBucketsService) List(parent string) *LocationsBucketsListCall { - c := &LocationsBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c +// method id "logging.locations.buckets.views.patch": + +type LocationsBucketsViewsPatchCall struct { + s *Service + name string + logview *LogView + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return from this request. Non-positive values are -// ignored. The presence of nextPageToken in the response indicates that -// more results might be available. -func (c *LocationsBucketsListCall) PageSize(pageSize int64) *LocationsBucketsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) +// Patch: Updates a view on a log bucket. This method replaces the +// following fields in the existing view with values from the new view: +// filter. If an UNAVAILABLE error is returned, this indicates that +// system is not in a state where it can update the view. If this +// occurs, please try again in a few minutes. +// +// - name: The full resource name of the view to update +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v +// iews/[VIEW_ID]" For +// example:"projects/my-project/locations/global/buckets/my-bucket/view +// s/my-view". +func (r *LocationsBucketsViewsService) Patch(name string, logview *LogView) *LocationsBucketsViewsPatchCall { + c := &LocationsBucketsViewsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.logview = logview return c } -// PageToken sets the optional parameter "pageToken": If present, then -// retrieve the next batch of results from the preceding call to this -// method. pageToken must be the value of nextPageToken from the -// previous response. The values of other method parameters should be -// identical to those in the previous call. -func (c *LocationsBucketsListCall) PageToken(pageToken string) *LocationsBucketsListCall { - c.urlParams_.Set("pageToken", pageToken) +// UpdateMask sets the optional parameter "updateMask": Field mask that +// specifies the fields in view that need an update. A field will be +// overwritten if, and only if, it is in the update mask. name and +// output only fields cannot be updated.For a detailed FieldMask +// definition, see +// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor +// example: updateMask=filter +func (c *LocationsBucketsViewsPatchCall) UpdateMask(updateMask string) *LocationsBucketsViewsPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsBucketsListCall) Fields(s ...googleapi.Field) *LocationsBucketsListCall { +func (c *LocationsBucketsViewsPatchCall) Fields(s ...googleapi.Field) *LocationsBucketsViewsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *LocationsBucketsListCall) IfNoneMatch(entityTag string) *LocationsBucketsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsBucketsListCall) Context(ctx context.Context) *LocationsBucketsListCall { +func (c *LocationsBucketsViewsPatchCall) Context(ctx context.Context) *LocationsBucketsViewsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsBucketsListCall) Header() http.Header { +func (c *LocationsBucketsViewsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsBucketsListCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "logging.locations.buckets.list" call. -// Exactly one of *ListBucketsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListBucketsResponse.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 *LocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucketsResponse, error) { + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "logging.locations.buckets.views.patch" call. +// Exactly one of *LogView or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogView.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 *LocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) (*LogView, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18262,7 +21977,7 @@ func (c *LocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucket if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListBucketsResponse{ + ret := &LogView{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -18274,115 +21989,77 @@ func (c *LocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucket } return ret, nil // { - // "description": "Lists log buckets.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets", - // "httpMethod": "GET", - // "id": "logging.locations.buckets.list", + // "description": "Updates a view on a log bucket. This method replaces the following fields in the existing view with values from the new view: filter. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can update the view. If this occurs, please try again in a few minutes.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", + // "httpMethod": "PATCH", + // "id": "logging.locations.buckets.views.patch", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "pageSize": { - // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The parent resource whose buckets are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets.", + // "name": { + // "description": "Required. The full resource name of the view to update \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", // "location": "path", - // "pattern": "^[^/]+/[^/]+/locations/[^/]+$", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "Optional. Field mask that specifies the fields in view that need an update. A field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+parent}/buckets", + // "path": "v2/{+name}", + // "request": { + // "$ref": "LogView" + // }, // "response": { - // "$ref": "ListBucketsResponse" + // "$ref": "LogView" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *LocationsBucketsListCall) Pages(ctx context.Context, f func(*ListBucketsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "logging.locations.buckets.patch": +// method id "logging.locations.operations.cancel": -type LocationsBucketsPatchCall struct { - s *Service - name string - logbucket *LogBucket - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type LocationsOperationsCancelCall struct { + s *Service + name string + canceloperationrequest *CancelOperationRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates a log bucket.If the bucket has a lifecycle_state of -// DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a -// bucket has been created, the bucket's location cannot be changed. +// Cancel: Starts asynchronous cancellation on a long-running operation. +// The server makes a best effort to cancel the operation, but success +// is not guaranteed. If the server doesn't support this method, it +// returns google.rpc.Code.UNIMPLEMENTED. Clients can use +// Operations.GetOperation or other methods to check whether the +// cancellation succeeded or whether the operation completed despite +// cancellation. On successful cancellation, the operation is not +// deleted; instead, it becomes an operation with an Operation.error +// value with a google.rpc.Status.code of 1, corresponding to +// Code.CANCELLED. // -// - name: The full resource name of the bucket to update. -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *LocationsBucketsService) Patch(name string, logbucket *LogBucket) *LocationsBucketsPatchCall { - c := &LocationsBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the operation resource to be cancelled. +func (r *LocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *LocationsOperationsCancelCall { + c := &LocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.logbucket = logbucket - return c -} - -// UpdateMask sets the optional parameter "updateMask": Required. Field -// mask that specifies the fields in bucket that need an update. A -// bucket field will be overwritten if, and only if, it is in the update -// mask. name and output only fields cannot be updated.For a detailed -// FieldMask definition, see: -// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor -// example: updateMask=retention_days -func (c *LocationsBucketsPatchCall) UpdateMask(updateMask string) *LocationsBucketsPatchCall { - c.urlParams_.Set("updateMask", updateMask) + c.canceloperationrequest = canceloperationrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsBucketsPatchCall) Fields(s ...googleapi.Field) *LocationsBucketsPatchCall { +func (c *LocationsOperationsCancelCall) Fields(s ...googleapi.Field) *LocationsOperationsCancelCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -18390,21 +22067,21 @@ func (c *LocationsBucketsPatchCall) Fields(s ...googleapi.Field) *LocationsBucke // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsBucketsPatchCall) Context(ctx context.Context) *LocationsBucketsPatchCall { +func (c *LocationsOperationsCancelCall) Context(ctx context.Context) *LocationsOperationsCancelCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsBucketsPatchCall) Header() http.Header { +func (c *LocationsOperationsCancelCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -18412,16 +22089,16 @@ func (c *LocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -18432,14 +22109,14 @@ func (c *LocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.buckets.patch" call. -// Exactly one of *LogBucket or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *LogBucket.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 *LocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { +// Do executes the "logging.locations.operations.cancel" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.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 *LocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18458,7 +22135,7 @@ func (c *LocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogBucket{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -18470,34 +22147,28 @@ func (c *LocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket } return ret, nil // { - // "description": "Updates a log bucket.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}", - // "httpMethod": "PATCH", - // "id": "logging.locations.buckets.patch", + // "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/operations/{operationsId}:cancel", + // "httpMethod": "POST", + // "id": "logging.locations.operations.cancel", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "description": "The name of the operation resource to be cancelled.", // "location": "path", - // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+/operations/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=retention_days", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+name}:cancel", // "request": { - // "$ref": "LogBucket" + // "$ref": "CancelOperationRequest" // }, // "response": { - // "$ref": "LogBucket" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -18507,79 +22178,79 @@ func (c *LocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket } -// method id "logging.locations.buckets.undelete": +// method id "logging.locations.operations.get": -type LocationsBucketsUndeleteCall struct { - s *Service - name string - undeletebucketrequest *UndeleteBucketRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type LocationsOperationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Undelete: Undeletes a log bucket. A bucket that has been deleted can -// be undeleted within the grace period of 7 days. +// Get: Gets the latest state of a long-running operation. Clients can +// use this method to poll the operation result at intervals as +// recommended by the API service. // -// - name: The full resource name of the bucket to undelete. -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *LocationsBucketsService) Undelete(name string, undeletebucketrequest *UndeleteBucketRequest) *LocationsBucketsUndeleteCall { - c := &LocationsBucketsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the operation resource. +func (r *LocationsOperationsService) Get(name string) *LocationsOperationsGetCall { + c := &LocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.undeletebucketrequest = undeletebucketrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsBucketsUndeleteCall) Fields(s ...googleapi.Field) *LocationsBucketsUndeleteCall { +func (c *LocationsOperationsGetCall) Fields(s ...googleapi.Field) *LocationsOperationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LocationsOperationsGetCall) IfNoneMatch(entityTag string) *LocationsOperationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsBucketsUndeleteCall) Context(ctx context.Context) *LocationsBucketsUndeleteCall { +func (c *LocationsOperationsGetCall) Context(ctx context.Context) *LocationsOperationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsBucketsUndeleteCall) Header() http.Header { +func (c *LocationsOperationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:undelete") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -18590,14 +22261,14 @@ func (c *LocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, er return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.buckets.undelete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.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 *LocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "logging.locations.operations.get" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.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 *LocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18616,7 +22287,7 @@ func (c *LocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -18628,124 +22299,137 @@ func (c *LocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, } return ret, nil // { - // "description": "Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period of 7 days.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}:undelete", - // "httpMethod": "POST", - // "id": "logging.locations.buckets.undelete", + // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/operations/{operationsId}", + // "httpMethod": "GET", + // "id": "logging.locations.operations.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The full resource name of the bucket to undelete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "description": "The name of the operation resource.", // "location": "path", - // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+/operations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}:undelete", - // "request": { - // "$ref": "UndeleteBucketRequest" - // }, + // "path": "v2/{+name}", // "response": { - // "$ref": "Empty" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.locations.buckets.updateAsync": +// method id "logging.locations.operations.list": -type LocationsBucketsUpdateAsyncCall struct { - s *Service - name string - logbucket *LogBucket - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type LocationsOperationsListCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// UpdateAsync: Updates a log bucket asynchronously.If the bucket has a -// lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be -// returned.After a bucket has been created, the bucket's location -// cannot be changed. +// List: Lists operations that match the specified filter in the +// request. If the server doesn't support this method, it returns +// UNIMPLEMENTED.NOTE: the name binding allows API services to override +// the binding to use different resource name schemes, such as +// users/*/operations. To override the binding, API services can add a +// binding such as "/v1/{name=users/*}/operations" to their service +// configuration. For backwards compatibility, the default name includes +// the operations collection id, however overriding users must ensure +// the name binding is the parent resource, without the operations +// collection id. // -// - name: The full resource name of the bucket to update. -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *LocationsBucketsService) UpdateAsync(name string, logbucket *LogBucket) *LocationsBucketsUpdateAsyncCall { - c := &LocationsBucketsUpdateAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the operation's parent resource. +func (r *LocationsOperationsService) List(name string) *LocationsOperationsListCall { + c := &LocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.logbucket = logbucket return c } -// UpdateMask sets the optional parameter "updateMask": Required. Field -// mask that specifies the fields in bucket that need an update. A -// bucket field will be overwritten if, and only if, it is in the update -// mask. name and output only fields cannot be updated.For a detailed -// FieldMask definition, see: -// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor -// example: updateMask=retention_days -func (c *LocationsBucketsUpdateAsyncCall) UpdateMask(updateMask string) *LocationsBucketsUpdateAsyncCall { - c.urlParams_.Set("updateMask", updateMask) +// Filter sets the optional parameter "filter": The standard list +// filter. +func (c *LocationsOperationsListCall) Filter(filter string) *LocationsOperationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The standard list +// page size. +func (c *LocationsOperationsListCall) PageSize(pageSize int64) *LocationsOperationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The standard list +// page token. +func (c *LocationsOperationsListCall) PageToken(pageToken string) *LocationsOperationsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsBucketsUpdateAsyncCall) Fields(s ...googleapi.Field) *LocationsBucketsUpdateAsyncCall { +func (c *LocationsOperationsListCall) Fields(s ...googleapi.Field) *LocationsOperationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LocationsOperationsListCall) IfNoneMatch(entityTag string) *LocationsOperationsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsBucketsUpdateAsyncCall) Context(ctx context.Context) *LocationsBucketsUpdateAsyncCall { +func (c *LocationsOperationsListCall) Context(ctx context.Context) *LocationsOperationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsBucketsUpdateAsyncCall) Header() http.Header { +func (c *LocationsOperationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsBucketsUpdateAsyncCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsOperationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:updateAsync") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -18756,14 +22440,14 @@ func (c *LocationsBucketsUpdateAsyncCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.buckets.updateAsync" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Operation.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 *LocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// Do executes the "logging.locations.operations.list" call. +// Exactly one of *ListOperationsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListOperationsResponse.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 *LocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18782,7 +22466,7 @@ func (c *LocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.CallOption) (*Ope if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &ListOperationsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -18794,81 +22478,107 @@ func (c *LocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.CallOption) (*Ope } return ret, nil // { - // "description": "Updates a log bucket asynchronously.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}:updateAsync", - // "httpMethod": "POST", - // "id": "logging.locations.buckets.updateAsync", + // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as \"/v1/{name=users/*}/operations\" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/operations", + // "httpMethod": "GET", + // "id": "logging.locations.operations.list", // "parameterOrder": [ // "name" // ], // "parameters": { + // "filter": { + // "description": "The standard list filter.", + // "location": "query", + // "type": "string" + // }, // "name": { - // "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "description": "The name of the operation's parent resource.", // "location": "path", - // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // }, - // "updateMask": { - // "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=retention_days", - // "format": "google-fieldmask", + // "pageSize": { + // "description": "The standard list page size.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The standard list page token.", // "location": "query", // "type": "string" // } // }, - // "path": "v2/{+name}:updateAsync", - // "request": { - // "$ref": "LogBucket" - // }, + // "path": "v2/{+name}/operations", // "response": { - // "$ref": "Operation" + // "$ref": "ListOperationsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.locations.buckets.views.create": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *LocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type LocationsBucketsViewsCreateCall struct { +// method id "logging.logs.delete": + +type LogsDeleteCall struct { s *Service - parent string - logview *LogView + logName string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Create: Creates a view over log entries in a log bucket. A bucket may -// contain a maximum of 30 views. +// Delete: Deletes all the log entries in a log for the _Default Log +// Bucket. The log reappears if it receives new entries. Log entries +// written shortly before the delete operation might not be deleted. +// Entries received after the delete operation with a timestamp before +// the operation will be deleted. // -// - parent: The bucket in which to create the view -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// ` For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *LocationsBucketsViewsService) Create(parent string, logview *LogView) *LocationsBucketsViewsCreateCall { - c := &LocationsBucketsViewsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.logview = logview - return c -} - -// ViewId sets the optional parameter "viewId": Required. A -// client-assigned identifier such as "my-view". Identifiers are limited -// to 100 characters and can include only letters, digits, underscores, -// hyphens, and periods. -func (c *LocationsBucketsViewsCreateCall) ViewId(viewId string) *LocationsBucketsViewsCreateCall { - c.urlParams_.Set("viewId", viewId) +// - logName: The resource name of the log to delete: +// projects/[PROJECT_ID]/logs/[LOG_ID] +// organizations/[ORGANIZATION_ID]/logs/[LOG_ID] +// billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID] +// folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For +// example, "projects/my-project-id/logs/syslog", +// "organizations/123/logs/cloudaudit.googleapis.com%2Factivity".For +// more information about log names, see LogEntry. +func (r *LogsService) Delete(logName string) *LogsDeleteCall { + c := &LogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.logName = logName return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsBucketsViewsCreateCall) Fields(s ...googleapi.Field) *LocationsBucketsViewsCreateCall { +func (c *LogsDeleteCall) Fields(s ...googleapi.Field) *LogsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -18876,21 +22586,21 @@ func (c *LocationsBucketsViewsCreateCall) Fields(s ...googleapi.Field) *Location // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsBucketsViewsCreateCall) Context(ctx context.Context) *LocationsBucketsViewsCreateCall { +func (c *LogsDeleteCall) Context(ctx context.Context) *LogsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsBucketsViewsCreateCall) Header() http.Header { +func (c *LogsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *LogsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -18898,34 +22608,29 @@ func (c *LocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+logName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "logName": c.logName, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.buckets.views.create" call. -// Exactly one of *LogView or error will be non-nil. Any non-2xx status +// Do executes the "logging.logs.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *LogView.ServerResponse.Header or (if a response was returned at all) +// *Empty.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 *LocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption) (*LogView, error) { +func (c *LogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18944,7 +22649,7 @@ func (c *LocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption) (*Log if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogView{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -18956,33 +22661,25 @@ func (c *LocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption) (*Log } return ret, nil // { - // "description": "Creates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/views", - // "httpMethod": "POST", - // "id": "logging.locations.buckets.views.create", + // "description": "Deletes all the log entries in a log for the _Default Log Bucket. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted.", + // "flatPath": "v2/{v2Id}/{v2Id1}/logs/{logsId}", + // "httpMethod": "DELETE", + // "id": "logging.logs.delete", // "parameterOrder": [ - // "parent" + // "logName" // ], // "parameters": { - // "parent": { - // "description": "Required. The bucket in which to create the view `\"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\"` For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "logName": { + // "description": "Required. The resource name of the log to delete: projects/[PROJECT_ID]/logs/[LOG_ID] organizations/[ORGANIZATION_ID]/logs/[LOG_ID] billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID] folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/123/logs/cloudaudit.googleapis.com%2Factivity\".For more information about log names, see LogEntry.", // "location": "path", - // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "pattern": "^[^/]+/[^/]+/logs/[^/]+$", // "required": true, // "type": "string" - // }, - // "viewId": { - // "description": "Required. A client-assigned identifier such as \"my-view\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+parent}/views", - // "request": { - // "$ref": "LogView" - // }, + // "path": "v2/{+logName}", // "response": { - // "$ref": "LogView" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -18992,87 +22689,134 @@ func (c *LocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption) (*Log } -// method id "logging.locations.buckets.views.delete": +// method id "logging.logs.list": -type LocationsBucketsViewsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type LogsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a view on a log bucket. If an UNAVAILABLE error is -// returned, this indicates that system is not in a state where it can -// delete the view. If this occurs, please try again in a few minutes. +// List: Lists the logs in projects, organizations, folders, or billing +// accounts. Only logs that have entries are listed. // -// - name: The full resource name of the view to delete: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v -// iews/[VIEW_ID]" For -// example:"projects/my-project/locations/global/buckets/my-bucket/view -// s/my-view". -func (r *LocationsBucketsViewsService) Delete(name string) *LocationsBucketsViewsDeleteCall { - c := &LocationsBucketsViewsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: The resource name that owns the logs: projects/[PROJECT_ID] +// organizations/[ORGANIZATION_ID] +// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]. +func (r *LogsService) List(parent string) *LogsListCall { + c := &LogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request. Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *LogsListCall) PageSize(pageSize int64) *LogsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *LogsListCall) PageToken(pageToken string) *LogsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ResourceNames sets the optional parameter "resourceNames": The +// resource name that owns the logs: +// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/view +// s/[VIEW_ID] +// organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKE +// T_ID]/views/[VIEW_ID] +// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[ +// BUCKET_ID]/views/[VIEW_ID] +// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/ +// [VIEW_ID]To support legacy queries, it could also be: +// projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] +// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID] +func (c *LogsListCall) ResourceNames(resourceNames ...string) *LogsListCall { + c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsBucketsViewsDeleteCall) Fields(s ...googleapi.Field) *LocationsBucketsViewsDeleteCall { +func (c *LogsListCall) Fields(s ...googleapi.Field) *LogsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LogsListCall) IfNoneMatch(entityTag string) *LogsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsBucketsViewsDeleteCall) Context(ctx context.Context) *LocationsBucketsViewsDeleteCall { +func (c *LogsListCall) Context(ctx context.Context) *LogsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsBucketsViewsDeleteCall) Header() http.Header { +func (c *LogsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *LogsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + 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, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + 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, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.buckets.views.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.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 *LocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "logging.logs.list" call. +// Exactly one of *ListLogsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListLogsResponse.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 *LogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -19091,7 +22835,7 @@ func (c *LocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Emp if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &ListLogsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -19103,62 +22847,114 @@ func (c *LocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Emp } return ret, nil // { - // "description": "Deletes a view on a log bucket. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", - // "httpMethod": "DELETE", - // "id": "logging.locations.buckets.views.delete", + // "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", + // "flatPath": "v2/{v2Id}/{v2Id1}/logs", + // "httpMethod": "GET", + // "id": "logging.logs.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The full resource name of the view to delete: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The resource name that owns the logs: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", // "location": "path", - // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", + // "pattern": "^[^/]+/[^/]+$", // "required": true, // "type": "string" + // }, + // "resourceNames": { + // "description": "Optional. The resource name that owns the logs: projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]To support legacy queries, it could also be: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", + // "location": "query", + // "repeated": true, + // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+parent}/logs", // "response": { - // "$ref": "Empty" + // "$ref": "ListLogsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.locations.buckets.views.get": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *LogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type LocationsBucketsViewsGetCall struct { +// method id "logging.monitoredResourceDescriptors.list": + +type MonitoredResourceDescriptorsListCall struct { s *Service - name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Gets a view on a log bucket.. -// -// - name: The resource name of the policy: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v -// iews/[VIEW_ID]" For -// example:"projects/my-project/locations/global/buckets/my-bucket/view -// s/my-view". -func (r *LocationsBucketsViewsService) Get(name string) *LocationsBucketsViewsGetCall { - c := &LocationsBucketsViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// List: Lists the descriptors for monitored resource types used by +// Logging. +func (r *MonitoredResourceDescriptorsService) List() *MonitoredResourceDescriptorsListCall { + c := &MonitoredResourceDescriptorsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request. Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *MonitoredResourceDescriptorsListCall) PageSize(pageSize int64) *MonitoredResourceDescriptorsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *MonitoredResourceDescriptorsListCall) PageToken(pageToken string) *MonitoredResourceDescriptorsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsBucketsViewsGetCall) Fields(s ...googleapi.Field) *LocationsBucketsViewsGetCall { +func (c *MonitoredResourceDescriptorsListCall) Fields(s ...googleapi.Field) *MonitoredResourceDescriptorsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -19168,7 +22964,7 @@ func (c *LocationsBucketsViewsGetCall) Fields(s ...googleapi.Field) *LocationsBu // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *LocationsBucketsViewsGetCall) IfNoneMatch(entityTag string) *LocationsBucketsViewsGetCall { +func (c *MonitoredResourceDescriptorsListCall) IfNoneMatch(entityTag string) *MonitoredResourceDescriptorsListCall { c.ifNoneMatch_ = entityTag return c } @@ -19176,21 +22972,21 @@ func (c *LocationsBucketsViewsGetCall) IfNoneMatch(entityTag string) *LocationsB // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsBucketsViewsGetCall) Context(ctx context.Context) *LocationsBucketsViewsGetCall { +func (c *MonitoredResourceDescriptorsListCall) Context(ctx context.Context) *MonitoredResourceDescriptorsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsBucketsViewsGetCall) Header() http.Header { +func (c *MonitoredResourceDescriptorsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsBucketsViewsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *MonitoredResourceDescriptorsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -19203,27 +22999,26 @@ func (c *LocationsBucketsViewsGetCall) doRequest(alt string) (*http.Response, er var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/monitoredResourceDescriptors") 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) } -// Do executes the "logging.locations.buckets.views.get" call. -// Exactly one of *LogView or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *LogView.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 *LocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogView, error) { +// Do executes the "logging.monitoredResourceDescriptors.list" call. +// Exactly one of *ListMonitoredResourceDescriptorsResponse or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *ListMonitoredResourceDescriptorsResponse.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 *MonitoredResourceDescriptorsListCall) Do(opts ...googleapi.CallOption) (*ListMonitoredResourceDescriptorsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -19242,7 +23037,7 @@ func (c *LocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogVie if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogView{ + ret := &ListMonitoredResourceDescriptorsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -19254,25 +23049,27 @@ func (c *LocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogVie } return ret, nil // { - // "description": "Gets a view on a log bucket..", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", + // "description": "Lists the descriptors for monitored resource types used by Logging.", + // "flatPath": "v2/monitoredResourceDescriptors", // "httpMethod": "GET", - // "id": "logging.locations.buckets.views.get", - // "parameterOrder": [ - // "name" - // ], + // "id": "logging.monitoredResourceDescriptors.list", + // "parameterOrder": [], // "parameters": { - // "name": { - // "description": "Required. The resource name of the policy: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", - // "location": "path", - // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", - // "required": true, + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "location": "query", // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/monitoredResourceDescriptors", // "response": { - // "$ref": "LogView" + // "$ref": "ListMonitoredResourceDescriptorsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -19284,50 +23081,67 @@ func (c *LocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogVie } -// method id "logging.locations.buckets.views.list": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *MonitoredResourceDescriptorsListCall) Pages(ctx context.Context, f func(*ListMonitoredResourceDescriptorsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type LocationsBucketsViewsListCall struct { +// method id "logging.organizations.getCmekSettings": + +type OrganizationsGetCmekSettingsCall struct { s *Service - parent string + name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists views on a log bucket. +// GetCmekSettings: Gets the Logging CMEK settings for the given +// resource.Note: CMEK for the Log Router can be configured for Google +// Cloud projects, folders, organizations and billing accounts. Once +// configured for an organization, it applies to all projects and +// folders in the Google Cloud organization.See Enabling CMEK for Log +// Router +// (https://cloud.google.com/logging/docs/routing/managed-encryption) +// for more information. // -// - parent: The bucket whose views are to be listed: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]". -func (r *LocationsBucketsViewsService) List(parent string) *LocationsBucketsViewsListCall { - c := &LocationsBucketsViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return from this request.Non-positive values are -// ignored. The presence of nextPageToken in the response indicates that -// more results might be available. -func (c *LocationsBucketsViewsListCall) PageSize(pageSize int64) *LocationsBucketsViewsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": If present, then -// retrieve the next batch of results from the preceding call to this -// method. pageToken must be the value of nextPageToken from the -// previous response. The values of other method parameters should be -// identical to those in the previous call. -func (c *LocationsBucketsViewsListCall) PageToken(pageToken string) *LocationsBucketsViewsListCall { - c.urlParams_.Set("pageToken", pageToken) +// - name: The resource for which to retrieve CMEK settings. +// "projects/[PROJECT_ID]/cmekSettings" +// "organizations/[ORGANIZATION_ID]/cmekSettings" +// "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" +// "folders/[FOLDER_ID]/cmekSettings" For +// example:"organizations/12345/cmekSettings"Note: CMEK for the Log +// Router can be configured for Google Cloud projects, folders, +// organizations and billing accounts. Once configured for an +// organization, it applies to all projects and folders in the Google +// Cloud organization. +func (r *OrganizationsService) GetCmekSettings(name string) *OrganizationsGetCmekSettingsCall { + c := &OrganizationsGetCmekSettingsCall{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 information. -func (c *LocationsBucketsViewsListCall) Fields(s ...googleapi.Field) *LocationsBucketsViewsListCall { +func (c *OrganizationsGetCmekSettingsCall) Fields(s ...googleapi.Field) *OrganizationsGetCmekSettingsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -19337,7 +23151,7 @@ func (c *LocationsBucketsViewsListCall) Fields(s ...googleapi.Field) *LocationsB // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *LocationsBucketsViewsListCall) IfNoneMatch(entityTag string) *LocationsBucketsViewsListCall { +func (c *OrganizationsGetCmekSettingsCall) IfNoneMatch(entityTag string) *OrganizationsGetCmekSettingsCall { c.ifNoneMatch_ = entityTag return c } @@ -19345,21 +23159,21 @@ func (c *LocationsBucketsViewsListCall) IfNoneMatch(entityTag string) *Locations // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsBucketsViewsListCall) Context(ctx context.Context) *LocationsBucketsViewsListCall { +func (c *OrganizationsGetCmekSettingsCall) Context(ctx context.Context) *OrganizationsGetCmekSettingsCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsBucketsViewsListCall) Header() http.Header { +func (c *OrganizationsGetCmekSettingsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsBucketsViewsListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsGetCmekSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -19372,7 +23186,7 @@ func (c *LocationsBucketsViewsListCall) doRequest(alt string) (*http.Response, e var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/cmekSettings") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -19380,19 +23194,19 @@ func (c *LocationsBucketsViewsListCall) doRequest(alt string) (*http.Response, e } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.buckets.views.list" call. -// Exactly one of *ListViewsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListViewsResponse.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 *LocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) (*ListViewsResponse, error) { +// Do executes the "logging.organizations.getCmekSettings" call. +// Exactly one of *CmekSettings or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CmekSettings.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 *OrganizationsGetCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSettings, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -19411,7 +23225,7 @@ func (c *LocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) (*ListV if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListViewsResponse{ + ret := &CmekSettings{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -19423,36 +23237,25 @@ func (c *LocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) (*ListV } return ret, nil // { - // "description": "Lists views on a log bucket.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/views", + // "description": "Gets the Logging CMEK settings for the given resource.Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", + // "flatPath": "v2/organizations/{organizationsId}/cmekSettings", // "httpMethod": "GET", - // "id": "logging.locations.buckets.views.list", + // "id": "logging.organizations.getCmekSettings", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "pageSize": { - // "description": "Optional. The maximum number of results to return from this request.Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The bucket whose views are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", + // "name": { + // "description": "Required. The resource for which to retrieve CMEK settings. \"projects/[PROJECT_ID]/cmekSettings\" \"organizations/[ORGANIZATION_ID]/cmekSettings\" \"billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings\" \"folders/[FOLDER_ID]/cmekSettings\" For example:\"organizations/12345/cmekSettings\"Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.", // "location": "path", - // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/views", + // "path": "v2/{+name}/cmekSettings", // "response": { - // "$ref": "ListViewsResponse" + // "$ref": "CmekSettings" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -19464,111 +23267,94 @@ func (c *LocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) (*ListV } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *LocationsBucketsViewsListCall) Pages(ctx context.Context, f func(*ListViewsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "logging.locations.buckets.views.patch": +// method id "logging.organizations.getSettings": -type LocationsBucketsViewsPatchCall struct { - s *Service - name string - logview *LogView - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsGetSettingsCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Patch: Updates a view on a log bucket. This method replaces the -// following fields in the existing view with values from the new view: -// filter. If an UNAVAILABLE error is returned, this indicates that -// system is not in a state where it can update the view. If this -// occurs, please try again in a few minutes. +// GetSettings: Gets the Log Router settings for the given +// resource.Note: Settings for the Log Router can be get for Google +// Cloud projects, folders, organizations and billing accounts. +// Currently it can only be configured for organizations. Once +// configured for an organization, it applies to all projects and +// folders in the Google Cloud organization.See Enabling CMEK for Log +// Router +// (https://cloud.google.com/logging/docs/routing/managed-encryption) +// for more information. // -// - name: The full resource name of the view to update -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v -// iews/[VIEW_ID]" For -// example:"projects/my-project/locations/global/buckets/my-bucket/view -// s/my-view". -func (r *LocationsBucketsViewsService) Patch(name string, logview *LogView) *LocationsBucketsViewsPatchCall { - c := &LocationsBucketsViewsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource for which to retrieve settings. +// "projects/[PROJECT_ID]/settings" +// "organizations/[ORGANIZATION_ID]/settings" +// "billingAccounts/[BILLING_ACCOUNT_ID]/settings" +// "folders/[FOLDER_ID]/settings" For +// example:"organizations/12345/settings"Note: Settings for the Log +// Router can be get for Google Cloud projects, folders, organizations +// and billing accounts. Currently it can only be configured for +// organizations. Once configured for an organization, it applies to +// all projects and folders in the Google Cloud organization. +func (r *OrganizationsService) GetSettings(name string) *OrganizationsGetSettingsCall { + c := &OrganizationsGetSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.logview = logview - return c -} - -// UpdateMask sets the optional parameter "updateMask": Field mask that -// specifies the fields in view that need an update. A field will be -// overwritten if, and only if, it is in the update mask. name and -// output only fields cannot be updated.For a detailed FieldMask -// definition, see -// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor -// example: updateMask=filter -func (c *LocationsBucketsViewsPatchCall) UpdateMask(updateMask string) *LocationsBucketsViewsPatchCall { - c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsBucketsViewsPatchCall) Fields(s ...googleapi.Field) *LocationsBucketsViewsPatchCall { +func (c *OrganizationsGetSettingsCall) Fields(s ...googleapi.Field) *OrganizationsGetSettingsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsGetSettingsCall) IfNoneMatch(entityTag string) *OrganizationsGetSettingsCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsBucketsViewsPatchCall) Context(ctx context.Context) *LocationsBucketsViewsPatchCall { +func (c *OrganizationsGetSettingsCall) Context(ctx context.Context) *OrganizationsGetSettingsCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsBucketsViewsPatchCall) Header() http.Header { +func (c *OrganizationsGetSettingsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsGetSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/settings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -19579,14 +23365,14 @@ func (c *LocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.buckets.views.patch" call. -// Exactly one of *LogView or error will be non-nil. Any non-2xx status +// Do executes the "logging.organizations.getSettings" call. +// Exactly one of *Settings or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *LogView.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 *LocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) (*LogView, error) { +// *Settings.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 *OrganizationsGetSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -19605,7 +23391,7 @@ func (c *LocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) (*LogV if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogView{ + ret := &Settings{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -19617,77 +23403,89 @@ func (c *LocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) (*LogV } return ret, nil // { - // "description": "Updates a view on a log bucket. This method replaces the following fields in the existing view with values from the new view: filter. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can update the view. If this occurs, please try again in a few minutes.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", - // "httpMethod": "PATCH", - // "id": "logging.locations.buckets.views.patch", + // "description": "Gets the Log Router settings for the given resource.Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", + // "flatPath": "v2/organizations/{organizationsId}/settings", + // "httpMethod": "GET", + // "id": "logging.organizations.getSettings", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The full resource name of the view to update \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", + // "description": "Required. The resource for which to retrieve settings. \"projects/[PROJECT_ID]/settings\" \"organizations/[ORGANIZATION_ID]/settings\" \"billingAccounts/[BILLING_ACCOUNT_ID]/settings\" \"folders/[FOLDER_ID]/settings\" For example:\"organizations/12345/settings\"Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.", // "location": "path", - // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", + // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "Optional. Field mask that specifies the fields in view that need an update. A field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+name}", - // "request": { - // "$ref": "LogView" - // }, + // "path": "v2/{+name}/settings", // "response": { - // "$ref": "LogView" + // "$ref": "Settings" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.locations.operations.cancel": +// method id "logging.organizations.updateCmekSettings": -type LocationsOperationsCancelCall struct { - s *Service - name string - canceloperationrequest *CancelOperationRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsUpdateCmekSettingsCall struct { + s *Service + name string + cmeksettings *CmekSettings + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Cancel: Starts asynchronous cancellation on a long-running operation. -// The server makes a best effort to cancel the operation, but success -// is not guaranteed. If the server doesn't support this method, it -// returns google.rpc.Code.UNIMPLEMENTED. Clients can use -// Operations.GetOperation or other methods to check whether the -// cancellation succeeded or whether the operation completed despite -// cancellation. On successful cancellation, the operation is not -// deleted; instead, it becomes an operation with an Operation.error -// value with a google.rpc.Status.code of 1, corresponding to -// Code.CANCELLED. +// UpdateCmekSettings: Updates the Log Router CMEK settings for the +// given resource.Note: CMEK for the Log Router can currently only be +// configured for Google Cloud organizations. Once configured, it +// applies to all projects and folders in the Google Cloud +// organization.UpdateCmekSettings will fail if 1) kms_key_name is +// invalid, or 2) the associated service account does not have the +// required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for +// the key, or 3) access to the key is disabled.See Enabling CMEK for +// Log Router +// (https://cloud.google.com/logging/docs/routing/managed-encryption) +// for more information. // -// - name: The name of the operation resource to be cancelled. -func (r *LocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *LocationsOperationsCancelCall { - c := &LocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name for the CMEK settings to update. +// "projects/[PROJECT_ID]/cmekSettings" +// "organizations/[ORGANIZATION_ID]/cmekSettings" +// "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" +// "folders/[FOLDER_ID]/cmekSettings" For +// example:"organizations/12345/cmekSettings"Note: CMEK for the Log +// Router can currently only be configured for Google Cloud +// organizations. Once configured, it applies to all projects and +// folders in the Google Cloud organization. +func (r *OrganizationsService) UpdateCmekSettings(name string, cmeksettings *CmekSettings) *OrganizationsUpdateCmekSettingsCall { + c := &OrganizationsUpdateCmekSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.canceloperationrequest = canceloperationrequest + c.cmeksettings = cmeksettings + return c +} + +// UpdateMask sets the optional parameter "updateMask": Field mask +// identifying which fields from cmek_settings should be updated. A +// field will be overwritten if and only if it is in the update mask. +// Output only fields cannot be updated.See FieldMask for more +// information.For example: "updateMask=kmsKeyName" +func (c *OrganizationsUpdateCmekSettingsCall) UpdateMask(updateMask string) *OrganizationsUpdateCmekSettingsCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsOperationsCancelCall) Fields(s ...googleapi.Field) *LocationsOperationsCancelCall { +func (c *OrganizationsUpdateCmekSettingsCall) Fields(s ...googleapi.Field) *OrganizationsUpdateCmekSettingsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -19695,21 +23493,21 @@ func (c *LocationsOperationsCancelCall) Fields(s ...googleapi.Field) *LocationsO // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsOperationsCancelCall) Context(ctx context.Context) *LocationsOperationsCancelCall { +func (c *OrganizationsUpdateCmekSettingsCall) Context(ctx context.Context) *OrganizationsUpdateCmekSettingsCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsOperationsCancelCall) Header() http.Header { +func (c *OrganizationsUpdateCmekSettingsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsUpdateCmekSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -19717,16 +23515,16 @@ func (c *LocationsOperationsCancelCall) doRequest(alt string) (*http.Response, e } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.cmeksettings) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:cancel") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/cmekSettings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -19737,14 +23535,14 @@ func (c *LocationsOperationsCancelCall) doRequest(alt string) (*http.Response, e return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.operations.cancel" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.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 *LocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "logging.organizations.updateCmekSettings" call. +// Exactly one of *CmekSettings or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CmekSettings.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 *OrganizationsUpdateCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSettings, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -19763,7 +23561,7 @@ func (c *LocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &CmekSettings{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -19775,110 +23573,133 @@ func (c *LocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty } return ret, nil // { - // "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/operations/{operationsId}:cancel", - // "httpMethod": "POST", - // "id": "logging.locations.operations.cancel", + // "description": "Updates the Log Router CMEK settings for the given resource.Note: CMEK for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.UpdateCmekSettings will fail if 1) kms_key_name is invalid, or 2) the associated service account does not have the required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, or 3) access to the key is disabled.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", + // "flatPath": "v2/organizations/{organizationsId}/cmekSettings", + // "httpMethod": "PATCH", + // "id": "logging.organizations.updateCmekSettings", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "The name of the operation resource to be cancelled.", + // "description": "Required. The resource name for the CMEK settings to update. \"projects/[PROJECT_ID]/cmekSettings\" \"organizations/[ORGANIZATION_ID]/cmekSettings\" \"billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings\" \"folders/[FOLDER_ID]/cmekSettings\" For example:\"organizations/12345/cmekSettings\"Note: CMEK for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.", // "location": "path", - // "pattern": "^[^/]+/[^/]+/locations/[^/]+/operations/[^/]+$", + // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "Optional. Field mask identifying which fields from cmek_settings should be updated. A field will be overwritten if and only if it is in the update mask. Output only fields cannot be updated.See FieldMask for more information.For example: \"updateMask=kmsKeyName\"", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+name}:cancel", + // "path": "v2/{+name}/cmekSettings", // "request": { - // "$ref": "CancelOperationRequest" + // "$ref": "CmekSettings" // }, // "response": { - // "$ref": "Empty" + // "$ref": "CmekSettings" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", // "https://www.googleapis.com/auth/logging.admin" // ] // } - -} - -// method id "logging.locations.operations.get": - -type LocationsOperationsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header + } -// Get: Gets the latest state of a long-running operation. Clients can -// use this method to poll the operation result at intervals as -// recommended by the API service. +// method id "logging.organizations.updateSettings": + +type OrganizationsUpdateSettingsCall struct { + s *Service + name string + settings *Settings + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// UpdateSettings: Updates the Log Router settings for the given +// resource.Note: Settings for the Log Router can currently only be +// configured for Google Cloud organizations. Once configured, it +// applies to all projects and folders in the Google Cloud +// organization.UpdateSettings will fail if 1) kms_key_name is invalid, +// or 2) the associated service account does not have the required +// roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, +// or 3) access to the key is disabled. 4) location_id is not supported +// by Logging. 5) location_id violate OrgPolicy.See Enabling CMEK for +// Log Router +// (https://cloud.google.com/logging/docs/routing/managed-encryption) +// for more information. // -// - name: The name of the operation resource. -func (r *LocationsOperationsService) Get(name string) *LocationsOperationsGetCall { - c := &LocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name for the settings to update. +// "organizations/[ORGANIZATION_ID]/settings" For +// example:"organizations/12345/settings"Note: Settings for the Log +// Router can currently only be configured for Google Cloud +// organizations. Once configured, it applies to all projects and +// folders in the Google Cloud organization. +func (r *OrganizationsService) UpdateSettings(name string, settings *Settings) *OrganizationsUpdateSettingsCall { + c := &OrganizationsUpdateSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.settings = settings + return c +} + +// UpdateMask sets the optional parameter "updateMask": Field mask +// identifying which fields from settings should be updated. A field +// will be overwritten if and only if it is in the update mask. Output +// only fields cannot be updated.See FieldMask for more information.For +// example: "updateMask=kmsKeyName" +func (c *OrganizationsUpdateSettingsCall) UpdateMask(updateMask string) *OrganizationsUpdateSettingsCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsOperationsGetCall) Fields(s ...googleapi.Field) *LocationsOperationsGetCall { +func (c *OrganizationsUpdateSettingsCall) Fields(s ...googleapi.Field) *OrganizationsUpdateSettingsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *LocationsOperationsGetCall) IfNoneMatch(entityTag string) *LocationsOperationsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsOperationsGetCall) Context(ctx context.Context) *LocationsOperationsGetCall { +func (c *OrganizationsUpdateSettingsCall) Context(ctx context.Context) *OrganizationsUpdateSettingsCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsOperationsGetCall) Header() http.Header { +func (c *OrganizationsUpdateSettingsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsUpdateSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.settings) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/settings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -19889,14 +23710,14 @@ func (c *LocationsOperationsGetCall) doRequest(alt string) (*http.Response, erro return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.operations.get" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at +// Do executes the "logging.organizations.updateSettings" call. +// Exactly one of *Settings or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Settings.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 *LocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *OrganizationsUpdateSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -19915,7 +23736,7 @@ func (c *LocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operatio if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &Settings{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -19927,155 +23748,130 @@ func (c *LocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operatio } return ret, nil // { - // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/operations/{operationsId}", - // "httpMethod": "GET", - // "id": "logging.locations.operations.get", + // "description": "Updates the Log Router settings for the given resource.Note: Settings for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.UpdateSettings will fail if 1) kms_key_name is invalid, or 2) the associated service account does not have the required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, or 3) access to the key is disabled. 4) location_id is not supported by Logging. 5) location_id violate OrgPolicy.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", + // "flatPath": "v2/organizations/{organizationsId}/settings", + // "httpMethod": "PATCH", + // "id": "logging.organizations.updateSettings", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "The name of the operation resource.", + // "description": "Required. The resource name for the settings to update. \"organizations/[ORGANIZATION_ID]/settings\" For example:\"organizations/12345/settings\"Note: Settings for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.", // "location": "path", - // "pattern": "^[^/]+/[^/]+/locations/[^/]+/operations/[^/]+$", + // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "Optional. Field mask identifying which fields from settings should be updated. A field will be overwritten if and only if it is in the update mask. Output only fields cannot be updated.See FieldMask for more information.For example: \"updateMask=kmsKeyName\"", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+name}/settings", + // "request": { + // "$ref": "Settings" + // }, // "response": { - // "$ref": "Operation" + // "$ref": "Settings" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// method id "logging.locations.operations.list": +// method id "logging.organizations.exclusions.create": -type LocationsOperationsListCall struct { +type OrganizationsExclusionsCreateCall struct { s *Service - name string + parent string + logexclusion *LogExclusion urlParams_ gensupport.URLParams - ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists operations that match the specified filter in the -// request. If the server doesn't support this method, it returns -// UNIMPLEMENTED.NOTE: the name binding allows API services to override -// the binding to use different resource name schemes, such as -// users/*/operations. To override the binding, API services can add a -// binding such as "/v1/{name=users/*}/operations" to their service -// configuration. For backwards compatibility, the default name includes -// the operations collection id, however overriding users must ensure -// the name binding is the parent resource, without the operations -// collection id. +// Create: Creates a new exclusion in the _Default sink in a specified +// parent resource. Only log entries belonging to that resource can be +// excluded. You can have up to 10 exclusions in a resource. // -// - name: The name of the operation's parent resource. -func (r *LocationsOperationsService) List(name string) *LocationsOperationsListCall { - c := &LocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - return c -} - -// Filter sets the optional parameter "filter": The standard list -// filter. -func (c *LocationsOperationsListCall) Filter(filter string) *LocationsOperationsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// PageSize sets the optional parameter "pageSize": The standard list -// page size. -func (c *LocationsOperationsListCall) PageSize(pageSize int64) *LocationsOperationsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The standard list -// page token. -func (c *LocationsOperationsListCall) PageToken(pageToken string) *LocationsOperationsListCall { - c.urlParams_.Set("pageToken", pageToken) +// - parent: The parent resource in which to create the exclusion: +// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For +// examples:"projects/my-logging-project" "organizations/123456789". +func (r *OrganizationsExclusionsService) Create(parent string, logexclusion *LogExclusion) *OrganizationsExclusionsCreateCall { + c := &OrganizationsExclusionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.logexclusion = logexclusion return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsOperationsListCall) Fields(s ...googleapi.Field) *LocationsOperationsListCall { +func (c *OrganizationsExclusionsCreateCall) Fields(s ...googleapi.Field) *OrganizationsExclusionsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *LocationsOperationsListCall) IfNoneMatch(entityTag string) *LocationsOperationsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsOperationsListCall) Context(ctx context.Context) *LocationsOperationsListCall { +func (c *OrganizationsExclusionsCreateCall) Context(ctx context.Context) *OrganizationsExclusionsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsOperationsListCall) Header() http.Header { +func (c *OrganizationsExclusionsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsOperationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsExclusionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.operations.list" call. -// Exactly one of *ListOperationsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListOperationsResponse.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 *LocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { +// Do executes the "logging.organizations.exclusions.create" call. +// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LogExclusion.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 *OrganizationsExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -20094,7 +23890,7 @@ func (c *LocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOpe if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListOperationsResponse{ + ret := &LogExclusion{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -20106,107 +23902,65 @@ func (c *LocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOpe } return ret, nil // { - // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as \"/v1/{name=users/*}/operations\" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/operations", - // "httpMethod": "GET", - // "id": "logging.locations.operations.list", + // "description": "Creates a new exclusion in the _Default sink in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.", + // "flatPath": "v2/organizations/{organizationsId}/exclusions", + // "httpMethod": "POST", + // "id": "logging.organizations.exclusions.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "filter": { - // "description": "The standard list filter.", - // "location": "query", - // "type": "string" - // }, - // "name": { - // "description": "The name of the operation's parent resource.", + // "parent": { + // "description": "Required. The parent resource in which to create the exclusion: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-logging-project\" \"organizations/123456789\"", // "location": "path", - // "pattern": "^[^/]+/[^/]+/locations/[^/]+$", - // "required": true, - // "type": "string" - // }, - // "pageSize": { - // "description": "The standard list page size.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The standard list page token.", - // "location": "query", + // "pattern": "^organizations/[^/]+$", + // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}/operations", + // "path": "v2/{+parent}/exclusions", + // "request": { + // "$ref": "LogExclusion" + // }, // "response": { - // "$ref": "ListOperationsResponse" + // "$ref": "LogExclusion" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *LocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "logging.logs.delete": +// method id "logging.organizations.exclusions.delete": -type LogsDeleteCall struct { +type OrganizationsExclusionsDeleteCall struct { s *Service - logName string + name string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Delete: Deletes all the log entries in a log for the _Default Log -// Bucket. The log reappears if it receives new entries. Log entries -// written shortly before the delete operation might not be deleted. -// Entries received after the delete operation with a timestamp before -// the operation will be deleted. +// Delete: Deletes an exclusion in the _Default sink. // -// - logName: The resource name of the log to delete: -// projects/[PROJECT_ID]/logs/[LOG_ID] -// organizations/[ORGANIZATION_ID]/logs/[LOG_ID] -// billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID] -// folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For -// example, "projects/my-project-id/logs/syslog", -// "organizations/123/logs/cloudaudit.googleapis.com%2Factivity".For -// more information about log names, see LogEntry. -func (r *LogsService) Delete(logName string) *LogsDeleteCall { - c := &LogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.logName = logName +// - name: The resource name of an existing exclusion to delete: +// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" +// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" +// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For +// example:"projects/my-project/exclusions/my-exclusion". +func (r *OrganizationsExclusionsService) Delete(name string) *OrganizationsExclusionsDeleteCall { + c := &OrganizationsExclusionsDeleteCall{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 information. -func (c *LogsDeleteCall) Fields(s ...googleapi.Field) *LogsDeleteCall { +func (c *OrganizationsExclusionsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsExclusionsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -20214,21 +23968,21 @@ func (c *LogsDeleteCall) Fields(s ...googleapi.Field) *LogsDeleteCall { // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LogsDeleteCall) Context(ctx context.Context) *LogsDeleteCall { +func (c *OrganizationsExclusionsDeleteCall) Context(ctx context.Context) *OrganizationsExclusionsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LogsDeleteCall) Header() http.Header { +func (c *OrganizationsExclusionsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LogsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -20238,7 +23992,7 @@ func (c *LogsDeleteCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+logName}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("DELETE", urls, body) if err != nil { @@ -20246,19 +24000,19 @@ func (c *LogsDeleteCall) doRequest(alt string) (*http.Response, error) { } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "logName": c.logName, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.logs.delete" call. +// Do executes the "logging.organizations.exclusions.delete" call. // Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *Empty.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 *LogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +func (c *OrganizationsExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -20289,23 +24043,23 @@ func (c *LogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { } return ret, nil // { - // "description": "Deletes all the log entries in a log for the _Default Log Bucket. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted.", - // "flatPath": "v2/{v2Id}/{v2Id1}/logs/{logsId}", + // "description": "Deletes an exclusion in the _Default sink.", + // "flatPath": "v2/organizations/{organizationsId}/exclusions/{exclusionsId}", // "httpMethod": "DELETE", - // "id": "logging.logs.delete", + // "id": "logging.organizations.exclusions.delete", // "parameterOrder": [ - // "logName" + // "name" // ], // "parameters": { - // "logName": { - // "description": "Required. The resource name of the log to delete: projects/[PROJECT_ID]/logs/[LOG_ID] organizations/[ORGANIZATION_ID]/logs/[LOG_ID] billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID] folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/123/logs/cloudaudit.googleapis.com%2Factivity\".For more information about log names, see LogEntry.", + // "name": { + // "description": "Required. The resource name of an existing exclusion to delete: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", // "location": "path", - // "pattern": "^[^/]+/[^/]+/logs/[^/]+$", + // "pattern": "^organizations/[^/]+/exclusions/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+logName}", + // "path": "v2/{+name}", // "response": { // "$ref": "Empty" // }, @@ -20317,69 +24071,35 @@ func (c *LogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { } -// method id "logging.logs.list": +// method id "logging.organizations.exclusions.get": -type LogsListCall struct { +type OrganizationsExclusionsGetCall struct { s *Service - parent string + name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists the logs in projects, organizations, folders, or billing -// accounts. Only logs that have entries are listed. +// Get: Gets the description of an exclusion in the _Default sink. // -// - parent: The resource name that owns the logs: projects/[PROJECT_ID] -// organizations/[ORGANIZATION_ID] -// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]. -func (r *LogsService) List(parent string) *LogsListCall { - c := &LogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return from this request. Non-positive values are -// ignored. The presence of nextPageToken in the response indicates that -// more results might be available. -func (c *LogsListCall) PageSize(pageSize int64) *LogsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": If present, then -// retrieve the next batch of results from the preceding call to this -// method. pageToken must be the value of nextPageToken from the -// previous response. The values of other method parameters should be -// identical to those in the previous call. -func (c *LogsListCall) PageToken(pageToken string) *LogsListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// ResourceNames sets the optional parameter "resourceNames": The -// resource name that owns the logs: -// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/view -// s/[VIEW_ID] -// organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKE -// T_ID]/views/[VIEW_ID] -// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[ -// BUCKET_ID]/views/[VIEW_ID] -// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/ -// [VIEW_ID]To support legacy queries, it could also be: -// projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] -// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID] -func (c *LogsListCall) ResourceNames(resourceNames ...string) *LogsListCall { - c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...)) +// - name: The resource name of an existing exclusion: +// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" +// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" +// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For +// example:"projects/my-project/exclusions/my-exclusion". +func (r *OrganizationsExclusionsService) Get(name string) *OrganizationsExclusionsGetCall { + c := &OrganizationsExclusionsGetCall{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 information. -func (c *LogsListCall) Fields(s ...googleapi.Field) *LogsListCall { +func (c *OrganizationsExclusionsGetCall) Fields(s ...googleapi.Field) *OrganizationsExclusionsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -20389,7 +24109,7 @@ func (c *LogsListCall) Fields(s ...googleapi.Field) *LogsListCall { // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *LogsListCall) IfNoneMatch(entityTag string) *LogsListCall { +func (c *OrganizationsExclusionsGetCall) IfNoneMatch(entityTag string) *OrganizationsExclusionsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -20397,21 +24117,21 @@ func (c *LogsListCall) IfNoneMatch(entityTag string) *LogsListCall { // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LogsListCall) Context(ctx context.Context) *LogsListCall { +func (c *OrganizationsExclusionsGetCall) Context(ctx context.Context) *OrganizationsExclusionsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LogsListCall) Header() http.Header { +func (c *OrganizationsExclusionsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LogsListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsExclusionsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -20424,7 +24144,7 @@ func (c *LogsListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -20432,19 +24152,19 @@ func (c *LogsListCall) doRequest(alt string) (*http.Response, error) { } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.logs.list" call. -// Exactly one of *ListLogsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListLogsResponse.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 *LogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) { +// Do executes the "logging.organizations.exclusions.get" call. +// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LogExclusion.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 *OrganizationsExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -20463,7 +24183,7 @@ func (c *LogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, erro if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListLogsResponse{ + ret := &LogExclusion{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -20475,88 +24195,56 @@ func (c *LogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, erro } return ret, nil // { - // "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", - // "flatPath": "v2/{v2Id}/{v2Id1}/logs", + // "description": "Gets the description of an exclusion in the _Default sink.", + // "flatPath": "v2/organizations/{organizationsId}/exclusions/{exclusionsId}", // "httpMethod": "GET", - // "id": "logging.logs.list", + // "id": "logging.organizations.exclusions.get", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "pageSize": { - // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The resource name that owns the logs: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", + // "name": { + // "description": "Required. The resource name of an existing exclusion: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", // "location": "path", - // "pattern": "^[^/]+/[^/]+$", + // "pattern": "^organizations/[^/]+/exclusions/[^/]+$", // "required": true, // "type": "string" - // }, - // "resourceNames": { - // "description": "Optional. The resource name that owns the logs: projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]To support legacy queries, it could also be: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", - // "location": "query", - // "repeated": true, - // "type": "string" - // } - // }, - // "path": "v2/{+parent}/logs", - // "response": { - // "$ref": "ListLogsResponse" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" - // ] - // } - -} - -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *LogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } + // } + // }, + // "path": "v2/{+name}", + // "response": { + // "$ref": "LogExclusion" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" + // ] + // } + } -// method id "logging.monitoredResourceDescriptors.list": +// method id "logging.organizations.exclusions.list": -type MonitoredResourceDescriptorsListCall struct { +type OrganizationsExclusionsListCall struct { s *Service + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists the descriptors for monitored resource types used by -// Logging. -func (r *MonitoredResourceDescriptorsService) List() *MonitoredResourceDescriptorsListCall { - c := &MonitoredResourceDescriptorsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// List: Lists all the exclusions on the _Default sink in a parent +// resource. +// +// - parent: The parent resource whose exclusions are to be listed. +// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]". +func (r *OrganizationsExclusionsService) List(parent string) *OrganizationsExclusionsListCall { + c := &OrganizationsExclusionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent return c } @@ -20564,7 +24252,7 @@ func (r *MonitoredResourceDescriptorsService) List() *MonitoredResourceDescripto // of results to return from this request. Non-positive values are // ignored. The presence of nextPageToken in the response indicates that // more results might be available. -func (c *MonitoredResourceDescriptorsListCall) PageSize(pageSize int64) *MonitoredResourceDescriptorsListCall { +func (c *OrganizationsExclusionsListCall) PageSize(pageSize int64) *OrganizationsExclusionsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } @@ -20574,7 +24262,7 @@ func (c *MonitoredResourceDescriptorsListCall) PageSize(pageSize int64) *Monitor // method. pageToken must be the value of nextPageToken from the // previous response. The values of other method parameters should be // identical to those in the previous call. -func (c *MonitoredResourceDescriptorsListCall) PageToken(pageToken string) *MonitoredResourceDescriptorsListCall { +func (c *OrganizationsExclusionsListCall) PageToken(pageToken string) *OrganizationsExclusionsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -20582,7 +24270,7 @@ func (c *MonitoredResourceDescriptorsListCall) PageToken(pageToken string) *Moni // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *MonitoredResourceDescriptorsListCall) Fields(s ...googleapi.Field) *MonitoredResourceDescriptorsListCall { +func (c *OrganizationsExclusionsListCall) Fields(s ...googleapi.Field) *OrganizationsExclusionsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -20592,7 +24280,7 @@ func (c *MonitoredResourceDescriptorsListCall) Fields(s ...googleapi.Field) *Mon // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *MonitoredResourceDescriptorsListCall) IfNoneMatch(entityTag string) *MonitoredResourceDescriptorsListCall { +func (c *OrganizationsExclusionsListCall) IfNoneMatch(entityTag string) *OrganizationsExclusionsListCall { c.ifNoneMatch_ = entityTag return c } @@ -20600,21 +24288,21 @@ func (c *MonitoredResourceDescriptorsListCall) IfNoneMatch(entityTag string) *Mo // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *MonitoredResourceDescriptorsListCall) Context(ctx context.Context) *MonitoredResourceDescriptorsListCall { +func (c *OrganizationsExclusionsListCall) Context(ctx context.Context) *OrganizationsExclusionsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *MonitoredResourceDescriptorsListCall) Header() http.Header { +func (c *OrganizationsExclusionsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *MonitoredResourceDescriptorsListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsExclusionsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -20627,26 +24315,27 @@ func (c *MonitoredResourceDescriptorsListCall) doRequest(alt string) (*http.Resp var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/monitoredResourceDescriptors") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") 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{ + "parent": c.parent, + }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.monitoredResourceDescriptors.list" call. -// Exactly one of *ListMonitoredResourceDescriptorsResponse or error -// will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *ListMonitoredResourceDescriptorsResponse.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 *MonitoredResourceDescriptorsListCall) Do(opts ...googleapi.CallOption) (*ListMonitoredResourceDescriptorsResponse, error) { +// Do executes the "logging.organizations.exclusions.list" call. +// Exactly one of *ListExclusionsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListExclusionsResponse.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 *OrganizationsExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -20665,7 +24354,7 @@ func (c *MonitoredResourceDescriptorsListCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListMonitoredResourceDescriptorsResponse{ + ret := &ListExclusionsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -20677,11 +24366,13 @@ func (c *MonitoredResourceDescriptorsListCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Lists the descriptors for monitored resource types used by Logging.", - // "flatPath": "v2/monitoredResourceDescriptors", + // "description": "Lists all the exclusions on the _Default sink in a parent resource.", + // "flatPath": "v2/organizations/{organizationsId}/exclusions", // "httpMethod": "GET", - // "id": "logging.monitoredResourceDescriptors.list", - // "parameterOrder": [], + // "id": "logging.organizations.exclusions.list", + // "parameterOrder": [ + // "parent" + // ], // "parameters": { // "pageSize": { // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", @@ -20693,11 +24384,18 @@ func (c *MonitoredResourceDescriptorsListCall) Do(opts ...googleapi.CallOption) // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", // "location": "query", // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent resource whose exclusions are to be listed. \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ", + // "location": "path", + // "pattern": "^organizations/[^/]+$", + // "required": true, + // "type": "string" // } // }, - // "path": "v2/monitoredResourceDescriptors", + // "path": "v2/{+parent}/exclusions", // "response": { - // "$ref": "ListMonitoredResourceDescriptorsResponse" + // "$ref": "ListExclusionsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -20712,7 +24410,7 @@ func (c *MonitoredResourceDescriptorsListCall) Do(opts ...googleapi.CallOption) // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *MonitoredResourceDescriptorsListCall) Pages(ctx context.Context, f func(*ListMonitoredResourceDescriptorsResponse) error) error { +func (c *OrganizationsExclusionsListCall) Pages(ctx context.Context, f func(*ListExclusionsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -20730,93 +24428,88 @@ func (c *MonitoredResourceDescriptorsListCall) Pages(ctx context.Context, f func } } -// method id "logging.organizations.getCmekSettings": +// method id "logging.organizations.exclusions.patch": -type OrganizationsGetCmekSettingsCall struct { +type OrganizationsExclusionsPatchCall struct { s *Service name string + logexclusion *LogExclusion urlParams_ gensupport.URLParams - ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// GetCmekSettings: Gets the Logging CMEK settings for the given -// resource.Note: CMEK for the Log Router can be configured for Google -// Cloud projects, folders, organizations and billing accounts. Once -// configured for an organization, it applies to all projects and -// folders in the Google Cloud organization.See Enabling CMEK for Log -// Router -// (https://cloud.google.com/logging/docs/routing/managed-encryption) -// for more information. +// Patch: Changes one or more properties of an existing exclusion in the +// _Default sink. // -// - name: The resource for which to retrieve CMEK settings. -// "projects/[PROJECT_ID]/cmekSettings" -// "organizations/[ORGANIZATION_ID]/cmekSettings" -// "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" -// "folders/[FOLDER_ID]/cmekSettings" For -// example:"organizations/12345/cmekSettings"Note: CMEK for the Log -// Router can be configured for Google Cloud projects, folders, -// organizations and billing accounts. Once configured for an -// organization, it applies to all projects and folders in the Google -// Cloud organization. -func (r *OrganizationsService) GetCmekSettings(name string) *OrganizationsGetCmekSettingsCall { - c := &OrganizationsGetCmekSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of the exclusion to update: +// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" +// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" +// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For +// example:"projects/my-project/exclusions/my-exclusion". +func (r *OrganizationsExclusionsService) Patch(name string, logexclusion *LogExclusion) *OrganizationsExclusionsPatchCall { + c := &OrganizationsExclusionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.logexclusion = logexclusion + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. A +// non-empty list of fields to change in the existing exclusion. New +// values for the fields are taken from the corresponding fields in the +// LogExclusion included in this request. Fields not mentioned in +// update_mask are not changed and are ignored in the request.For +// example, to change the filter and description of an exclusion, +// specify an update_mask of "filter,description". +func (c *OrganizationsExclusionsPatchCall) UpdateMask(updateMask string) *OrganizationsExclusionsPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsGetCmekSettingsCall) Fields(s ...googleapi.Field) *OrganizationsGetCmekSettingsCall { +func (c *OrganizationsExclusionsPatchCall) Fields(s ...googleapi.Field) *OrganizationsExclusionsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *OrganizationsGetCmekSettingsCall) IfNoneMatch(entityTag string) *OrganizationsGetCmekSettingsCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsGetCmekSettingsCall) Context(ctx context.Context) *OrganizationsGetCmekSettingsCall { +func (c *OrganizationsExclusionsPatchCall) Context(ctx context.Context) *OrganizationsExclusionsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsGetCmekSettingsCall) Header() http.Header { +func (c *OrganizationsExclusionsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsGetCmekSettingsCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsExclusionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/cmekSettings") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -20827,14 +24520,14 @@ func (c *OrganizationsGetCmekSettingsCall) doRequest(alt string) (*http.Response return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.getCmekSettings" call. -// Exactly one of *CmekSettings or error will be non-nil. Any non-2xx +// Do executes the "logging.organizations.exclusions.patch" call. +// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either -// *CmekSettings.ServerResponse.Header or (if a response was returned at +// *LogExclusion.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 *OrganizationsGetCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSettings, error) { +func (c *OrganizationsExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -20853,7 +24546,7 @@ func (c *OrganizationsGetCmekSettingsCall) Do(opts ...googleapi.CallOption) (*Cm if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &CmekSettings{ + ret := &LogExclusion{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -20865,39 +24558,46 @@ func (c *OrganizationsGetCmekSettingsCall) Do(opts ...googleapi.CallOption) (*Cm } return ret, nil // { - // "description": "Gets the Logging CMEK settings for the given resource.Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", - // "flatPath": "v2/organizations/{organizationsId}/cmekSettings", - // "httpMethod": "GET", - // "id": "logging.organizations.getCmekSettings", + // "description": "Changes one or more properties of an existing exclusion in the _Default sink.", + // "flatPath": "v2/organizations/{organizationsId}/exclusions/{exclusionsId}", + // "httpMethod": "PATCH", + // "id": "logging.organizations.exclusions.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource for which to retrieve CMEK settings. \"projects/[PROJECT_ID]/cmekSettings\" \"organizations/[ORGANIZATION_ID]/cmekSettings\" \"billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings\" \"folders/[FOLDER_ID]/cmekSettings\" For example:\"organizations/12345/cmekSettings\"Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.", + // "description": "Required. The resource name of the exclusion to update: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", // "location": "path", - // "pattern": "^organizations/[^/]+$", + // "pattern": "^organizations/[^/]+/exclusions/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "Required. A non-empty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of \"filter,description\".", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+name}/cmekSettings", + // "path": "v2/{+name}", + // "request": { + // "$ref": "LogExclusion" + // }, // "response": { - // "$ref": "CmekSettings" + // "$ref": "LogExclusion" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// method id "logging.organizations.getSettings": +// method id "logging.organizations.locations.get": -type OrganizationsGetSettingsCall struct { +type OrganizationsLocationsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -20906,28 +24606,11 @@ type OrganizationsGetSettingsCall struct { header_ http.Header } -// GetSettings: Gets the Log Router settings for the given -// resource.Note: Settings for the Log Router can be get for Google -// Cloud projects, folders, organizations and billing accounts. -// Currently it can only be configured for organizations. Once -// configured for an organization, it applies to all projects and -// folders in the Google Cloud organization.See Enabling CMEK for Log -// Router -// (https://cloud.google.com/logging/docs/routing/managed-encryption) -// for more information. +// Get: Gets information about a location. // -// - name: The resource for which to retrieve settings. -// "projects/[PROJECT_ID]/settings" -// "organizations/[ORGANIZATION_ID]/settings" -// "billingAccounts/[BILLING_ACCOUNT_ID]/settings" -// "folders/[FOLDER_ID]/settings" For -// example:"organizations/12345/settings"Note: Settings for the Log -// Router can be get for Google Cloud projects, folders, organizations -// and billing accounts. Currently it can only be configured for -// organizations. Once configured for an organization, it applies to -// all projects and folders in the Google Cloud organization. -func (r *OrganizationsService) GetSettings(name string) *OrganizationsGetSettingsCall { - c := &OrganizationsGetSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Resource name for the location. +func (r *OrganizationsLocationsService) Get(name string) *OrganizationsLocationsGetCall { + c := &OrganizationsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -20935,7 +24618,7 @@ func (r *OrganizationsService) GetSettings(name string) *OrganizationsGetSetting // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsGetSettingsCall) Fields(s ...googleapi.Field) *OrganizationsGetSettingsCall { +func (c *OrganizationsLocationsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -20945,7 +24628,7 @@ func (c *OrganizationsGetSettingsCall) Fields(s ...googleapi.Field) *Organizatio // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsGetSettingsCall) IfNoneMatch(entityTag string) *OrganizationsGetSettingsCall { +func (c *OrganizationsLocationsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -20953,21 +24636,21 @@ func (c *OrganizationsGetSettingsCall) IfNoneMatch(entityTag string) *Organizati // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsGetSettingsCall) Context(ctx context.Context) *OrganizationsGetSettingsCall { +func (c *OrganizationsLocationsGetCall) Context(ctx context.Context) *OrganizationsLocationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsGetSettingsCall) Header() http.Header { +func (c *OrganizationsLocationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsGetSettingsCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -20980,7 +24663,7 @@ func (c *OrganizationsGetSettingsCall) doRequest(alt string) (*http.Response, er var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/settings") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -20993,14 +24676,14 @@ func (c *OrganizationsGetSettingsCall) doRequest(alt string) (*http.Response, er return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.getSettings" call. -// Exactly one of *Settings or error will be non-nil. Any non-2xx status +// Do executes the "logging.organizations.locations.get" call. +// Exactly one of *Location or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *Settings.ServerResponse.Header or (if a response was returned at +// *Location.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 *OrganizationsGetSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, error) { +func (c *OrganizationsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -21019,7 +24702,7 @@ func (c *OrganizationsGetSettingsCall) Do(opts ...googleapi.CallOption) (*Settin if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Settings{ + ret := &Location{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -21031,25 +24714,25 @@ func (c *OrganizationsGetSettingsCall) Do(opts ...googleapi.CallOption) (*Settin } return ret, nil // { - // "description": "Gets the Log Router settings for the given resource.Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", - // "flatPath": "v2/organizations/{organizationsId}/settings", + // "description": "Gets information about a location.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}", // "httpMethod": "GET", - // "id": "logging.organizations.getSettings", + // "id": "logging.organizations.locations.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource for which to retrieve settings. \"projects/[PROJECT_ID]/settings\" \"organizations/[ORGANIZATION_ID]/settings\" \"billingAccounts/[BILLING_ACCOUNT_ID]/settings\" \"folders/[FOLDER_ID]/settings\" For example:\"organizations/12345/settings\"Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.", + // "description": "Resource name for the location.", // "location": "path", - // "pattern": "^organizations/[^/]+$", + // "pattern": "^organizations/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}/settings", + // "path": "v2/{+name}", // "response": { - // "$ref": "Settings" + // "$ref": "Location" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -21061,98 +24744,103 @@ func (c *OrganizationsGetSettingsCall) Do(opts ...googleapi.CallOption) (*Settin } -// method id "logging.organizations.updateCmekSettings": +// method id "logging.organizations.locations.list": -type OrganizationsUpdateCmekSettingsCall struct { +type OrganizationsLocationsListCall struct { s *Service name string - cmeksettings *CmekSettings urlParams_ gensupport.URLParams + ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// UpdateCmekSettings: Updates the Log Router CMEK settings for the -// given resource.Note: CMEK for the Log Router can currently only be -// configured for Google Cloud organizations. Once configured, it -// applies to all projects and folders in the Google Cloud -// organization.UpdateCmekSettings will fail if 1) kms_key_name is -// invalid, or 2) the associated service account does not have the -// required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for -// the key, or 3) access to the key is disabled.See Enabling CMEK for -// Log Router -// (https://cloud.google.com/logging/docs/routing/managed-encryption) -// for more information. +// List: Lists information about the supported locations for this +// service. // -// - name: The resource name for the CMEK settings to update. -// "projects/[PROJECT_ID]/cmekSettings" -// "organizations/[ORGANIZATION_ID]/cmekSettings" -// "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" -// "folders/[FOLDER_ID]/cmekSettings" For -// example:"organizations/12345/cmekSettings"Note: CMEK for the Log -// Router can currently only be configured for Google Cloud -// organizations. Once configured, it applies to all projects and -// folders in the Google Cloud organization. -func (r *OrganizationsService) UpdateCmekSettings(name string, cmeksettings *CmekSettings) *OrganizationsUpdateCmekSettingsCall { - c := &OrganizationsUpdateCmekSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource that owns the locations collection, if +// applicable. +func (r *OrganizationsLocationsService) List(name string) *OrganizationsLocationsListCall { + c := &OrganizationsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.cmeksettings = cmeksettings return c } -// UpdateMask sets the optional parameter "updateMask": Field mask -// identifying which fields from cmek_settings should be updated. A -// field will be overwritten if and only if it is in the update mask. -// Output only fields cannot be updated.See FieldMask for more -// information.For example: "updateMask=kmsKeyName" -func (c *OrganizationsUpdateCmekSettingsCall) UpdateMask(updateMask string) *OrganizationsUpdateCmekSettingsCall { - c.urlParams_.Set("updateMask", updateMask) +// Filter sets the optional parameter "filter": A filter to narrow down +// results to a preferred subset. The filtering language accepts strings +// like "displayName=tokyo", and is documented in more detail in AIP-160 +// (https://google.aip.dev/160). +func (c *OrganizationsLocationsListCall) Filter(filter string) *OrganizationsLocationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return. If not set, the service selects a default. +func (c *OrganizationsLocationsListCall) PageSize(pageSize int64) *OrganizationsLocationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token +// received from the next_page_token field in the response. Send that +// page token to receive the subsequent page. +func (c *OrganizationsLocationsListCall) PageToken(pageToken string) *OrganizationsLocationsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsUpdateCmekSettingsCall) Fields(s ...googleapi.Field) *OrganizationsUpdateCmekSettingsCall { +func (c *OrganizationsLocationsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsLocationsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsUpdateCmekSettingsCall) Context(ctx context.Context) *OrganizationsUpdateCmekSettingsCall { +func (c *OrganizationsLocationsListCall) Context(ctx context.Context) *OrganizationsLocationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsUpdateCmekSettingsCall) Header() http.Header { +func (c *OrganizationsLocationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsUpdateCmekSettingsCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cmeksettings) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/cmekSettings") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -21163,14 +24851,14 @@ func (c *OrganizationsUpdateCmekSettingsCall) doRequest(alt string) (*http.Respo return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.updateCmekSettings" call. -// Exactly one of *CmekSettings or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *CmekSettings.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 *OrganizationsUpdateCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSettings, error) { +// Do executes the "logging.organizations.locations.list" call. +// Exactly one of *ListLocationsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListLocationsResponse.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 *OrganizationsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -21189,7 +24877,7 @@ func (c *OrganizationsUpdateCmekSettingsCall) Do(opts ...googleapi.CallOption) ( if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &CmekSettings{ + ret := &ListLocationsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -21201,94 +24889,111 @@ func (c *OrganizationsUpdateCmekSettingsCall) Do(opts ...googleapi.CallOption) ( } return ret, nil // { - // "description": "Updates the Log Router CMEK settings for the given resource.Note: CMEK for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.UpdateCmekSettings will fail if 1) kms_key_name is invalid, or 2) the associated service account does not have the required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, or 3) access to the key is disabled.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", - // "flatPath": "v2/organizations/{organizationsId}/cmekSettings", - // "httpMethod": "PATCH", - // "id": "logging.organizations.updateCmekSettings", + // "description": "Lists information about the supported locations for this service.", + // "flatPath": "v2/organizations/{organizationsId}/locations", + // "httpMethod": "GET", + // "id": "logging.organizations.locations.list", // "parameterOrder": [ // "name" // ], // "parameters": { + // "filter": { + // "description": "A filter to narrow down results to a preferred subset. The filtering language accepts strings like \"displayName=tokyo\", and is documented in more detail in AIP-160 (https://google.aip.dev/160).", + // "location": "query", + // "type": "string" + // }, // "name": { - // "description": "Required. The resource name for the CMEK settings to update. \"projects/[PROJECT_ID]/cmekSettings\" \"organizations/[ORGANIZATION_ID]/cmekSettings\" \"billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings\" \"folders/[FOLDER_ID]/cmekSettings\" For example:\"organizations/12345/cmekSettings\"Note: CMEK for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.", + // "description": "The resource that owns the locations collection, if applicable.", // "location": "path", // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" // }, - // "updateMask": { - // "description": "Optional. Field mask identifying which fields from cmek_settings should be updated. A field will be overwritten if and only if it is in the update mask. Output only fields cannot be updated.See FieldMask for more information.For example: \"updateMask=kmsKeyName\"", - // "format": "google-fieldmask", + // "pageSize": { + // "description": "The maximum number of results to return. If not set, the service selects a default.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token received from the next_page_token field in the response. Send that page token to receive the subsequent page.", // "location": "query", // "type": "string" // } // }, - // "path": "v2/{+name}/cmekSettings", - // "request": { - // "$ref": "CmekSettings" - // }, + // "path": "v2/{+name}/locations", // "response": { - // "$ref": "CmekSettings" + // "$ref": "ListLocationsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.organizations.updateSettings": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *OrganizationsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type OrganizationsUpdateSettingsCall struct { +// method id "logging.organizations.locations.buckets.create": + +type OrganizationsLocationsBucketsCreateCall struct { s *Service - name string - settings *Settings + parent string + logbucket *LogBucket urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// UpdateSettings: Updates the Log Router settings for the given -// resource.Note: Settings for the Log Router can currently only be -// configured for Google Cloud organizations. Once configured, it -// applies to all projects and folders in the Google Cloud -// organization.UpdateSettings will fail if 1) kms_key_name is invalid, -// or 2) the associated service account does not have the required -// roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, -// or 3) access to the key is disabled. 4) location_id is not supported -// by Logging. 5) location_id violate OrgPolicy.See Enabling CMEK for -// Log Router -// (https://cloud.google.com/logging/docs/routing/managed-encryption) -// for more information. +// Create: Creates a log bucket that can be used to store log entries. +// After a bucket has been created, the bucket's location cannot be +// changed. // -// - name: The resource name for the settings to update. -// "organizations/[ORGANIZATION_ID]/settings" For -// example:"organizations/12345/settings"Note: Settings for the Log -// Router can currently only be configured for Google Cloud -// organizations. Once configured, it applies to all projects and -// folders in the Google Cloud organization. -func (r *OrganizationsService) UpdateSettings(name string, settings *Settings) *OrganizationsUpdateSettingsCall { - c := &OrganizationsUpdateSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.settings = settings +// - parent: The resource in which to create the log bucket: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For +// example:"projects/my-project/locations/global". +func (r *OrganizationsLocationsBucketsService) Create(parent string, logbucket *LogBucket) *OrganizationsLocationsBucketsCreateCall { + c := &OrganizationsLocationsBucketsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.logbucket = logbucket return c } -// UpdateMask sets the optional parameter "updateMask": Field mask -// identifying which fields from settings should be updated. A field -// will be overwritten if and only if it is in the update mask. Output -// only fields cannot be updated.See FieldMask for more information.For -// example: "updateMask=kmsKeyName" -func (c *OrganizationsUpdateSettingsCall) UpdateMask(updateMask string) *OrganizationsUpdateSettingsCall { - c.urlParams_.Set("updateMask", updateMask) +// BucketId sets the optional parameter "bucketId": Required. A +// client-assigned identifier such as "my-bucket". Identifiers are +// limited to 100 characters and can include only letters, digits, +// underscores, hyphens, and periods. +func (c *OrganizationsLocationsBucketsCreateCall) BucketId(bucketId string) *OrganizationsLocationsBucketsCreateCall { + c.urlParams_.Set("bucketId", bucketId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsUpdateSettingsCall) Fields(s ...googleapi.Field) *OrganizationsUpdateSettingsCall { +func (c *OrganizationsLocationsBucketsCreateCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -21296,21 +25001,21 @@ func (c *OrganizationsUpdateSettingsCall) Fields(s ...googleapi.Field) *Organiza // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsUpdateSettingsCall) Context(ctx context.Context) *OrganizationsUpdateSettingsCall { +func (c *OrganizationsLocationsBucketsCreateCall) Context(ctx context.Context) *OrganizationsLocationsBucketsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsUpdateSettingsCall) Header() http.Header { +func (c *OrganizationsLocationsBucketsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsUpdateSettingsCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -21318,34 +25023,34 @@ func (c *OrganizationsUpdateSettingsCall) doRequest(alt string) (*http.Response, } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.settings) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/settings") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.updateSettings" call. -// Exactly one of *Settings or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Settings.ServerResponse.Header or (if a response was returned at +// Do executes the "logging.organizations.locations.buckets.create" call. +// Exactly one of *LogBucket or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LogBucket.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 *OrganizationsUpdateSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, error) { +func (c *OrganizationsLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -21364,7 +25069,7 @@ func (c *OrganizationsUpdateSettingsCall) Do(opts ...googleapi.CallOption) (*Set if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Settings{ + ret := &LogBucket{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -21376,34 +25081,33 @@ func (c *OrganizationsUpdateSettingsCall) Do(opts ...googleapi.CallOption) (*Set } return ret, nil // { - // "description": "Updates the Log Router settings for the given resource.Note: Settings for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.UpdateSettings will fail if 1) kms_key_name is invalid, or 2) the associated service account does not have the required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, or 3) access to the key is disabled. 4) location_id is not supported by Logging. 5) location_id violate OrgPolicy.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", - // "flatPath": "v2/organizations/{organizationsId}/settings", - // "httpMethod": "PATCH", - // "id": "logging.organizations.updateSettings", + // "description": "Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets", + // "httpMethod": "POST", + // "id": "logging.organizations.locations.buckets.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The resource name for the settings to update. \"organizations/[ORGANIZATION_ID]/settings\" For example:\"organizations/12345/settings\"Note: Settings for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.", - // "location": "path", - // "pattern": "^organizations/[^/]+$", - // "required": true, + // "bucketId": { + // "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", + // "location": "query", // "type": "string" // }, - // "updateMask": { - // "description": "Optional. Field mask identifying which fields from settings should be updated. A field will be overwritten if and only if it is in the update mask. Output only fields cannot be updated.See FieldMask for more information.For example: \"updateMask=kmsKeyName\"", - // "format": "google-fieldmask", - // "location": "query", + // "parent": { + // "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"", + // "location": "path", + // "pattern": "^organizations/[^/]+/locations/[^/]+$", + // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}/settings", + // "path": "v2/{+parent}/buckets", // "request": { - // "$ref": "Settings" + // "$ref": "LogBucket" // }, // "response": { - // "$ref": "Settings" + // "$ref": "LogBucket" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -21413,36 +25117,44 @@ func (c *OrganizationsUpdateSettingsCall) Do(opts ...googleapi.CallOption) (*Set } -// method id "logging.organizations.exclusions.create": +// method id "logging.organizations.locations.buckets.createAsync": -type OrganizationsExclusionsCreateCall struct { - s *Service - parent string - logexclusion *LogExclusion - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsLocationsBucketsCreateAsyncCall struct { + s *Service + parent string + logbucket *LogBucket + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates a new exclusion in the _Default sink in a specified -// parent resource. Only log entries belonging to that resource can be -// excluded. You can have up to 10 exclusions in a resource. +// CreateAsync: Creates a log bucket asynchronously that can be used to +// store log entries.After a bucket has been created, the bucket's +// location cannot be changed. // -// - parent: The parent resource in which to create the exclusion: -// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For -// examples:"projects/my-logging-project" "organizations/123456789". -func (r *OrganizationsExclusionsService) Create(parent string, logexclusion *LogExclusion) *OrganizationsExclusionsCreateCall { - c := &OrganizationsExclusionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The resource in which to create the log bucket: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For +// example:"projects/my-project/locations/global". +func (r *OrganizationsLocationsBucketsService) CreateAsync(parent string, logbucket *LogBucket) *OrganizationsLocationsBucketsCreateAsyncCall { + c := &OrganizationsLocationsBucketsCreateAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.logexclusion = logexclusion + c.logbucket = logbucket + return c +} + +// BucketId sets the optional parameter "bucketId": Required. A +// client-assigned identifier such as "my-bucket". Identifiers are +// limited to 100 characters and can include only letters, digits, +// underscores, hyphens, and periods. +func (c *OrganizationsLocationsBucketsCreateAsyncCall) BucketId(bucketId string) *OrganizationsLocationsBucketsCreateAsyncCall { + c.urlParams_.Set("bucketId", bucketId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsExclusionsCreateCall) Fields(s ...googleapi.Field) *OrganizationsExclusionsCreateCall { +func (c *OrganizationsLocationsBucketsCreateAsyncCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsCreateAsyncCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -21450,21 +25162,21 @@ func (c *OrganizationsExclusionsCreateCall) Fields(s ...googleapi.Field) *Organi // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsExclusionsCreateCall) Context(ctx context.Context) *OrganizationsExclusionsCreateCall { +func (c *OrganizationsLocationsBucketsCreateAsyncCall) Context(ctx context.Context) *OrganizationsLocationsBucketsCreateAsyncCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsExclusionsCreateCall) Header() http.Header { +func (c *OrganizationsLocationsBucketsCreateAsyncCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsExclusionsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsBucketsCreateAsyncCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -21472,14 +25184,14 @@ func (c *OrganizationsExclusionsCreateCall) doRequest(alt string) (*http.Respons } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets:createAsync") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -21492,14 +25204,14 @@ func (c *OrganizationsExclusionsCreateCall) doRequest(alt string) (*http.Respons return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.exclusions.create" call. -// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx +// Do executes the "logging.organizations.locations.buckets.createAsync" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either -// *LogExclusion.ServerResponse.Header or (if a response was returned at +// *Operation.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 *OrganizationsExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { +func (c *OrganizationsLocationsBucketsCreateAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -21518,7 +25230,7 @@ func (c *OrganizationsExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*L if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogExclusion{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -21530,28 +25242,33 @@ func (c *OrganizationsExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*L } return ret, nil // { - // "description": "Creates a new exclusion in the _Default sink in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.", - // "flatPath": "v2/organizations/{organizationsId}/exclusions", + // "description": "Creates a log bucket asynchronously that can be used to store log entries.After a bucket has been created, the bucket's location cannot be changed.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets:createAsync", // "httpMethod": "POST", - // "id": "logging.organizations.exclusions.create", + // "id": "logging.organizations.locations.buckets.createAsync", // "parameterOrder": [ // "parent" // ], // "parameters": { + // "bucketId": { + // "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", + // "location": "query", + // "type": "string" + // }, // "parent": { - // "description": "Required. The parent resource in which to create the exclusion: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-logging-project\" \"organizations/123456789\"", + // "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"", // "location": "path", - // "pattern": "^organizations/[^/]+$", + // "pattern": "^organizations/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/exclusions", + // "path": "v2/{+parent}/buckets:createAsync", // "request": { - // "$ref": "LogExclusion" + // "$ref": "LogBucket" // }, // "response": { - // "$ref": "LogExclusion" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -21561,9 +25278,9 @@ func (c *OrganizationsExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*L } -// method id "logging.organizations.exclusions.delete": +// method id "logging.organizations.locations.buckets.delete": -type OrganizationsExclusionsDeleteCall struct { +type OrganizationsLocationsBucketsDeleteCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -21571,16 +25288,21 @@ type OrganizationsExclusionsDeleteCall struct { header_ http.Header } -// Delete: Deletes an exclusion in the _Default sink. +// Delete: Deletes a log bucket.Changes the bucket's lifecycle_state to +// the DELETE_REQUESTED state. After 7 days, the bucket will be purged +// and all log entries in the bucket will be permanently deleted. // -// - name: The resource name of an existing exclusion to delete: -// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" -// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" -// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For -// example:"projects/my-project/exclusions/my-exclusion". -func (r *OrganizationsExclusionsService) Delete(name string) *OrganizationsExclusionsDeleteCall { - c := &OrganizationsExclusionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The full resource name of the bucket to delete. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *OrganizationsLocationsBucketsService) Delete(name string) *OrganizationsLocationsBucketsDeleteCall { + c := &OrganizationsLocationsBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -21588,7 +25310,7 @@ func (r *OrganizationsExclusionsService) Delete(name string) *OrganizationsExclu // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsExclusionsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsExclusionsDeleteCall { +func (c *OrganizationsLocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -21596,21 +25318,21 @@ func (c *OrganizationsExclusionsDeleteCall) Fields(s ...googleapi.Field) *Organi // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsExclusionsDeleteCall) Context(ctx context.Context) *OrganizationsExclusionsDeleteCall { +func (c *OrganizationsLocationsBucketsDeleteCall) Context(ctx context.Context) *OrganizationsLocationsBucketsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsExclusionsDeleteCall) Header() http.Header { +func (c *OrganizationsLocationsBucketsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -21633,14 +25355,14 @@ func (c *OrganizationsExclusionsDeleteCall) doRequest(alt string) (*http.Respons return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.exclusions.delete" call. +// Do executes the "logging.organizations.locations.buckets.delete" call. // Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *Empty.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 *OrganizationsExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +func (c *OrganizationsLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -21671,18 +25393,18 @@ func (c *OrganizationsExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*E } return ret, nil // { - // "description": "Deletes an exclusion in the _Default sink.", - // "flatPath": "v2/organizations/{organizationsId}/exclusions/{exclusionsId}", + // "description": "Deletes a log bucket.Changes the bucket's lifecycle_state to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}", // "httpMethod": "DELETE", - // "id": "logging.organizations.exclusions.delete", + // "id": "logging.organizations.locations.buckets.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource name of an existing exclusion to delete: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", + // "description": "Required. The full resource name of the bucket to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", - // "pattern": "^organizations/[^/]+/exclusions/[^/]+$", + // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" // } @@ -21699,9 +25421,9 @@ func (c *OrganizationsExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*E } -// method id "logging.organizations.exclusions.get": +// method id "logging.organizations.locations.buckets.get": -type OrganizationsExclusionsGetCall struct { +type OrganizationsLocationsBucketsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -21710,16 +25432,19 @@ type OrganizationsExclusionsGetCall struct { header_ http.Header } -// Get: Gets the description of an exclusion in the _Default sink. +// Get: Gets a log bucket. // -// - name: The resource name of an existing exclusion: -// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" -// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" -// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For -// example:"projects/my-project/exclusions/my-exclusion". -func (r *OrganizationsExclusionsService) Get(name string) *OrganizationsExclusionsGetCall { - c := &OrganizationsExclusionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of the bucket: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *OrganizationsLocationsBucketsService) Get(name string) *OrganizationsLocationsBucketsGetCall { + c := &OrganizationsLocationsBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -21727,7 +25452,7 @@ func (r *OrganizationsExclusionsService) Get(name string) *OrganizationsExclusio // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsExclusionsGetCall) Fields(s ...googleapi.Field) *OrganizationsExclusionsGetCall { +func (c *OrganizationsLocationsBucketsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -21737,7 +25462,7 @@ func (c *OrganizationsExclusionsGetCall) Fields(s ...googleapi.Field) *Organizat // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsExclusionsGetCall) IfNoneMatch(entityTag string) *OrganizationsExclusionsGetCall { +func (c *OrganizationsLocationsBucketsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -21745,21 +25470,21 @@ func (c *OrganizationsExclusionsGetCall) IfNoneMatch(entityTag string) *Organiza // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsExclusionsGetCall) Context(ctx context.Context) *OrganizationsExclusionsGetCall { +func (c *OrganizationsLocationsBucketsGetCall) Context(ctx context.Context) *OrganizationsLocationsBucketsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsExclusionsGetCall) Header() http.Header { +func (c *OrganizationsLocationsBucketsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsExclusionsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsBucketsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -21785,14 +25510,14 @@ func (c *OrganizationsExclusionsGetCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.exclusions.get" call. -// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx +// Do executes the "logging.organizations.locations.buckets.get" call. +// Exactly one of *LogBucket or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either -// *LogExclusion.ServerResponse.Header or (if a response was returned at +// *LogBucket.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 *OrganizationsExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { +func (c *OrganizationsLocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -21811,7 +25536,7 @@ func (c *OrganizationsExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogE if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogExclusion{ + ret := &LogBucket{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -21823,25 +25548,25 @@ func (c *OrganizationsExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogE } return ret, nil // { - // "description": "Gets the description of an exclusion in the _Default sink.", - // "flatPath": "v2/organizations/{organizationsId}/exclusions/{exclusionsId}", + // "description": "Gets a log bucket.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}", // "httpMethod": "GET", - // "id": "logging.organizations.exclusions.get", + // "id": "logging.organizations.locations.buckets.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource name of an existing exclusion: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", + // "description": "Required. The resource name of the bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", - // "pattern": "^organizations/[^/]+/exclusions/[^/]+$", + // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v2/{+name}", // "response": { - // "$ref": "LogExclusion" + // "$ref": "LogBucket" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -21853,9 +25578,9 @@ func (c *OrganizationsExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogE } -// method id "logging.organizations.exclusions.list": +// method id "logging.organizations.locations.buckets.list": -type OrganizationsExclusionsListCall struct { +type OrganizationsLocationsBucketsListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -21864,14 +25589,17 @@ type OrganizationsExclusionsListCall struct { header_ http.Header } -// List: Lists all the exclusions on the _Default sink in a parent -// resource. +// List: Lists log buckets. // -// - parent: The parent resource whose exclusions are to be listed. -// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]". -func (r *OrganizationsExclusionsService) List(parent string) *OrganizationsExclusionsListCall { - c := &OrganizationsExclusionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The parent resource whose buckets are to be listed: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" Note: The locations +// portion of the resource must be specified, but supplying the +// character - in place of LOCATION_ID will return all buckets. +func (r *OrganizationsLocationsBucketsService) List(parent string) *OrganizationsLocationsBucketsListCall { + c := &OrganizationsLocationsBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } @@ -21880,7 +25608,7 @@ func (r *OrganizationsExclusionsService) List(parent string) *OrganizationsExclu // of results to return from this request. Non-positive values are // ignored. The presence of nextPageToken in the response indicates that // more results might be available. -func (c *OrganizationsExclusionsListCall) PageSize(pageSize int64) *OrganizationsExclusionsListCall { +func (c *OrganizationsLocationsBucketsListCall) PageSize(pageSize int64) *OrganizationsLocationsBucketsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } @@ -21890,7 +25618,7 @@ func (c *OrganizationsExclusionsListCall) PageSize(pageSize int64) *Organization // method. pageToken must be the value of nextPageToken from the // previous response. The values of other method parameters should be // identical to those in the previous call. -func (c *OrganizationsExclusionsListCall) PageToken(pageToken string) *OrganizationsExclusionsListCall { +func (c *OrganizationsLocationsBucketsListCall) PageToken(pageToken string) *OrganizationsLocationsBucketsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -21898,7 +25626,7 @@ func (c *OrganizationsExclusionsListCall) PageToken(pageToken string) *Organizat // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsExclusionsListCall) Fields(s ...googleapi.Field) *OrganizationsExclusionsListCall { +func (c *OrganizationsLocationsBucketsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -21908,7 +25636,7 @@ func (c *OrganizationsExclusionsListCall) Fields(s ...googleapi.Field) *Organiza // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsExclusionsListCall) IfNoneMatch(entityTag string) *OrganizationsExclusionsListCall { +func (c *OrganizationsLocationsBucketsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsListCall { c.ifNoneMatch_ = entityTag return c } @@ -21916,21 +25644,21 @@ func (c *OrganizationsExclusionsListCall) IfNoneMatch(entityTag string) *Organiz // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsExclusionsListCall) Context(ctx context.Context) *OrganizationsExclusionsListCall { +func (c *OrganizationsLocationsBucketsListCall) Context(ctx context.Context) *OrganizationsLocationsBucketsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsExclusionsListCall) Header() http.Header { +func (c *OrganizationsLocationsBucketsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsExclusionsListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsBucketsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -21943,7 +25671,7 @@ func (c *OrganizationsExclusionsListCall) doRequest(alt string) (*http.Response, var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -21956,14 +25684,14 @@ func (c *OrganizationsExclusionsListCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.exclusions.list" call. -// Exactly one of *ListExclusionsResponse or error will be non-nil. Any +// Do executes the "logging.organizations.locations.buckets.list" call. +// Exactly one of *ListBucketsResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either -// *ListExclusionsResponse.ServerResponse.Header or (if a response was +// *ListBucketsResponse.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 *OrganizationsExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsResponse, error) { +func (c *OrganizationsLocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucketsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -21982,7 +25710,7 @@ func (c *OrganizationsExclusionsListCall) Do(opts ...googleapi.CallOption) (*Lis if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListExclusionsResponse{ + ret := &ListBucketsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -21994,10 +25722,10 @@ func (c *OrganizationsExclusionsListCall) Do(opts ...googleapi.CallOption) (*Lis } return ret, nil // { - // "description": "Lists all the exclusions on the _Default sink in a parent resource.", - // "flatPath": "v2/organizations/{organizationsId}/exclusions", + // "description": "Lists log buckets.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets", // "httpMethod": "GET", - // "id": "logging.organizations.exclusions.list", + // "id": "logging.organizations.locations.buckets.list", // "parameterOrder": [ // "parent" // ], @@ -22014,16 +25742,16 @@ func (c *OrganizationsExclusionsListCall) Do(opts ...googleapi.CallOption) (*Lis // "type": "string" // }, // "parent": { - // "description": "Required. The parent resource whose exclusions are to be listed. \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ", + // "description": "Required. The parent resource whose buckets are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets.", // "location": "path", - // "pattern": "^organizations/[^/]+$", + // "pattern": "^organizations/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/exclusions", + // "path": "v2/{+parent}/buckets", // "response": { - // "$ref": "ListExclusionsResponse" + // "$ref": "ListBucketsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -22038,7 +25766,7 @@ func (c *OrganizationsExclusionsListCall) Do(opts ...googleapi.CallOption) (*Lis // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *OrganizationsExclusionsListCall) Pages(ctx context.Context, f func(*ListExclusionsResponse) error) error { +func (c *OrganizationsLocationsBucketsListCall) Pages(ctx context.Context, f func(*ListBucketsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -22056,49 +25784,211 @@ func (c *OrganizationsExclusionsListCall) Pages(ctx context.Context, f func(*Lis } } -// method id "logging.organizations.exclusions.patch": +// method id "logging.organizations.locations.buckets.patch": -type OrganizationsExclusionsPatchCall struct { - s *Service - name string - logexclusion *LogExclusion - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsLocationsBucketsPatchCall struct { + s *Service + name string + logbucket *LogBucket + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Changes one or more properties of an existing exclusion in the -// _Default sink. +// Patch: Updates a log bucket.If the bucket has a lifecycle_state of +// DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a +// bucket has been created, the bucket's location cannot be changed. // -// - name: The resource name of the exclusion to update: -// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" -// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" -// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For -// example:"projects/my-project/exclusions/my-exclusion". -func (r *OrganizationsExclusionsService) Patch(name string, logexclusion *LogExclusion) *OrganizationsExclusionsPatchCall { - c := &OrganizationsExclusionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The full resource name of the bucket to update. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *OrganizationsLocationsBucketsService) Patch(name string, logbucket *LogBucket) *OrganizationsLocationsBucketsPatchCall { + c := &OrganizationsLocationsBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.logbucket = logbucket + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. Field +// mask that specifies the fields in bucket that need an update. A +// bucket field will be overwritten if, and only if, it is in the update +// mask. name and output only fields cannot be updated.For a detailed +// FieldMask definition, see: +// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor +// example: updateMask=retention_days +func (c *OrganizationsLocationsBucketsPatchCall) UpdateMask(updateMask string) *OrganizationsLocationsBucketsPatchCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsLocationsBucketsPatchCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *OrganizationsLocationsBucketsPatchCall) Context(ctx context.Context) *OrganizationsLocationsBucketsPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsLocationsBucketsPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsLocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", 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) +} + +// Do executes the "logging.organizations.locations.buckets.patch" call. +// Exactly one of *LogBucket or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LogBucket.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 *OrganizationsLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket, 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 := &LogBucket{ + 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 + // { + // "description": "Updates a log bucket.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}", + // "httpMethod": "PATCH", + // "id": "logging.organizations.locations.buckets.patch", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "location": "path", + // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "updateMask": { + // "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=retention_days", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v2/{+name}", + // "request": { + // "$ref": "LogBucket" + // }, + // "response": { + // "$ref": "LogBucket" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.organizations.locations.buckets.undelete": + +type OrganizationsLocationsBucketsUndeleteCall struct { + s *Service + name string + undeletebucketrequest *UndeleteBucketRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Undelete: Undeletes a log bucket. A bucket that has been deleted can +// be undeleted within the grace period of 7 days. +// +// - name: The full resource name of the bucket to undelete. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *OrganizationsLocationsBucketsService) Undelete(name string, undeletebucketrequest *UndeleteBucketRequest) *OrganizationsLocationsBucketsUndeleteCall { + c := &OrganizationsLocationsBucketsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.logexclusion = logexclusion - return c -} - -// UpdateMask sets the optional parameter "updateMask": Required. A -// non-empty list of fields to change in the existing exclusion. New -// values for the fields are taken from the corresponding fields in the -// LogExclusion included in this request. Fields not mentioned in -// update_mask are not changed and are ignored in the request.For -// example, to change the filter and description of an exclusion, -// specify an update_mask of "filter,description". -func (c *OrganizationsExclusionsPatchCall) UpdateMask(updateMask string) *OrganizationsExclusionsPatchCall { - c.urlParams_.Set("updateMask", updateMask) + c.undeletebucketrequest = undeletebucketrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsExclusionsPatchCall) Fields(s ...googleapi.Field) *OrganizationsExclusionsPatchCall { +func (c *OrganizationsLocationsBucketsUndeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsUndeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -22106,21 +25996,21 @@ func (c *OrganizationsExclusionsPatchCall) Fields(s ...googleapi.Field) *Organiz // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsExclusionsPatchCall) Context(ctx context.Context) *OrganizationsExclusionsPatchCall { +func (c *OrganizationsLocationsBucketsUndeleteCall) Context(ctx context.Context) *OrganizationsLocationsBucketsUndeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsExclusionsPatchCall) Header() http.Header { +func (c *OrganizationsLocationsBucketsUndeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsExclusionsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -22128,16 +26018,16 @@ func (c *OrganizationsExclusionsPatchCall) doRequest(alt string) (*http.Response } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:undelete") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -22148,14 +26038,14 @@ func (c *OrganizationsExclusionsPatchCall) doRequest(alt string) (*http.Response return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.exclusions.patch" call. -// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *LogExclusion.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 *OrganizationsExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { +// Do executes the "logging.organizations.locations.buckets.undelete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.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 *OrganizationsLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -22174,7 +26064,7 @@ func (c *OrganizationsExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*Lo if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogExclusion{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -22186,34 +26076,28 @@ func (c *OrganizationsExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*Lo } return ret, nil // { - // "description": "Changes one or more properties of an existing exclusion in the _Default sink.", - // "flatPath": "v2/organizations/{organizationsId}/exclusions/{exclusionsId}", - // "httpMethod": "PATCH", - // "id": "logging.organizations.exclusions.patch", + // "description": "Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period of 7 days.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}:undelete", + // "httpMethod": "POST", + // "id": "logging.organizations.locations.buckets.undelete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource name of the exclusion to update: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", + // "description": "Required. The full resource name of the bucket to undelete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", - // "pattern": "^organizations/[^/]+/exclusions/[^/]+$", + // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "Required. A non-empty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of \"filter,description\".", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+name}:undelete", // "request": { - // "$ref": "LogExclusion" + // "$ref": "UndeleteBucketRequest" // }, // "response": { - // "$ref": "LogExclusion" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -22223,77 +26107,93 @@ func (c *OrganizationsExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*Lo } -// method id "logging.organizations.locations.get": +// method id "logging.organizations.locations.buckets.updateAsync": -type OrganizationsLocationsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsLocationsBucketsUpdateAsyncCall struct { + s *Service + name string + logbucket *LogBucket + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets information about a location. +// UpdateAsync: Updates a log bucket asynchronously.If the bucket has a +// lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be +// returned.After a bucket has been created, the bucket's location +// cannot be changed. // -// - name: Resource name for the location. -func (r *OrganizationsLocationsService) Get(name string) *OrganizationsLocationsGetCall { - c := &OrganizationsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The full resource name of the bucket to update. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *OrganizationsLocationsBucketsService) UpdateAsync(name string, logbucket *LogBucket) *OrganizationsLocationsBucketsUpdateAsyncCall { + c := &OrganizationsLocationsBucketsUpdateAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.logbucket = logbucket + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. Field +// mask that specifies the fields in bucket that need an update. A +// bucket field will be overwritten if, and only if, it is in the update +// mask. name and output only fields cannot be updated.For a detailed +// FieldMask definition, see: +// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor +// example: updateMask=retention_days +func (c *OrganizationsLocationsBucketsUpdateAsyncCall) UpdateMask(updateMask string) *OrganizationsLocationsBucketsUpdateAsyncCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsGetCall { +func (c *OrganizationsLocationsBucketsUpdateAsyncCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsUpdateAsyncCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *OrganizationsLocationsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsGetCall) Context(ctx context.Context) *OrganizationsLocationsGetCall { +func (c *OrganizationsLocationsBucketsUpdateAsyncCall) Context(ctx context.Context) *OrganizationsLocationsBucketsUpdateAsyncCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsGetCall) Header() http.Header { +func (c *OrganizationsLocationsBucketsUpdateAsyncCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsBucketsUpdateAsyncCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:updateAsync") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -22304,14 +26204,14 @@ func (c *OrganizationsLocationsGetCall) doRequest(alt string) (*http.Response, e return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.get" call. -// Exactly one of *Location or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Location.ServerResponse.Header or (if a response was returned at +// Do executes the "logging.organizations.locations.buckets.updateAsync" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.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 *OrganizationsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) { +func (c *OrganizationsLocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -22330,7 +26230,7 @@ func (c *OrganizationsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Locat if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Location{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -22342,151 +26242,142 @@ func (c *OrganizationsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Locat } return ret, nil // { - // "description": "Gets information about a location.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}", - // "httpMethod": "GET", - // "id": "logging.organizations.locations.get", + // "description": "Updates a log bucket asynchronously.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}:updateAsync", + // "httpMethod": "POST", + // "id": "logging.organizations.locations.buckets.updateAsync", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Resource name for the location.", + // "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+$", + // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=retention_days", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+name}:updateAsync", + // "request": { + // "$ref": "LogBucket" + // }, // "response": { - // "$ref": "Location" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// method id "logging.organizations.locations.list": +// method id "logging.organizations.locations.buckets.links.create": -type OrganizationsLocationsListCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsLocationsBucketsLinksCreateCall struct { + s *Service + parent string + link *Link + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists information about the supported locations for this -// service. +// Create: Asynchronously creates linked dataset in BigQuery which makes +// it possible to use BugQuery to read the logs stored in the bucket. A +// bucket may currently only contain one link. // -// - name: The resource that owns the locations collection, if -// applicable. -func (r *OrganizationsLocationsService) List(name string) *OrganizationsLocationsListCall { - c := &OrganizationsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - return c -} - -// Filter sets the optional parameter "filter": A filter to narrow down -// results to a preferred subset. The filtering language accepts strings -// like "displayName=tokyo", and is documented in more detail in AIP-160 -// (https://google.aip.dev/160). -func (c *OrganizationsLocationsListCall) Filter(filter string) *OrganizationsLocationsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return. If not set, the service selects a default. -func (c *OrganizationsLocationsListCall) PageSize(pageSize int64) *OrganizationsLocationsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) +// - parent: The full resource name of the bucket to create a link for. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]". +func (r *OrganizationsLocationsBucketsLinksService) Create(parent string, link *Link) *OrganizationsLocationsBucketsLinksCreateCall { + c := &OrganizationsLocationsBucketsLinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.link = link return c } -// PageToken sets the optional parameter "pageToken": A page token -// received from the next_page_token field in the response. Send that -// page token to receive the subsequent page. -func (c *OrganizationsLocationsListCall) PageToken(pageToken string) *OrganizationsLocationsListCall { - c.urlParams_.Set("pageToken", pageToken) +// LinkId sets the optional parameter "linkId": Required. The ID to use +// for the link. The link_id can have up to 100 characters. A valid +// link_id must only have alphanumeric characters and underscores within +// it. +func (c *OrganizationsLocationsBucketsLinksCreateCall) LinkId(linkId string) *OrganizationsLocationsBucketsLinksCreateCall { + c.urlParams_.Set("linkId", linkId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsListCall { +func (c *OrganizationsLocationsBucketsLinksCreateCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsLinksCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *OrganizationsLocationsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsListCall) Context(ctx context.Context) *OrganizationsLocationsListCall { +func (c *OrganizationsLocationsBucketsLinksCreateCall) Context(ctx context.Context) *OrganizationsLocationsBucketsLinksCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsListCall) Header() http.Header { +func (c *OrganizationsLocationsBucketsLinksCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsBucketsLinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } - reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } + reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.link) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/links") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.list" call. -// Exactly one of *ListLocationsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListLocationsResponse.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 *OrganizationsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) { +// Do executes the "logging.organizations.locations.buckets.links.create" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.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 *OrganizationsLocationsBucketsLinksCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -22505,7 +26396,7 @@ func (c *OrganizationsLocationsListCall) Do(opts ...googleapi.CallOption) (*List if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListLocationsResponse{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -22517,111 +26408,74 @@ func (c *OrganizationsLocationsListCall) Do(opts ...googleapi.CallOption) (*List } return ret, nil // { - // "description": "Lists information about the supported locations for this service.", - // "flatPath": "v2/organizations/{organizationsId}/locations", - // "httpMethod": "GET", - // "id": "logging.organizations.locations.list", + // "description": "Asynchronously creates linked dataset in BigQuery which makes it possible to use BugQuery to read the logs stored in the bucket. A bucket may currently only contain one link.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/links", + // "httpMethod": "POST", + // "id": "logging.organizations.locations.buckets.links.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "filter": { - // "description": "A filter to narrow down results to a preferred subset. The filtering language accepts strings like \"displayName=tokyo\", and is documented in more detail in AIP-160 (https://google.aip.dev/160).", + // "linkId": { + // "description": "Required. The ID to use for the link. The link_id can have up to 100 characters. A valid link_id must only have alphanumeric characters and underscores within it.", // "location": "query", // "type": "string" // }, - // "name": { - // "description": "The resource that owns the locations collection, if applicable.", + // "parent": { + // "description": "Required. The full resource name of the bucket to create a link for. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", // "location": "path", - // "pattern": "^organizations/[^/]+$", + // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" - // }, - // "pageSize": { - // "description": "The maximum number of results to return. If not set, the service selects a default.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "A page token received from the next_page_token field in the response. Send that page token to receive the subsequent page.", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+name}/locations", + // "path": "v2/{+parent}/links", + // "request": { + // "$ref": "Link" + // }, // "response": { - // "$ref": "ListLocationsResponse" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *OrganizationsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "logging.organizations.locations.buckets.create": +// method id "logging.organizations.locations.buckets.links.delete": -type OrganizationsLocationsBucketsCreateCall struct { +type OrganizationsLocationsBucketsLinksDeleteCall struct { s *Service - parent string - logbucket *LogBucket + name string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Create: Creates a log bucket that can be used to store log entries. -// After a bucket has been created, the bucket's location cannot be -// changed. +// Delete: Deletes a link. This will also delete the corresponding +// BigQuery linked dataset. // -// - parent: The resource in which to create the log bucket: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For -// example:"projects/my-project/locations/global". -func (r *OrganizationsLocationsBucketsService) Create(parent string, logbucket *LogBucket) *OrganizationsLocationsBucketsCreateCall { - c := &OrganizationsLocationsBucketsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.logbucket = logbucket - return c -} - -// BucketId sets the optional parameter "bucketId": Required. A -// client-assigned identifier such as "my-bucket". Identifiers are -// limited to 100 characters and can include only letters, digits, -// underscores, hyphens, and periods. -func (c *OrganizationsLocationsBucketsCreateCall) BucketId(bucketId string) *OrganizationsLocationsBucketsCreateCall { - c.urlParams_.Set("bucketId", bucketId) +// - name: The full resource name of the link to +// delete."projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/ +// links/LINK_ID" +// "organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ +// ID/links/LINK_ID" +// "billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BU +// CKET_ID/links/LINK_ID" +// "folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LIN +// K_ID". +func (r *OrganizationsLocationsBucketsLinksService) Delete(name string) *OrganizationsLocationsBucketsLinksDeleteCall { + c := &OrganizationsLocationsBucketsLinksDeleteCall{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 information. -func (c *OrganizationsLocationsBucketsCreateCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsCreateCall { +func (c *OrganizationsLocationsBucketsLinksDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsLinksDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -22629,21 +26483,21 @@ func (c *OrganizationsLocationsBucketsCreateCall) Fields(s ...googleapi.Field) * // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsBucketsCreateCall) Context(ctx context.Context) *OrganizationsLocationsBucketsCreateCall { +func (c *OrganizationsLocationsBucketsLinksDeleteCall) Context(ctx context.Context) *OrganizationsLocationsBucketsLinksDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsBucketsCreateCall) Header() http.Header { +func (c *OrganizationsLocationsBucketsLinksDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsBucketsLinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -22651,34 +26505,29 @@ func (c *OrganizationsLocationsBucketsCreateCall) doRequest(alt string) (*http.R } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.buckets.create" call. -// Exactly one of *LogBucket or error will be non-nil. Any non-2xx +// Do executes the "logging.organizations.locations.buckets.links.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either -// *LogBucket.ServerResponse.Header or (if a response was returned at +// *Operation.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 *OrganizationsLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { +func (c *OrganizationsLocationsBucketsLinksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -22697,7 +26546,7 @@ func (c *OrganizationsLocationsBucketsCreateCall) Do(opts ...googleapi.CallOptio if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogBucket{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -22709,33 +26558,25 @@ func (c *OrganizationsLocationsBucketsCreateCall) Do(opts ...googleapi.CallOptio } return ret, nil // { - // "description": "Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets", - // "httpMethod": "POST", - // "id": "logging.organizations.locations.buckets.create", + // "description": "Deletes a link. This will also delete the corresponding BigQuery linked dataset.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/links/{linksId}", + // "httpMethod": "DELETE", + // "id": "logging.organizations.locations.buckets.links.delete", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "bucketId": { - // "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"", + // "name": { + // "description": "Required. The full resource name of the link to delete.\"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\"", // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+$", + // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+/links/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/buckets", - // "request": { - // "$ref": "LogBucket" - // }, + // "path": "v2/{+name}", // "response": { - // "$ref": "LogBucket" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -22745,101 +26586,103 @@ func (c *OrganizationsLocationsBucketsCreateCall) Do(opts ...googleapi.CallOptio } -// method id "logging.organizations.locations.buckets.createAsync": +// method id "logging.organizations.locations.buckets.links.get": -type OrganizationsLocationsBucketsCreateAsyncCall struct { - s *Service - parent string - logbucket *LogBucket - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsLocationsBucketsLinksGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// CreateAsync: Creates a log bucket asynchronously that can be used to -// store log entries.After a bucket has been created, the bucket's -// location cannot be changed. +// Get: Gets a link. // -// - parent: The resource in which to create the log bucket: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For -// example:"projects/my-project/locations/global". -func (r *OrganizationsLocationsBucketsService) CreateAsync(parent string, logbucket *LogBucket) *OrganizationsLocationsBucketsCreateAsyncCall { - c := &OrganizationsLocationsBucketsCreateAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.logbucket = logbucket - return c -} - -// BucketId sets the optional parameter "bucketId": Required. A -// client-assigned identifier such as "my-bucket". Identifiers are -// limited to 100 characters and can include only letters, digits, -// underscores, hyphens, and periods. -func (c *OrganizationsLocationsBucketsCreateAsyncCall) BucketId(bucketId string) *OrganizationsLocationsBucketsCreateAsyncCall { - c.urlParams_.Set("bucketId", bucketId) +// - name: The resource name of the +// link:"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/li +// nks/LINK_ID" +// "organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ +// ID/links/LINK_ID" +// "billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BU +// CKET_ID/links/LINK_ID" +// "folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LIN +// K_ID. +func (r *OrganizationsLocationsBucketsLinksService) Get(name string) *OrganizationsLocationsBucketsLinksGetCall { + c := &OrganizationsLocationsBucketsLinksGetCall{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 information. -func (c *OrganizationsLocationsBucketsCreateAsyncCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsCreateAsyncCall { +func (c *OrganizationsLocationsBucketsLinksGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsLinksGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsLocationsBucketsLinksGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsLinksGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsBucketsCreateAsyncCall) Context(ctx context.Context) *OrganizationsLocationsBucketsCreateAsyncCall { +func (c *OrganizationsLocationsBucketsLinksGetCall) Context(ctx context.Context) *OrganizationsLocationsBucketsLinksGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsBucketsCreateAsyncCall) Header() http.Header { +func (c *OrganizationsLocationsBucketsLinksGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsBucketsCreateAsyncCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsBucketsLinksGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets:createAsync") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.buckets.createAsync" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Operation.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 *OrganizationsLocationsBucketsCreateAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// Do executes the "logging.organizations.locations.buckets.links.get" call. +// Exactly one of *Link or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Link.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 *OrganizationsLocationsBucketsLinksGetCall) Do(opts ...googleapi.CallOption) (*Link, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -22858,7 +26701,7 @@ func (c *OrganizationsLocationsBucketsCreateAsyncCall) Do(opts ...googleapi.Call if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &Link{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -22870,127 +26713,148 @@ func (c *OrganizationsLocationsBucketsCreateAsyncCall) Do(opts ...googleapi.Call } return ret, nil // { - // "description": "Creates a log bucket asynchronously that can be used to store log entries.After a bucket has been created, the bucket's location cannot be changed.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets:createAsync", - // "httpMethod": "POST", - // "id": "logging.organizations.locations.buckets.createAsync", + // "description": "Gets a link.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/links/{linksId}", + // "httpMethod": "GET", + // "id": "logging.organizations.locations.buckets.links.get", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "bucketId": { - // "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"", + // "name": { + // "description": "Required. The resource name of the link:\"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID", // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+$", + // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+/links/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/buckets:createAsync", - // "request": { - // "$ref": "LogBucket" - // }, + // "path": "v2/{+name}", // "response": { - // "$ref": "Operation" + // "$ref": "Link" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.organizations.locations.buckets.delete": +// method id "logging.organizations.locations.buckets.links.list": + +type OrganizationsLocationsBucketsLinksListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists links. +// +// - parent: The parent resource whose links are to be +// listed:"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/ +// links/" +// "organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ +// ID/" +// "billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BU +// CKET_ID/" +// "folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/. +func (r *OrganizationsLocationsBucketsLinksService) List(parent string) *OrganizationsLocationsBucketsLinksListCall { + c := &OrganizationsLocationsBucketsLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} -type OrganizationsLocationsBucketsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request. +func (c *OrganizationsLocationsBucketsLinksListCall) PageSize(pageSize int64) *OrganizationsLocationsBucketsLinksListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c } -// Delete: Deletes a log bucket.Changes the bucket's lifecycle_state to -// the DELETE_REQUESTED state. After 7 days, the bucket will be purged -// and all log entries in the bucket will be permanently deleted. -// -// - name: The full resource name of the bucket to delete. -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *OrganizationsLocationsBucketsService) Delete(name string) *OrganizationsLocationsBucketsDeleteCall { - c := &OrganizationsLocationsBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. +func (c *OrganizationsLocationsBucketsLinksListCall) PageToken(pageToken string) *OrganizationsLocationsBucketsLinksListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsDeleteCall { +func (c *OrganizationsLocationsBucketsLinksListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsLinksListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsLocationsBucketsLinksListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsLinksListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsBucketsDeleteCall) Context(ctx context.Context) *OrganizationsLocationsBucketsDeleteCall { +func (c *OrganizationsLocationsBucketsLinksListCall) Context(ctx context.Context) *OrganizationsLocationsBucketsLinksListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsBucketsDeleteCall) Header() http.Header { +func (c *OrganizationsLocationsBucketsLinksListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsBucketsLinksListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + 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, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/links") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + 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, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.buckets.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.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 *OrganizationsLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "logging.organizations.locations.buckets.links.list" call. +// Exactly one of *ListLinksResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListLinksResponse.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 *OrganizationsLocationsBucketsLinksListCall) Do(opts ...googleapi.CallOption) (*ListLinksResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -23009,7 +26873,7 @@ func (c *OrganizationsLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOptio if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &ListLinksResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -23021,131 +26885,163 @@ func (c *OrganizationsLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOptio } return ret, nil // { - // "description": "Deletes a log bucket.Changes the bucket's lifecycle_state to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}", - // "httpMethod": "DELETE", - // "id": "logging.organizations.locations.buckets.delete", + // "description": "Lists links.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/links", + // "httpMethod": "GET", + // "id": "logging.organizations.locations.buckets.links.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The full resource name of the bucket to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent resource whose links are to be listed:\"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/\" \"organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/\" \"billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/\" \"folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/", // "location": "path", // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+parent}/links", // "response": { - // "$ref": "Empty" + // "$ref": "ListLinksResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.organizations.locations.buckets.get": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *OrganizationsLocationsBucketsLinksListCall) Pages(ctx context.Context, f func(*ListLinksResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type OrganizationsLocationsBucketsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// method id "logging.organizations.locations.buckets.views.create": + +type OrganizationsLocationsBucketsViewsCreateCall struct { + s *Service + parent string + logview *LogView + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a log bucket. +// Create: Creates a view over log entries in a log bucket. A bucket may +// contain a maximum of 30 views. // -// - name: The resource name of the bucket: +// - parent: The bucket in which to create the view // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// For +// ` For // example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *OrganizationsLocationsBucketsService) Get(name string) *OrganizationsLocationsBucketsGetCall { - c := &OrganizationsLocationsBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +func (r *OrganizationsLocationsBucketsViewsService) Create(parent string, logview *LogView) *OrganizationsLocationsBucketsViewsCreateCall { + c := &OrganizationsLocationsBucketsViewsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.logview = logview + return c +} + +// ViewId sets the optional parameter "viewId": Required. A +// client-assigned identifier such as "my-view". Identifiers are limited +// to 100 characters and can include only letters, digits, underscores, +// hyphens, and periods. +func (c *OrganizationsLocationsBucketsViewsCreateCall) ViewId(viewId string) *OrganizationsLocationsBucketsViewsCreateCall { + c.urlParams_.Set("viewId", viewId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsBucketsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsGetCall { +func (c *OrganizationsLocationsBucketsViewsCreateCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *OrganizationsLocationsBucketsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsBucketsGetCall) Context(ctx context.Context) *OrganizationsLocationsBucketsGetCall { +func (c *OrganizationsLocationsBucketsViewsCreateCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsBucketsGetCall) Header() http.Header { +func (c *OrganizationsLocationsBucketsViewsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsBucketsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.buckets.get" call. -// Exactly one of *LogBucket or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *LogBucket.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 *OrganizationsLocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { +// Do executes the "logging.organizations.locations.buckets.views.create" call. +// Exactly one of *LogView or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogView.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 *OrganizationsLocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption) (*LogView, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -23164,7 +27060,7 @@ func (c *OrganizationsLocationsBucketsGetCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogBucket{ + ret := &LogView{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -23176,150 +27072,123 @@ func (c *OrganizationsLocationsBucketsGetCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Gets a log bucket.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}", - // "httpMethod": "GET", - // "id": "logging.organizations.locations.buckets.get", + // "description": "Creates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views", + // "httpMethod": "POST", + // "id": "logging.organizations.locations.buckets.views.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The resource name of the bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "parent": { + // "description": "Required. The bucket in which to create the view `\"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\"` For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" + // }, + // "viewId": { + // "description": "Required. A client-assigned identifier such as \"my-view\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+parent}/views", + // "request": { + // "$ref": "LogView" + // }, // "response": { - // "$ref": "LogBucket" + // "$ref": "LogView" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] - // } - -} - -// method id "logging.organizations.locations.buckets.list": - -type OrganizationsLocationsBucketsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} + // } -// List: Lists log buckets. -// -// - parent: The parent resource whose buckets are to be listed: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" Note: The locations -// portion of the resource must be specified, but supplying the -// character - in place of LOCATION_ID will return all buckets. -func (r *OrganizationsLocationsBucketsService) List(parent string) *OrganizationsLocationsBucketsListCall { - c := &OrganizationsLocationsBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c } -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return from this request. Non-positive values are -// ignored. The presence of nextPageToken in the response indicates that -// more results might be available. -func (c *OrganizationsLocationsBucketsListCall) PageSize(pageSize int64) *OrganizationsLocationsBucketsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c +// method id "logging.organizations.locations.buckets.views.delete": + +type OrganizationsLocationsBucketsViewsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// PageToken sets the optional parameter "pageToken": If present, then -// retrieve the next batch of results from the preceding call to this -// method. pageToken must be the value of nextPageToken from the -// previous response. The values of other method parameters should be -// identical to those in the previous call. -func (c *OrganizationsLocationsBucketsListCall) PageToken(pageToken string) *OrganizationsLocationsBucketsListCall { - c.urlParams_.Set("pageToken", pageToken) +// Delete: Deletes a view on a log bucket. If an UNAVAILABLE error is +// returned, this indicates that system is not in a state where it can +// delete the view. If this occurs, please try again in a few minutes. +// +// - name: The full resource name of the view to delete: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v +// iews/[VIEW_ID]" For +// example:"projects/my-project/locations/global/buckets/my-bucket/view +// s/my-view". +func (r *OrganizationsLocationsBucketsViewsService) Delete(name string) *OrganizationsLocationsBucketsViewsDeleteCall { + c := &OrganizationsLocationsBucketsViewsDeleteCall{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 information. -func (c *OrganizationsLocationsBucketsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsListCall { +func (c *OrganizationsLocationsBucketsViewsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *OrganizationsLocationsBucketsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsBucketsListCall) Context(ctx context.Context) *OrganizationsLocationsBucketsListCall { +func (c *OrganizationsLocationsBucketsViewsDeleteCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsBucketsListCall) Header() http.Header { +func (c *OrganizationsLocationsBucketsViewsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsBucketsListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - 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, "v2/{+parent}/buckets") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.buckets.list" call. -// Exactly one of *ListBucketsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListBucketsResponse.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 *OrganizationsLocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucketsResponse, error) { +// Do executes the "logging.organizations.locations.buckets.views.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.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 *OrganizationsLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -23338,7 +27207,7 @@ func (c *OrganizationsLocationsBucketsListCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListBucketsResponse{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -23350,154 +27219,109 @@ func (c *OrganizationsLocationsBucketsListCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Lists log buckets.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets", - // "httpMethod": "GET", - // "id": "logging.organizations.locations.buckets.list", + // "description": "Deletes a view on a log bucket. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", + // "httpMethod": "DELETE", + // "id": "logging.organizations.locations.buckets.views.delete", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "pageSize": { - // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The parent resource whose buckets are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets.", + // "name": { + // "description": "Required. The full resource name of the view to delete: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+$", + // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/buckets", + // "path": "v2/{+name}", // "response": { - // "$ref": "ListBucketsResponse" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *OrganizationsLocationsBucketsListCall) Pages(ctx context.Context, f func(*ListBucketsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "logging.organizations.locations.buckets.patch": +// method id "logging.organizations.locations.buckets.views.get": -type OrganizationsLocationsBucketsPatchCall struct { - s *Service - name string - logbucket *LogBucket - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsLocationsBucketsViewsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Patch: Updates a log bucket.If the bucket has a lifecycle_state of -// DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a -// bucket has been created, the bucket's location cannot be changed. +// Get: Gets a view on a log bucket.. // -// - name: The full resource name of the bucket to update. -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *OrganizationsLocationsBucketsService) Patch(name string, logbucket *LogBucket) *OrganizationsLocationsBucketsPatchCall { - c := &OrganizationsLocationsBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of the policy: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v +// iews/[VIEW_ID]" For +// example:"projects/my-project/locations/global/buckets/my-bucket/view +// s/my-view". +func (r *OrganizationsLocationsBucketsViewsService) Get(name string) *OrganizationsLocationsBucketsViewsGetCall { + c := &OrganizationsLocationsBucketsViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.logbucket = logbucket - return c -} - -// UpdateMask sets the optional parameter "updateMask": Required. Field -// mask that specifies the fields in bucket that need an update. A -// bucket field will be overwritten if, and only if, it is in the update -// mask. name and output only fields cannot be updated.For a detailed -// FieldMask definition, see: -// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor -// example: updateMask=retention_days -func (c *OrganizationsLocationsBucketsPatchCall) UpdateMask(updateMask string) *OrganizationsLocationsBucketsPatchCall { - c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsBucketsPatchCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsPatchCall { +func (c *OrganizationsLocationsBucketsViewsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsLocationsBucketsViewsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsViewsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsBucketsPatchCall) Context(ctx context.Context) *OrganizationsLocationsBucketsPatchCall { +func (c *OrganizationsLocationsBucketsViewsGetCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsBucketsPatchCall) Header() http.Header { +func (c *OrganizationsLocationsBucketsViewsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsBucketsViewsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -23508,14 +27332,14 @@ func (c *OrganizationsLocationsBucketsPatchCall) doRequest(alt string) (*http.Re return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.buckets.patch" call. -// Exactly one of *LogBucket or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *LogBucket.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 *OrganizationsLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { +// Do executes the "logging.organizations.locations.buckets.views.get" call. +// Exactly one of *LogView or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogView.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 *OrganizationsLocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogView, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -23534,7 +27358,7 @@ func (c *OrganizationsLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogBucket{ + ret := &LogView{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -23546,134 +27370,145 @@ func (c *OrganizationsLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption } return ret, nil // { - // "description": "Updates a log bucket.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}", - // "httpMethod": "PATCH", - // "id": "logging.organizations.locations.buckets.patch", + // "description": "Gets a view on a log bucket..", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", + // "httpMethod": "GET", + // "id": "logging.organizations.locations.buckets.views.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "description": "Required. The resource name of the policy: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=retention_days", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, // "path": "v2/{+name}", - // "request": { - // "$ref": "LogBucket" - // }, // "response": { - // "$ref": "LogBucket" + // "$ref": "LogView" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.organizations.locations.buckets.undelete": +// method id "logging.organizations.locations.buckets.views.list": -type OrganizationsLocationsBucketsUndeleteCall struct { - s *Service - name string - undeletebucketrequest *UndeleteBucketRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsLocationsBucketsViewsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Undelete: Undeletes a log bucket. A bucket that has been deleted can -// be undeleted within the grace period of 7 days. +// List: Lists views on a log bucket. // -// - name: The full resource name of the bucket to undelete. -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *OrganizationsLocationsBucketsService) Undelete(name string, undeletebucketrequest *UndeleteBucketRequest) *OrganizationsLocationsBucketsUndeleteCall { - c := &OrganizationsLocationsBucketsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.undeletebucketrequest = undeletebucketrequest +// - parent: The bucket whose views are to be listed: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]". +func (r *OrganizationsLocationsBucketsViewsService) List(parent string) *OrganizationsLocationsBucketsViewsListCall { + c := &OrganizationsLocationsBucketsViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request.Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *OrganizationsLocationsBucketsViewsListCall) PageSize(pageSize int64) *OrganizationsLocationsBucketsViewsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *OrganizationsLocationsBucketsViewsListCall) PageToken(pageToken string) *OrganizationsLocationsBucketsViewsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsBucketsUndeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsUndeleteCall { +func (c *OrganizationsLocationsBucketsViewsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsLocationsBucketsViewsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsViewsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsBucketsUndeleteCall) Context(ctx context.Context) *OrganizationsLocationsBucketsUndeleteCall { +func (c *OrganizationsLocationsBucketsViewsListCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsBucketsUndeleteCall) Header() http.Header { +func (c *OrganizationsLocationsBucketsViewsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsBucketsViewsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:undelete") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + 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, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.buckets.undelete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.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 *OrganizationsLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "logging.organizations.locations.buckets.views.list" call. +// Exactly one of *ListViewsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListViewsResponse.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 *OrganizationsLocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) (*ListViewsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -23692,7 +27527,7 @@ func (c *OrganizationsLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOpt if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &ListViewsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -23704,77 +27539,105 @@ func (c *OrganizationsLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOpt } return ret, nil // { - // "description": "Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period of 7 days.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}:undelete", - // "httpMethod": "POST", - // "id": "logging.organizations.locations.buckets.undelete", + // "description": "Lists views on a log bucket.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views", + // "httpMethod": "GET", + // "id": "logging.organizations.locations.buckets.views.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The full resource name of the bucket to undelete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request.Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The bucket whose views are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", // "location": "path", // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}:undelete", - // "request": { - // "$ref": "UndeleteBucketRequest" - // }, + // "path": "v2/{+parent}/views", // "response": { - // "$ref": "Empty" + // "$ref": "ListViewsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.organizations.locations.buckets.updateAsync": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *OrganizationsLocationsBucketsViewsListCall) Pages(ctx context.Context, f func(*ListViewsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type OrganizationsLocationsBucketsUpdateAsyncCall struct { +// method id "logging.organizations.locations.buckets.views.patch": + +type OrganizationsLocationsBucketsViewsPatchCall struct { s *Service name string - logbucket *LogBucket + logview *LogView urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// UpdateAsync: Updates a log bucket asynchronously.If the bucket has a -// lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be -// returned.After a bucket has been created, the bucket's location -// cannot be changed. +// Patch: Updates a view on a log bucket. This method replaces the +// following fields in the existing view with values from the new view: +// filter. If an UNAVAILABLE error is returned, this indicates that +// system is not in a state where it can update the view. If this +// occurs, please try again in a few minutes. // -// - name: The full resource name of the bucket to update. -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *OrganizationsLocationsBucketsService) UpdateAsync(name string, logbucket *LogBucket) *OrganizationsLocationsBucketsUpdateAsyncCall { - c := &OrganizationsLocationsBucketsUpdateAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The full resource name of the view to update +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v +// iews/[VIEW_ID]" For +// example:"projects/my-project/locations/global/buckets/my-bucket/view +// s/my-view". +func (r *OrganizationsLocationsBucketsViewsService) Patch(name string, logview *LogView) *OrganizationsLocationsBucketsViewsPatchCall { + c := &OrganizationsLocationsBucketsViewsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.logbucket = logbucket + c.logview = logview return c } -// UpdateMask sets the optional parameter "updateMask": Required. Field -// mask that specifies the fields in bucket that need an update. A -// bucket field will be overwritten if, and only if, it is in the update -// mask. name and output only fields cannot be updated.For a detailed -// FieldMask definition, see: +// UpdateMask sets the optional parameter "updateMask": Field mask that +// specifies the fields in view that need an update. A field will be +// overwritten if, and only if, it is in the update mask. name and +// output only fields cannot be updated.For a detailed FieldMask +// definition, see // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor -// example: updateMask=retention_days -func (c *OrganizationsLocationsBucketsUpdateAsyncCall) UpdateMask(updateMask string) *OrganizationsLocationsBucketsUpdateAsyncCall { +// example: updateMask=filter +func (c *OrganizationsLocationsBucketsViewsPatchCall) UpdateMask(updateMask string) *OrganizationsLocationsBucketsViewsPatchCall { c.urlParams_.Set("updateMask", updateMask) return c } @@ -23782,7 +27645,7 @@ func (c *OrganizationsLocationsBucketsUpdateAsyncCall) UpdateMask(updateMask str // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsBucketsUpdateAsyncCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsUpdateAsyncCall { +func (c *OrganizationsLocationsBucketsViewsPatchCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -23790,21 +27653,21 @@ func (c *OrganizationsLocationsBucketsUpdateAsyncCall) Fields(s ...googleapi.Fie // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsBucketsUpdateAsyncCall) Context(ctx context.Context) *OrganizationsLocationsBucketsUpdateAsyncCall { +func (c *OrganizationsLocationsBucketsViewsPatchCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsBucketsUpdateAsyncCall) Header() http.Header { +func (c *OrganizationsLocationsBucketsViewsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsBucketsUpdateAsyncCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -23812,16 +27675,16 @@ func (c *OrganizationsLocationsBucketsUpdateAsyncCall) doRequest(alt string) (*h } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:updateAsync") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -23832,14 +27695,14 @@ func (c *OrganizationsLocationsBucketsUpdateAsyncCall) doRequest(alt string) (*h return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.buckets.updateAsync" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Operation.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 *OrganizationsLocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// Do executes the "logging.organizations.locations.buckets.views.patch" call. +// Exactly one of *LogView or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogView.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 *OrganizationsLocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) (*LogView, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -23858,7 +27721,7 @@ func (c *OrganizationsLocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.Call if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &LogView{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -23870,34 +27733,34 @@ func (c *OrganizationsLocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.Call } return ret, nil // { - // "description": "Updates a log bucket asynchronously.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}:updateAsync", - // "httpMethod": "POST", - // "id": "logging.organizations.locations.buckets.updateAsync", + // "description": "Updates a view on a log bucket. This method replaces the following fields in the existing view with values from the new view: filter. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can update the view. If this occurs, please try again in a few minutes.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", + // "httpMethod": "PATCH", + // "id": "logging.organizations.locations.buckets.views.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "description": "Required. The full resource name of the view to update \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", // "required": true, // "type": "string" // }, // "updateMask": { - // "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=retention_days", + // "description": "Optional. Field mask that specifies the fields in view that need an update. A field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", // "format": "google-fieldmask", // "location": "query", // "type": "string" // } // }, - // "path": "v2/{+name}:updateAsync", + // "path": "v2/{+name}", // "request": { - // "$ref": "LogBucket" + // "$ref": "LogView" // }, // "response": { - // "$ref": "Operation" + // "$ref": "LogView" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -23907,83 +27770,116 @@ func (c *OrganizationsLocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.Call } -// method id "logging.organizations.locations.buckets.views.create": +// method id "logging.organizations.locations.buckets.views.logs.list": -type OrganizationsLocationsBucketsViewsCreateCall struct { - s *Service - parent string - logview *LogView - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsLocationsBucketsViewsLogsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Create: Creates a view over log entries in a log bucket. A bucket may -// contain a maximum of 30 views. +// List: Lists the logs in projects, organizations, folders, or billing +// accounts. Only logs that have entries are listed. // -// - parent: The bucket in which to create the view -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// ` For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *OrganizationsLocationsBucketsViewsService) Create(parent string, logview *LogView) *OrganizationsLocationsBucketsViewsCreateCall { - c := &OrganizationsLocationsBucketsViewsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The resource name that owns the logs: projects/[PROJECT_ID] +// organizations/[ORGANIZATION_ID] +// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]. +func (r *OrganizationsLocationsBucketsViewsLogsService) List(parent string) *OrganizationsLocationsBucketsViewsLogsListCall { + c := &OrganizationsLocationsBucketsViewsLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.logview = logview return c } -// ViewId sets the optional parameter "viewId": Required. A -// client-assigned identifier such as "my-view". Identifiers are limited -// to 100 characters and can include only letters, digits, underscores, -// hyphens, and periods. -func (c *OrganizationsLocationsBucketsViewsCreateCall) ViewId(viewId string) *OrganizationsLocationsBucketsViewsCreateCall { - c.urlParams_.Set("viewId", viewId) +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request. Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *OrganizationsLocationsBucketsViewsLogsListCall) PageSize(pageSize int64) *OrganizationsLocationsBucketsViewsLogsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *OrganizationsLocationsBucketsViewsLogsListCall) PageToken(pageToken string) *OrganizationsLocationsBucketsViewsLogsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ResourceNames sets the optional parameter "resourceNames": The +// resource name that owns the logs: +// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/view +// s/[VIEW_ID] +// organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKE +// T_ID]/views/[VIEW_ID] +// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[ +// BUCKET_ID]/views/[VIEW_ID] +// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/ +// [VIEW_ID]To support legacy queries, it could also be: +// projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] +// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID] +func (c *OrganizationsLocationsBucketsViewsLogsListCall) ResourceNames(resourceNames ...string) *OrganizationsLocationsBucketsViewsLogsListCall { + c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsBucketsViewsCreateCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsCreateCall { +func (c *OrganizationsLocationsBucketsViewsLogsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsLogsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsLocationsBucketsViewsLogsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsViewsLogsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsBucketsViewsCreateCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsCreateCall { +func (c *OrganizationsLocationsBucketsViewsLogsListCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsLogsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsBucketsViewsCreateCall) Header() http.Header { +func (c *OrganizationsLocationsBucketsViewsLogsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsBucketsViewsLogsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -23994,14 +27890,14 @@ func (c *OrganizationsLocationsBucketsViewsCreateCall) doRequest(alt string) (*h return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.buckets.views.create" call. -// Exactly one of *LogView or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *LogView.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 *OrganizationsLocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption) (*LogView, error) { +// Do executes the "logging.organizations.locations.buckets.views.logs.list" call. +// Exactly one of *ListLogsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListLogsResponse.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 *OrganizationsLocationsBucketsViewsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -24020,7 +27916,7 @@ func (c *OrganizationsLocationsBucketsViewsCreateCall) Do(opts ...googleapi.Call if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogView{ + ret := &ListLogsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -24032,71 +27928,108 @@ func (c *OrganizationsLocationsBucketsViewsCreateCall) Do(opts ...googleapi.Call } return ret, nil // { - // "description": "Creates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views", - // "httpMethod": "POST", - // "id": "logging.organizations.locations.buckets.views.create", + // "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}/logs", + // "httpMethod": "GET", + // "id": "logging.organizations.locations.buckets.views.logs.list", // "parameterOrder": [ // "parent" // ], // "parameters": { + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "location": "query", + // "type": "string" + // }, // "parent": { - // "description": "Required. The bucket in which to create the view `\"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\"` For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "description": "Required. The resource name that owns the logs: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", // "required": true, // "type": "string" // }, - // "viewId": { - // "description": "Required. A client-assigned identifier such as \"my-view\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", + // "resourceNames": { + // "description": "Optional. The resource name that owns the logs: projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]To support legacy queries, it could also be: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", // "location": "query", + // "repeated": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/views", - // "request": { - // "$ref": "LogView" - // }, + // "path": "v2/{+parent}/logs", // "response": { - // "$ref": "LogView" + // "$ref": "ListLogsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.organizations.locations.buckets.views.delete": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *OrganizationsLocationsBucketsViewsLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type OrganizationsLocationsBucketsViewsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "logging.organizations.locations.operations.cancel": + +type OrganizationsLocationsOperationsCancelCall struct { + s *Service + name string + canceloperationrequest *CancelOperationRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a view on a log bucket. If an UNAVAILABLE error is -// returned, this indicates that system is not in a state where it can -// delete the view. If this occurs, please try again in a few minutes. +// Cancel: Starts asynchronous cancellation on a long-running operation. +// The server makes a best effort to cancel the operation, but success +// is not guaranteed. If the server doesn't support this method, it +// returns google.rpc.Code.UNIMPLEMENTED. Clients can use +// Operations.GetOperation or other methods to check whether the +// cancellation succeeded or whether the operation completed despite +// cancellation. On successful cancellation, the operation is not +// deleted; instead, it becomes an operation with an Operation.error +// value with a google.rpc.Status.code of 1, corresponding to +// Code.CANCELLED. // -// - name: The full resource name of the view to delete: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v -// iews/[VIEW_ID]" For -// example:"projects/my-project/locations/global/buckets/my-bucket/view -// s/my-view". -func (r *OrganizationsLocationsBucketsViewsService) Delete(name string) *OrganizationsLocationsBucketsViewsDeleteCall { - c := &OrganizationsLocationsBucketsViewsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the operation resource to be cancelled. +func (r *OrganizationsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *OrganizationsLocationsOperationsCancelCall { + c := &OrganizationsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.canceloperationrequest = canceloperationrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsBucketsViewsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsDeleteCall { +func (c *OrganizationsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *OrganizationsLocationsOperationsCancelCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -24104,21 +28037,21 @@ func (c *OrganizationsLocationsBucketsViewsDeleteCall) Fields(s ...googleapi.Fie // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsBucketsViewsDeleteCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsDeleteCall { +func (c *OrganizationsLocationsOperationsCancelCall) Context(ctx context.Context) *OrganizationsLocationsOperationsCancelCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsBucketsViewsDeleteCall) Header() http.Header { +func (c *OrganizationsLocationsOperationsCancelCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -24126,11 +28059,16 @@ func (c *OrganizationsLocationsBucketsViewsDeleteCall) doRequest(alt string) (*h } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -24141,14 +28079,14 @@ func (c *OrganizationsLocationsBucketsViewsDeleteCall) doRequest(alt string) (*h return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.buckets.views.delete" call. +// Do executes the "logging.organizations.locations.operations.cancel" call. // Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *Empty.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 *OrganizationsLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +func (c *OrganizationsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -24179,23 +28117,26 @@ func (c *OrganizationsLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.Call } return ret, nil // { - // "description": "Deletes a view on a log bucket. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", - // "httpMethod": "DELETE", - // "id": "logging.organizations.locations.buckets.views.delete", + // "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/operations/{operationsId}:cancel", + // "httpMethod": "POST", + // "id": "logging.organizations.locations.operations.cancel", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The full resource name of the view to delete: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", + // "description": "The name of the operation resource to be cancelled.", // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", + // "pattern": "^organizations/[^/]+/locations/[^/]+/operations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+name}:cancel", + // "request": { + // "$ref": "CancelOperationRequest" + // }, // "response": { // "$ref": "Empty" // }, @@ -24207,9 +28148,9 @@ func (c *OrganizationsLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.Call } -// method id "logging.organizations.locations.buckets.views.get": +// method id "logging.organizations.locations.operations.get": -type OrganizationsLocationsBucketsViewsGetCall struct { +type OrganizationsLocationsOperationsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -24218,15 +28159,13 @@ type OrganizationsLocationsBucketsViewsGetCall struct { header_ http.Header } -// Get: Gets a view on a log bucket.. +// Get: Gets the latest state of a long-running operation. Clients can +// use this method to poll the operation result at intervals as +// recommended by the API service. // -// - name: The resource name of the policy: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v -// iews/[VIEW_ID]" For -// example:"projects/my-project/locations/global/buckets/my-bucket/view -// s/my-view". -func (r *OrganizationsLocationsBucketsViewsService) Get(name string) *OrganizationsLocationsBucketsViewsGetCall { - c := &OrganizationsLocationsBucketsViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the operation resource. +func (r *OrganizationsLocationsOperationsService) Get(name string) *OrganizationsLocationsOperationsGetCall { + c := &OrganizationsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -24234,7 +28173,7 @@ func (r *OrganizationsLocationsBucketsViewsService) Get(name string) *Organizati // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsBucketsViewsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsGetCall { +func (c *OrganizationsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsOperationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -24244,7 +28183,7 @@ func (c *OrganizationsLocationsBucketsViewsGetCall) Fields(s ...googleapi.Field) // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsLocationsBucketsViewsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsViewsGetCall { +func (c *OrganizationsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsOperationsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -24252,21 +28191,21 @@ func (c *OrganizationsLocationsBucketsViewsGetCall) IfNoneMatch(entityTag string // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsBucketsViewsGetCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsGetCall { +func (c *OrganizationsLocationsOperationsGetCall) Context(ctx context.Context) *OrganizationsLocationsOperationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsBucketsViewsGetCall) Header() http.Header { +func (c *OrganizationsLocationsOperationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsBucketsViewsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -24292,14 +28231,14 @@ func (c *OrganizationsLocationsBucketsViewsGetCall) doRequest(alt string) (*http return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.buckets.views.get" call. -// Exactly one of *LogView or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *LogView.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 *OrganizationsLocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogView, error) { +// Do executes the "logging.organizations.locations.operations.get" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.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 *OrganizationsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -24318,7 +28257,7 @@ func (c *OrganizationsLocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOpt if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogView{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -24330,25 +28269,25 @@ func (c *OrganizationsLocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOpt } return ret, nil // { - // "description": "Gets a view on a log bucket..", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", + // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/operations/{operationsId}", // "httpMethod": "GET", - // "id": "logging.organizations.locations.buckets.views.get", + // "id": "logging.organizations.locations.operations.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource name of the policy: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", + // "description": "The name of the operation resource.", // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", + // "pattern": "^organizations/[^/]+/locations/[^/]+/operations/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v2/{+name}", // "response": { - // "$ref": "LogView" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -24360,42 +28299,52 @@ func (c *OrganizationsLocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOpt } -// method id "logging.organizations.locations.buckets.views.list": +// method id "logging.organizations.locations.operations.list": -type OrganizationsLocationsBucketsViewsListCall struct { +type OrganizationsLocationsOperationsListCall struct { s *Service - parent string + name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists views on a log bucket. +// List: Lists operations that match the specified filter in the +// request. If the server doesn't support this method, it returns +// UNIMPLEMENTED.NOTE: the name binding allows API services to override +// the binding to use different resource name schemes, such as +// users/*/operations. To override the binding, API services can add a +// binding such as "/v1/{name=users/*}/operations" to their service +// configuration. For backwards compatibility, the default name includes +// the operations collection id, however overriding users must ensure +// the name binding is the parent resource, without the operations +// collection id. // -// - parent: The bucket whose views are to be listed: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]". -func (r *OrganizationsLocationsBucketsViewsService) List(parent string) *OrganizationsLocationsBucketsViewsListCall { - c := &OrganizationsLocationsBucketsViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent +// - name: The name of the operation's parent resource. +func (r *OrganizationsLocationsOperationsService) List(name string) *OrganizationsLocationsOperationsListCall { + c := &OrganizationsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return from this request.Non-positive values are -// ignored. The presence of nextPageToken in the response indicates that -// more results might be available. -func (c *OrganizationsLocationsBucketsViewsListCall) PageSize(pageSize int64) *OrganizationsLocationsBucketsViewsListCall { +// Filter sets the optional parameter "filter": The standard list +// filter. +func (c *OrganizationsLocationsOperationsListCall) Filter(filter string) *OrganizationsLocationsOperationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The standard list +// page size. +func (c *OrganizationsLocationsOperationsListCall) PageSize(pageSize int64) *OrganizationsLocationsOperationsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } -// PageToken sets the optional parameter "pageToken": If present, then -// retrieve the next batch of results from the preceding call to this -// method. pageToken must be the value of nextPageToken from the -// previous response. The values of other method parameters should be -// identical to those in the previous call. -func (c *OrganizationsLocationsBucketsViewsListCall) PageToken(pageToken string) *OrganizationsLocationsBucketsViewsListCall { +// PageToken sets the optional parameter "pageToken": The standard list +// page token. +func (c *OrganizationsLocationsOperationsListCall) PageToken(pageToken string) *OrganizationsLocationsOperationsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -24403,7 +28352,7 @@ func (c *OrganizationsLocationsBucketsViewsListCall) PageToken(pageToken string) // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsBucketsViewsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsListCall { +func (c *OrganizationsLocationsOperationsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsOperationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -24413,7 +28362,7 @@ func (c *OrganizationsLocationsBucketsViewsListCall) Fields(s ...googleapi.Field // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsLocationsBucketsViewsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsViewsListCall { +func (c *OrganizationsLocationsOperationsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsOperationsListCall { c.ifNoneMatch_ = entityTag return c } @@ -24421,21 +28370,21 @@ func (c *OrganizationsLocationsBucketsViewsListCall) IfNoneMatch(entityTag strin // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsBucketsViewsListCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsListCall { +func (c *OrganizationsLocationsOperationsListCall) Context(ctx context.Context) *OrganizationsLocationsOperationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsBucketsViewsListCall) Header() http.Header { +func (c *OrganizationsLocationsOperationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsBucketsViewsListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -24448,7 +28397,7 @@ func (c *OrganizationsLocationsBucketsViewsListCall) doRequest(alt string) (*htt var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -24456,19 +28405,19 @@ func (c *OrganizationsLocationsBucketsViewsListCall) doRequest(alt string) (*htt } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.buckets.views.list" call. -// Exactly one of *ListViewsResponse or error will be non-nil. Any +// Do executes the "logging.organizations.locations.operations.list" call. +// Exactly one of *ListOperationsResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either -// *ListViewsResponse.ServerResponse.Header or (if a response was +// *ListOperationsResponse.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 *OrganizationsLocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) (*ListViewsResponse, error) { +func (c *OrganizationsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -24487,7 +28436,7 @@ func (c *OrganizationsLocationsBucketsViewsListCall) Do(opts ...googleapi.CallOp if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListViewsResponse{ + ret := &ListOperationsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -24499,36 +28448,41 @@ func (c *OrganizationsLocationsBucketsViewsListCall) Do(opts ...googleapi.CallOp } return ret, nil // { - // "description": "Lists views on a log bucket.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views", + // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as \"/v1/{name=users/*}/operations\" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/operations", // "httpMethod": "GET", - // "id": "logging.organizations.locations.buckets.views.list", + // "id": "logging.organizations.locations.operations.list", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { + // "filter": { + // "description": "The standard list filter.", + // "location": "query", + // "type": "string" + // }, + // "name": { + // "description": "The name of the operation's parent resource.", + // "location": "path", + // "pattern": "^organizations/[^/]+/locations/[^/]+$", + // "required": true, + // "type": "string" + // }, // "pageSize": { - // "description": "Optional. The maximum number of results to return from this request.Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "description": "The standard list page size.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "description": "The standard list page token.", // "location": "query", // "type": "string" - // }, - // "parent": { - // "description": "Required. The bucket whose views are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", - // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$", - // "required": true, - // "type": "string" // } // }, - // "path": "v2/{+parent}/views", + // "path": "v2/{+name}/operations", // "response": { - // "$ref": "ListViewsResponse" + // "$ref": "ListOperationsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -24543,7 +28497,7 @@ func (c *OrganizationsLocationsBucketsViewsListCall) Do(opts ...googleapi.CallOp // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *OrganizationsLocationsBucketsViewsListCall) Pages(ctx context.Context, f func(*ListViewsResponse) error) error { +func (c *OrganizationsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -24561,51 +28515,40 @@ func (c *OrganizationsLocationsBucketsViewsListCall) Pages(ctx context.Context, } } -// method id "logging.organizations.locations.buckets.views.patch": +// method id "logging.organizations.logs.delete": -type OrganizationsLocationsBucketsViewsPatchCall struct { +type OrganizationsLogsDeleteCall struct { s *Service - name string - logview *LogView + logName string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Patch: Updates a view on a log bucket. This method replaces the -// following fields in the existing view with values from the new view: -// filter. If an UNAVAILABLE error is returned, this indicates that -// system is not in a state where it can update the view. If this -// occurs, please try again in a few minutes. +// Delete: Deletes all the log entries in a log for the _Default Log +// Bucket. The log reappears if it receives new entries. Log entries +// written shortly before the delete operation might not be deleted. +// Entries received after the delete operation with a timestamp before +// the operation will be deleted. // -// - name: The full resource name of the view to update -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v -// iews/[VIEW_ID]" For -// example:"projects/my-project/locations/global/buckets/my-bucket/view -// s/my-view". -func (r *OrganizationsLocationsBucketsViewsService) Patch(name string, logview *LogView) *OrganizationsLocationsBucketsViewsPatchCall { - c := &OrganizationsLocationsBucketsViewsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.logview = logview - return c -} - -// UpdateMask sets the optional parameter "updateMask": Field mask that -// specifies the fields in view that need an update. A field will be -// overwritten if, and only if, it is in the update mask. name and -// output only fields cannot be updated.For a detailed FieldMask -// definition, see -// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor -// example: updateMask=filter -func (c *OrganizationsLocationsBucketsViewsPatchCall) UpdateMask(updateMask string) *OrganizationsLocationsBucketsViewsPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// - logName: The resource name of the log to delete: +// projects/[PROJECT_ID]/logs/[LOG_ID] +// organizations/[ORGANIZATION_ID]/logs/[LOG_ID] +// billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID] +// folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For +// example, "projects/my-project-id/logs/syslog", +// "organizations/123/logs/cloudaudit.googleapis.com%2Factivity".For +// more information about log names, see LogEntry. +func (r *OrganizationsLogsService) Delete(logName string) *OrganizationsLogsDeleteCall { + c := &OrganizationsLogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.logName = logName return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsBucketsViewsPatchCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsPatchCall { +func (c *OrganizationsLogsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLogsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -24613,21 +28556,21 @@ func (c *OrganizationsLocationsBucketsViewsPatchCall) Fields(s ...googleapi.Fiel // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsBucketsViewsPatchCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsPatchCall { +func (c *OrganizationsLogsDeleteCall) Context(ctx context.Context) *OrganizationsLogsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsBucketsViewsPatchCall) Header() http.Header { +func (c *OrganizationsLogsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLogsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -24635,34 +28578,29 @@ func (c *OrganizationsLocationsBucketsViewsPatchCall) doRequest(alt string) (*ht } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+logName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "logName": c.logName, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.buckets.views.patch" call. -// Exactly one of *LogView or error will be non-nil. Any non-2xx status +// Do executes the "logging.organizations.logs.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *LogView.ServerResponse.Header or (if a response was returned at all) +// *Empty.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 *OrganizationsLocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) (*LogView, error) { +func (c *OrganizationsLogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -24681,7 +28619,7 @@ func (c *OrganizationsLocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallO if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogView{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -24693,34 +28631,25 @@ func (c *OrganizationsLocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallO } return ret, nil // { - // "description": "Updates a view on a log bucket. This method replaces the following fields in the existing view with values from the new view: filter. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can update the view. If this occurs, please try again in a few minutes.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", - // "httpMethod": "PATCH", - // "id": "logging.organizations.locations.buckets.views.patch", + // "description": "Deletes all the log entries in a log for the _Default Log Bucket. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted.", + // "flatPath": "v2/organizations/{organizationsId}/logs/{logsId}", + // "httpMethod": "DELETE", + // "id": "logging.organizations.logs.delete", // "parameterOrder": [ - // "name" + // "logName" // ], // "parameters": { - // "name": { - // "description": "Required. The full resource name of the view to update \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", + // "logName": { + // "description": "Required. The resource name of the log to delete: projects/[PROJECT_ID]/logs/[LOG_ID] organizations/[ORGANIZATION_ID]/logs/[LOG_ID] billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID] folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/123/logs/cloudaudit.googleapis.com%2Factivity\".For more information about log names, see LogEntry.", // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", + // "pattern": "^organizations/[^/]+/logs/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "Optional. Field mask that specifies the fields in view that need an update. A field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+name}", - // "request": { - // "$ref": "LogView" - // }, + // "path": "v2/{+logName}", // "response": { - // "$ref": "LogView" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -24730,9 +28659,9 @@ func (c *OrganizationsLocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallO } -// method id "logging.organizations.locations.buckets.views.logs.list": +// method id "logging.organizations.logs.list": -type OrganizationsLocationsBucketsViewsLogsListCall struct { +type OrganizationsLogsListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -24747,8 +28676,8 @@ type OrganizationsLocationsBucketsViewsLogsListCall struct { // - parent: The resource name that owns the logs: projects/[PROJECT_ID] // organizations/[ORGANIZATION_ID] // billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]. -func (r *OrganizationsLocationsBucketsViewsLogsService) List(parent string) *OrganizationsLocationsBucketsViewsLogsListCall { - c := &OrganizationsLocationsBucketsViewsLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *OrganizationsLogsService) List(parent string) *OrganizationsLogsListCall { + c := &OrganizationsLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } @@ -24757,7 +28686,7 @@ func (r *OrganizationsLocationsBucketsViewsLogsService) List(parent string) *Org // of results to return from this request. Non-positive values are // ignored. The presence of nextPageToken in the response indicates that // more results might be available. -func (c *OrganizationsLocationsBucketsViewsLogsListCall) PageSize(pageSize int64) *OrganizationsLocationsBucketsViewsLogsListCall { +func (c *OrganizationsLogsListCall) PageSize(pageSize int64) *OrganizationsLogsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } @@ -24767,7 +28696,7 @@ func (c *OrganizationsLocationsBucketsViewsLogsListCall) PageSize(pageSize int64 // method. pageToken must be the value of nextPageToken from the // previous response. The values of other method parameters should be // identical to those in the previous call. -func (c *OrganizationsLocationsBucketsViewsLogsListCall) PageToken(pageToken string) *OrganizationsLocationsBucketsViewsLogsListCall { +func (c *OrganizationsLogsListCall) PageToken(pageToken string) *OrganizationsLogsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -24784,7 +28713,7 @@ func (c *OrganizationsLocationsBucketsViewsLogsListCall) PageToken(pageToken str // [VIEW_ID]To support legacy queries, it could also be: // projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] // billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID] -func (c *OrganizationsLocationsBucketsViewsLogsListCall) ResourceNames(resourceNames ...string) *OrganizationsLocationsBucketsViewsLogsListCall { +func (c *OrganizationsLogsListCall) ResourceNames(resourceNames ...string) *OrganizationsLogsListCall { c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...)) return c } @@ -24792,7 +28721,7 @@ func (c *OrganizationsLocationsBucketsViewsLogsListCall) ResourceNames(resourceN // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsBucketsViewsLogsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsLogsListCall { +func (c *OrganizationsLogsListCall) Fields(s ...googleapi.Field) *OrganizationsLogsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -24802,7 +28731,7 @@ func (c *OrganizationsLocationsBucketsViewsLogsListCall) Fields(s ...googleapi.F // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsLocationsBucketsViewsLogsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsViewsLogsListCall { +func (c *OrganizationsLogsListCall) IfNoneMatch(entityTag string) *OrganizationsLogsListCall { c.ifNoneMatch_ = entityTag return c } @@ -24810,21 +28739,21 @@ func (c *OrganizationsLocationsBucketsViewsLogsListCall) IfNoneMatch(entityTag s // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsBucketsViewsLogsListCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsLogsListCall { +func (c *OrganizationsLogsListCall) Context(ctx context.Context) *OrganizationsLogsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsBucketsViewsLogsListCall) Header() http.Header { +func (c *OrganizationsLogsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsBucketsViewsLogsListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLogsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -24850,14 +28779,14 @@ func (c *OrganizationsLocationsBucketsViewsLogsListCall) doRequest(alt string) ( return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.buckets.views.logs.list" call. +// Do executes the "logging.organizations.logs.list" call. // Exactly one of *ListLogsResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either // *ListLogsResponse.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 *OrganizationsLocationsBucketsViewsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) { +func (c *OrganizationsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -24889,9 +28818,9 @@ func (c *OrganizationsLocationsBucketsViewsLogsListCall) Do(opts ...googleapi.Ca return ret, nil // { // "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}/logs", + // "flatPath": "v2/organizations/{organizationsId}/logs", // "httpMethod": "GET", - // "id": "logging.organizations.locations.buckets.views.logs.list", + // "id": "logging.organizations.logs.list", // "parameterOrder": [ // "parent" // ], @@ -24908,297 +28837,160 @@ func (c *OrganizationsLocationsBucketsViewsLogsListCall) Do(opts ...googleapi.Ca // "type": "string" // }, // "parent": { - // "description": "Required. The resource name that owns the logs: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", - // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", - // "required": true, - // "type": "string" - // }, - // "resourceNames": { - // "description": "Optional. The resource name that owns the logs: projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]To support legacy queries, it could also be: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", - // "location": "query", - // "repeated": true, - // "type": "string" - // } - // }, - // "path": "v2/{+parent}/logs", - // "response": { - // "$ref": "ListLogsResponse" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" - // ] - // } - -} - -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *OrganizationsLocationsBucketsViewsLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "logging.organizations.locations.operations.cancel": - -type OrganizationsLocationsOperationsCancelCall struct { - s *Service - name string - canceloperationrequest *CancelOperationRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Cancel: Starts asynchronous cancellation on a long-running operation. -// The server makes a best effort to cancel the operation, but success -// is not guaranteed. If the server doesn't support this method, it -// returns google.rpc.Code.UNIMPLEMENTED. Clients can use -// Operations.GetOperation or other methods to check whether the -// cancellation succeeded or whether the operation completed despite -// cancellation. On successful cancellation, the operation is not -// deleted; instead, it becomes an operation with an Operation.error -// value with a google.rpc.Status.code of 1, corresponding to -// Code.CANCELLED. -// -// - name: The name of the operation resource to be cancelled. -func (r *OrganizationsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *OrganizationsLocationsOperationsCancelCall { - c := &OrganizationsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.canceloperationrequest = canceloperationrequest - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *OrganizationsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *OrganizationsLocationsOperationsCancelCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *OrganizationsLocationsOperationsCancelCall) Context(ctx context.Context) *OrganizationsLocationsOperationsCancelCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *OrganizationsLocationsOperationsCancelCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *OrganizationsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:cancel") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", 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) -} - -// Do executes the "logging.organizations.locations.operations.cancel" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.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 *OrganizationsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, 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 := &Empty{ - 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 - // { - // "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/operations/{operationsId}:cancel", - // "httpMethod": "POST", - // "id": "logging.organizations.locations.operations.cancel", - // "parameterOrder": [ - // "name" - // ], - // "parameters": { - // "name": { - // "description": "The name of the operation resource to be cancelled.", + // "description": "Required. The resource name that owns the logs: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+/operations/[^/]+$", + // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" + // }, + // "resourceNames": { + // "description": "Optional. The resource name that owns the logs: projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]To support legacy queries, it could also be: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", + // "location": "query", + // "repeated": true, + // "type": "string" // } // }, - // "path": "v2/{+name}:cancel", - // "request": { - // "$ref": "CancelOperationRequest" - // }, + // "path": "v2/{+parent}/logs", // "response": { - // "$ref": "Empty" + // "$ref": "ListLogsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.organizations.locations.operations.get": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *OrganizationsLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type OrganizationsLocationsOperationsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// method id "logging.organizations.sinks.create": + +type OrganizationsSinksCreateCall struct { + s *Service + parent string + logsink *LogSink + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets the latest state of a long-running operation. Clients can -// use this method to poll the operation result at intervals as -// recommended by the API service. +// Create: Creates a sink that exports specified log entries to a +// destination. The export of newly-ingested log entries begins +// immediately, unless the sink's writer_identity is not permitted to +// write to the destination. A sink can export log entries only from the +// resource owning the sink. // -// - name: The name of the operation resource. -func (r *OrganizationsLocationsOperationsService) Get(name string) *OrganizationsLocationsOperationsGetCall { - c := &OrganizationsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: The resource in which to create the sink: +// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For +// examples:"projects/my-project" "organizations/123456789". +func (r *OrganizationsSinksService) Create(parent string, logsink *LogSink) *OrganizationsSinksCreateCall { + c := &OrganizationsSinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.logsink = logsink + return c +} + +// UniqueWriterIdentity sets the optional parameter +// "uniqueWriterIdentity": Determines the kind of IAM identity returned +// as writer_identity in the new sink. If this value is omitted or set +// to false, and if the sink's parent is a project, then the value +// returned as writer_identity is the same group or service account used +// by Cloud Logging before the addition of writer identities to this +// API. The sink's destination must be in the same project as the sink +// itself.If this field is set to true, or if the sink is owned by a +// non-project resource such as an organization, then the value of +// writer_identity will be a unique service account used only for +// exports from the new sink. For more information, see writer_identity +// in LogSink. +func (c *OrganizationsSinksCreateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *OrganizationsSinksCreateCall { + c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsOperationsGetCall { +func (c *OrganizationsSinksCreateCall) Fields(s ...googleapi.Field) *OrganizationsSinksCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *OrganizationsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsOperationsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsOperationsGetCall) Context(ctx context.Context) *OrganizationsLocationsOperationsGetCall { +func (c *OrganizationsSinksCreateCall) Context(ctx context.Context) *OrganizationsSinksCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsOperationsGetCall) Header() http.Header { +func (c *OrganizationsSinksCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.operations.get" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Operation.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 *OrganizationsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// Do executes the "logging.organizations.sinks.create" call. +// Exactly one of *LogSink or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogSink.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 *OrganizationsSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -25217,7 +29009,7 @@ func (c *OrganizationsLocationsOperationsGetCall) Do(opts ...googleapi.CallOptio if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &LogSink{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -25229,155 +29021,124 @@ func (c *OrganizationsLocationsOperationsGetCall) Do(opts ...googleapi.CallOptio } return ret, nil // { - // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/operations/{operationsId}", - // "httpMethod": "GET", - // "id": "logging.organizations.locations.operations.get", + // "description": "Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.", + // "flatPath": "v2/organizations/{organizationsId}/sinks", + // "httpMethod": "POST", + // "id": "logging.organizations.sinks.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "The name of the operation resource.", + // "parent": { + // "description": "Required. The resource in which to create the sink: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-project\" \"organizations/123456789\"", // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+/operations/[^/]+$", + // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" + // }, + // "uniqueWriterIdentity": { + // "description": "Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Cloud Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink.", + // "location": "query", + // "type": "boolean" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+parent}/sinks", + // "request": { + // "$ref": "LogSink" + // }, // "response": { - // "$ref": "Operation" + // "$ref": "LogSink" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// method id "logging.organizations.locations.operations.list": +// method id "logging.organizations.sinks.delete": -type OrganizationsLocationsOperationsListCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsSinksDeleteCall struct { + s *Service + sinkNameid string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists operations that match the specified filter in the -// request. If the server doesn't support this method, it returns -// UNIMPLEMENTED.NOTE: the name binding allows API services to override -// the binding to use different resource name schemes, such as -// users/*/operations. To override the binding, API services can add a -// binding such as "/v1/{name=users/*}/operations" to their service -// configuration. For backwards compatibility, the default name includes -// the operations collection id, however overriding users must ensure -// the name binding is the parent resource, without the operations -// collection id. +// Delete: Deletes a sink. If the sink has a unique writer_identity, +// then that service account is also deleted. // -// - name: The name of the operation's parent resource. -func (r *OrganizationsLocationsOperationsService) List(name string) *OrganizationsLocationsOperationsListCall { - c := &OrganizationsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - return c -} - -// Filter sets the optional parameter "filter": The standard list -// filter. -func (c *OrganizationsLocationsOperationsListCall) Filter(filter string) *OrganizationsLocationsOperationsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// PageSize sets the optional parameter "pageSize": The standard list -// page size. -func (c *OrganizationsLocationsOperationsListCall) PageSize(pageSize int64) *OrganizationsLocationsOperationsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The standard list -// page token. -func (c *OrganizationsLocationsOperationsListCall) PageToken(pageToken string) *OrganizationsLocationsOperationsListCall { - c.urlParams_.Set("pageToken", pageToken) +// - sinkName: The full resource name of the sink to delete, including +// the parent resource and the sink identifier: +// "projects/[PROJECT_ID]/sinks/[SINK_ID]" +// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" +// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For +// example:"projects/my-project/sinks/my-sink". +func (r *OrganizationsSinksService) Delete(sinkNameid string) *OrganizationsSinksDeleteCall { + c := &OrganizationsSinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.sinkNameid = sinkNameid return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsOperationsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsOperationsListCall { +func (c *OrganizationsSinksDeleteCall) Fields(s ...googleapi.Field) *OrganizationsSinksDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *OrganizationsLocationsOperationsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsOperationsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsOperationsListCall) Context(ctx context.Context) *OrganizationsLocationsOperationsListCall { +func (c *OrganizationsSinksDeleteCall) Context(ctx context.Context) *OrganizationsSinksDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsOperationsListCall) Header() http.Header { +func (c *OrganizationsSinksDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - 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, "v2/{+name}/operations") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "sinkName": c.sinkNameid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.operations.list" call. -// Exactly one of *ListOperationsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListOperationsResponse.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 *OrganizationsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { +// Do executes the "logging.organizations.sinks.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.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 *OrganizationsSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -25396,7 +29157,7 @@ func (c *OrganizationsLocationsOperationsListCall) Do(opts ...googleapi.CallOpti if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListOperationsResponse{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -25408,159 +29169,128 @@ func (c *OrganizationsLocationsOperationsListCall) Do(opts ...googleapi.CallOpti } return ret, nil // { - // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as \"/v1/{name=users/*}/operations\" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/operations", - // "httpMethod": "GET", - // "id": "logging.organizations.locations.operations.list", + // "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.", + // "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}", + // "httpMethod": "DELETE", + // "id": "logging.organizations.sinks.delete", // "parameterOrder": [ - // "name" + // "sinkName" // ], // "parameters": { - // "filter": { - // "description": "The standard list filter.", - // "location": "query", - // "type": "string" - // }, - // "name": { - // "description": "The name of the operation's parent resource.", + // "sinkName": { + // "description": "Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+$", + // "pattern": "^organizations/[^/]+/sinks/[^/]+$", // "required": true, // "type": "string" - // }, - // "pageSize": { - // "description": "The standard list page size.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The standard list page token.", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+name}/operations", + // "path": "v2/{+sinkName}", // "response": { - // "$ref": "ListOperationsResponse" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *OrganizationsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "logging.organizations.logs.delete": +// method id "logging.organizations.sinks.get": -type OrganizationsLogsDeleteCall struct { - s *Service - logName string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsSinksGetCall struct { + s *Service + sinkName string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes all the log entries in a log for the _Default Log -// Bucket. The log reappears if it receives new entries. Log entries -// written shortly before the delete operation might not be deleted. -// Entries received after the delete operation with a timestamp before -// the operation will be deleted. +// Get: Gets a sink. // -// - logName: The resource name of the log to delete: -// projects/[PROJECT_ID]/logs/[LOG_ID] -// organizations/[ORGANIZATION_ID]/logs/[LOG_ID] -// billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID] -// folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For -// example, "projects/my-project-id/logs/syslog", -// "organizations/123/logs/cloudaudit.googleapis.com%2Factivity".For -// more information about log names, see LogEntry. -func (r *OrganizationsLogsService) Delete(logName string) *OrganizationsLogsDeleteCall { - c := &OrganizationsLogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.logName = logName +// - sinkName: The resource name of the sink: +// "projects/[PROJECT_ID]/sinks/[SINK_ID]" +// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" +// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For +// example:"projects/my-project/sinks/my-sink". +func (r *OrganizationsSinksService) Get(sinkName string) *OrganizationsSinksGetCall { + c := &OrganizationsSinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.sinkName = sinkName return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLogsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLogsDeleteCall { +func (c *OrganizationsSinksGetCall) Fields(s ...googleapi.Field) *OrganizationsSinksGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsSinksGetCall) IfNoneMatch(entityTag string) *OrganizationsSinksGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLogsDeleteCall) Context(ctx context.Context) *OrganizationsLogsDeleteCall { +func (c *OrganizationsSinksGetCall) Context(ctx context.Context) *OrganizationsSinksGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLogsDeleteCall) Header() http.Header { +func (c *OrganizationsSinksGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLogsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSinksGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + 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, "v2/{+logName}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "logName": c.logName, + "sinkName": c.sinkName, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.logs.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// Do executes the "logging.organizations.sinks.get" call. +// Exactly one of *LogSink or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) +// *LogSink.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 *OrganizationsLogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +func (c *OrganizationsSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -25579,7 +29309,7 @@ func (c *OrganizationsLogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &LogSink{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -25591,37 +29321,39 @@ func (c *OrganizationsLogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, } return ret, nil // { - // "description": "Deletes all the log entries in a log for the _Default Log Bucket. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted.", - // "flatPath": "v2/organizations/{organizationsId}/logs/{logsId}", - // "httpMethod": "DELETE", - // "id": "logging.organizations.logs.delete", + // "description": "Gets a sink.", + // "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}", + // "httpMethod": "GET", + // "id": "logging.organizations.sinks.get", // "parameterOrder": [ - // "logName" + // "sinkName" // ], // "parameters": { - // "logName": { - // "description": "Required. The resource name of the log to delete: projects/[PROJECT_ID]/logs/[LOG_ID] organizations/[ORGANIZATION_ID]/logs/[LOG_ID] billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID] folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/123/logs/cloudaudit.googleapis.com%2Factivity\".For more information about log names, see LogEntry.", + // "sinkName": { + // "description": "Required. The resource name of the sink: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", // "location": "path", - // "pattern": "^organizations/[^/]+/logs/[^/]+$", + // "pattern": "^organizations/[^/]+/sinks/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+logName}", + // "path": "v2/{+sinkName}", // "response": { - // "$ref": "Empty" + // "$ref": "LogSink" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.organizations.logs.list": +// method id "logging.organizations.sinks.list": -type OrganizationsLogsListCall struct { +type OrganizationsSinksListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -25630,14 +29362,13 @@ type OrganizationsLogsListCall struct { header_ http.Header } -// List: Lists the logs in projects, organizations, folders, or billing -// accounts. Only logs that have entries are listed. +// List: Lists sinks. // -// - parent: The resource name that owns the logs: projects/[PROJECT_ID] -// organizations/[ORGANIZATION_ID] -// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]. -func (r *OrganizationsLogsService) List(parent string) *OrganizationsLogsListCall { - c := &OrganizationsLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The parent resource whose sinks are to be listed: +// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]". +func (r *OrganizationsSinksService) List(parent string) *OrganizationsSinksListCall { + c := &OrganizationsSinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } @@ -25646,7 +29377,7 @@ func (r *OrganizationsLogsService) List(parent string) *OrganizationsLogsListCal // of results to return from this request. Non-positive values are // ignored. The presence of nextPageToken in the response indicates that // more results might be available. -func (c *OrganizationsLogsListCall) PageSize(pageSize int64) *OrganizationsLogsListCall { +func (c *OrganizationsSinksListCall) PageSize(pageSize int64) *OrganizationsSinksListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } @@ -25656,32 +29387,15 @@ func (c *OrganizationsLogsListCall) PageSize(pageSize int64) *OrganizationsLogsL // method. pageToken must be the value of nextPageToken from the // previous response. The values of other method parameters should be // identical to those in the previous call. -func (c *OrganizationsLogsListCall) PageToken(pageToken string) *OrganizationsLogsListCall { +func (c *OrganizationsSinksListCall) PageToken(pageToken string) *OrganizationsSinksListCall { c.urlParams_.Set("pageToken", pageToken) return c } -// ResourceNames sets the optional parameter "resourceNames": The -// resource name that owns the logs: -// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/view -// s/[VIEW_ID] -// organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKE -// T_ID]/views/[VIEW_ID] -// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[ -// BUCKET_ID]/views/[VIEW_ID] -// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/ -// [VIEW_ID]To support legacy queries, it could also be: -// projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] -// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID] -func (c *OrganizationsLogsListCall) ResourceNames(resourceNames ...string) *OrganizationsLogsListCall { - c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...)) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLogsListCall) Fields(s ...googleapi.Field) *OrganizationsLogsListCall { +func (c *OrganizationsSinksListCall) Fields(s ...googleapi.Field) *OrganizationsSinksListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -25691,7 +29405,7 @@ func (c *OrganizationsLogsListCall) Fields(s ...googleapi.Field) *OrganizationsL // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsLogsListCall) IfNoneMatch(entityTag string) *OrganizationsLogsListCall { +func (c *OrganizationsSinksListCall) IfNoneMatch(entityTag string) *OrganizationsSinksListCall { c.ifNoneMatch_ = entityTag return c } @@ -25699,21 +29413,21 @@ func (c *OrganizationsLogsListCall) IfNoneMatch(entityTag string) *Organizations // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLogsListCall) Context(ctx context.Context) *OrganizationsLogsListCall { +func (c *OrganizationsSinksListCall) Context(ctx context.Context) *OrganizationsSinksListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLogsListCall) Header() http.Header { +func (c *OrganizationsSinksListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLogsListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSinksListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -25726,7 +29440,7 @@ func (c *OrganizationsLogsListCall) doRequest(alt string) (*http.Response, error var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -25739,14 +29453,14 @@ func (c *OrganizationsLogsListCall) doRequest(alt string) (*http.Response, error return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.logs.list" call. -// Exactly one of *ListLogsResponse or error will be non-nil. Any +// Do executes the "logging.organizations.sinks.list" call. +// Exactly one of *ListSinksResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either -// *ListLogsResponse.ServerResponse.Header or (if a response was +// *ListSinksResponse.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 *OrganizationsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) { +func (c *OrganizationsSinksListCall) Do(opts ...googleapi.CallOption) (*ListSinksResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -25765,7 +29479,7 @@ func (c *OrganizationsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsR if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListLogsResponse{ + ret := &ListSinksResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -25777,10 +29491,10 @@ func (c *OrganizationsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsR } return ret, nil // { - // "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", - // "flatPath": "v2/organizations/{organizationsId}/logs", + // "description": "Lists sinks.", + // "flatPath": "v2/organizations/{organizationsId}/sinks", // "httpMethod": "GET", - // "id": "logging.organizations.logs.list", + // "id": "logging.organizations.sinks.list", // "parameterOrder": [ // "parent" // ], @@ -25797,22 +29511,16 @@ func (c *OrganizationsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsR // "type": "string" // }, // "parent": { - // "description": "Required. The resource name that owns the logs: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", + // "description": "Required. The parent resource whose sinks are to be listed: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ", // "location": "path", // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" - // }, - // "resourceNames": { - // "description": "Optional. The resource name that owns the logs: projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]To support legacy queries, it could also be: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", - // "location": "query", - // "repeated": true, - // "type": "string" // } // }, - // "path": "v2/{+parent}/logs", + // "path": "v2/{+parent}/sinks", // "response": { - // "$ref": "ListLogsResponse" + // "$ref": "ListSinksResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -25827,7 +29535,7 @@ func (c *OrganizationsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsR // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *OrganizationsLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error { +func (c *OrganizationsSinksListCall) Pages(ctx context.Context, f func(*ListSinksResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -25845,55 +29553,70 @@ func (c *OrganizationsLogsListCall) Pages(ctx context.Context, f func(*ListLogsR } } -// method id "logging.organizations.sinks.create": +// method id "logging.organizations.sinks.patch": -type OrganizationsSinksCreateCall struct { +type OrganizationsSinksPatchCall struct { s *Service - parent string + sinkNameid string logsink *LogSink urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Create: Creates a sink that exports specified log entries to a -// destination. The export of newly-ingested log entries begins -// immediately, unless the sink's writer_identity is not permitted to -// write to the destination. A sink can export log entries only from the -// resource owning the sink. +// Patch: Updates a sink. This method replaces the following fields in +// the existing sink with values from the new sink: destination, and +// filter.The updated sink might also have a new writer_identity; see +// the unique_writer_identity field. // -// - parent: The resource in which to create the sink: -// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For -// examples:"projects/my-project" "organizations/123456789". -func (r *OrganizationsSinksService) Create(parent string, logsink *LogSink) *OrganizationsSinksCreateCall { - c := &OrganizationsSinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent +// - sinkName: The full resource name of the sink to update, including +// the parent resource and the sink identifier: +// "projects/[PROJECT_ID]/sinks/[SINK_ID]" +// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" +// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For +// example:"projects/my-project/sinks/my-sink". +func (r *OrganizationsSinksService) Patch(sinkNameid string, logsink *LogSink) *OrganizationsSinksPatchCall { + c := &OrganizationsSinksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.sinkNameid = sinkNameid c.logsink = logsink return c } // UniqueWriterIdentity sets the optional parameter -// "uniqueWriterIdentity": Determines the kind of IAM identity returned -// as writer_identity in the new sink. If this value is omitted or set -// to false, and if the sink's parent is a project, then the value -// returned as writer_identity is the same group or service account used -// by Cloud Logging before the addition of writer identities to this -// API. The sink's destination must be in the same project as the sink -// itself.If this field is set to true, or if the sink is owned by a -// non-project resource such as an organization, then the value of -// writer_identity will be a unique service account used only for -// exports from the new sink. For more information, see writer_identity -// in LogSink. -func (c *OrganizationsSinksCreateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *OrganizationsSinksCreateCall { +// "uniqueWriterIdentity": See sinks.create for a description of this +// field. When updating a sink, the effect of this field on the value of +// writer_identity in the updated sink depends on both the old and new +// values of this field: If the old and new values of this field are +// both false or both true, then there is no change to the sink's +// writer_identity. If the old value is false and the new value is true, +// then writer_identity is changed to a unique service account. It is an +// error if the old value is true and the new value is set to false or +// defaulted to false. +func (c *OrganizationsSinksPatchCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *OrganizationsSinksPatchCall { c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity)) return c } +// UpdateMask sets the optional parameter "updateMask": Field mask that +// specifies the fields in sink that need an update. A sink field will +// be overwritten if, and only if, it is in the update mask. name and +// output only fields cannot be updated.An empty updateMask is +// temporarily treated as using the following mask for backwards +// compatibility purposes:destination,filter,includeChildrenAt some +// point in the future, behavior will be removed and specifying an empty +// updateMask will be an error.For a detailed FieldMask definition, see +// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor +// example: updateMask=filter +func (c *OrganizationsSinksPatchCall) UpdateMask(updateMask string) *OrganizationsSinksPatchCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSinksCreateCall) Fields(s ...googleapi.Field) *OrganizationsSinksCreateCall { +func (c *OrganizationsSinksPatchCall) Fields(s ...googleapi.Field) *OrganizationsSinksPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -25901,21 +29624,21 @@ func (c *OrganizationsSinksCreateCall) Fields(s ...googleapi.Field) *Organizatio // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSinksCreateCall) Context(ctx context.Context) *OrganizationsSinksCreateCall { +func (c *OrganizationsSinksPatchCall) Context(ctx context.Context) *OrganizationsSinksPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSinksCreateCall) Header() http.Header { +func (c *OrganizationsSinksPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSinksCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSinksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -25930,27 +29653,27 @@ func (c *OrganizationsSinksCreateCall) doRequest(alt string) (*http.Response, er reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "sinkName": c.sinkNameid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.sinks.create" call. +// Do executes the "logging.organizations.sinks.patch" call. // Exactly one of *LogSink or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *LogSink.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 *OrganizationsSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { +func (c *OrganizationsSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -25981,28 +29704,34 @@ func (c *OrganizationsSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSin } return ret, nil // { - // "description": "Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.", - // "flatPath": "v2/organizations/{organizationsId}/sinks", - // "httpMethod": "POST", - // "id": "logging.organizations.sinks.create", + // "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field.", + // "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}", + // "httpMethod": "PATCH", + // "id": "logging.organizations.sinks.patch", // "parameterOrder": [ - // "parent" + // "sinkName" // ], // "parameters": { - // "parent": { - // "description": "Required. The resource in which to create the sink: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-project\" \"organizations/123456789\"", + // "sinkName": { + // "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", // "location": "path", - // "pattern": "^organizations/[^/]+$", + // "pattern": "^organizations/[^/]+/sinks/[^/]+$", // "required": true, // "type": "string" // }, // "uniqueWriterIdentity": { - // "description": "Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Cloud Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink.", + // "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a unique service account. It is an error if the old value is true and the new value is set to false or defaulted to false.", // "location": "query", // "type": "boolean" + // }, + // "updateMask": { + // "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes:destination,filter,includeChildrenAt some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+parent}/sinks", + // "path": "v2/{+sinkName}", // "request": { // "$ref": "LogSink" // }, @@ -26017,36 +29746,70 @@ func (c *OrganizationsSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSin } -// method id "logging.organizations.sinks.delete": +// method id "logging.organizations.sinks.update": -type OrganizationsSinksDeleteCall struct { +type OrganizationsSinksUpdateCall struct { s *Service sinkNameid string + logsink *LogSink urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Delete: Deletes a sink. If the sink has a unique writer_identity, -// then that service account is also deleted. +// Update: Updates a sink. This method replaces the following fields in +// the existing sink with values from the new sink: destination, and +// filter.The updated sink might also have a new writer_identity; see +// the unique_writer_identity field. // -// - sinkName: The full resource name of the sink to delete, including +// - sinkName: The full resource name of the sink to update, including // the parent resource and the sink identifier: // "projects/[PROJECT_ID]/sinks/[SINK_ID]" // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" // "folders/[FOLDER_ID]/sinks/[SINK_ID]" For // example:"projects/my-project/sinks/my-sink". -func (r *OrganizationsSinksService) Delete(sinkNameid string) *OrganizationsSinksDeleteCall { - c := &OrganizationsSinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *OrganizationsSinksService) Update(sinkNameid string, logsink *LogSink) *OrganizationsSinksUpdateCall { + c := &OrganizationsSinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.sinkNameid = sinkNameid + c.logsink = logsink + return c +} + +// UniqueWriterIdentity sets the optional parameter +// "uniqueWriterIdentity": See sinks.create for a description of this +// field. When updating a sink, the effect of this field on the value of +// writer_identity in the updated sink depends on both the old and new +// values of this field: If the old and new values of this field are +// both false or both true, then there is no change to the sink's +// writer_identity. If the old value is false and the new value is true, +// then writer_identity is changed to a unique service account. It is an +// error if the old value is true and the new value is set to false or +// defaulted to false. +func (c *OrganizationsSinksUpdateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *OrganizationsSinksUpdateCall { + c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity)) + return c +} + +// UpdateMask sets the optional parameter "updateMask": Field mask that +// specifies the fields in sink that need an update. A sink field will +// be overwritten if, and only if, it is in the update mask. name and +// output only fields cannot be updated.An empty updateMask is +// temporarily treated as using the following mask for backwards +// compatibility purposes:destination,filter,includeChildrenAt some +// point in the future, behavior will be removed and specifying an empty +// updateMask will be an error.For a detailed FieldMask definition, see +// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor +// example: updateMask=filter +func (c *OrganizationsSinksUpdateCall) UpdateMask(updateMask string) *OrganizationsSinksUpdateCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSinksDeleteCall) Fields(s ...googleapi.Field) *OrganizationsSinksDeleteCall { +func (c *OrganizationsSinksUpdateCall) Fields(s ...googleapi.Field) *OrganizationsSinksUpdateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -26054,21 +29817,21 @@ func (c *OrganizationsSinksDeleteCall) Fields(s ...googleapi.Field) *Organizatio // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSinksDeleteCall) Context(ctx context.Context) *OrganizationsSinksDeleteCall { +func (c *OrganizationsSinksUpdateCall) Context(ctx context.Context) *OrganizationsSinksUpdateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSinksDeleteCall) Header() http.Header { +func (c *OrganizationsSinksUpdateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSinksDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSinksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -26076,11 +29839,16 @@ func (c *OrganizationsSinksDeleteCall) doRequest(alt string) (*http.Response, er } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("PUT", urls, body) if err != nil { return nil, err } @@ -26091,14 +29859,14 @@ func (c *OrganizationsSinksDeleteCall) doRequest(alt string) (*http.Response, er return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.sinks.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// Do executes the "logging.organizations.sinks.update" call. +// Exactly one of *LogSink or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) +// *LogSink.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 *OrganizationsSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +func (c *OrganizationsSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -26117,7 +29885,7 @@ func (c *OrganizationsSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &LogSink{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -26129,25 +29897,39 @@ func (c *OrganizationsSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, } return ret, nil // { - // "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.", + // "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field.", // "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}", - // "httpMethod": "DELETE", - // "id": "logging.organizations.sinks.delete", + // "httpMethod": "PUT", + // "id": "logging.organizations.sinks.update", // "parameterOrder": [ // "sinkName" // ], // "parameters": { // "sinkName": { - // "description": "Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", + // "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", // "location": "path", // "pattern": "^organizations/[^/]+/sinks/[^/]+$", // "required": true, // "type": "string" + // }, + // "uniqueWriterIdentity": { + // "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a unique service account. It is an error if the old value is true and the new value is set to false or defaulted to false.", + // "location": "query", + // "type": "boolean" + // }, + // "updateMask": { + // "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes:destination,filter,includeChildrenAt some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, // "path": "v2/{+sinkName}", + // "request": { + // "$ref": "LogSink" + // }, // "response": { - // "$ref": "Empty" + // "$ref": "LogSink" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -26157,35 +29939,46 @@ func (c *OrganizationsSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, } -// method id "logging.organizations.sinks.get": +// method id "logging.projects.getCmekSettings": -type OrganizationsSinksGetCall struct { +type ProjectsGetCmekSettingsCall struct { s *Service - sinkName string + name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Gets a sink. +// GetCmekSettings: Gets the Logging CMEK settings for the given +// resource.Note: CMEK for the Log Router can be configured for Google +// Cloud projects, folders, organizations and billing accounts. Once +// configured for an organization, it applies to all projects and +// folders in the Google Cloud organization.See Enabling CMEK for Log +// Router +// (https://cloud.google.com/logging/docs/routing/managed-encryption) +// for more information. // -// - sinkName: The resource name of the sink: -// "projects/[PROJECT_ID]/sinks/[SINK_ID]" -// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" -// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For -// example:"projects/my-project/sinks/my-sink". -func (r *OrganizationsSinksService) Get(sinkName string) *OrganizationsSinksGetCall { - c := &OrganizationsSinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.sinkName = sinkName +// - name: The resource for which to retrieve CMEK settings. +// "projects/[PROJECT_ID]/cmekSettings" +// "organizations/[ORGANIZATION_ID]/cmekSettings" +// "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" +// "folders/[FOLDER_ID]/cmekSettings" For +// example:"organizations/12345/cmekSettings"Note: CMEK for the Log +// Router can be configured for Google Cloud projects, folders, +// organizations and billing accounts. Once configured for an +// organization, it applies to all projects and folders in the Google +// Cloud organization. +func (r *ProjectsService) GetCmekSettings(name string) *ProjectsGetCmekSettingsCall { + c := &ProjectsGetCmekSettingsCall{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 information. -func (c *OrganizationsSinksGetCall) Fields(s ...googleapi.Field) *OrganizationsSinksGetCall { +func (c *ProjectsGetCmekSettingsCall) Fields(s ...googleapi.Field) *ProjectsGetCmekSettingsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -26195,7 +29988,7 @@ func (c *OrganizationsSinksGetCall) Fields(s ...googleapi.Field) *OrganizationsS // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsSinksGetCall) IfNoneMatch(entityTag string) *OrganizationsSinksGetCall { +func (c *ProjectsGetCmekSettingsCall) IfNoneMatch(entityTag string) *ProjectsGetCmekSettingsCall { c.ifNoneMatch_ = entityTag return c } @@ -26203,21 +29996,21 @@ func (c *OrganizationsSinksGetCall) IfNoneMatch(entityTag string) *Organizations // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSinksGetCall) Context(ctx context.Context) *OrganizationsSinksGetCall { +func (c *ProjectsGetCmekSettingsCall) Context(ctx context.Context) *ProjectsGetCmekSettingsCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSinksGetCall) Header() http.Header { +func (c *ProjectsGetCmekSettingsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSinksGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsGetCmekSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -26230,7 +30023,7 @@ func (c *OrganizationsSinksGetCall) doRequest(alt string) (*http.Response, error var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/cmekSettings") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -26238,19 +30031,19 @@ func (c *OrganizationsSinksGetCall) doRequest(alt string) (*http.Response, error } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "sinkName": c.sinkName, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.sinks.get" call. -// Exactly one of *LogSink or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *LogSink.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 *OrganizationsSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { +// Do executes the "logging.projects.getCmekSettings" call. +// Exactly one of *CmekSettings or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CmekSettings.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 *ProjectsGetCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSettings, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -26269,7 +30062,7 @@ func (c *OrganizationsSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogSink{ + ret := &CmekSettings{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -26281,25 +30074,25 @@ func (c *OrganizationsSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, } return ret, nil // { - // "description": "Gets a sink.", - // "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}", + // "description": "Gets the Logging CMEK settings for the given resource.Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", + // "flatPath": "v2/projects/{projectsId}/cmekSettings", // "httpMethod": "GET", - // "id": "logging.organizations.sinks.get", + // "id": "logging.projects.getCmekSettings", // "parameterOrder": [ - // "sinkName" + // "name" // ], // "parameters": { - // "sinkName": { - // "description": "Required. The resource name of the sink: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", + // "name": { + // "description": "Required. The resource for which to retrieve CMEK settings. \"projects/[PROJECT_ID]/cmekSettings\" \"organizations/[ORGANIZATION_ID]/cmekSettings\" \"billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings\" \"folders/[FOLDER_ID]/cmekSettings\" For example:\"organizations/12345/cmekSettings\"Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.", // "location": "path", - // "pattern": "^organizations/[^/]+/sinks/[^/]+$", + // "pattern": "^projects/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+sinkName}", + // "path": "v2/{+name}/cmekSettings", // "response": { - // "$ref": "LogSink" + // "$ref": "CmekSettings" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -26311,51 +30104,47 @@ func (c *OrganizationsSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, } -// method id "logging.organizations.sinks.list": +// method id "logging.projects.getSettings": -type OrganizationsSinksListCall struct { +type ProjectsGetSettingsCall struct { s *Service - parent string + name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists sinks. +// GetSettings: Gets the Log Router settings for the given +// resource.Note: Settings for the Log Router can be get for Google +// Cloud projects, folders, organizations and billing accounts. +// Currently it can only be configured for organizations. Once +// configured for an organization, it applies to all projects and +// folders in the Google Cloud organization.See Enabling CMEK for Log +// Router +// (https://cloud.google.com/logging/docs/routing/managed-encryption) +// for more information. // -// - parent: The parent resource whose sinks are to be listed: -// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]". -func (r *OrganizationsSinksService) List(parent string) *OrganizationsSinksListCall { - c := &OrganizationsSinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return from this request. Non-positive values are -// ignored. The presence of nextPageToken in the response indicates that -// more results might be available. -func (c *OrganizationsSinksListCall) PageSize(pageSize int64) *OrganizationsSinksListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": If present, then -// retrieve the next batch of results from the preceding call to this -// method. pageToken must be the value of nextPageToken from the -// previous response. The values of other method parameters should be -// identical to those in the previous call. -func (c *OrganizationsSinksListCall) PageToken(pageToken string) *OrganizationsSinksListCall { - c.urlParams_.Set("pageToken", pageToken) +// - name: The resource for which to retrieve settings. +// "projects/[PROJECT_ID]/settings" +// "organizations/[ORGANIZATION_ID]/settings" +// "billingAccounts/[BILLING_ACCOUNT_ID]/settings" +// "folders/[FOLDER_ID]/settings" For +// example:"organizations/12345/settings"Note: Settings for the Log +// Router can be get for Google Cloud projects, folders, organizations +// and billing accounts. Currently it can only be configured for +// organizations. Once configured for an organization, it applies to +// all projects and folders in the Google Cloud organization. +func (r *ProjectsService) GetSettings(name string) *ProjectsGetSettingsCall { + c := &ProjectsGetSettingsCall{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 information. -func (c *OrganizationsSinksListCall) Fields(s ...googleapi.Field) *OrganizationsSinksListCall { +func (c *ProjectsGetSettingsCall) Fields(s ...googleapi.Field) *ProjectsGetSettingsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -26365,7 +30154,7 @@ func (c *OrganizationsSinksListCall) Fields(s ...googleapi.Field) *Organizations // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsSinksListCall) IfNoneMatch(entityTag string) *OrganizationsSinksListCall { +func (c *ProjectsGetSettingsCall) IfNoneMatch(entityTag string) *ProjectsGetSettingsCall { c.ifNoneMatch_ = entityTag return c } @@ -26373,21 +30162,21 @@ func (c *OrganizationsSinksListCall) IfNoneMatch(entityTag string) *Organization // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSinksListCall) Context(ctx context.Context) *OrganizationsSinksListCall { +func (c *ProjectsGetSettingsCall) Context(ctx context.Context) *ProjectsGetSettingsCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSinksListCall) Header() http.Header { +func (c *ProjectsGetSettingsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSinksListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsGetSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -26400,7 +30189,7 @@ func (c *OrganizationsSinksListCall) doRequest(alt string) (*http.Response, erro var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/settings") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -26408,19 +30197,19 @@ func (c *OrganizationsSinksListCall) doRequest(alt string) (*http.Response, erro } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.sinks.list" call. -// Exactly one of *ListSinksResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListSinksResponse.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 *OrganizationsSinksListCall) Do(opts ...googleapi.CallOption) (*ListSinksResponse, error) { +// Do executes the "logging.projects.getSettings" call. +// Exactly one of *Settings or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Settings.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 *ProjectsGetSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -26439,7 +30228,7 @@ func (c *OrganizationsSinksListCall) Do(opts ...googleapi.CallOption) (*ListSink if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListSinksResponse{ + ret := &Settings{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -26451,36 +30240,25 @@ func (c *OrganizationsSinksListCall) Do(opts ...googleapi.CallOption) (*ListSink } return ret, nil // { - // "description": "Lists sinks.", - // "flatPath": "v2/organizations/{organizationsId}/sinks", + // "description": "Gets the Log Router settings for the given resource.Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", + // "flatPath": "v2/projects/{projectsId}/settings", // "httpMethod": "GET", - // "id": "logging.organizations.sinks.list", + // "id": "logging.projects.getSettings", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "pageSize": { - // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The parent resource whose sinks are to be listed: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ", + // "name": { + // "description": "Required. The resource for which to retrieve settings. \"projects/[PROJECT_ID]/settings\" \"organizations/[ORGANIZATION_ID]/settings\" \"billingAccounts/[BILLING_ACCOUNT_ID]/settings\" \"folders/[FOLDER_ID]/settings\" For example:\"organizations/12345/settings\"Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.", // "location": "path", - // "pattern": "^organizations/[^/]+$", + // "pattern": "^projects/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/sinks", + // "path": "v2/{+name}/settings", // "response": { - // "$ref": "ListSinksResponse" + // "$ref": "Settings" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -26492,91 +30270,36 @@ func (c *OrganizationsSinksListCall) Do(opts ...googleapi.CallOption) (*ListSink } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *OrganizationsSinksListCall) Pages(ctx context.Context, f func(*ListSinksResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "logging.organizations.sinks.patch": - -type OrganizationsSinksPatchCall struct { - s *Service - sinkNameid string - logsink *LogSink - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Patch: Updates a sink. This method replaces the following fields in -// the existing sink with values from the new sink: destination, and -// filter.The updated sink might also have a new writer_identity; see -// the unique_writer_identity field. -// -// - sinkName: The full resource name of the sink to update, including -// the parent resource and the sink identifier: -// "projects/[PROJECT_ID]/sinks/[SINK_ID]" -// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" -// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For -// example:"projects/my-project/sinks/my-sink". -func (r *OrganizationsSinksService) Patch(sinkNameid string, logsink *LogSink) *OrganizationsSinksPatchCall { - c := &OrganizationsSinksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.sinkNameid = sinkNameid - c.logsink = logsink - return c -} +// method id "logging.projects.exclusions.create": -// UniqueWriterIdentity sets the optional parameter -// "uniqueWriterIdentity": See sinks.create for a description of this -// field. When updating a sink, the effect of this field on the value of -// writer_identity in the updated sink depends on both the old and new -// values of this field: If the old and new values of this field are -// both false or both true, then there is no change to the sink's -// writer_identity. If the old value is false and the new value is true, -// then writer_identity is changed to a unique service account. It is an -// error if the old value is true and the new value is set to false or -// defaulted to false. -func (c *OrganizationsSinksPatchCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *OrganizationsSinksPatchCall { - c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity)) - return c +type ProjectsExclusionsCreateCall struct { + s *Service + parent string + logexclusion *LogExclusion + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// UpdateMask sets the optional parameter "updateMask": Field mask that -// specifies the fields in sink that need an update. A sink field will -// be overwritten if, and only if, it is in the update mask. name and -// output only fields cannot be updated.An empty updateMask is -// temporarily treated as using the following mask for backwards -// compatibility purposes:destination,filter,includeChildrenAt some -// point in the future, behavior will be removed and specifying an empty -// updateMask will be an error.For a detailed FieldMask definition, see -// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor -// example: updateMask=filter -func (c *OrganizationsSinksPatchCall) UpdateMask(updateMask string) *OrganizationsSinksPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// Create: Creates a new exclusion in the _Default sink in a specified +// parent resource. Only log entries belonging to that resource can be +// excluded. You can have up to 10 exclusions in a resource. +// +// - parent: The parent resource in which to create the exclusion: +// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For +// examples:"projects/my-logging-project" "organizations/123456789". +func (r *ProjectsExclusionsService) Create(parent string, logexclusion *LogExclusion) *ProjectsExclusionsCreateCall { + c := &ProjectsExclusionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.logexclusion = logexclusion return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSinksPatchCall) Fields(s ...googleapi.Field) *OrganizationsSinksPatchCall { +func (c *ProjectsExclusionsCreateCall) Fields(s ...googleapi.Field) *ProjectsExclusionsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -26584,21 +30307,21 @@ func (c *OrganizationsSinksPatchCall) Fields(s ...googleapi.Field) *Organization // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSinksPatchCall) Context(ctx context.Context) *OrganizationsSinksPatchCall { +func (c *ProjectsExclusionsCreateCall) Context(ctx context.Context) *ProjectsExclusionsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSinksPatchCall) Header() http.Header { +func (c *ProjectsExclusionsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSinksPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsExclusionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -26606,34 +30329,34 @@ func (c *OrganizationsSinksPatchCall) doRequest(alt string) (*http.Response, err } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "sinkName": c.sinkNameid, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.sinks.patch" call. -// Exactly one of *LogSink or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *LogSink.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 *OrganizationsSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { +// Do executes the "logging.projects.exclusions.create" call. +// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LogExclusion.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 *ProjectsExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -26652,7 +30375,7 @@ func (c *OrganizationsSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogSink{ + ret := &LogExclusion{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -26664,39 +30387,28 @@ func (c *OrganizationsSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink } return ret, nil // { - // "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field.", - // "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}", - // "httpMethod": "PATCH", - // "id": "logging.organizations.sinks.patch", + // "description": "Creates a new exclusion in the _Default sink in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.", + // "flatPath": "v2/projects/{projectsId}/exclusions", + // "httpMethod": "POST", + // "id": "logging.projects.exclusions.create", // "parameterOrder": [ - // "sinkName" + // "parent" // ], // "parameters": { - // "sinkName": { - // "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", + // "parent": { + // "description": "Required. The parent resource in which to create the exclusion: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-logging-project\" \"organizations/123456789\"", // "location": "path", - // "pattern": "^organizations/[^/]+/sinks/[^/]+$", + // "pattern": "^projects/[^/]+$", // "required": true, // "type": "string" - // }, - // "uniqueWriterIdentity": { - // "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a unique service account. It is an error if the old value is true and the new value is set to false or defaulted to false.", - // "location": "query", - // "type": "boolean" - // }, - // "updateMask": { - // "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes:destination,filter,includeChildrenAt some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+sinkName}", + // "path": "v2/{+parent}/exclusions", // "request": { - // "$ref": "LogSink" + // "$ref": "LogExclusion" // }, // "response": { - // "$ref": "LogSink" + // "$ref": "LogExclusion" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -26706,70 +30418,34 @@ func (c *OrganizationsSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink } -// method id "logging.organizations.sinks.update": +// method id "logging.projects.exclusions.delete": -type OrganizationsSinksUpdateCall struct { +type ProjectsExclusionsDeleteCall struct { s *Service - sinkNameid string - logsink *LogSink + name string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Update: Updates a sink. This method replaces the following fields in -// the existing sink with values from the new sink: destination, and -// filter.The updated sink might also have a new writer_identity; see -// the unique_writer_identity field. +// Delete: Deletes an exclusion in the _Default sink. // -// - sinkName: The full resource name of the sink to update, including -// the parent resource and the sink identifier: -// "projects/[PROJECT_ID]/sinks/[SINK_ID]" -// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" -// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For -// example:"projects/my-project/sinks/my-sink". -func (r *OrganizationsSinksService) Update(sinkNameid string, logsink *LogSink) *OrganizationsSinksUpdateCall { - c := &OrganizationsSinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.sinkNameid = sinkNameid - c.logsink = logsink - return c -} - -// UniqueWriterIdentity sets the optional parameter -// "uniqueWriterIdentity": See sinks.create for a description of this -// field. When updating a sink, the effect of this field on the value of -// writer_identity in the updated sink depends on both the old and new -// values of this field: If the old and new values of this field are -// both false or both true, then there is no change to the sink's -// writer_identity. If the old value is false and the new value is true, -// then writer_identity is changed to a unique service account. It is an -// error if the old value is true and the new value is set to false or -// defaulted to false. -func (c *OrganizationsSinksUpdateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *OrganizationsSinksUpdateCall { - c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity)) - return c -} - -// UpdateMask sets the optional parameter "updateMask": Field mask that -// specifies the fields in sink that need an update. A sink field will -// be overwritten if, and only if, it is in the update mask. name and -// output only fields cannot be updated.An empty updateMask is -// temporarily treated as using the following mask for backwards -// compatibility purposes:destination,filter,includeChildrenAt some -// point in the future, behavior will be removed and specifying an empty -// updateMask will be an error.For a detailed FieldMask definition, see -// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor -// example: updateMask=filter -func (c *OrganizationsSinksUpdateCall) UpdateMask(updateMask string) *OrganizationsSinksUpdateCall { - c.urlParams_.Set("updateMask", updateMask) +// - name: The resource name of an existing exclusion to delete: +// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" +// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" +// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For +// example:"projects/my-project/exclusions/my-exclusion". +func (r *ProjectsExclusionsService) Delete(name string) *ProjectsExclusionsDeleteCall { + c := &ProjectsExclusionsDeleteCall{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 information. -func (c *OrganizationsSinksUpdateCall) Fields(s ...googleapi.Field) *OrganizationsSinksUpdateCall { +func (c *ProjectsExclusionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsExclusionsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -26777,21 +30453,21 @@ func (c *OrganizationsSinksUpdateCall) Fields(s ...googleapi.Field) *Organizatio // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSinksUpdateCall) Context(ctx context.Context) *OrganizationsSinksUpdateCall { +func (c *ProjectsExclusionsDeleteCall) Context(ctx context.Context) *ProjectsExclusionsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSinksUpdateCall) Header() http.Header { +func (c *ProjectsExclusionsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSinksUpdateCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -26799,34 +30475,29 @@ func (c *OrganizationsSinksUpdateCall) doRequest(alt string) (*http.Response, er } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "sinkName": c.sinkNameid, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.sinks.update" call. -// Exactly one of *LogSink or error will be non-nil. Any non-2xx status +// Do executes the "logging.projects.exclusions.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *LogSink.ServerResponse.Header or (if a response was returned at all) +// *Empty.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 *OrganizationsSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { +func (c *ProjectsExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -26845,7 +30516,7 @@ func (c *OrganizationsSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSin if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogSink{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -26857,39 +30528,25 @@ func (c *OrganizationsSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSin } return ret, nil // { - // "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field.", - // "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}", - // "httpMethod": "PUT", - // "id": "logging.organizations.sinks.update", + // "description": "Deletes an exclusion in the _Default sink.", + // "flatPath": "v2/projects/{projectsId}/exclusions/{exclusionsId}", + // "httpMethod": "DELETE", + // "id": "logging.projects.exclusions.delete", // "parameterOrder": [ - // "sinkName" + // "name" // ], // "parameters": { - // "sinkName": { - // "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", + // "name": { + // "description": "Required. The resource name of an existing exclusion to delete: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", // "location": "path", - // "pattern": "^organizations/[^/]+/sinks/[^/]+$", + // "pattern": "^projects/[^/]+/exclusions/[^/]+$", // "required": true, // "type": "string" - // }, - // "uniqueWriterIdentity": { - // "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a unique service account. It is an error if the old value is true and the new value is set to false or defaulted to false.", - // "location": "query", - // "type": "boolean" - // }, - // "updateMask": { - // "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes:destination,filter,includeChildrenAt some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+sinkName}", - // "request": { - // "$ref": "LogSink" - // }, + // "path": "v2/{+name}", // "response": { - // "$ref": "LogSink" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -26899,9 +30556,9 @@ func (c *OrganizationsSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSin } -// method id "logging.projects.getCmekSettings": +// method id "logging.projects.exclusions.get": -type ProjectsGetCmekSettingsCall struct { +type ProjectsExclusionsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -26910,27 +30567,16 @@ type ProjectsGetCmekSettingsCall struct { header_ http.Header } -// GetCmekSettings: Gets the Logging CMEK settings for the given -// resource.Note: CMEK for the Log Router can be configured for Google -// Cloud projects, folders, organizations and billing accounts. Once -// configured for an organization, it applies to all projects and -// folders in the Google Cloud organization.See Enabling CMEK for Log -// Router -// (https://cloud.google.com/logging/docs/routing/managed-encryption) -// for more information. +// Get: Gets the description of an exclusion in the _Default sink. // -// - name: The resource for which to retrieve CMEK settings. -// "projects/[PROJECT_ID]/cmekSettings" -// "organizations/[ORGANIZATION_ID]/cmekSettings" -// "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" -// "folders/[FOLDER_ID]/cmekSettings" For -// example:"organizations/12345/cmekSettings"Note: CMEK for the Log -// Router can be configured for Google Cloud projects, folders, -// organizations and billing accounts. Once configured for an -// organization, it applies to all projects and folders in the Google -// Cloud organization. -func (r *ProjectsService) GetCmekSettings(name string) *ProjectsGetCmekSettingsCall { - c := &ProjectsGetCmekSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of an existing exclusion: +// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" +// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" +// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For +// example:"projects/my-project/exclusions/my-exclusion". +func (r *ProjectsExclusionsService) Get(name string) *ProjectsExclusionsGetCall { + c := &ProjectsExclusionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -26938,7 +30584,7 @@ func (r *ProjectsService) GetCmekSettings(name string) *ProjectsGetCmekSettingsC // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsGetCmekSettingsCall) Fields(s ...googleapi.Field) *ProjectsGetCmekSettingsCall { +func (c *ProjectsExclusionsGetCall) Fields(s ...googleapi.Field) *ProjectsExclusionsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -26948,7 +30594,7 @@ func (c *ProjectsGetCmekSettingsCall) Fields(s ...googleapi.Field) *ProjectsGetC // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsGetCmekSettingsCall) IfNoneMatch(entityTag string) *ProjectsGetCmekSettingsCall { +func (c *ProjectsExclusionsGetCall) IfNoneMatch(entityTag string) *ProjectsExclusionsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -26956,21 +30602,21 @@ func (c *ProjectsGetCmekSettingsCall) IfNoneMatch(entityTag string) *ProjectsGet // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsGetCmekSettingsCall) Context(ctx context.Context) *ProjectsGetCmekSettingsCall { +func (c *ProjectsExclusionsGetCall) Context(ctx context.Context) *ProjectsExclusionsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsGetCmekSettingsCall) Header() http.Header { +func (c *ProjectsExclusionsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsGetCmekSettingsCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsExclusionsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -26983,7 +30629,7 @@ func (c *ProjectsGetCmekSettingsCall) doRequest(alt string) (*http.Response, err var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/cmekSettings") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -26996,14 +30642,14 @@ func (c *ProjectsGetCmekSettingsCall) doRequest(alt string) (*http.Response, err return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.getCmekSettings" call. -// Exactly one of *CmekSettings or error will be non-nil. Any non-2xx +// Do executes the "logging.projects.exclusions.get" call. +// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either -// *CmekSettings.ServerResponse.Header or (if a response was returned at +// *LogExclusion.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 *ProjectsGetCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSettings, error) { +func (c *ProjectsExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -27022,7 +30668,7 @@ func (c *ProjectsGetCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSet if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &CmekSettings{ + ret := &LogExclusion{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -27034,25 +30680,25 @@ func (c *ProjectsGetCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSet } return ret, nil // { - // "description": "Gets the Logging CMEK settings for the given resource.Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", - // "flatPath": "v2/projects/{projectsId}/cmekSettings", + // "description": "Gets the description of an exclusion in the _Default sink.", + // "flatPath": "v2/projects/{projectsId}/exclusions/{exclusionsId}", // "httpMethod": "GET", - // "id": "logging.projects.getCmekSettings", + // "id": "logging.projects.exclusions.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource for which to retrieve CMEK settings. \"projects/[PROJECT_ID]/cmekSettings\" \"organizations/[ORGANIZATION_ID]/cmekSettings\" \"billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings\" \"folders/[FOLDER_ID]/cmekSettings\" For example:\"organizations/12345/cmekSettings\"Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.", + // "description": "Required. The resource name of an existing exclusion: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", // "location": "path", - // "pattern": "^projects/[^/]+$", + // "pattern": "^projects/[^/]+/exclusions/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}/cmekSettings", + // "path": "v2/{+name}", // "response": { - // "$ref": "CmekSettings" + // "$ref": "LogExclusion" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -27064,47 +30710,52 @@ func (c *ProjectsGetCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSet } -// method id "logging.projects.getSettings": +// method id "logging.projects.exclusions.list": -type ProjectsGetSettingsCall struct { +type ProjectsExclusionsListCall struct { s *Service - name string + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// GetSettings: Gets the Log Router settings for the given -// resource.Note: Settings for the Log Router can be get for Google -// Cloud projects, folders, organizations and billing accounts. -// Currently it can only be configured for organizations. Once -// configured for an organization, it applies to all projects and -// folders in the Google Cloud organization.See Enabling CMEK for Log -// Router -// (https://cloud.google.com/logging/docs/routing/managed-encryption) -// for more information. +// List: Lists all the exclusions on the _Default sink in a parent +// resource. // -// - name: The resource for which to retrieve settings. -// "projects/[PROJECT_ID]/settings" -// "organizations/[ORGANIZATION_ID]/settings" -// "billingAccounts/[BILLING_ACCOUNT_ID]/settings" -// "folders/[FOLDER_ID]/settings" For -// example:"organizations/12345/settings"Note: Settings for the Log -// Router can be get for Google Cloud projects, folders, organizations -// and billing accounts. Currently it can only be configured for -// organizations. Once configured for an organization, it applies to -// all projects and folders in the Google Cloud organization. -func (r *ProjectsService) GetSettings(name string) *ProjectsGetSettingsCall { - c := &ProjectsGetSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: The parent resource whose exclusions are to be listed. +// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]". +func (r *ProjectsExclusionsService) List(parent string) *ProjectsExclusionsListCall { + c := &ProjectsExclusionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request. Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *ProjectsExclusionsListCall) PageSize(pageSize int64) *ProjectsExclusionsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *ProjectsExclusionsListCall) PageToken(pageToken string) *ProjectsExclusionsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsGetSettingsCall) Fields(s ...googleapi.Field) *ProjectsGetSettingsCall { +func (c *ProjectsExclusionsListCall) Fields(s ...googleapi.Field) *ProjectsExclusionsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -27114,7 +30765,7 @@ func (c *ProjectsGetSettingsCall) Fields(s ...googleapi.Field) *ProjectsGetSetti // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsGetSettingsCall) IfNoneMatch(entityTag string) *ProjectsGetSettingsCall { +func (c *ProjectsExclusionsListCall) IfNoneMatch(entityTag string) *ProjectsExclusionsListCall { c.ifNoneMatch_ = entityTag return c } @@ -27122,21 +30773,21 @@ func (c *ProjectsGetSettingsCall) IfNoneMatch(entityTag string) *ProjectsGetSett // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsGetSettingsCall) Context(ctx context.Context) *ProjectsGetSettingsCall { +func (c *ProjectsExclusionsListCall) Context(ctx context.Context) *ProjectsExclusionsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsGetSettingsCall) Header() http.Header { +func (c *ProjectsExclusionsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsGetSettingsCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsExclusionsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -27149,7 +30800,7 @@ func (c *ProjectsGetSettingsCall) doRequest(alt string) (*http.Response, error) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/settings") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -27157,19 +30808,19 @@ func (c *ProjectsGetSettingsCall) doRequest(alt string) (*http.Response, error) } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.getSettings" call. -// Exactly one of *Settings or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Settings.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 *ProjectsGetSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, error) { +// Do executes the "logging.projects.exclusions.list" call. +// Exactly one of *ListExclusionsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListExclusionsResponse.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 *ProjectsExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -27188,7 +30839,7 @@ func (c *ProjectsGetSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, e if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Settings{ + ret := &ListExclusionsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -27200,25 +30851,36 @@ func (c *ProjectsGetSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, e } return ret, nil // { - // "description": "Gets the Log Router settings for the given resource.Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", - // "flatPath": "v2/projects/{projectsId}/settings", + // "description": "Lists all the exclusions on the _Default sink in a parent resource.", + // "flatPath": "v2/projects/{projectsId}/exclusions", // "httpMethod": "GET", - // "id": "logging.projects.getSettings", + // "id": "logging.projects.exclusions.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The resource for which to retrieve settings. \"projects/[PROJECT_ID]/settings\" \"organizations/[ORGANIZATION_ID]/settings\" \"billingAccounts/[BILLING_ACCOUNT_ID]/settings\" \"folders/[FOLDER_ID]/settings\" For example:\"organizations/12345/settings\"Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.", + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent resource whose exclusions are to be listed. \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ", // "location": "path", // "pattern": "^projects/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}/settings", + // "path": "v2/{+parent}/exclusions", // "response": { - // "$ref": "Settings" + // "$ref": "ListExclusionsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -27230,36 +30892,70 @@ func (c *ProjectsGetSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, e } -// method id "logging.projects.exclusions.create": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsExclusionsListCall) Pages(ctx context.Context, f func(*ListExclusionsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type ProjectsExclusionsCreateCall struct { +// method id "logging.projects.exclusions.patch": + +type ProjectsExclusionsPatchCall struct { s *Service - parent string + name string logexclusion *LogExclusion urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Create: Creates a new exclusion in the _Default sink in a specified -// parent resource. Only log entries belonging to that resource can be -// excluded. You can have up to 10 exclusions in a resource. +// Patch: Changes one or more properties of an existing exclusion in the +// _Default sink. // -// - parent: The parent resource in which to create the exclusion: -// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For -// examples:"projects/my-logging-project" "organizations/123456789". -func (r *ProjectsExclusionsService) Create(parent string, logexclusion *LogExclusion) *ProjectsExclusionsCreateCall { - c := &ProjectsExclusionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent +// - name: The resource name of the exclusion to update: +// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" +// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" +// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For +// example:"projects/my-project/exclusions/my-exclusion". +func (r *ProjectsExclusionsService) Patch(name string, logexclusion *LogExclusion) *ProjectsExclusionsPatchCall { + c := &ProjectsExclusionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name c.logexclusion = logexclusion return c } +// UpdateMask sets the optional parameter "updateMask": Required. A +// non-empty list of fields to change in the existing exclusion. New +// values for the fields are taken from the corresponding fields in the +// LogExclusion included in this request. Fields not mentioned in +// update_mask are not changed and are ignored in the request.For +// example, to change the filter and description of an exclusion, +// specify an update_mask of "filter,description". +func (c *ProjectsExclusionsPatchCall) UpdateMask(updateMask string) *ProjectsExclusionsPatchCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsExclusionsCreateCall) Fields(s ...googleapi.Field) *ProjectsExclusionsCreateCall { +func (c *ProjectsExclusionsPatchCall) Fields(s ...googleapi.Field) *ProjectsExclusionsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -27267,21 +30963,21 @@ func (c *ProjectsExclusionsCreateCall) Fields(s ...googleapi.Field) *ProjectsExc // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsExclusionsCreateCall) Context(ctx context.Context) *ProjectsExclusionsCreateCall { +func (c *ProjectsExclusionsPatchCall) Context(ctx context.Context) *ProjectsExclusionsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsExclusionsCreateCall) Header() http.Header { +func (c *ProjectsExclusionsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsExclusionsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsExclusionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -27296,27 +30992,27 @@ func (c *ProjectsExclusionsCreateCall) doRequest(alt string) (*http.Response, er reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.exclusions.create" call. +// Do executes the "logging.projects.exclusions.patch" call. // Exactly one of *LogExclusion or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *LogExclusion.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 *ProjectsExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { +func (c *ProjectsExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -27347,23 +31043,29 @@ func (c *ProjectsExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExc } return ret, nil // { - // "description": "Creates a new exclusion in the _Default sink in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.", - // "flatPath": "v2/projects/{projectsId}/exclusions", - // "httpMethod": "POST", - // "id": "logging.projects.exclusions.create", + // "description": "Changes one or more properties of an existing exclusion in the _Default sink.", + // "flatPath": "v2/projects/{projectsId}/exclusions/{exclusionsId}", + // "httpMethod": "PATCH", + // "id": "logging.projects.exclusions.patch", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. The parent resource in which to create the exclusion: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-logging-project\" \"organizations/123456789\"", + // "name": { + // "description": "Required. The resource name of the exclusion to update: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", // "location": "path", - // "pattern": "^projects/[^/]+$", + // "pattern": "^projects/[^/]+/exclusions/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "Required. A non-empty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of \"filter,description\".", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+parent}/exclusions", + // "path": "v2/{+name}", // "request": { // "$ref": "LogExclusion" // }, @@ -27378,26 +31080,22 @@ func (c *ProjectsExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExc } -// method id "logging.projects.exclusions.delete": +// method id "logging.projects.locations.get": -type ProjectsExclusionsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes an exclusion in the _Default sink. -// -// - name: The resource name of an existing exclusion to delete: -// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" -// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" -// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For -// example:"projects/my-project/exclusions/my-exclusion". -func (r *ProjectsExclusionsService) Delete(name string) *ProjectsExclusionsDeleteCall { - c := &ProjectsExclusionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// Get: Gets information about a location. +// +// - name: Resource name for the location. +func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall { + c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -27405,41 +31103,54 @@ func (r *ProjectsExclusionsService) Delete(name string) *ProjectsExclusionsDelet // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsExclusionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsExclusionsDeleteCall { +func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsExclusionsDeleteCall) Context(ctx context.Context) *ProjectsExclusionsDeleteCall { +func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsExclusionsDeleteCall) Header() http.Header { +func (c *ProjectsLocationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + 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, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -27450,14 +31161,14 @@ func (c *ProjectsExclusionsDeleteCall) doRequest(alt string) (*http.Response, er return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.exclusions.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// Do executes the "logging.projects.locations.get" call. +// Exactly one of *Location or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *Empty.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 *ProjectsExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// *Location.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 *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -27476,7 +31187,7 @@ func (c *ProjectsExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &Location{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -27488,37 +31199,39 @@ func (c *ProjectsExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, } return ret, nil // { - // "description": "Deletes an exclusion in the _Default sink.", - // "flatPath": "v2/projects/{projectsId}/exclusions/{exclusionsId}", - // "httpMethod": "DELETE", - // "id": "logging.projects.exclusions.delete", + // "description": "Gets information about a location.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}", + // "httpMethod": "GET", + // "id": "logging.projects.locations.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource name of an existing exclusion to delete: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", + // "description": "Resource name for the location.", // "location": "path", - // "pattern": "^projects/[^/]+/exclusions/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v2/{+name}", // "response": { - // "$ref": "Empty" + // "$ref": "Location" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.projects.exclusions.get": +// method id "logging.projects.locations.list": -type ProjectsExclusionsGetCall struct { +type ProjectsLocationsListCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -27527,24 +31240,45 @@ type ProjectsExclusionsGetCall struct { header_ http.Header } -// Get: Gets the description of an exclusion in the _Default sink. +// List: Lists information about the supported locations for this +// service. // -// - name: The resource name of an existing exclusion: -// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" -// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" -// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For -// example:"projects/my-project/exclusions/my-exclusion". -func (r *ProjectsExclusionsService) Get(name string) *ProjectsExclusionsGetCall { - c := &ProjectsExclusionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource that owns the locations collection, if +// applicable. +func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall { + c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } +// Filter sets the optional parameter "filter": A filter to narrow down +// results to a preferred subset. The filtering language accepts strings +// like "displayName=tokyo", and is documented in more detail in AIP-160 +// (https://google.aip.dev/160). +func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return. If not set, the service selects a default. +func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token +// received from the next_page_token field in the response. Send that +// page token to receive the subsequent page. +func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsExclusionsGetCall) Fields(s ...googleapi.Field) *ProjectsExclusionsGetCall { +func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -27554,7 +31288,7 @@ func (c *ProjectsExclusionsGetCall) Fields(s ...googleapi.Field) *ProjectsExclus // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsExclusionsGetCall) IfNoneMatch(entityTag string) *ProjectsExclusionsGetCall { +func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall { c.ifNoneMatch_ = entityTag return c } @@ -27562,21 +31296,21 @@ func (c *ProjectsExclusionsGetCall) IfNoneMatch(entityTag string) *ProjectsExclu // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsExclusionsGetCall) Context(ctx context.Context) *ProjectsExclusionsGetCall { +func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsExclusionsGetCall) Header() http.Header { +func (c *ProjectsLocationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsExclusionsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -27589,7 +31323,7 @@ func (c *ProjectsExclusionsGetCall) doRequest(alt string) (*http.Response, error var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -27602,14 +31336,14 @@ func (c *ProjectsExclusionsGetCall) doRequest(alt string) (*http.Response, error return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.exclusions.get" call. -// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *LogExclusion.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 *ProjectsExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { +// Do executes the "logging.projects.locations.list" call. +// Exactly one of *ListLocationsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListLocationsResponse.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 *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -27628,7 +31362,7 @@ func (c *ProjectsExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclus if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogExclusion{ + ret := &ListLocationsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -27640,25 +31374,41 @@ func (c *ProjectsExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclus } return ret, nil // { - // "description": "Gets the description of an exclusion in the _Default sink.", - // "flatPath": "v2/projects/{projectsId}/exclusions/{exclusionsId}", + // "description": "Lists information about the supported locations for this service.", + // "flatPath": "v2/projects/{projectsId}/locations", // "httpMethod": "GET", - // "id": "logging.projects.exclusions.get", + // "id": "logging.projects.locations.list", // "parameterOrder": [ // "name" // ], // "parameters": { + // "filter": { + // "description": "A filter to narrow down results to a preferred subset. The filtering language accepts strings like \"displayName=tokyo\", and is documented in more detail in AIP-160 (https://google.aip.dev/160).", + // "location": "query", + // "type": "string" + // }, // "name": { - // "description": "Required. The resource name of an existing exclusion: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", + // "description": "The resource that owns the locations collection, if applicable.", // "location": "path", - // "pattern": "^projects/[^/]+/exclusions/[^/]+$", + // "pattern": "^projects/[^/]+$", // "required": true, // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of results to return. If not set, the service selects a default.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token received from the next_page_token field in the response. Send that page token to receive the subsequent page.", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+name}/locations", // "response": { - // "$ref": "LogExclusion" + // "$ref": "ListLocationsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -27670,99 +31420,104 @@ func (c *ProjectsExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclus } -// method id "logging.projects.exclusions.list": - -type ProjectsExclusionsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } } -// List: Lists all the exclusions on the _Default sink in a parent -// resource. -// -// - parent: The parent resource whose exclusions are to be listed. -// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]". -func (r *ProjectsExclusionsService) List(parent string) *ProjectsExclusionsListCall { - c := &ProjectsExclusionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} +// method id "logging.projects.locations.buckets.create": -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return from this request. Non-positive values are -// ignored. The presence of nextPageToken in the response indicates that -// more results might be available. -func (c *ProjectsExclusionsListCall) PageSize(pageSize int64) *ProjectsExclusionsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c +type ProjectsLocationsBucketsCreateCall struct { + s *Service + parent string + logbucket *LogBucket + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// PageToken sets the optional parameter "pageToken": If present, then -// retrieve the next batch of results from the preceding call to this -// method. pageToken must be the value of nextPageToken from the -// previous response. The values of other method parameters should be -// identical to those in the previous call. -func (c *ProjectsExclusionsListCall) PageToken(pageToken string) *ProjectsExclusionsListCall { - c.urlParams_.Set("pageToken", pageToken) +// Create: Creates a log bucket that can be used to store log entries. +// After a bucket has been created, the bucket's location cannot be +// changed. +// +// - parent: The resource in which to create the log bucket: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For +// example:"projects/my-project/locations/global". +func (r *ProjectsLocationsBucketsService) Create(parent string, logbucket *LogBucket) *ProjectsLocationsBucketsCreateCall { + c := &ProjectsLocationsBucketsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.logbucket = logbucket return c } -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsExclusionsListCall) Fields(s ...googleapi.Field) *ProjectsExclusionsListCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) +// BucketId sets the optional parameter "bucketId": Required. A +// client-assigned identifier such as "my-bucket". Identifiers are +// limited to 100 characters and can include only letters, digits, +// underscores, hyphens, and periods. +func (c *ProjectsLocationsBucketsCreateCall) BucketId(bucketId string) *ProjectsLocationsBucketsCreateCall { + c.urlParams_.Set("bucketId", bucketId) return c -} - -// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsExclusionsListCall) IfNoneMatch(entityTag string) *ProjectsExclusionsListCall { - c.ifNoneMatch_ = entityTag +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsBucketsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsExclusionsListCall) Context(ctx context.Context) *ProjectsExclusionsListCall { +func (c *ProjectsLocationsBucketsCreateCall) Context(ctx context.Context) *ProjectsLocationsBucketsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsExclusionsListCall) Header() http.Header { +func (c *ProjectsLocationsBucketsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsExclusionsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -27773,14 +31528,14 @@ func (c *ProjectsExclusionsListCall) doRequest(alt string) (*http.Response, erro return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.exclusions.list" call. -// Exactly one of *ListExclusionsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListExclusionsResponse.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 *ProjectsExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsResponse, error) { +// Do executes the "logging.projects.locations.buckets.create" call. +// Exactly one of *LogBucket or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LogBucket.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 *ProjectsLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -27799,7 +31554,7 @@ func (c *ProjectsExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExcl if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListExclusionsResponse{ + ret := &LogBucket{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -27811,111 +31566,80 @@ func (c *ProjectsExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExcl } return ret, nil // { - // "description": "Lists all the exclusions on the _Default sink in a parent resource.", - // "flatPath": "v2/projects/{projectsId}/exclusions", - // "httpMethod": "GET", - // "id": "logging.projects.exclusions.list", + // "description": "Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets", + // "httpMethod": "POST", + // "id": "logging.projects.locations.buckets.create", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "pageSize": { - // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "bucketId": { + // "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. The parent resource whose exclusions are to be listed. \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ", + // "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"", // "location": "path", - // "pattern": "^projects/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/exclusions", + // "path": "v2/{+parent}/buckets", + // "request": { + // "$ref": "LogBucket" + // }, // "response": { - // "$ref": "ListExclusionsResponse" + // "$ref": "LogBucket" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ProjectsExclusionsListCall) Pages(ctx context.Context, f func(*ListExclusionsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "logging.projects.exclusions.patch": +// method id "logging.projects.locations.buckets.createAsync": -type ProjectsExclusionsPatchCall struct { - s *Service - name string - logexclusion *LogExclusion - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsBucketsCreateAsyncCall struct { + s *Service + parent string + logbucket *LogBucket + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Changes one or more properties of an existing exclusion in the -// _Default sink. +// CreateAsync: Creates a log bucket asynchronously that can be used to +// store log entries.After a bucket has been created, the bucket's +// location cannot be changed. // -// - name: The resource name of the exclusion to update: -// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" -// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" -// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For -// example:"projects/my-project/exclusions/my-exclusion". -func (r *ProjectsExclusionsService) Patch(name string, logexclusion *LogExclusion) *ProjectsExclusionsPatchCall { - c := &ProjectsExclusionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.logexclusion = logexclusion +// - parent: The resource in which to create the log bucket: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For +// example:"projects/my-project/locations/global". +func (r *ProjectsLocationsBucketsService) CreateAsync(parent string, logbucket *LogBucket) *ProjectsLocationsBucketsCreateAsyncCall { + c := &ProjectsLocationsBucketsCreateAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.logbucket = logbucket return c } -// UpdateMask sets the optional parameter "updateMask": Required. A -// non-empty list of fields to change in the existing exclusion. New -// values for the fields are taken from the corresponding fields in the -// LogExclusion included in this request. Fields not mentioned in -// update_mask are not changed and are ignored in the request.For -// example, to change the filter and description of an exclusion, -// specify an update_mask of "filter,description". -func (c *ProjectsExclusionsPatchCall) UpdateMask(updateMask string) *ProjectsExclusionsPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// BucketId sets the optional parameter "bucketId": Required. A +// client-assigned identifier such as "my-bucket". Identifiers are +// limited to 100 characters and can include only letters, digits, +// underscores, hyphens, and periods. +func (c *ProjectsLocationsBucketsCreateAsyncCall) BucketId(bucketId string) *ProjectsLocationsBucketsCreateAsyncCall { + c.urlParams_.Set("bucketId", bucketId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsExclusionsPatchCall) Fields(s ...googleapi.Field) *ProjectsExclusionsPatchCall { +func (c *ProjectsLocationsBucketsCreateAsyncCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsCreateAsyncCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -27923,21 +31647,21 @@ func (c *ProjectsExclusionsPatchCall) Fields(s ...googleapi.Field) *ProjectsExcl // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsExclusionsPatchCall) Context(ctx context.Context) *ProjectsExclusionsPatchCall { +func (c *ProjectsLocationsBucketsCreateAsyncCall) Context(ctx context.Context) *ProjectsLocationsBucketsCreateAsyncCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsExclusionsPatchCall) Header() http.Header { +func (c *ProjectsLocationsBucketsCreateAsyncCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsExclusionsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsBucketsCreateAsyncCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -27945,34 +31669,34 @@ func (c *ProjectsExclusionsPatchCall) doRequest(alt string) (*http.Response, err } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets:createAsync") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.exclusions.patch" call. -// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx +// Do executes the "logging.projects.locations.buckets.createAsync" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either -// *LogExclusion.ServerResponse.Header or (if a response was returned at +// *Operation.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 *ProjectsExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { +func (c *ProjectsLocationsBucketsCreateAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -27991,7 +31715,7 @@ func (c *ProjectsExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExcl if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogExclusion{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -28003,34 +31727,33 @@ func (c *ProjectsExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExcl } return ret, nil // { - // "description": "Changes one or more properties of an existing exclusion in the _Default sink.", - // "flatPath": "v2/projects/{projectsId}/exclusions/{exclusionsId}", - // "httpMethod": "PATCH", - // "id": "logging.projects.exclusions.patch", + // "description": "Creates a log bucket asynchronously that can be used to store log entries.After a bucket has been created, the bucket's location cannot be changed.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets:createAsync", + // "httpMethod": "POST", + // "id": "logging.projects.locations.buckets.createAsync", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The resource name of the exclusion to update: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", - // "location": "path", - // "pattern": "^projects/[^/]+/exclusions/[^/]+$", - // "required": true, + // "bucketId": { + // "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", + // "location": "query", // "type": "string" // }, - // "updateMask": { - // "description": "Required. A non-empty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of \"filter,description\".", - // "format": "google-fieldmask", - // "location": "query", + // "parent": { + // "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+parent}/buckets:createAsync", // "request": { - // "$ref": "LogExclusion" + // "$ref": "LogBucket" // }, // "response": { - // "$ref": "LogExclusion" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -28040,77 +31763,73 @@ func (c *ProjectsExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExcl } -// method id "logging.projects.locations.get": +// method id "logging.projects.locations.buckets.delete": -type ProjectsLocationsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsBucketsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets information about a location. +// Delete: Deletes a log bucket.Changes the bucket's lifecycle_state to +// the DELETE_REQUESTED state. After 7 days, the bucket will be purged +// and all log entries in the bucket will be permanently deleted. // -// - name: Resource name for the location. -func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall { - c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The full resource name of the bucket to delete. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *ProjectsLocationsBucketsService) Delete(name string) *ProjectsLocationsBucketsDeleteCall { + c := &ProjectsLocationsBucketsDeleteCall{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 information. -func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall { - c.ifNoneMatch_ = entityTag +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall { +func (c *ProjectsLocationsBucketsDeleteCall) Context(ctx context.Context) *ProjectsLocationsBucketsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsGetCall) Header() http.Header { +func (c *ProjectsLocationsBucketsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - 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, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -28121,14 +31840,14 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.locations.get" call. -// Exactly one of *Location or error will be non-nil. Any non-2xx status +// Do executes the "logging.projects.locations.buckets.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *Location.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 *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) { +// *Empty.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 *ProjectsLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -28147,7 +31866,7 @@ func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Location{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -28159,39 +31878,37 @@ func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, } return ret, nil // { - // "description": "Gets information about a location.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}", - // "httpMethod": "GET", - // "id": "logging.projects.locations.get", + // "description": "Deletes a log bucket.Changes the bucket's lifecycle_state to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}", + // "httpMethod": "DELETE", + // "id": "logging.projects.locations.buckets.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Resource name for the location.", + // "description": "Required. The full resource name of the bucket to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v2/{+name}", // "response": { - // "$ref": "Location" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// method id "logging.projects.locations.list": +// method id "logging.projects.locations.buckets.get": -type ProjectsLocationsListCall struct { +type ProjectsLocationsBucketsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -28200,45 +31917,27 @@ type ProjectsLocationsListCall struct { header_ http.Header } -// List: Lists information about the supported locations for this -// service. +// Get: Gets a log bucket. // -// - name: The resource that owns the locations collection, if -// applicable. -func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall { - c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of the bucket: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *ProjectsLocationsBucketsService) Get(name string) *ProjectsLocationsBucketsGetCall { + c := &ProjectsLocationsBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } -// Filter sets the optional parameter "filter": A filter to narrow down -// results to a preferred subset. The filtering language accepts strings -// like "displayName=tokyo", and is documented in more detail in AIP-160 -// (https://google.aip.dev/160). -func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return. If not set, the service selects a default. -func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": A page token -// received from the next_page_token field in the response. Send that -// page token to receive the subsequent page. -func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall { +func (c *ProjectsLocationsBucketsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -28248,7 +31947,7 @@ func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocati // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall { +func (c *ProjectsLocationsBucketsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsBucketsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -28256,21 +31955,21 @@ func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocat // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall { +func (c *ProjectsLocationsBucketsGetCall) Context(ctx context.Context) *ProjectsLocationsBucketsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsListCall) Header() http.Header { +func (c *ProjectsLocationsBucketsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsBucketsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -28283,7 +31982,7 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -28296,14 +31995,14 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.locations.list" call. -// Exactly one of *ListLocationsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListLocationsResponse.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 *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) { +// Do executes the "logging.projects.locations.buckets.get" call. +// Exactly one of *LogBucket or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LogBucket.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 *ProjectsLocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -28322,7 +32021,7 @@ func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocat if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListLocationsResponse{ + ret := &LogBucket{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -28334,41 +32033,25 @@ func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocat } return ret, nil // { - // "description": "Lists information about the supported locations for this service.", - // "flatPath": "v2/projects/{projectsId}/locations", + // "description": "Gets a log bucket.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}", // "httpMethod": "GET", - // "id": "logging.projects.locations.list", + // "id": "logging.projects.locations.buckets.get", // "parameterOrder": [ // "name" // ], // "parameters": { - // "filter": { - // "description": "A filter to narrow down results to a preferred subset. The filtering language accepts strings like \"displayName=tokyo\", and is documented in more detail in AIP-160 (https://google.aip.dev/160).", - // "location": "query", - // "type": "string" - // }, // "name": { - // "description": "The resource that owns the locations collection, if applicable.", + // "description": "Required. The resource name of the bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", - // "pattern": "^projects/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" - // }, - // "pageSize": { - // "description": "The maximum number of results to return. If not set, the service selects a default.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "A page token received from the next_page_token field in the response. Send that page token to receive the subsequent page.", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+name}/locations", + // "path": "v2/{+name}", // "response": { - // "$ref": "ListLocationsResponse" + // "$ref": "LogBucket" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -28380,104 +32063,102 @@ func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocat } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "logging.projects.locations.buckets.create": +// method id "logging.projects.locations.buckets.list": -type ProjectsLocationsBucketsCreateCall struct { - s *Service - parent string - logbucket *LogBucket - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsBucketsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Create: Creates a log bucket that can be used to store log entries. -// After a bucket has been created, the bucket's location cannot be -// changed. +// List: Lists log buckets. // -// - parent: The resource in which to create the log bucket: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For -// example:"projects/my-project/locations/global". -func (r *ProjectsLocationsBucketsService) Create(parent string, logbucket *LogBucket) *ProjectsLocationsBucketsCreateCall { - c := &ProjectsLocationsBucketsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The parent resource whose buckets are to be listed: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" Note: The locations +// portion of the resource must be specified, but supplying the +// character - in place of LOCATION_ID will return all buckets. +func (r *ProjectsLocationsBucketsService) List(parent string) *ProjectsLocationsBucketsListCall { + c := &ProjectsLocationsBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.logbucket = logbucket return c } -// BucketId sets the optional parameter "bucketId": Required. A -// client-assigned identifier such as "my-bucket". Identifiers are -// limited to 100 characters and can include only letters, digits, -// underscores, hyphens, and periods. -func (c *ProjectsLocationsBucketsCreateCall) BucketId(bucketId string) *ProjectsLocationsBucketsCreateCall { - c.urlParams_.Set("bucketId", bucketId) +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request. Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *ProjectsLocationsBucketsListCall) PageSize(pageSize int64) *ProjectsLocationsBucketsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *ProjectsLocationsBucketsListCall) PageToken(pageToken string) *ProjectsLocationsBucketsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsBucketsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsCreateCall { +func (c *ProjectsLocationsBucketsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsBucketsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsBucketsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsBucketsCreateCall) Context(ctx context.Context) *ProjectsLocationsBucketsCreateCall { +func (c *ProjectsLocationsBucketsListCall) Context(ctx context.Context) *ProjectsLocationsBucketsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsBucketsCreateCall) Header() http.Header { +func (c *ProjectsLocationsBucketsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsBucketsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -28488,14 +32169,14 @@ func (c *ProjectsLocationsBucketsCreateCall) doRequest(alt string) (*http.Respon return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.locations.buckets.create" call. -// Exactly one of *LogBucket or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *LogBucket.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 *ProjectsLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { +// Do executes the "logging.projects.locations.buckets.list" call. +// Exactly one of *ListBucketsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListBucketsResponse.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 *ProjectsLocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucketsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -28514,7 +32195,7 @@ func (c *ProjectsLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogBucket{ + ret := &ListBucketsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -28526,21 +32207,27 @@ func (c *ProjectsLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (* } return ret, nil // { - // "description": "Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed.", + // "description": "Lists log buckets.", // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets", - // "httpMethod": "POST", - // "id": "logging.projects.locations.buckets.create", + // "httpMethod": "GET", + // "id": "logging.projects.locations.buckets.list", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "bucketId": { - // "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"", + // "description": "Required. The parent resource whose buckets are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+$", // "required": true, @@ -28548,58 +32235,87 @@ func (c *ProjectsLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (* // } // }, // "path": "v2/{+parent}/buckets", - // "request": { - // "$ref": "LogBucket" - // }, // "response": { - // "$ref": "LogBucket" + // "$ref": "ListBucketsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.projects.locations.buckets.createAsync": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsBucketsListCall) Pages(ctx context.Context, f func(*ListBucketsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type ProjectsLocationsBucketsCreateAsyncCall struct { +// method id "logging.projects.locations.buckets.patch": + +type ProjectsLocationsBucketsPatchCall struct { s *Service - parent string + name string logbucket *LogBucket urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// CreateAsync: Creates a log bucket asynchronously that can be used to -// store log entries.After a bucket has been created, the bucket's -// location cannot be changed. +// Patch: Updates a log bucket.If the bucket has a lifecycle_state of +// DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a +// bucket has been created, the bucket's location cannot be changed. // -// - parent: The resource in which to create the log bucket: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For -// example:"projects/my-project/locations/global". -func (r *ProjectsLocationsBucketsService) CreateAsync(parent string, logbucket *LogBucket) *ProjectsLocationsBucketsCreateAsyncCall { - c := &ProjectsLocationsBucketsCreateAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent +// - name: The full resource name of the bucket to update. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *ProjectsLocationsBucketsService) Patch(name string, logbucket *LogBucket) *ProjectsLocationsBucketsPatchCall { + c := &ProjectsLocationsBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name c.logbucket = logbucket return c } -// BucketId sets the optional parameter "bucketId": Required. A -// client-assigned identifier such as "my-bucket". Identifiers are -// limited to 100 characters and can include only letters, digits, -// underscores, hyphens, and periods. -func (c *ProjectsLocationsBucketsCreateAsyncCall) BucketId(bucketId string) *ProjectsLocationsBucketsCreateAsyncCall { - c.urlParams_.Set("bucketId", bucketId) +// UpdateMask sets the optional parameter "updateMask": Required. Field +// mask that specifies the fields in bucket that need an update. A +// bucket field will be overwritten if, and only if, it is in the update +// mask. name and output only fields cannot be updated.For a detailed +// FieldMask definition, see: +// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor +// example: updateMask=retention_days +func (c *ProjectsLocationsBucketsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsBucketsPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsBucketsCreateAsyncCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsCreateAsyncCall { +func (c *ProjectsLocationsBucketsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -28607,21 +32323,21 @@ func (c *ProjectsLocationsBucketsCreateAsyncCall) Fields(s ...googleapi.Field) * // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsBucketsCreateAsyncCall) Context(ctx context.Context) *ProjectsLocationsBucketsCreateAsyncCall { +func (c *ProjectsLocationsBucketsPatchCall) Context(ctx context.Context) *ProjectsLocationsBucketsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsBucketsCreateAsyncCall) Header() http.Header { +func (c *ProjectsLocationsBucketsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsBucketsCreateAsyncCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -28636,27 +32352,27 @@ func (c *ProjectsLocationsBucketsCreateAsyncCall) doRequest(alt string) (*http.R reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets:createAsync") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.locations.buckets.createAsync" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx +// Do executes the "logging.projects.locations.buckets.patch" call. +// Exactly one of *LogBucket or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at +// *LogBucket.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 *ProjectsLocationsBucketsCreateAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *ProjectsLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -28675,7 +32391,7 @@ func (c *ProjectsLocationsBucketsCreateAsyncCall) Do(opts ...googleapi.CallOptio if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &LogBucket{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -28687,33 +32403,34 @@ func (c *ProjectsLocationsBucketsCreateAsyncCall) Do(opts ...googleapi.CallOptio } return ret, nil // { - // "description": "Creates a log bucket asynchronously that can be used to store log entries.After a bucket has been created, the bucket's location cannot be changed.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets:createAsync", - // "httpMethod": "POST", - // "id": "logging.projects.locations.buckets.createAsync", + // "description": "Updates a log bucket.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}", + // "httpMethod": "PATCH", + // "id": "logging.projects.locations.buckets.patch", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "bucketId": { - // "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"", + // "name": { + // "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=retention_days", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+parent}/buckets:createAsync", + // "path": "v2/{+name}", // "request": { // "$ref": "LogBucket" // }, // "response": { - // "$ref": "Operation" + // "$ref": "LogBucket" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -28723,21 +32440,21 @@ func (c *ProjectsLocationsBucketsCreateAsyncCall) Do(opts ...googleapi.CallOptio } -// method id "logging.projects.locations.buckets.delete": +// method id "logging.projects.locations.buckets.undelete": -type ProjectsLocationsBucketsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsBucketsUndeleteCall struct { + s *Service + name string + undeletebucketrequest *UndeleteBucketRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a log bucket.Changes the bucket's lifecycle_state to -// the DELETE_REQUESTED state. After 7 days, the bucket will be purged -// and all log entries in the bucket will be permanently deleted. +// Undelete: Undeletes a log bucket. A bucket that has been deleted can +// be undeleted within the grace period of 7 days. // -// - name: The full resource name of the bucket to delete. +// - name: The full resource name of the bucket to undelete. // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU // CKET_ID]" @@ -28746,16 +32463,17 @@ type ProjectsLocationsBucketsDeleteCall struct { // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" // For // example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *ProjectsLocationsBucketsService) Delete(name string) *ProjectsLocationsBucketsDeleteCall { - c := &ProjectsLocationsBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsLocationsBucketsService) Undelete(name string, undeletebucketrequest *UndeleteBucketRequest) *ProjectsLocationsBucketsUndeleteCall { + c := &ProjectsLocationsBucketsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.undeletebucketrequest = undeletebucketrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsDeleteCall { +func (c *ProjectsLocationsBucketsUndeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsUndeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -28763,21 +32481,21 @@ func (c *ProjectsLocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *Proje // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsBucketsDeleteCall) Context(ctx context.Context) *ProjectsLocationsBucketsDeleteCall { +func (c *ProjectsLocationsBucketsUndeleteCall) Context(ctx context.Context) *ProjectsLocationsBucketsUndeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsBucketsDeleteCall) Header() http.Header { +func (c *ProjectsLocationsBucketsUndeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -28785,11 +32503,16 @@ func (c *ProjectsLocationsBucketsDeleteCall) doRequest(alt string) (*http.Respon } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:undelete") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -28800,14 +32523,14 @@ func (c *ProjectsLocationsBucketsDeleteCall) doRequest(alt string) (*http.Respon return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.locations.buckets.delete" call. +// Do executes the "logging.projects.locations.buckets.undelete" call. // Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *Empty.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 *ProjectsLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +func (c *ProjectsLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -28838,23 +32561,26 @@ func (c *ProjectsLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (* } return ret, nil // { - // "description": "Deletes a log bucket.Changes the bucket's lifecycle_state to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}", - // "httpMethod": "DELETE", - // "id": "logging.projects.locations.buckets.delete", + // "description": "Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period of 7 days.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}:undelete", + // "httpMethod": "POST", + // "id": "logging.projects.locations.buckets.undelete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The full resource name of the bucket to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "description": "Required. The full resource name of the bucket to undelete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+name}:undelete", + // "request": { + // "$ref": "UndeleteBucketRequest" + // }, // "response": { // "$ref": "Empty" // }, @@ -28866,20 +32592,23 @@ func (c *ProjectsLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (* } -// method id "logging.projects.locations.buckets.get": +// method id "logging.projects.locations.buckets.updateAsync": -type ProjectsLocationsBucketsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsBucketsUpdateAsyncCall struct { + s *Service + name string + logbucket *LogBucket + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a log bucket. +// UpdateAsync: Updates a log bucket asynchronously.If the bucket has a +// lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be +// returned.After a bucket has been created, the bucket's location +// cannot be changed. // -// - name: The resource name of the bucket: +// - name: The full resource name of the bucket to update. // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU // CKET_ID]" @@ -28888,63 +32617,68 @@ type ProjectsLocationsBucketsGetCall struct { // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" // For // example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *ProjectsLocationsBucketsService) Get(name string) *ProjectsLocationsBucketsGetCall { - c := &ProjectsLocationsBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsLocationsBucketsService) UpdateAsync(name string, logbucket *LogBucket) *ProjectsLocationsBucketsUpdateAsyncCall { + c := &ProjectsLocationsBucketsUpdateAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.logbucket = logbucket + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. Field +// mask that specifies the fields in bucket that need an update. A +// bucket field will be overwritten if, and only if, it is in the update +// mask. name and output only fields cannot be updated.For a detailed +// FieldMask definition, see: +// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor +// example: updateMask=retention_days +func (c *ProjectsLocationsBucketsUpdateAsyncCall) UpdateMask(updateMask string) *ProjectsLocationsBucketsUpdateAsyncCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsBucketsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsGetCall { +func (c *ProjectsLocationsBucketsUpdateAsyncCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsUpdateAsyncCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsBucketsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsBucketsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsBucketsGetCall) Context(ctx context.Context) *ProjectsLocationsBucketsGetCall { +func (c *ProjectsLocationsBucketsUpdateAsyncCall) Context(ctx context.Context) *ProjectsLocationsBucketsUpdateAsyncCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsBucketsGetCall) Header() http.Header { +func (c *ProjectsLocationsBucketsUpdateAsyncCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsBucketsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsBucketsUpdateAsyncCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:updateAsync") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -28955,14 +32689,14 @@ func (c *ProjectsLocationsBucketsGetCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.locations.buckets.get" call. -// Exactly one of *LogBucket or error will be non-nil. Any non-2xx +// Do executes the "logging.projects.locations.buckets.updateAsync" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either -// *LogBucket.ServerResponse.Header or (if a response was returned at +// *Operation.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 *ProjectsLocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { +func (c *ProjectsLocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -28981,7 +32715,7 @@ func (c *ProjectsLocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*Log if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogBucket{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -28993,132 +32727,124 @@ func (c *ProjectsLocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*Log } return ret, nil // { - // "description": "Gets a log bucket.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}", - // "httpMethod": "GET", - // "id": "logging.projects.locations.buckets.get", + // "description": "Updates a log bucket asynchronously.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}:updateAsync", + // "httpMethod": "POST", + // "id": "logging.projects.locations.buckets.updateAsync", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource name of the bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=retention_days", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+name}", - // "response": { + // "path": "v2/{+name}:updateAsync", + // "request": { // "$ref": "LogBucket" // }, + // "response": { + // "$ref": "Operation" + // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// method id "logging.projects.locations.buckets.list": +// method id "logging.projects.locations.buckets.links.create": -type ProjectsLocationsBucketsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsBucketsLinksCreateCall struct { + s *Service + parent string + link *Link + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists log buckets. +// Create: Asynchronously creates linked dataset in BigQuery which makes +// it possible to use BugQuery to read the logs stored in the bucket. A +// bucket may currently only contain one link. // -// - parent: The parent resource whose buckets are to be listed: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" Note: The locations -// portion of the resource must be specified, but supplying the -// character - in place of LOCATION_ID will return all buckets. -func (r *ProjectsLocationsBucketsService) List(parent string) *ProjectsLocationsBucketsListCall { - c := &ProjectsLocationsBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The full resource name of the bucket to create a link for. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]". +func (r *ProjectsLocationsBucketsLinksService) Create(parent string, link *Link) *ProjectsLocationsBucketsLinksCreateCall { + c := &ProjectsLocationsBucketsLinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent + c.link = link return c } -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return from this request. Non-positive values are -// ignored. The presence of nextPageToken in the response indicates that -// more results might be available. -func (c *ProjectsLocationsBucketsListCall) PageSize(pageSize int64) *ProjectsLocationsBucketsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": If present, then -// retrieve the next batch of results from the preceding call to this -// method. pageToken must be the value of nextPageToken from the -// previous response. The values of other method parameters should be -// identical to those in the previous call. -func (c *ProjectsLocationsBucketsListCall) PageToken(pageToken string) *ProjectsLocationsBucketsListCall { - c.urlParams_.Set("pageToken", pageToken) +// LinkId sets the optional parameter "linkId": Required. The ID to use +// for the link. The link_id can have up to 100 characters. A valid +// link_id must only have alphanumeric characters and underscores within +// it. +func (c *ProjectsLocationsBucketsLinksCreateCall) LinkId(linkId string) *ProjectsLocationsBucketsLinksCreateCall { + c.urlParams_.Set("linkId", linkId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsBucketsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsListCall { +func (c *ProjectsLocationsBucketsLinksCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsLinksCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsBucketsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsBucketsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsBucketsListCall) Context(ctx context.Context) *ProjectsLocationsBucketsListCall { +func (c *ProjectsLocationsBucketsLinksCreateCall) Context(ctx context.Context) *ProjectsLocationsBucketsLinksCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsBucketsListCall) Header() http.Header { +func (c *ProjectsLocationsBucketsLinksCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsBucketsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsBucketsLinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.link) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/links") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -29129,14 +32855,14 @@ func (c *ProjectsLocationsBucketsListCall) doRequest(alt string) (*http.Response return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.locations.buckets.list" call. -// Exactly one of *ListBucketsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListBucketsResponse.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 *ProjectsLocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucketsResponse, error) { +// Do executes the "logging.projects.locations.buckets.links.create" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.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 *ProjectsLocationsBucketsLinksCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -29155,7 +32881,7 @@ func (c *ProjectsLocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*Li if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListBucketsResponse{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -29167,115 +32893,74 @@ func (c *ProjectsLocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*Li } return ret, nil // { - // "description": "Lists log buckets.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets", - // "httpMethod": "GET", - // "id": "logging.projects.locations.buckets.list", + // "description": "Asynchronously creates linked dataset in BigQuery which makes it possible to use BugQuery to read the logs stored in the bucket. A bucket may currently only contain one link.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/links", + // "httpMethod": "POST", + // "id": "logging.projects.locations.buckets.links.create", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "pageSize": { - // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "linkId": { + // "description": "Required. The ID to use for the link. The link_id can have up to 100 characters. A valid link_id must only have alphanumeric characters and underscores within it.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. The parent resource whose buckets are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets.", + // "description": "Required. The full resource name of the bucket to create a link for. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/buckets", + // "path": "v2/{+parent}/links", + // "request": { + // "$ref": "Link" + // }, // "response": { - // "$ref": "ListBucketsResponse" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsBucketsListCall) Pages(ctx context.Context, f func(*ListBucketsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "logging.projects.locations.buckets.patch": +// method id "logging.projects.locations.buckets.links.delete": -type ProjectsLocationsBucketsPatchCall struct { +type ProjectsLocationsBucketsLinksDeleteCall struct { s *Service name string - logbucket *LogBucket urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Patch: Updates a log bucket.If the bucket has a lifecycle_state of -// DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a -// bucket has been created, the bucket's location cannot be changed. +// Delete: Deletes a link. This will also delete the corresponding +// BigQuery linked dataset. // -// - name: The full resource name of the bucket to update. -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *ProjectsLocationsBucketsService) Patch(name string, logbucket *LogBucket) *ProjectsLocationsBucketsPatchCall { - c := &ProjectsLocationsBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The full resource name of the link to +// delete."projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/ +// links/LINK_ID" +// "organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ +// ID/links/LINK_ID" +// "billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BU +// CKET_ID/links/LINK_ID" +// "folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LIN +// K_ID". +func (r *ProjectsLocationsBucketsLinksService) Delete(name string) *ProjectsLocationsBucketsLinksDeleteCall { + c := &ProjectsLocationsBucketsLinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.logbucket = logbucket - return c -} - -// UpdateMask sets the optional parameter "updateMask": Required. Field -// mask that specifies the fields in bucket that need an update. A -// bucket field will be overwritten if, and only if, it is in the update -// mask. name and output only fields cannot be updated.For a detailed -// FieldMask definition, see: -// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor -// example: updateMask=retention_days -func (c *ProjectsLocationsBucketsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsBucketsPatchCall { - c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsBucketsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsPatchCall { +func (c *ProjectsLocationsBucketsLinksDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsLinksDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -29283,38 +32968,33 @@ func (c *ProjectsLocationsBucketsPatchCall) Fields(s ...googleapi.Field) *Projec // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsBucketsPatchCall) Context(ctx context.Context) *ProjectsLocationsBucketsPatchCall { +func (c *ProjectsLocationsBucketsLinksDeleteCall) Context(ctx context.Context) *ProjectsLocationsBucketsLinksDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsBucketsPatchCall) Header() http.Header { +func (c *ProjectsLocationsBucketsLinksDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsBucketsLinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) - if err != nil { - return nil, err + reqHeaders[k] = v } - reqHeaders.Set("Content-Type", "application/json") + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -29325,14 +33005,14 @@ func (c *ProjectsLocationsBucketsPatchCall) doRequest(alt string) (*http.Respons return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.locations.buckets.patch" call. -// Exactly one of *LogBucket or error will be non-nil. Any non-2xx +// Do executes the "logging.projects.locations.buckets.links.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either -// *LogBucket.ServerResponse.Header or (if a response was returned at +// *Operation.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 *ProjectsLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { +func (c *ProjectsLocationsBucketsLinksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -29351,7 +33031,7 @@ func (c *ProjectsLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*L if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogBucket{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -29363,34 +33043,25 @@ func (c *ProjectsLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*L } return ret, nil // { - // "description": "Updates a log bucket.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}", - // "httpMethod": "PATCH", - // "id": "logging.projects.locations.buckets.patch", + // "description": "Deletes a link. This will also delete the corresponding BigQuery linked dataset.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/links/{linksId}", + // "httpMethod": "DELETE", + // "id": "logging.projects.locations.buckets.links.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "description": "Required. The full resource name of the link to delete.\"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\"", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+/links/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=retention_days", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, // "path": "v2/{+name}", - // "request": { - // "$ref": "LogBucket" - // }, // "response": { - // "$ref": "LogBucket" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -29400,79 +33071,85 @@ func (c *ProjectsLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*L } -// method id "logging.projects.locations.buckets.undelete": +// method id "logging.projects.locations.buckets.links.get": -type ProjectsLocationsBucketsUndeleteCall struct { - s *Service - name string - undeletebucketrequest *UndeleteBucketRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsBucketsLinksGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Undelete: Undeletes a log bucket. A bucket that has been deleted can -// be undeleted within the grace period of 7 days. +// Get: Gets a link. // -// - name: The full resource name of the bucket to undelete. -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *ProjectsLocationsBucketsService) Undelete(name string, undeletebucketrequest *UndeleteBucketRequest) *ProjectsLocationsBucketsUndeleteCall { - c := &ProjectsLocationsBucketsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of the +// link:"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/li +// nks/LINK_ID" +// "organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ +// ID/links/LINK_ID" +// "billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BU +// CKET_ID/links/LINK_ID" +// "folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LIN +// K_ID. +func (r *ProjectsLocationsBucketsLinksService) Get(name string) *ProjectsLocationsBucketsLinksGetCall { + c := &ProjectsLocationsBucketsLinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.undeletebucketrequest = undeletebucketrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsBucketsUndeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsUndeleteCall { +func (c *ProjectsLocationsBucketsLinksGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsLinksGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsBucketsLinksGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsBucketsLinksGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsBucketsUndeleteCall) Context(ctx context.Context) *ProjectsLocationsBucketsUndeleteCall { +func (c *ProjectsLocationsBucketsLinksGetCall) Context(ctx context.Context) *ProjectsLocationsBucketsLinksGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsBucketsUndeleteCall) Header() http.Header { +func (c *ProjectsLocationsBucketsLinksGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsBucketsLinksGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:undelete") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -29483,14 +33160,14 @@ func (c *ProjectsLocationsBucketsUndeleteCall) doRequest(alt string) (*http.Resp return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.locations.buckets.undelete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// Do executes the "logging.projects.locations.buckets.links.get" call. +// Exactly one of *Link or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *Empty.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 *ProjectsLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// *Link.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 *ProjectsLocationsBucketsLinksGetCall) Do(opts ...googleapi.CallOption) (*Link, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -29509,7 +33186,7 @@ func (c *ProjectsLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &Link{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -29521,142 +33198,148 @@ func (c *ProjectsLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period of 7 days.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}:undelete", - // "httpMethod": "POST", - // "id": "logging.projects.locations.buckets.undelete", + // "description": "Gets a link.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/links/{linksId}", + // "httpMethod": "GET", + // "id": "logging.projects.locations.buckets.links.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The full resource name of the bucket to undelete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "description": "Required. The resource name of the link:\"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID\" \"folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/LINK_ID", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+/links/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}:undelete", - // "request": { - // "$ref": "UndeleteBucketRequest" - // }, + // "path": "v2/{+name}", // "response": { - // "$ref": "Empty" + // "$ref": "Link" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.projects.locations.buckets.updateAsync": +// method id "logging.projects.locations.buckets.links.list": -type ProjectsLocationsBucketsUpdateAsyncCall struct { - s *Service - name string - logbucket *LogBucket - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsBucketsLinksListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// UpdateAsync: Updates a log bucket asynchronously.If the bucket has a -// lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be -// returned.After a bucket has been created, the bucket's location -// cannot be changed. +// List: Lists links. // -// - name: The full resource name of the bucket to update. -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *ProjectsLocationsBucketsService) UpdateAsync(name string, logbucket *LogBucket) *ProjectsLocationsBucketsUpdateAsyncCall { - c := &ProjectsLocationsBucketsUpdateAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.logbucket = logbucket +// - parent: The parent resource whose links are to be +// listed:"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/ +// links/" +// "organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ +// ID/" +// "billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BU +// CKET_ID/" +// "folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/. +func (r *ProjectsLocationsBucketsLinksService) List(parent string) *ProjectsLocationsBucketsLinksListCall { + c := &ProjectsLocationsBucketsLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent return c } -// UpdateMask sets the optional parameter "updateMask": Required. Field -// mask that specifies the fields in bucket that need an update. A -// bucket field will be overwritten if, and only if, it is in the update -// mask. name and output only fields cannot be updated.For a detailed -// FieldMask definition, see: -// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor -// example: updateMask=retention_days -func (c *ProjectsLocationsBucketsUpdateAsyncCall) UpdateMask(updateMask string) *ProjectsLocationsBucketsUpdateAsyncCall { - c.urlParams_.Set("updateMask", updateMask) +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request. +func (c *ProjectsLocationsBucketsLinksListCall) PageSize(pageSize int64) *ProjectsLocationsBucketsLinksListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. +func (c *ProjectsLocationsBucketsLinksListCall) PageToken(pageToken string) *ProjectsLocationsBucketsLinksListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsBucketsUpdateAsyncCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsUpdateAsyncCall { +func (c *ProjectsLocationsBucketsLinksListCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsLinksListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsBucketsLinksListCall) IfNoneMatch(entityTag string) *ProjectsLocationsBucketsLinksListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsBucketsUpdateAsyncCall) Context(ctx context.Context) *ProjectsLocationsBucketsUpdateAsyncCall { +func (c *ProjectsLocationsBucketsLinksListCall) Context(ctx context.Context) *ProjectsLocationsBucketsLinksListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsBucketsUpdateAsyncCall) Header() http.Header { +func (c *ProjectsLocationsBucketsLinksListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsBucketsUpdateAsyncCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsBucketsLinksListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:updateAsync") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/links") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + 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, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.locations.buckets.updateAsync" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Operation.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 *ProjectsLocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// Do executes the "logging.projects.locations.buckets.links.list" call. +// Exactly one of *ListLinksResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListLinksResponse.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 *ProjectsLocationsBucketsLinksListCall) Do(opts ...googleapi.CallOption) (*ListLinksResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -29675,7 +33358,7 @@ func (c *ProjectsLocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.CallOptio if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &ListLinksResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -29687,43 +33370,68 @@ func (c *ProjectsLocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.CallOptio } return ret, nil // { - // "description": "Updates a log bucket asynchronously.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}:updateAsync", - // "httpMethod": "POST", - // "id": "logging.projects.locations.buckets.updateAsync", + // "description": "Lists links.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/links", + // "httpMethod": "GET", + // "id": "logging.projects.locations.buckets.links.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent resource whose links are to be listed:\"projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/links/\" \"organizations/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/\" \"billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/\" \"folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=retention_days", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+name}:updateAsync", - // "request": { - // "$ref": "LogBucket" - // }, + // "path": "v2/{+parent}/links", // "response": { - // "$ref": "Operation" + // "$ref": "ListLinksResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsBucketsLinksListCall) Pages(ctx context.Context, f func(*ListLinksResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + // method id "logging.projects.locations.buckets.views.create": type ProjectsLocationsBucketsViewsCreateCall struct { diff --git a/networkservices/v1/networkservices-api.json b/networkservices/v1/networkservices-api.json index 0e12df9d56c..78f32b790a5 100644 --- a/networkservices/v1/networkservices-api.json +++ b/networkservices/v1/networkservices-api.json @@ -2148,7 +2148,7 @@ } } }, - "revision": "20230130", + "revision": "20230213", "rootUrl": "https://networkservices.googleapis.com/", "schemas": { "AuditConfig": { @@ -2412,7 +2412,7 @@ "type": "array" }, "scope": { - "description": "Required. Immutable. Scope determines how configuration across multiple Gateway instances are merged. The configuration for multiple Gateway instances with the same scope will be merged as presented as a single coniguration to the proxy/load balancer. Max length 64 characters. Scope should start with a letter and can only have letters, numbers, hyphens.", + "description": "Optional. Scope determines how configuration across multiple Gateway instances are merged. The configuration for multiple Gateway instances with the same scope will be merged as presented as a single coniguration to the proxy/load balancer. Max length 64 characters. Scope should start with a letter and can only have letters, numbers, hyphens.", "type": "string" }, "selfLink": { diff --git a/networkservices/v1/networkservices-gen.go b/networkservices/v1/networkservices-gen.go index b78763643a6..71cdb2023b0 100644 --- a/networkservices/v1/networkservices-gen.go +++ b/networkservices/v1/networkservices-gen.go @@ -801,12 +801,12 @@ type Gateway struct { // of type 'OPEN_MESH' listen on 0.0.0.0 and support multiple ports. Ports []int64 `json:"ports,omitempty"` - // Scope: Required. Immutable. Scope determines how configuration across - // multiple Gateway instances are merged. The configuration for multiple - // Gateway instances with the same scope will be merged as presented as - // a single coniguration to the proxy/load balancer. Max length 64 - // characters. Scope should start with a letter and can only have - // letters, numbers, hyphens. + // Scope: Optional. Scope determines how configuration across multiple + // Gateway instances are merged. The configuration for multiple Gateway + // instances with the same scope will be merged as presented as a single + // coniguration to the proxy/load balancer. Max length 64 characters. + // Scope should start with a letter and can only have letters, numbers, + // hyphens. Scope string `json:"scope,omitempty"` // SelfLink: Output only. Server-defined URL of this resource diff --git a/networkservices/v1beta1/networkservices-api.json b/networkservices/v1beta1/networkservices-api.json index b19ebd73a8e..1112743e71d 100644 --- a/networkservices/v1beta1/networkservices-api.json +++ b/networkservices/v1beta1/networkservices-api.json @@ -1875,7 +1875,7 @@ } } }, - "revision": "20230130", + "revision": "20230213", "rootUrl": "https://networkservices.googleapis.com/", "schemas": { "AuditConfig": { @@ -2096,7 +2096,7 @@ "type": "array" }, "scope": { - "description": "Required. Immutable. Scope determines how configuration across multiple Gateway instances are merged. The configuration for multiple Gateway instances with the same scope will be merged as presented as a single coniguration to the proxy/load balancer. Max length 64 characters. Scope should start with a letter and can only have letters, numbers, hyphens.", + "description": "Optional. Scope determines how configuration across multiple Gateway instances are merged. The configuration for multiple Gateway instances with the same scope will be merged as presented as a single coniguration to the proxy/load balancer. Max length 64 characters. Scope should start with a letter and can only have letters, numbers, hyphens.", "type": "string" }, "selfLink": { diff --git a/networkservices/v1beta1/networkservices-gen.go b/networkservices/v1beta1/networkservices-gen.go index e3d433417f9..a79214ab35a 100644 --- a/networkservices/v1beta1/networkservices-gen.go +++ b/networkservices/v1beta1/networkservices-gen.go @@ -673,12 +673,12 @@ type Gateway struct { // of type 'OPEN_MESH' listen on 0.0.0.0 and support multiple ports. Ports []int64 `json:"ports,omitempty"` - // Scope: Required. Immutable. Scope determines how configuration across - // multiple Gateway instances are merged. The configuration for multiple - // Gateway instances with the same scope will be merged as presented as - // a single coniguration to the proxy/load balancer. Max length 64 - // characters. Scope should start with a letter and can only have - // letters, numbers, hyphens. + // Scope: Optional. Scope determines how configuration across multiple + // Gateway instances are merged. The configuration for multiple Gateway + // instances with the same scope will be merged as presented as a single + // coniguration to the proxy/load balancer. Max length 64 characters. + // Scope should start with a letter and can only have letters, numbers, + // hyphens. Scope string `json:"scope,omitempty"` // SelfLink: Output only. Server-defined URL of this resource diff --git a/readerrevenuesubscriptionlinking/v1/readerrevenuesubscriptionlinking-api.json b/readerrevenuesubscriptionlinking/v1/readerrevenuesubscriptionlinking-api.json new file mode 100644 index 00000000000..9290f1fbe6b --- /dev/null +++ b/readerrevenuesubscriptionlinking/v1/readerrevenuesubscriptionlinking-api.json @@ -0,0 +1,285 @@ +{ + "basePath": "", + "baseUrl": "https://readerrevenuesubscriptionlinking.googleapis.com/", + "batchPath": "batch", + "canonicalName": "Subscription Linking", + "description": "readerrevenuesubscriptionlinking.googleapis.com API.", + "discoveryVersion": "v1", + "documentationLink": "https://developers.google.com/news/subscribe/subscription-linking/overview", + "fullyEncodeReservedExpansion": true, + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "id": "readerrevenuesubscriptionlinking:v1", + "kind": "discovery#restDescription", + "mtlsRootUrl": "https://readerrevenuesubscriptionlinking.mtls.googleapis.com/", + "name": "readerrevenuesubscriptionlinking", + "ownerDomain": "google.com", + "ownerName": "Google", + "parameters": { + "$.xgafv": { + "description": "V1 error format.", + "enum": [ + "1", + "2" + ], + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "type": "string" + }, + "access_token": { + "description": "OAuth access token.", + "location": "query", + "type": "string" + }, + "alt": { + "default": "json", + "description": "Data format for response.", + "enum": [ + "json", + "media", + "proto" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query", + "type": "string" + }, + "callback": { + "description": "JSONP", + "location": "query", + "type": "string" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "location": "query", + "type": "string" + }, + "key": { + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query", + "type": "string" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "location": "query", + "type": "string" + }, + "prettyPrint": { + "default": "true", + "description": "Returns response with indentations and line breaks.", + "location": "query", + "type": "boolean" + }, + "quotaUser": { + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query", + "type": "string" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query", + "type": "string" + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query", + "type": "string" + } + }, + "protocol": "rest", + "resources": { + "publications": { + "resources": { + "readers": { + "methods": { + "delete": { + "description": "Removes a publication reader, effectively severing the association with a Google user. If `force` is set to true, any entitlements for this reader will also be deleted. (Otherwise, the request will only work if the reader has no entitlements.) - If the reader does not exist, return NOT_FOUND. - Return FAILED_PRECONDITION if the force field is false (or unset) and entitlements are present.", + "flatPath": "v1/publications/{publicationsId}/readers/{readersId}", + "httpMethod": "DELETE", + "id": "readerrevenuesubscriptionlinking.publications.readers.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "force": { + "description": "If set to true, any entitlements under the reader will also be purged.", + "location": "query", + "type": "boolean" + }, + "name": { + "description": "Required. The resource name of the reader. Format: publications/{publication_id}/readers/{ppid}", + "location": "path", + "pattern": "^publications/[^/]+/readers/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "DeleteReaderResponse" + } + }, + "get": { + "description": "Gets a reader of a publication. Returns NOT_FOUND if the reader does not exist.", + "flatPath": "v1/publications/{publicationsId}/readers/{readersId}", + "httpMethod": "GET", + "id": "readerrevenuesubscriptionlinking.publications.readers.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the reader. Format: publications/{publication_id}/readers/{ppid}", + "location": "path", + "pattern": "^publications/[^/]+/readers/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "Reader" + } + }, + "getEntitlements": { + "description": "Gets the reader entitlements for a publication reader. - Returns PERMISSION_DENIED if the caller does not have access. - Returns NOT_FOUND if the reader does not exist.", + "flatPath": "v1/publications/{publicationsId}/readers/{readersId}/entitlements", + "httpMethod": "GET", + "id": "readerrevenuesubscriptionlinking.publications.readers.getEntitlements", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the reader entitlements to retrieve. Format: publications/{publication_id}/readers/{reader_id}/entitlements", + "location": "path", + "pattern": "^publications/[^/]+/readers/[^/]+/entitlements$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "ReaderEntitlements" + } + }, + "updateEntitlements": { + "description": "Updates the reader entitlements for a publication reader. The entire reader entitlements will be overwritten by the new reader entitlements in the payload, like a PUT. - Returns PERMISSION_DENIED if the caller does not have access. - Returns NOT_FOUND if the reader does not exist.", + "flatPath": "v1/publications/{publicationsId}/readers/{readersId}/entitlements", + "httpMethod": "PATCH", + "id": "readerrevenuesubscriptionlinking.publications.readers.updateEntitlements", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Output only. The resource name of the singleton.", + "location": "path", + "pattern": "^publications/[^/]+/readers/[^/]+/entitlements$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Optional. The list of fields to update. Defaults to all fields.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "v1/{+name}", + "request": { + "$ref": "ReaderEntitlements" + }, + "response": { + "$ref": "ReaderEntitlements" + } + } + } + } + } + } + }, + "revision": "20230216", + "rootUrl": "https://readerrevenuesubscriptionlinking.googleapis.com/", + "schemas": { + "DeleteReaderResponse": { + "description": "Response to deleting a reader of a publication.", + "id": "DeleteReaderResponse", + "properties": {}, + "type": "object" + }, + "Entitlement": { + "description": "A single entitlement for a publication reader", + "id": "Entitlement", + "properties": { + "detail": { + "description": "The detail field can carry a description of the SKU that corresponds to what the user has been granted access to. This description, which is opaque to Google, can be displayed in the Google user subscription console for users who linked the subscription to a Google Account. Max 80 character limit.", + "type": "string" + }, + "expireTime": { + "description": "Required. Expiration time of the entitlement. Entitlements that have expired over 30 days will be purged. Required. LINT.IfChange(expire_time) The max expire_time is 398 days from now(). LINT.ThenChange(//depot/google3/java/com/google/subscribewithgoogle/accountlinking/subscriptionlink/service/config/protoconf.pi:max_expiry_age)", + "format": "google-datetime", + "type": "string" + }, + "productId": { + "description": "Required. The publication's product ID that the user has access to. This is the same product ID as can be found in Schema.org markup (http://schema.org/productID). E.g. \"dailybugle.com:basic\"", + "type": "string" + }, + "subscriptionToken": { + "description": "A source-specific subscription token. This is an opaque string that the publisher provides to Google. This token is opaque and has no meaning to Google.", + "type": "string" + } + }, + "type": "object" + }, + "Reader": { + "description": "A reader of a publication.", + "id": "Reader", + "properties": { + "createTime": { + "description": "Output only. Time the publication reader was created and associated with a Google user.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "name": { + "description": "Output only. The resource name of the reader. The last part of ppid in the resource name is the publisher provided id.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "ReaderEntitlements": { + "description": "A singleton containing all of a reader's entitlements for a publication.", + "id": "ReaderEntitlements", + "properties": { + "entitlements": { + "description": "All of the entitlements for a publication reader.", + "items": { + "$ref": "Entitlement" + }, + "type": "array" + }, + "name": { + "description": "Output only. The resource name of the singleton.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + } + }, + "servicePath": "", + "title": "Reader Revenue Subscription Linking API", + "version": "v1", + "version_module": true +} \ No newline at end of file diff --git a/readerrevenuesubscriptionlinking/v1/readerrevenuesubscriptionlinking-gen.go b/readerrevenuesubscriptionlinking/v1/readerrevenuesubscriptionlinking-gen.go new file mode 100644 index 00000000000..17a9f5bf748 --- /dev/null +++ b/readerrevenuesubscriptionlinking/v1/readerrevenuesubscriptionlinking-gen.go @@ -0,0 +1,872 @@ +// Copyright 2023 Google LLC. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Code generated file. DO NOT EDIT. + +// Package readerrevenuesubscriptionlinking provides access to the Reader Revenue Subscription Linking API. +// +// For product documentation, see: https://developers.google.com/news/subscribe/subscription-linking/overview +// +// # Creating a client +// +// Usage example: +// +// import "google.golang.org/api/readerrevenuesubscriptionlinking/v1" +// ... +// ctx := context.Background() +// readerrevenuesubscriptionlinkingService, err := readerrevenuesubscriptionlinking.NewService(ctx) +// +// In this example, Google Application Default Credentials are used for authentication. +// +// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// +// # Other authentication options +// +// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: +// +// readerrevenuesubscriptionlinkingService, err := readerrevenuesubscriptionlinking.NewService(ctx, option.WithAPIKey("AIza...")) +// +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: +// +// config := &oauth2.Config{...} +// // ... +// token, err := config.Exchange(ctx, ...) +// readerrevenuesubscriptionlinkingService, err := readerrevenuesubscriptionlinking.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) +// +// See https://godoc.org/google.golang.org/api/option/ for details on options. +package readerrevenuesubscriptionlinking // import "google.golang.org/api/readerrevenuesubscriptionlinking/v1" + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "strconv" + "strings" + + googleapi "google.golang.org/api/googleapi" + internal "google.golang.org/api/internal" + gensupport "google.golang.org/api/internal/gensupport" + option "google.golang.org/api/option" + internaloption "google.golang.org/api/option/internaloption" + htransport "google.golang.org/api/transport/http" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = gensupport.MarshalJSON +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = context.Canceled +var _ = internaloption.WithDefaultEndpoint + +const apiId = "readerrevenuesubscriptionlinking:v1" +const apiName = "readerrevenuesubscriptionlinking" +const apiVersion = "v1" +const basePath = "https://readerrevenuesubscriptionlinking.googleapis.com/" +const mtlsBasePath = "https://readerrevenuesubscriptionlinking.mtls.googleapis.com/" + +// NewService creates a new Service. +func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { + opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) + opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) + client, endpoint, err := htransport.NewClient(ctx, opts...) + if err != nil { + return nil, err + } + s, err := New(client) + if err != nil { + return nil, err + } + if endpoint != "" { + s.BasePath = endpoint + } + return s, nil +} + +// New creates a new Service. It uses the provided http.Client for requests. +// +// Deprecated: please use NewService instead. +// To provide a custom HTTP client, use option.WithHTTPClient. +// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Publications = NewPublicationsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Publications *PublicationsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewPublicationsService(s *Service) *PublicationsService { + rs := &PublicationsService{s: s} + rs.Readers = NewPublicationsReadersService(s) + return rs +} + +type PublicationsService struct { + s *Service + + Readers *PublicationsReadersService +} + +func NewPublicationsReadersService(s *Service) *PublicationsReadersService { + rs := &PublicationsReadersService{s: s} + return rs +} + +type PublicationsReadersService struct { + s *Service +} + +// DeleteReaderResponse: Response to deleting a reader of a publication. +type DeleteReaderResponse struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} + +// Entitlement: A single entitlement for a publication reader +type Entitlement struct { + // Detail: The detail field can carry a description of the SKU that + // corresponds to what the user has been granted access to. This + // description, which is opaque to Google, can be displayed in the + // Google user subscription console for users who linked the + // subscription to a Google Account. Max 80 character limit. + Detail string `json:"detail,omitempty"` + + // ExpireTime: Required. Expiration time of the entitlement. + // Entitlements that have expired over 30 days will be purged. Required. + // LINT.IfChange(expire_time) The max expire_time is 398 days from + // now(). + // LINT.ThenChange(//depot/google3/java/com/google/subscribewithgoogle/ac + // countlinking/subscriptionlink/service/config/protoconf.pi:max_expiry_a + // ge) + ExpireTime string `json:"expireTime,omitempty"` + + // ProductId: Required. The publication's product ID that the user has + // access to. This is the same product ID as can be found in Schema.org + // markup (http://schema.org/productID). E.g. "dailybugle.com:basic" + ProductId string `json:"productId,omitempty"` + + // SubscriptionToken: A source-specific subscription token. This is an + // opaque string that the publisher provides to Google. This token is + // opaque and has no meaning to Google. + SubscriptionToken string `json:"subscriptionToken,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Detail") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Detail") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *Entitlement) MarshalJSON() ([]byte, error) { + type NoMethod Entitlement + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// Reader: A reader of a publication. +type Reader struct { + // CreateTime: Output only. Time the publication reader was created and + // associated with a Google user. + CreateTime string `json:"createTime,omitempty"` + + // Name: Output only. The resource name of the reader. The last part of + // ppid in the resource name is the publisher provided id. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *Reader) MarshalJSON() ([]byte, error) { + type NoMethod Reader + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ReaderEntitlements: A singleton containing all of a reader's +// entitlements for a publication. +type ReaderEntitlements struct { + // Entitlements: All of the entitlements for a publication reader. + Entitlements []*Entitlement `json:"entitlements,omitempty"` + + // Name: Output only. The resource name of the singleton. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Entitlements") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Entitlements") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ReaderEntitlements) MarshalJSON() ([]byte, error) { + type NoMethod ReaderEntitlements + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// method id "readerrevenuesubscriptionlinking.publications.readers.delete": + +type PublicationsReadersDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Removes a publication reader, effectively severing the +// association with a Google user. If `force` is set to true, any +// entitlements for this reader will also be deleted. (Otherwise, the +// request will only work if the reader has no entitlements.) - If the +// reader does not exist, return NOT_FOUND. - Return FAILED_PRECONDITION +// if the force field is false (or unset) and entitlements are present. +// +// - name: The resource name of the reader. Format: +// publications/{publication_id}/readers/{ppid}. +func (r *PublicationsReadersService) Delete(name string) *PublicationsReadersDeleteCall { + c := &PublicationsReadersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Force sets the optional parameter "force": If set to true, any +// entitlements under the reader will also be purged. +func (c *PublicationsReadersDeleteCall) Force(force bool) *PublicationsReadersDeleteCall { + c.urlParams_.Set("force", fmt.Sprint(force)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PublicationsReadersDeleteCall) Fields(s ...googleapi.Field) *PublicationsReadersDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *PublicationsReadersDeleteCall) Context(ctx context.Context) *PublicationsReadersDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *PublicationsReadersDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *PublicationsReadersDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", 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) +} + +// Do executes the "readerrevenuesubscriptionlinking.publications.readers.delete" call. +// Exactly one of *DeleteReaderResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *DeleteReaderResponse.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 *PublicationsReadersDeleteCall) Do(opts ...googleapi.CallOption) (*DeleteReaderResponse, 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 := &DeleteReaderResponse{ + 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 + // { + // "description": "Removes a publication reader, effectively severing the association with a Google user. If `force` is set to true, any entitlements for this reader will also be deleted. (Otherwise, the request will only work if the reader has no entitlements.) - If the reader does not exist, return NOT_FOUND. - Return FAILED_PRECONDITION if the force field is false (or unset) and entitlements are present.", + // "flatPath": "v1/publications/{publicationsId}/readers/{readersId}", + // "httpMethod": "DELETE", + // "id": "readerrevenuesubscriptionlinking.publications.readers.delete", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "force": { + // "description": "If set to true, any entitlements under the reader will also be purged.", + // "location": "query", + // "type": "boolean" + // }, + // "name": { + // "description": "Required. The resource name of the reader. Format: publications/{publication_id}/readers/{ppid}", + // "location": "path", + // "pattern": "^publications/[^/]+/readers/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "response": { + // "$ref": "DeleteReaderResponse" + // } + // } + +} + +// method id "readerrevenuesubscriptionlinking.publications.readers.get": + +type PublicationsReadersGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets a reader of a publication. Returns NOT_FOUND if the reader +// does not exist. +// +// - name: The resource name of the reader. Format: +// publications/{publication_id}/readers/{ppid}. +func (r *PublicationsReadersService) Get(name string) *PublicationsReadersGetCall { + c := &PublicationsReadersGetCall{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 information. +func (c *PublicationsReadersGetCall) Fields(s ...googleapi.Field) *PublicationsReadersGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PublicationsReadersGetCall) IfNoneMatch(entityTag string) *PublicationsReadersGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *PublicationsReadersGetCall) Context(ctx context.Context) *PublicationsReadersGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *PublicationsReadersGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *PublicationsReadersGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + 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}") + 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) +} + +// Do executes the "readerrevenuesubscriptionlinking.publications.readers.get" call. +// Exactly one of *Reader or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Reader.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 *PublicationsReadersGetCall) Do(opts ...googleapi.CallOption) (*Reader, 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 := &Reader{ + 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 + // { + // "description": "Gets a reader of a publication. Returns NOT_FOUND if the reader does not exist.", + // "flatPath": "v1/publications/{publicationsId}/readers/{readersId}", + // "httpMethod": "GET", + // "id": "readerrevenuesubscriptionlinking.publications.readers.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The resource name of the reader. Format: publications/{publication_id}/readers/{ppid}", + // "location": "path", + // "pattern": "^publications/[^/]+/readers/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "response": { + // "$ref": "Reader" + // } + // } + +} + +// method id "readerrevenuesubscriptionlinking.publications.readers.getEntitlements": + +type PublicationsReadersGetEntitlementsCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// GetEntitlements: Gets the reader entitlements for a publication +// reader. - Returns PERMISSION_DENIED if the caller does not have +// access. - Returns NOT_FOUND if the reader does not exist. +// +// - name: The name of the reader entitlements to retrieve. Format: +// publications/{publication_id}/readers/{reader_id}/entitlements. +func (r *PublicationsReadersService) GetEntitlements(name string) *PublicationsReadersGetEntitlementsCall { + c := &PublicationsReadersGetEntitlementsCall{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 information. +func (c *PublicationsReadersGetEntitlementsCall) Fields(s ...googleapi.Field) *PublicationsReadersGetEntitlementsCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PublicationsReadersGetEntitlementsCall) IfNoneMatch(entityTag string) *PublicationsReadersGetEntitlementsCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *PublicationsReadersGetEntitlementsCall) Context(ctx context.Context) *PublicationsReadersGetEntitlementsCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *PublicationsReadersGetEntitlementsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *PublicationsReadersGetEntitlementsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + 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}") + 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) +} + +// Do executes the "readerrevenuesubscriptionlinking.publications.readers.getEntitlements" call. +// Exactly one of *ReaderEntitlements or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ReaderEntitlements.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 *PublicationsReadersGetEntitlementsCall) Do(opts ...googleapi.CallOption) (*ReaderEntitlements, 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 := &ReaderEntitlements{ + 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 + // { + // "description": "Gets the reader entitlements for a publication reader. - Returns PERMISSION_DENIED if the caller does not have access. - Returns NOT_FOUND if the reader does not exist.", + // "flatPath": "v1/publications/{publicationsId}/readers/{readersId}/entitlements", + // "httpMethod": "GET", + // "id": "readerrevenuesubscriptionlinking.publications.readers.getEntitlements", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The name of the reader entitlements to retrieve. Format: publications/{publication_id}/readers/{reader_id}/entitlements", + // "location": "path", + // "pattern": "^publications/[^/]+/readers/[^/]+/entitlements$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "response": { + // "$ref": "ReaderEntitlements" + // } + // } + +} + +// method id "readerrevenuesubscriptionlinking.publications.readers.updateEntitlements": + +type PublicationsReadersUpdateEntitlementsCall struct { + s *Service + name string + readerentitlements *ReaderEntitlements + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// UpdateEntitlements: Updates the reader entitlements for a publication +// reader. The entire reader entitlements will be overwritten by the new +// reader entitlements in the payload, like a PUT. - Returns +// PERMISSION_DENIED if the caller does not have access. - Returns +// NOT_FOUND if the reader does not exist. +// +// - name: Output only. The resource name of the singleton. +func (r *PublicationsReadersService) UpdateEntitlements(name string, readerentitlements *ReaderEntitlements) *PublicationsReadersUpdateEntitlementsCall { + c := &PublicationsReadersUpdateEntitlementsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.readerentitlements = readerentitlements + return c +} + +// UpdateMask sets the optional parameter "updateMask": The list of +// fields to update. Defaults to all fields. +func (c *PublicationsReadersUpdateEntitlementsCall) UpdateMask(updateMask string) *PublicationsReadersUpdateEntitlementsCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PublicationsReadersUpdateEntitlementsCall) Fields(s ...googleapi.Field) *PublicationsReadersUpdateEntitlementsCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *PublicationsReadersUpdateEntitlementsCall) Context(ctx context.Context) *PublicationsReadersUpdateEntitlementsCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *PublicationsReadersUpdateEntitlementsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *PublicationsReadersUpdateEntitlementsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.readerentitlements) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", 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) +} + +// Do executes the "readerrevenuesubscriptionlinking.publications.readers.updateEntitlements" call. +// Exactly one of *ReaderEntitlements or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ReaderEntitlements.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 *PublicationsReadersUpdateEntitlementsCall) Do(opts ...googleapi.CallOption) (*ReaderEntitlements, 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 := &ReaderEntitlements{ + 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 + // { + // "description": "Updates the reader entitlements for a publication reader. The entire reader entitlements will be overwritten by the new reader entitlements in the payload, like a PUT. - Returns PERMISSION_DENIED if the caller does not have access. - Returns NOT_FOUND if the reader does not exist.", + // "flatPath": "v1/publications/{publicationsId}/readers/{readersId}/entitlements", + // "httpMethod": "PATCH", + // "id": "readerrevenuesubscriptionlinking.publications.readers.updateEntitlements", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Output only. The resource name of the singleton.", + // "location": "path", + // "pattern": "^publications/[^/]+/readers/[^/]+/entitlements$", + // "required": true, + // "type": "string" + // }, + // "updateMask": { + // "description": "Optional. The list of fields to update. Defaults to all fields.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "request": { + // "$ref": "ReaderEntitlements" + // }, + // "response": { + // "$ref": "ReaderEntitlements" + // } + // } + +} diff --git a/safebrowsing/v4/safebrowsing-api.json b/safebrowsing/v4/safebrowsing-api.json index 1650d940e14..43ed0ff6821 100644 --- a/safebrowsing/v4/safebrowsing-api.json +++ b/safebrowsing/v4/safebrowsing-api.json @@ -127,7 +127,7 @@ }, "path": "v4/encodedFullHashes/{encodedRequest}", "response": { - "$ref": "FindFullHashesResponse" + "$ref": "GoogleSecuritySafebrowsingV4FindFullHashesResponse" } } } @@ -163,7 +163,7 @@ }, "path": "v4/encodedUpdates/{encodedRequest}", "response": { - "$ref": "FetchThreatListUpdatesResponse" + "$ref": "GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponse" } } } @@ -179,10 +179,10 @@ "parameters": {}, "path": "v4/fullHashes:find", "request": { - "$ref": "FindFullHashesRequest" + "$ref": "GoogleSecuritySafebrowsingV4FindFullHashesRequest" }, "response": { - "$ref": "FindFullHashesResponse" + "$ref": "GoogleSecuritySafebrowsingV4FindFullHashesResponse" } } } @@ -198,10 +198,10 @@ "parameters": {}, "path": "v4/threatHits", "request": { - "$ref": "ThreatHit" + "$ref": "GoogleSecuritySafebrowsingV4ThreatHit" }, "response": { - "$ref": "Empty" + "$ref": "GoogleProtobufEmpty" } } } @@ -217,10 +217,10 @@ "parameters": {}, "path": "v4/threatListUpdates:fetch", "request": { - "$ref": "FetchThreatListUpdatesRequest" + "$ref": "GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequest" }, "response": { - "$ref": "FetchThreatListUpdatesResponse" + "$ref": "GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponse" } } } @@ -236,7 +236,7 @@ "parameters": {}, "path": "v4/threatLists", "response": { - "$ref": "ListThreatListsResponse" + "$ref": "GoogleSecuritySafebrowsingV4ListThreatListsResponse" } } } @@ -252,21 +252,27 @@ "parameters": {}, "path": "v4/threatMatches:find", "request": { - "$ref": "FindThreatMatchesRequest" + "$ref": "GoogleSecuritySafebrowsingV4FindThreatMatchesRequest" }, "response": { - "$ref": "FindThreatMatchesResponse" + "$ref": "GoogleSecuritySafebrowsingV4FindThreatMatchesResponse" } } } } }, - "revision": "20230129", + "revision": "20230216", "rootUrl": "https://safebrowsing.googleapis.com/", "schemas": { - "Checksum": { + "GoogleProtobufEmpty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }", + "id": "GoogleProtobufEmpty", + "properties": {}, + "type": "object" + }, + "GoogleSecuritySafebrowsingV4Checksum": { "description": "The expected state of a client's local database.", - "id": "Checksum", + "id": "GoogleSecuritySafebrowsingV4Checksum", "properties": { "sha256": { "description": "The SHA256 hash of the client state; that is, of the sorted list of all hashes present in the database.", @@ -276,9 +282,9 @@ }, "type": "object" }, - "ClientInfo": { + "GoogleSecuritySafebrowsingV4ClientInfo": { "description": "The client metadata associated with Safe Browsing API requests.", - "id": "ClientInfo", + "id": "GoogleSecuritySafebrowsingV4ClientInfo", "properties": { "clientId": { "description": "A client ID that (hopefully) uniquely identifies the client implementation of the Safe Browsing API.", @@ -291,191 +297,30 @@ }, "type": "object" }, - "Constraints": { - "description": "The constraints for this update.", - "id": "Constraints", - "properties": { - "deviceLocation": { - "description": "A client's physical location, expressed as a ISO 31166-1 alpha-2 region code.", - "type": "string" - }, - "language": { - "description": "Requests the lists for a specific language. Expects ISO 639 alpha-2 format.", - "type": "string" - }, - "maxDatabaseEntries": { - "description": "Sets the maximum number of entries that the client is willing to have in the local database for the specified list. This should be a power of 2 between 2**10 and 2**20. If zero, no database size limit is set.", - "format": "int32", - "type": "integer" - }, - "maxUpdateEntries": { - "description": "The maximum size in number of entries. The update will not contain more entries than this value. This should be a power of 2 between 2**10 and 2**20. If zero, no update size limit is set.", - "format": "int32", - "type": "integer" - }, - "region": { - "description": "Requests the list for a specific geographic location. If not set the server may pick that value based on the user's IP address. Expects ISO 3166-1 alpha-2 format.", - "type": "string" - }, - "supportedCompressions": { - "description": "The compression types supported by the client.", - "items": { - "enum": [ - "COMPRESSION_TYPE_UNSPECIFIED", - "RAW", - "RICE" - ], - "enumDescriptions": [ - "Unknown.", - "Raw, uncompressed data.", - "Rice-Golomb encoded data." - ], - "type": "string" - }, - "type": "array" - } - }, - "type": "object" - }, - "Empty": { - "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }", - "id": "Empty", - "properties": {}, - "type": "object" - }, - "FetchThreatListUpdatesRequest": { + "GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequest": { "description": "Describes a Safe Browsing API update request. Clients can request updates for multiple lists in a single request. The server may not respond to all requests, if the server has no updates for that list. NOTE: Field index 2 is unused. NEXT: 5", - "id": "FetchThreatListUpdatesRequest", + "id": "GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequest", "properties": { "client": { - "$ref": "ClientInfo", + "$ref": "GoogleSecuritySafebrowsingV4ClientInfo", "description": "The client metadata." }, "listUpdateRequests": { "description": "The requested threat list updates.", "items": { - "$ref": "ListUpdateRequest" - }, - "type": "array" - } - }, - "type": "object" - }, - "FetchThreatListUpdatesResponse": { - "id": "FetchThreatListUpdatesResponse", - "properties": { - "listUpdateResponses": { - "description": "The list updates requested by the clients. The number of responses here may be less than the number of requests sent by clients. This is the case, for example, if the server has no updates for a particular list.", - "items": { - "$ref": "ListUpdateResponse" - }, - "type": "array" - }, - "minimumWaitDuration": { - "description": "The minimum duration the client must wait before issuing any update request. If this field is not set clients may update as soon as they want.", - "format": "google-duration", - "type": "string" - } - }, - "type": "object" - }, - "FindFullHashesRequest": { - "description": "Request to return full hashes matched by the provided hash prefixes.", - "id": "FindFullHashesRequest", - "properties": { - "apiClient": { - "$ref": "ClientInfo", - "description": "Client metadata associated with callers of higher-level APIs built on top of the client's implementation." - }, - "client": { - "$ref": "ClientInfo", - "description": "The client metadata." - }, - "clientStates": { - "description": "The current client states for each of the client's local threat lists.", - "items": { - "format": "byte", - "type": "string" - }, - "type": "array" - }, - "threatInfo": { - "$ref": "ThreatInfo", - "description": "The lists and hashes to be checked." - } - }, - "type": "object" - }, - "FindFullHashesResponse": { - "id": "FindFullHashesResponse", - "properties": { - "matches": { - "description": "The full hashes that matched the requested prefixes.", - "items": { - "$ref": "ThreatMatch" - }, - "type": "array" - }, - "minimumWaitDuration": { - "description": "The minimum duration the client must wait before issuing any find hashes request. If this field is not set, clients can issue a request as soon as they want.", - "format": "google-duration", - "type": "string" - }, - "negativeCacheDuration": { - "description": "For requested entities that did not match the threat list, how long to cache the response.", - "format": "google-duration", - "type": "string" - } - }, - "type": "object" - }, - "FindThreatMatchesRequest": { - "description": "Request to check entries against lists.", - "id": "FindThreatMatchesRequest", - "properties": { - "client": { - "$ref": "ClientInfo", - "description": "The client metadata." - }, - "threatInfo": { - "$ref": "ThreatInfo", - "description": "The lists and entries to be checked for matches." - } - }, - "type": "object" - }, - "FindThreatMatchesResponse": { - "id": "FindThreatMatchesResponse", - "properties": { - "matches": { - "description": "The threat list matches.", - "items": { - "$ref": "ThreatMatch" - }, - "type": "array" - } - }, - "type": "object" - }, - "ListThreatListsResponse": { - "id": "ListThreatListsResponse", - "properties": { - "threatLists": { - "description": "The lists available for download by the client.", - "items": { - "$ref": "ThreatListDescriptor" + "$ref": "GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequest" }, "type": "array" } }, "type": "object" }, - "ListUpdateRequest": { + "GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequest": { "description": "A single list update request.", - "id": "ListUpdateRequest", + "id": "GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequest", "properties": { "constraints": { - "$ref": "Constraints", + "$ref": "GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequestConstraints", "description": "The constraints associated with this request." }, "platformType": { @@ -578,19 +423,83 @@ }, "type": "object" }, - "ListUpdateResponse": { + "GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequestConstraints": { + "description": "The constraints for this update.", + "id": "GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequestConstraints", + "properties": { + "deviceLocation": { + "description": "A client's physical location, expressed as a ISO 31166-1 alpha-2 region code.", + "type": "string" + }, + "language": { + "description": "Requests the lists for a specific language. Expects ISO 639 alpha-2 format.", + "type": "string" + }, + "maxDatabaseEntries": { + "description": "Sets the maximum number of entries that the client is willing to have in the local database for the specified list. This should be a power of 2 between 2**10 and 2**20. If zero, no database size limit is set.", + "format": "int32", + "type": "integer" + }, + "maxUpdateEntries": { + "description": "The maximum size in number of entries. The update will not contain more entries than this value. This should be a power of 2 between 2**10 and 2**20. If zero, no update size limit is set.", + "format": "int32", + "type": "integer" + }, + "region": { + "description": "Requests the list for a specific geographic location. If not set the server may pick that value based on the user's IP address. Expects ISO 3166-1 alpha-2 format.", + "type": "string" + }, + "supportedCompressions": { + "description": "The compression types supported by the client.", + "items": { + "enum": [ + "COMPRESSION_TYPE_UNSPECIFIED", + "RAW", + "RICE" + ], + "enumDescriptions": [ + "Unknown.", + "Raw, uncompressed data.", + "Rice-Golomb encoded data." + ], + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponse": { + "id": "GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponse", + "properties": { + "listUpdateResponses": { + "description": "The list updates requested by the clients. The number of responses here may be less than the number of requests sent by clients. This is the case, for example, if the server has no updates for a particular list.", + "items": { + "$ref": "GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponseListUpdateResponse" + }, + "type": "array" + }, + "minimumWaitDuration": { + "description": "The minimum duration the client must wait before issuing any update request. If this field is not set clients may update as soon as they want.", + "format": "google-duration", + "type": "string" + } + }, + "type": "object" + }, + "GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponseListUpdateResponse": { "description": "An update to an individual list.", - "id": "ListUpdateResponse", + "id": "GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponseListUpdateResponse", "properties": { "additions": { "description": "A set of entries to add to a local threat type's list. Repeated to allow for a combination of compressed and raw data to be sent in a single response.", "items": { - "$ref": "ThreatEntrySet" + "$ref": "GoogleSecuritySafebrowsingV4ThreatEntrySet" }, "type": "array" }, "checksum": { - "$ref": "Checksum", + "$ref": "GoogleSecuritySafebrowsingV4Checksum", "description": "The expected SHA256 hash of the client state; that is, of the sorted list of all hashes present in the database after applying the provided update. If the client state doesn't match the expected state, the client must disregard this update and retry later." }, "newClientState": { @@ -627,7 +536,7 @@ "removals": { "description": "A set of entries to remove from a local threat type's list. In practice, this field is empty or contains exactly one ThreatEntrySet.", "items": { - "$ref": "ThreatEntrySet" + "$ref": "GoogleSecuritySafebrowsingV4ThreatEntrySet" }, "type": "array" }, @@ -714,26 +623,100 @@ }, "type": "object" }, - "MetadataEntry": { - "description": "A single metadata entry.", - "id": "MetadataEntry", + "GoogleSecuritySafebrowsingV4FindFullHashesRequest": { + "description": "Request to return full hashes matched by the provided hash prefixes.", + "id": "GoogleSecuritySafebrowsingV4FindFullHashesRequest", "properties": { - "key": { - "description": "The metadata entry key. For JSON requests, the key is base64-encoded.", - "format": "byte", + "apiClient": { + "$ref": "GoogleSecuritySafebrowsingV4ClientInfo", + "description": "Client metadata associated with callers of higher-level APIs built on top of the client's implementation." + }, + "client": { + "$ref": "GoogleSecuritySafebrowsingV4ClientInfo", + "description": "The client metadata." + }, + "clientStates": { + "description": "The current client states for each of the client's local threat lists.", + "items": { + "format": "byte", + "type": "string" + }, + "type": "array" + }, + "threatInfo": { + "$ref": "GoogleSecuritySafebrowsingV4ThreatInfo", + "description": "The lists and hashes to be checked." + } + }, + "type": "object" + }, + "GoogleSecuritySafebrowsingV4FindFullHashesResponse": { + "id": "GoogleSecuritySafebrowsingV4FindFullHashesResponse", + "properties": { + "matches": { + "description": "The full hashes that matched the requested prefixes.", + "items": { + "$ref": "GoogleSecuritySafebrowsingV4ThreatMatch" + }, + "type": "array" + }, + "minimumWaitDuration": { + "description": "The minimum duration the client must wait before issuing any find hashes request. If this field is not set, clients can issue a request as soon as they want.", + "format": "google-duration", "type": "string" }, - "value": { - "description": "The metadata entry value. For JSON requests, the value is base64-encoded.", - "format": "byte", + "negativeCacheDuration": { + "description": "For requested entities that did not match the threat list, how long to cache the response.", + "format": "google-duration", "type": "string" } }, "type": "object" }, - "RawHashes": { + "GoogleSecuritySafebrowsingV4FindThreatMatchesRequest": { + "description": "Request to check entries against lists.", + "id": "GoogleSecuritySafebrowsingV4FindThreatMatchesRequest", + "properties": { + "client": { + "$ref": "GoogleSecuritySafebrowsingV4ClientInfo", + "description": "The client metadata." + }, + "threatInfo": { + "$ref": "GoogleSecuritySafebrowsingV4ThreatInfo", + "description": "The lists and entries to be checked for matches." + } + }, + "type": "object" + }, + "GoogleSecuritySafebrowsingV4FindThreatMatchesResponse": { + "id": "GoogleSecuritySafebrowsingV4FindThreatMatchesResponse", + "properties": { + "matches": { + "description": "The threat list matches.", + "items": { + "$ref": "GoogleSecuritySafebrowsingV4ThreatMatch" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleSecuritySafebrowsingV4ListThreatListsResponse": { + "id": "GoogleSecuritySafebrowsingV4ListThreatListsResponse", + "properties": { + "threatLists": { + "description": "The lists available for download by the client.", + "items": { + "$ref": "GoogleSecuritySafebrowsingV4ThreatListDescriptor" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleSecuritySafebrowsingV4RawHashes": { "description": "The uncompressed threat entries in hash format of a particular prefix length. Hashes can be anywhere from 4 to 32 bytes in size. A large majority are 4 bytes, but some hashes are lengthened if they collide with the hash of a popular URL. Used for sending ThreatEntrySet to clients that do not support compression, or when sending non-4-byte hashes to clients that do support compression.", - "id": "RawHashes", + "id": "GoogleSecuritySafebrowsingV4RawHashes", "properties": { "prefixSize": { "description": "The number of bytes for each prefix encoded below. This field can be anywhere from 4 (shortest prefix) to 32 (full SHA256 hash).", @@ -748,9 +731,9 @@ }, "type": "object" }, - "RawIndices": { + "GoogleSecuritySafebrowsingV4RawIndices": { "description": "A set of raw indices to remove from a local list.", - "id": "RawIndices", + "id": "GoogleSecuritySafebrowsingV4RawIndices", "properties": { "indices": { "description": "The indices to remove from a lexicographically-sorted local list.", @@ -763,9 +746,9 @@ }, "type": "object" }, - "RiceDeltaEncoding": { + "GoogleSecuritySafebrowsingV4RiceDeltaEncoding": { "description": "The Rice-Golomb encoded data. Used for sending compressed 4-byte hashes or compressed removal indices.", - "id": "RiceDeltaEncoding", + "id": "GoogleSecuritySafebrowsingV4RiceDeltaEncoding", "properties": { "encodedData": { "description": "The encoded deltas that are encoded using the Golomb-Rice coder.", @@ -790,9 +773,9 @@ }, "type": "object" }, - "ThreatEntry": { + "GoogleSecuritySafebrowsingV4ThreatEntry": { "description": "An individual threat; for example, a malicious URL or its hash representation. Only one of these fields should be set.", - "id": "ThreatEntry", + "id": "GoogleSecuritySafebrowsingV4ThreatEntry", "properties": { "digest": { "description": "The digest of an executable in SHA256 format. The API supports both binary and hex digests. For JSON requests, digests are base64-encoded.", @@ -811,23 +794,40 @@ }, "type": "object" }, - "ThreatEntryMetadata": { + "GoogleSecuritySafebrowsingV4ThreatEntryMetadata": { "description": "The metadata associated with a specific threat entry. The client is expected to know the metadata key/value pairs associated with each threat type.", - "id": "ThreatEntryMetadata", + "id": "GoogleSecuritySafebrowsingV4ThreatEntryMetadata", "properties": { "entries": { "description": "The metadata entries.", "items": { - "$ref": "MetadataEntry" + "$ref": "GoogleSecuritySafebrowsingV4ThreatEntryMetadataMetadataEntry" }, "type": "array" } }, "type": "object" }, - "ThreatEntrySet": { + "GoogleSecuritySafebrowsingV4ThreatEntryMetadataMetadataEntry": { + "description": "A single metadata entry.", + "id": "GoogleSecuritySafebrowsingV4ThreatEntryMetadataMetadataEntry", + "properties": { + "key": { + "description": "The metadata entry key. For JSON requests, the key is base64-encoded.", + "format": "byte", + "type": "string" + }, + "value": { + "description": "The metadata entry value. For JSON requests, the value is base64-encoded.", + "format": "byte", + "type": "string" + } + }, + "type": "object" + }, + "GoogleSecuritySafebrowsingV4ThreatEntrySet": { "description": "A set of threats that should be added or removed from a client's local database.", - "id": "ThreatEntrySet", + "id": "GoogleSecuritySafebrowsingV4ThreatEntrySet", "properties": { "compressionType": { "description": "The compression type for the entries in this set.", @@ -844,33 +844,33 @@ "type": "string" }, "rawHashes": { - "$ref": "RawHashes", + "$ref": "GoogleSecuritySafebrowsingV4RawHashes", "description": "The raw SHA256-formatted entries." }, "rawIndices": { - "$ref": "RawIndices", + "$ref": "GoogleSecuritySafebrowsingV4RawIndices", "description": "The raw removal indices for a local list." }, "riceHashes": { - "$ref": "RiceDeltaEncoding", + "$ref": "GoogleSecuritySafebrowsingV4RiceDeltaEncoding", "description": "The encoded 4-byte prefixes of SHA256-formatted entries, using a Golomb-Rice encoding. The hashes are converted to uint32, sorted in ascending order, then delta encoded and stored as encoded_data." }, "riceIndices": { - "$ref": "RiceDeltaEncoding", + "$ref": "GoogleSecuritySafebrowsingV4RiceDeltaEncoding", "description": "The encoded local, lexicographically-sorted list indices, using a Golomb-Rice encoding. Used for sending compressed removal indices. The removal indices (uint32) are sorted in ascending order, then delta encoded and stored as encoded_data." } }, "type": "object" }, - "ThreatHit": { - "id": "ThreatHit", + "GoogleSecuritySafebrowsingV4ThreatHit": { + "id": "GoogleSecuritySafebrowsingV4ThreatHit", "properties": { "clientInfo": { - "$ref": "ClientInfo", + "$ref": "GoogleSecuritySafebrowsingV4ClientInfo", "description": "Client-reported identification." }, "entry": { - "$ref": "ThreatEntry", + "$ref": "GoogleSecuritySafebrowsingV4ThreatEntry", "description": "The threat entry responsible for the hit. Full hash should be reported for hash-based hits." }, "platformType": { @@ -902,7 +902,7 @@ "resources": { "description": "The resources related to the threat hit.", "items": { - "$ref": "ThreatSource" + "$ref": "GoogleSecuritySafebrowsingV4ThreatHitThreatSource" }, "type": "array" }, @@ -951,15 +951,68 @@ "type": "string" }, "userInfo": { - "$ref": "UserInfo", + "$ref": "GoogleSecuritySafebrowsingV4ThreatHitUserInfo", "description": "Details about the user that encountered the threat." } }, "type": "object" }, - "ThreatInfo": { + "GoogleSecuritySafebrowsingV4ThreatHitThreatSource": { + "description": "A single resource related to a threat hit.", + "id": "GoogleSecuritySafebrowsingV4ThreatHitThreatSource", + "properties": { + "referrer": { + "description": "Referrer of the resource. Only set if the referrer is available.", + "type": "string" + }, + "remoteIp": { + "description": "The remote IP of the resource in ASCII format. Either IPv4 or IPv6.", + "type": "string" + }, + "type": { + "description": "The type of source reported.", + "enum": [ + "THREAT_SOURCE_TYPE_UNSPECIFIED", + "MATCHING_URL", + "TAB_URL", + "TAB_REDIRECT", + "TAB_RESOURCE" + ], + "enumDescriptions": [ + "Unknown.", + "The URL that matched the threat list (for which GetFullHash returned a valid hash).", + "The final top-level URL of the tab that the client was browsing when the match occurred.", + "A redirect URL that was fetched before hitting the final TAB_URL.", + "A resource loaded within the final TAB_URL." + ], + "type": "string" + }, + "url": { + "description": "The URL of the resource.", + "type": "string" + } + }, + "type": "object" + }, + "GoogleSecuritySafebrowsingV4ThreatHitUserInfo": { + "description": "Details about the user that encountered the threat.", + "id": "GoogleSecuritySafebrowsingV4ThreatHitUserInfo", + "properties": { + "regionCode": { + "description": "The UN M.49 region code associated with the user's location.", + "type": "string" + }, + "userId": { + "description": "Unique user identifier defined by the client.", + "format": "byte", + "type": "string" + } + }, + "type": "object" + }, + "GoogleSecuritySafebrowsingV4ThreatInfo": { "description": "The information regarding one or more threats that a client submits when checking for matches in threat lists.", - "id": "ThreatInfo", + "id": "GoogleSecuritySafebrowsingV4ThreatInfo", "properties": { "platformTypes": { "description": "The platform types to be checked.", @@ -993,7 +1046,7 @@ "threatEntries": { "description": "The threat entries to be checked.", "items": { - "$ref": "ThreatEntry" + "$ref": "GoogleSecuritySafebrowsingV4ThreatEntry" }, "type": "array" }, @@ -1072,9 +1125,9 @@ }, "type": "object" }, - "ThreatListDescriptor": { + "GoogleSecuritySafebrowsingV4ThreatListDescriptor": { "description": "Describes an individual threat list. A list is defined by three parameters: the type of threat posed, the type of platform targeted by the threat, and the type of entries in the list.", - "id": "ThreatListDescriptor", + "id": "GoogleSecuritySafebrowsingV4ThreatListDescriptor", "properties": { "platformType": { "description": "The platform type targeted by the list's entries.", @@ -1171,9 +1224,9 @@ }, "type": "object" }, - "ThreatMatch": { + "GoogleSecuritySafebrowsingV4ThreatMatch": { "description": "A match when checking a threat entry in the Safe Browsing threat lists.", - "id": "ThreatMatch", + "id": "GoogleSecuritySafebrowsingV4ThreatMatch", "properties": { "cacheDuration": { "description": "The cache lifetime for the returned match. Clients must not cache this response for more than this duration to avoid false positives.", @@ -1207,11 +1260,11 @@ "type": "string" }, "threat": { - "$ref": "ThreatEntry", + "$ref": "GoogleSecuritySafebrowsingV4ThreatEntry", "description": "The threat matching this threat." }, "threatEntryMetadata": { - "$ref": "ThreatEntryMetadata", + "$ref": "GoogleSecuritySafebrowsingV4ThreatEntryMetadata", "description": "Optional metadata associated with this threat." }, "threatEntryType": { @@ -1282,59 +1335,6 @@ } }, "type": "object" - }, - "ThreatSource": { - "description": "A single resource related to a threat hit.", - "id": "ThreatSource", - "properties": { - "referrer": { - "description": "Referrer of the resource. Only set if the referrer is available.", - "type": "string" - }, - "remoteIp": { - "description": "The remote IP of the resource in ASCII format. Either IPv4 or IPv6.", - "type": "string" - }, - "type": { - "description": "The type of source reported.", - "enum": [ - "THREAT_SOURCE_TYPE_UNSPECIFIED", - "MATCHING_URL", - "TAB_URL", - "TAB_REDIRECT", - "TAB_RESOURCE" - ], - "enumDescriptions": [ - "Unknown.", - "The URL that matched the threat list (for which GetFullHash returned a valid hash).", - "The final top-level URL of the tab that the client was browsing when the match occurred.", - "A redirect URL that was fetched before hitting the final TAB_URL.", - "A resource loaded within the final TAB_URL." - ], - "type": "string" - }, - "url": { - "description": "The URL of the resource.", - "type": "string" - } - }, - "type": "object" - }, - "UserInfo": { - "description": "Details about the user that encountered the threat.", - "id": "UserInfo", - "properties": { - "regionCode": { - "description": "The UN M.49 region code associated with the user's location.", - "type": "string" - }, - "userId": { - "description": "Unique user identifier defined by the client.", - "format": "byte", - "type": "string" - } - }, - "type": "object" } }, "servicePath": "", diff --git a/safebrowsing/v4/safebrowsing-gen.go b/safebrowsing/v4/safebrowsing-gen.go index 731ebb8a0ba..30c93e9f967 100644 --- a/safebrowsing/v4/safebrowsing-gen.go +++ b/safebrowsing/v4/safebrowsing-gen.go @@ -206,8 +206,20 @@ type ThreatMatchesService struct { s *Service } -// Checksum: The expected state of a client's local database. -type Checksum struct { +// GoogleProtobufEmpty: A generic empty message that you can re-use to +// avoid defining duplicated empty messages in your APIs. A typical +// example is to use it as the request or the response type of an API +// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) +// returns (google.protobuf.Empty); } +type GoogleProtobufEmpty struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} + +// GoogleSecuritySafebrowsingV4Checksum: The expected state of a +// client's local database. +type GoogleSecuritySafebrowsingV4Checksum struct { // Sha256: The SHA256 hash of the client state; that is, of the sorted // list of all hashes present in the database. Sha256 string `json:"sha256,omitempty"` @@ -229,15 +241,15 @@ type Checksum struct { NullFields []string `json:"-"` } -func (s *Checksum) MarshalJSON() ([]byte, error) { - type NoMethod Checksum +func (s *GoogleSecuritySafebrowsingV4Checksum) MarshalJSON() ([]byte, error) { + type NoMethod GoogleSecuritySafebrowsingV4Checksum raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ClientInfo: The client metadata associated with Safe Browsing API -// requests. -type ClientInfo struct { +// GoogleSecuritySafebrowsingV4ClientInfo: The client metadata +// associated with Safe Browsing API requests. +type GoogleSecuritySafebrowsingV4ClientInfo struct { // ClientId: A client ID that (hopefully) uniquely identifies the client // implementation of the Safe Browsing API. ClientId string `json:"clientId,omitempty"` @@ -262,242 +274,23 @@ type ClientInfo struct { NullFields []string `json:"-"` } -func (s *ClientInfo) MarshalJSON() ([]byte, error) { - type NoMethod ClientInfo +func (s *GoogleSecuritySafebrowsingV4ClientInfo) MarshalJSON() ([]byte, error) { + type NoMethod GoogleSecuritySafebrowsingV4ClientInfo raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// Constraints: The constraints for this update. -type Constraints struct { - // DeviceLocation: A client's physical location, expressed as a ISO - // 31166-1 alpha-2 region code. - DeviceLocation string `json:"deviceLocation,omitempty"` - - // Language: Requests the lists for a specific language. Expects ISO 639 - // alpha-2 format. - Language string `json:"language,omitempty"` - - // MaxDatabaseEntries: Sets the maximum number of entries that the - // client is willing to have in the local database for the specified - // list. This should be a power of 2 between 2**10 and 2**20. If zero, - // no database size limit is set. - MaxDatabaseEntries int64 `json:"maxDatabaseEntries,omitempty"` - - // MaxUpdateEntries: The maximum size in number of entries. The update - // will not contain more entries than this value. This should be a power - // of 2 between 2**10 and 2**20. If zero, no update size limit is set. - MaxUpdateEntries int64 `json:"maxUpdateEntries,omitempty"` - - // Region: Requests the list for a specific geographic location. If not - // set the server may pick that value based on the user's IP address. - // Expects ISO 3166-1 alpha-2 format. - Region string `json:"region,omitempty"` - - // SupportedCompressions: The compression types supported by the client. - // - // Possible values: - // "COMPRESSION_TYPE_UNSPECIFIED" - Unknown. - // "RAW" - Raw, uncompressed data. - // "RICE" - Rice-Golomb encoded data. - SupportedCompressions []string `json:"supportedCompressions,omitempty"` - - // ForceSendFields is a list of field names (e.g. "DeviceLocation") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "DeviceLocation") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. - NullFields []string `json:"-"` -} - -func (s *Constraints) MarshalJSON() ([]byte, error) { - type NoMethod Constraints - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// Empty: A generic empty message that you can re-use to avoid defining -// duplicated empty messages in your APIs. A typical example is to use -// it as the request or the response type of an API method. For -// instance: service Foo { rpc Bar(google.protobuf.Empty) returns -// (google.protobuf.Empty); } -type Empty struct { - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` -} - -// FetchThreatListUpdatesRequest: Describes a Safe Browsing API update -// request. Clients can request updates for multiple lists in a single -// request. The server may not respond to all requests, if the server -// has no updates for that list. NOTE: Field index 2 is unused. NEXT: 5 -type FetchThreatListUpdatesRequest struct { +// GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequest: Describes +// a Safe Browsing API update request. Clients can request updates for +// multiple lists in a single request. The server may not respond to all +// requests, if the server has no updates for that list. NOTE: Field +// index 2 is unused. NEXT: 5 +type GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequest struct { // Client: The client metadata. - Client *ClientInfo `json:"client,omitempty"` + Client *GoogleSecuritySafebrowsingV4ClientInfo `json:"client,omitempty"` // ListUpdateRequests: The requested threat list updates. - ListUpdateRequests []*ListUpdateRequest `json:"listUpdateRequests,omitempty"` - - // ForceSendFields is a list of field names (e.g. "Client") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Client") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *FetchThreatListUpdatesRequest) MarshalJSON() ([]byte, error) { - type NoMethod FetchThreatListUpdatesRequest - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -type FetchThreatListUpdatesResponse struct { - // ListUpdateResponses: The list updates requested by the clients. The - // number of responses here may be less than the number of requests sent - // by clients. This is the case, for example, if the server has no - // updates for a particular list. - ListUpdateResponses []*ListUpdateResponse `json:"listUpdateResponses,omitempty"` - - // MinimumWaitDuration: The minimum duration the client must wait before - // issuing any update request. If this field is not set clients may - // update as soon as they want. - MinimumWaitDuration string `json:"minimumWaitDuration,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "ListUpdateResponses") - // to unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "ListUpdateResponses") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. - NullFields []string `json:"-"` -} - -func (s *FetchThreatListUpdatesResponse) MarshalJSON() ([]byte, error) { - type NoMethod FetchThreatListUpdatesResponse - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// FindFullHashesRequest: Request to return full hashes matched by the -// provided hash prefixes. -type FindFullHashesRequest struct { - // ApiClient: Client metadata associated with callers of higher-level - // APIs built on top of the client's implementation. - ApiClient *ClientInfo `json:"apiClient,omitempty"` - - // Client: The client metadata. - Client *ClientInfo `json:"client,omitempty"` - - // ClientStates: The current client states for each of the client's - // local threat lists. - ClientStates []string `json:"clientStates,omitempty"` - - // ThreatInfo: The lists and hashes to be checked. - ThreatInfo *ThreatInfo `json:"threatInfo,omitempty"` - - // ForceSendFields is a list of field names (e.g. "ApiClient") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "ApiClient") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *FindFullHashesRequest) MarshalJSON() ([]byte, error) { - type NoMethod FindFullHashesRequest - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -type FindFullHashesResponse struct { - // Matches: The full hashes that matched the requested prefixes. - Matches []*ThreatMatch `json:"matches,omitempty"` - - // MinimumWaitDuration: The minimum duration the client must wait before - // issuing any find hashes request. If this field is not set, clients - // can issue a request as soon as they want. - MinimumWaitDuration string `json:"minimumWaitDuration,omitempty"` - - // NegativeCacheDuration: For requested entities that did not match the - // threat list, how long to cache the response. - NegativeCacheDuration string `json:"negativeCacheDuration,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "Matches") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Matches") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *FindFullHashesResponse) MarshalJSON() ([]byte, error) { - type NoMethod FindFullHashesResponse - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// FindThreatMatchesRequest: Request to check entries against lists. -type FindThreatMatchesRequest struct { - // Client: The client metadata. - Client *ClientInfo `json:"client,omitempty"` - - // ThreatInfo: The lists and entries to be checked for matches. - ThreatInfo *ThreatInfo `json:"threatInfo,omitempty"` + ListUpdateRequests []*GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequest `json:"listUpdateRequests,omitempty"` // ForceSendFields is a list of field names (e.g. "Client") to // unconditionally include in API requests. By default, fields with @@ -516,78 +309,17 @@ type FindThreatMatchesRequest struct { NullFields []string `json:"-"` } -func (s *FindThreatMatchesRequest) MarshalJSON() ([]byte, error) { - type NoMethod FindThreatMatchesRequest - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -type FindThreatMatchesResponse struct { - // Matches: The threat list matches. - Matches []*ThreatMatch `json:"matches,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "Matches") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Matches") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *FindThreatMatchesResponse) MarshalJSON() ([]byte, error) { - type NoMethod FindThreatMatchesResponse +func (s *GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -type ListThreatListsResponse struct { - // ThreatLists: The lists available for download by the client. - ThreatLists []*ThreatListDescriptor `json:"threatLists,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "ThreatLists") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "ThreatLists") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *ListThreatListsResponse) MarshalJSON() ([]byte, error) { - type NoMethod ListThreatListsResponse - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// ListUpdateRequest: A single list update request. -type ListUpdateRequest struct { +// GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateReq +// uest: A single list update request. +type GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequest struct { // Constraints: The constraints associated with this request. - Constraints *Constraints `json:"constraints,omitempty"` + Constraints *GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequestConstraints `json:"constraints,omitempty"` // PlatformType: The type of platform at risk by entries present in the // list. @@ -669,24 +401,124 @@ type ListUpdateRequest struct { NullFields []string `json:"-"` } -func (s *ListUpdateRequest) MarshalJSON() ([]byte, error) { - type NoMethod ListUpdateRequest +func (s *GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateReq +// uestConstraints: The constraints for this update. +type GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequestConstraints struct { + // DeviceLocation: A client's physical location, expressed as a ISO + // 31166-1 alpha-2 region code. + DeviceLocation string `json:"deviceLocation,omitempty"` + + // Language: Requests the lists for a specific language. Expects ISO 639 + // alpha-2 format. + Language string `json:"language,omitempty"` + + // MaxDatabaseEntries: Sets the maximum number of entries that the + // client is willing to have in the local database for the specified + // list. This should be a power of 2 between 2**10 and 2**20. If zero, + // no database size limit is set. + MaxDatabaseEntries int64 `json:"maxDatabaseEntries,omitempty"` + + // MaxUpdateEntries: The maximum size in number of entries. The update + // will not contain more entries than this value. This should be a power + // of 2 between 2**10 and 2**20. If zero, no update size limit is set. + MaxUpdateEntries int64 `json:"maxUpdateEntries,omitempty"` + + // Region: Requests the list for a specific geographic location. If not + // set the server may pick that value based on the user's IP address. + // Expects ISO 3166-1 alpha-2 format. + Region string `json:"region,omitempty"` + + // SupportedCompressions: The compression types supported by the client. + // + // Possible values: + // "COMPRESSION_TYPE_UNSPECIFIED" - Unknown. + // "RAW" - Raw, uncompressed data. + // "RICE" - Rice-Golomb encoded data. + SupportedCompressions []string `json:"supportedCompressions,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DeviceLocation") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "DeviceLocation") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequestConstraints) MarshalJSON() ([]byte, error) { + type NoMethod GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequestListUpdateRequestConstraints + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponse struct { + // ListUpdateResponses: The list updates requested by the clients. The + // number of responses here may be less than the number of requests sent + // by clients. This is the case, for example, if the server has no + // updates for a particular list. + ListUpdateResponses []*GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponseListUpdateResponse `json:"listUpdateResponses,omitempty"` + + // MinimumWaitDuration: The minimum duration the client must wait before + // issuing any update request. If this field is not set clients may + // update as soon as they want. + MinimumWaitDuration string `json:"minimumWaitDuration,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ListUpdateResponses") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ListUpdateResponses") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ListUpdateResponse: An update to an individual list. -type ListUpdateResponse struct { +// GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponseListUpdateRe +// sponse: An update to an individual list. +type GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponseListUpdateResponse struct { // Additions: A set of entries to add to a local threat type's list. // Repeated to allow for a combination of compressed and raw data to be // sent in a single response. - Additions []*ThreatEntrySet `json:"additions,omitempty"` + Additions []*GoogleSecuritySafebrowsingV4ThreatEntrySet `json:"additions,omitempty"` // Checksum: The expected SHA256 hash of the client state; that is, of // the sorted list of all hashes present in the database after applying // the provided update. If the client state doesn't match the expected // state, the client must disregard this update and retry later. - Checksum *Checksum `json:"checksum,omitempty"` + Checksum *GoogleSecuritySafebrowsingV4Checksum `json:"checksum,omitempty"` // NewClientState: The new client state, in encrypted format. Opaque to // clients. @@ -710,7 +542,7 @@ type ListUpdateResponse struct { // Removals: A set of entries to remove from a local threat type's list. // In practice, this field is empty or contains exactly one // ThreatEntrySet. - Removals []*ThreatEntrySet `json:"removals,omitempty"` + Removals []*GoogleSecuritySafebrowsingV4ThreatEntrySet `json:"removals,omitempty"` // ResponseType: The type of response. This may indicate that an action // is required by the client when the response is received. @@ -766,7 +598,119 @@ type ListUpdateResponse struct { // See https://jigsaw.google.com/. ThreatType string `json:"threatType,omitempty"` - // ForceSendFields is a list of field names (e.g. "Additions") to + // ForceSendFields is a list of field names (e.g. "Additions") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Additions") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponseListUpdateResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponseListUpdateResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleSecuritySafebrowsingV4FindFullHashesRequest: Request to return +// full hashes matched by the provided hash prefixes. +type GoogleSecuritySafebrowsingV4FindFullHashesRequest struct { + // ApiClient: Client metadata associated with callers of higher-level + // APIs built on top of the client's implementation. + ApiClient *GoogleSecuritySafebrowsingV4ClientInfo `json:"apiClient,omitempty"` + + // Client: The client metadata. + Client *GoogleSecuritySafebrowsingV4ClientInfo `json:"client,omitempty"` + + // ClientStates: The current client states for each of the client's + // local threat lists. + ClientStates []string `json:"clientStates,omitempty"` + + // ThreatInfo: The lists and hashes to be checked. + ThreatInfo *GoogleSecuritySafebrowsingV4ThreatInfo `json:"threatInfo,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ApiClient") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ApiClient") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleSecuritySafebrowsingV4FindFullHashesRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleSecuritySafebrowsingV4FindFullHashesRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type GoogleSecuritySafebrowsingV4FindFullHashesResponse struct { + // Matches: The full hashes that matched the requested prefixes. + Matches []*GoogleSecuritySafebrowsingV4ThreatMatch `json:"matches,omitempty"` + + // MinimumWaitDuration: The minimum duration the client must wait before + // issuing any find hashes request. If this field is not set, clients + // can issue a request as soon as they want. + MinimumWaitDuration string `json:"minimumWaitDuration,omitempty"` + + // NegativeCacheDuration: For requested entities that did not match the + // threat list, how long to cache the response. + NegativeCacheDuration string `json:"negativeCacheDuration,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Matches") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Matches") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleSecuritySafebrowsingV4FindFullHashesResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleSecuritySafebrowsingV4FindFullHashesResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleSecuritySafebrowsingV4FindThreatMatchesRequest: Request to +// check entries against lists. +type GoogleSecuritySafebrowsingV4FindThreatMatchesRequest struct { + // Client: The client metadata. + Client *GoogleSecuritySafebrowsingV4ClientInfo `json:"client,omitempty"` + + // ThreatInfo: The lists and entries to be checked for matches. + ThreatInfo *GoogleSecuritySafebrowsingV4ThreatInfo `json:"threatInfo,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Client") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -774,8 +718,8 @@ type ListUpdateResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Additions") to include in - // API requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "Client") to include in API + // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -783,23 +727,21 @@ type ListUpdateResponse struct { NullFields []string `json:"-"` } -func (s *ListUpdateResponse) MarshalJSON() ([]byte, error) { - type NoMethod ListUpdateResponse +func (s *GoogleSecuritySafebrowsingV4FindThreatMatchesRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleSecuritySafebrowsingV4FindThreatMatchesRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// MetadataEntry: A single metadata entry. -type MetadataEntry struct { - // Key: The metadata entry key. For JSON requests, the key is - // base64-encoded. - Key string `json:"key,omitempty"` +type GoogleSecuritySafebrowsingV4FindThreatMatchesResponse struct { + // Matches: The threat list matches. + Matches []*GoogleSecuritySafebrowsingV4ThreatMatch `json:"matches,omitempty"` - // Value: The metadata entry value. For JSON requests, the value is - // base64-encoded. - Value string `json:"value,omitempty"` + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "Key") to + // ForceSendFields is a list of field names (e.g. "Matches") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -807,8 +749,8 @@ type MetadataEntry struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Key") to include in API - // requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "Matches") to include in + // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -816,19 +758,51 @@ type MetadataEntry struct { NullFields []string `json:"-"` } -func (s *MetadataEntry) MarshalJSON() ([]byte, error) { - type NoMethod MetadataEntry +func (s *GoogleSecuritySafebrowsingV4FindThreatMatchesResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleSecuritySafebrowsingV4FindThreatMatchesResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// RawHashes: The uncompressed threat entries in hash format of a -// particular prefix length. Hashes can be anywhere from 4 to 32 bytes -// in size. A large majority are 4 bytes, but some hashes are lengthened -// if they collide with the hash of a popular URL. Used for sending -// ThreatEntrySet to clients that do not support compression, or when -// sending non-4-byte hashes to clients that do support compression. -type RawHashes struct { +type GoogleSecuritySafebrowsingV4ListThreatListsResponse struct { + // ThreatLists: The lists available for download by the client. + ThreatLists []*GoogleSecuritySafebrowsingV4ThreatListDescriptor `json:"threatLists,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ThreatLists") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ThreatLists") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleSecuritySafebrowsingV4ListThreatListsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleSecuritySafebrowsingV4ListThreatListsResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleSecuritySafebrowsingV4RawHashes: The uncompressed threat +// entries in hash format of a particular prefix length. Hashes can be +// anywhere from 4 to 32 bytes in size. A large majority are 4 bytes, +// but some hashes are lengthened if they collide with the hash of a +// popular URL. Used for sending ThreatEntrySet to clients that do not +// support compression, or when sending non-4-byte hashes to clients +// that do support compression. +type GoogleSecuritySafebrowsingV4RawHashes struct { // PrefixSize: The number of bytes for each prefix encoded below. This // field can be anywhere from 4 (shortest prefix) to 32 (full SHA256 // hash). @@ -856,14 +830,15 @@ type RawHashes struct { NullFields []string `json:"-"` } -func (s *RawHashes) MarshalJSON() ([]byte, error) { - type NoMethod RawHashes +func (s *GoogleSecuritySafebrowsingV4RawHashes) MarshalJSON() ([]byte, error) { + type NoMethod GoogleSecuritySafebrowsingV4RawHashes raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// RawIndices: A set of raw indices to remove from a local list. -type RawIndices struct { +// GoogleSecuritySafebrowsingV4RawIndices: A set of raw indices to +// remove from a local list. +type GoogleSecuritySafebrowsingV4RawIndices struct { // Indices: The indices to remove from a lexicographically-sorted local // list. Indices []int64 `json:"indices,omitempty"` @@ -885,15 +860,16 @@ type RawIndices struct { NullFields []string `json:"-"` } -func (s *RawIndices) MarshalJSON() ([]byte, error) { - type NoMethod RawIndices +func (s *GoogleSecuritySafebrowsingV4RawIndices) MarshalJSON() ([]byte, error) { + type NoMethod GoogleSecuritySafebrowsingV4RawIndices raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// RiceDeltaEncoding: The Rice-Golomb encoded data. Used for sending -// compressed 4-byte hashes or compressed removal indices. -type RiceDeltaEncoding struct { +// GoogleSecuritySafebrowsingV4RiceDeltaEncoding: The Rice-Golomb +// encoded data. Used for sending compressed 4-byte hashes or compressed +// removal indices. +type GoogleSecuritySafebrowsingV4RiceDeltaEncoding struct { // EncodedData: The encoded deltas that are encoded using the // Golomb-Rice coder. EncodedData string `json:"encodedData,omitempty"` @@ -930,15 +906,16 @@ type RiceDeltaEncoding struct { NullFields []string `json:"-"` } -func (s *RiceDeltaEncoding) MarshalJSON() ([]byte, error) { - type NoMethod RiceDeltaEncoding +func (s *GoogleSecuritySafebrowsingV4RiceDeltaEncoding) MarshalJSON() ([]byte, error) { + type NoMethod GoogleSecuritySafebrowsingV4RiceDeltaEncoding raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ThreatEntry: An individual threat; for example, a malicious URL or -// its hash representation. Only one of these fields should be set. -type ThreatEntry struct { +// GoogleSecuritySafebrowsingV4ThreatEntry: An individual threat; for +// example, a malicious URL or its hash representation. Only one of +// these fields should be set. +type GoogleSecuritySafebrowsingV4ThreatEntry struct { // Digest: The digest of an executable in SHA256 format. The API // supports both binary and hex digests. For JSON requests, digests are // base64-encoded. @@ -969,18 +946,18 @@ type ThreatEntry struct { NullFields []string `json:"-"` } -func (s *ThreatEntry) MarshalJSON() ([]byte, error) { - type NoMethod ThreatEntry +func (s *GoogleSecuritySafebrowsingV4ThreatEntry) MarshalJSON() ([]byte, error) { + type NoMethod GoogleSecuritySafebrowsingV4ThreatEntry raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ThreatEntryMetadata: The metadata associated with a specific threat -// entry. The client is expected to know the metadata key/value pairs -// associated with each threat type. -type ThreatEntryMetadata struct { +// GoogleSecuritySafebrowsingV4ThreatEntryMetadata: The metadata +// associated with a specific threat entry. The client is expected to +// know the metadata key/value pairs associated with each threat type. +type GoogleSecuritySafebrowsingV4ThreatEntryMetadata struct { // Entries: The metadata entries. - Entries []*MetadataEntry `json:"entries,omitempty"` + Entries []*GoogleSecuritySafebrowsingV4ThreatEntryMetadataMetadataEntry `json:"entries,omitempty"` // ForceSendFields is a list of field names (e.g. "Entries") to // unconditionally include in API requests. By default, fields with @@ -999,15 +976,49 @@ type ThreatEntryMetadata struct { NullFields []string `json:"-"` } -func (s *ThreatEntryMetadata) MarshalJSON() ([]byte, error) { - type NoMethod ThreatEntryMetadata +func (s *GoogleSecuritySafebrowsingV4ThreatEntryMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleSecuritySafebrowsingV4ThreatEntryMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleSecuritySafebrowsingV4ThreatEntryMetadataMetadataEntry: A +// single metadata entry. +type GoogleSecuritySafebrowsingV4ThreatEntryMetadataMetadataEntry struct { + // Key: The metadata entry key. For JSON requests, the key is + // base64-encoded. + Key string `json:"key,omitempty"` + + // Value: The metadata entry value. For JSON requests, the value is + // base64-encoded. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Key") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleSecuritySafebrowsingV4ThreatEntryMetadataMetadataEntry) MarshalJSON() ([]byte, error) { + type NoMethod GoogleSecuritySafebrowsingV4ThreatEntryMetadataMetadataEntry raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ThreatEntrySet: A set of threats that should be added or removed from -// a client's local database. -type ThreatEntrySet struct { +// GoogleSecuritySafebrowsingV4ThreatEntrySet: A set of threats that +// should be added or removed from a client's local database. +type GoogleSecuritySafebrowsingV4ThreatEntrySet struct { // CompressionType: The compression type for the entries in this set. // // Possible values: @@ -1017,22 +1028,22 @@ type ThreatEntrySet struct { CompressionType string `json:"compressionType,omitempty"` // RawHashes: The raw SHA256-formatted entries. - RawHashes *RawHashes `json:"rawHashes,omitempty"` + RawHashes *GoogleSecuritySafebrowsingV4RawHashes `json:"rawHashes,omitempty"` // RawIndices: The raw removal indices for a local list. - RawIndices *RawIndices `json:"rawIndices,omitempty"` + RawIndices *GoogleSecuritySafebrowsingV4RawIndices `json:"rawIndices,omitempty"` // RiceHashes: The encoded 4-byte prefixes of SHA256-formatted entries, // using a Golomb-Rice encoding. The hashes are converted to uint32, // sorted in ascending order, then delta encoded and stored as // encoded_data. - RiceHashes *RiceDeltaEncoding `json:"riceHashes,omitempty"` + RiceHashes *GoogleSecuritySafebrowsingV4RiceDeltaEncoding `json:"riceHashes,omitempty"` // RiceIndices: The encoded local, lexicographically-sorted list // indices, using a Golomb-Rice encoding. Used for sending compressed // removal indices. The removal indices (uint32) are sorted in ascending // order, then delta encoded and stored as encoded_data. - RiceIndices *RiceDeltaEncoding `json:"riceIndices,omitempty"` + RiceIndices *GoogleSecuritySafebrowsingV4RiceDeltaEncoding `json:"riceIndices,omitempty"` // ForceSendFields is a list of field names (e.g. "CompressionType") to // unconditionally include in API requests. By default, fields with @@ -1052,19 +1063,19 @@ type ThreatEntrySet struct { NullFields []string `json:"-"` } -func (s *ThreatEntrySet) MarshalJSON() ([]byte, error) { - type NoMethod ThreatEntrySet +func (s *GoogleSecuritySafebrowsingV4ThreatEntrySet) MarshalJSON() ([]byte, error) { + type NoMethod GoogleSecuritySafebrowsingV4ThreatEntrySet raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -type ThreatHit struct { +type GoogleSecuritySafebrowsingV4ThreatHit struct { // ClientInfo: Client-reported identification. - ClientInfo *ClientInfo `json:"clientInfo,omitempty"` + ClientInfo *GoogleSecuritySafebrowsingV4ClientInfo `json:"clientInfo,omitempty"` // Entry: The threat entry responsible for the hit. Full hash should be // reported for hash-based hits. - Entry *ThreatEntry `json:"entry,omitempty"` + Entry *GoogleSecuritySafebrowsingV4ThreatEntry `json:"entry,omitempty"` // PlatformType: The platform type reported. // @@ -1082,7 +1093,7 @@ type ThreatHit struct { PlatformType string `json:"platformType,omitempty"` // Resources: The resources related to the threat hit. - Resources []*ThreatSource `json:"resources,omitempty"` + Resources []*GoogleSecuritySafebrowsingV4ThreatHitThreatSource `json:"resources,omitempty"` // ThreatType: The threat type reported. // @@ -1115,7 +1126,7 @@ type ThreatHit struct { ThreatType string `json:"threatType,omitempty"` // UserInfo: Details about the user that encountered the threat. - UserInfo *UserInfo `json:"userInfo,omitempty"` + UserInfo *GoogleSecuritySafebrowsingV4ThreatHitUserInfo `json:"userInfo,omitempty"` // ForceSendFields is a list of field names (e.g. "ClientInfo") to // unconditionally include in API requests. By default, fields with @@ -1134,15 +1145,99 @@ type ThreatHit struct { NullFields []string `json:"-"` } -func (s *ThreatHit) MarshalJSON() ([]byte, error) { - type NoMethod ThreatHit +func (s *GoogleSecuritySafebrowsingV4ThreatHit) MarshalJSON() ([]byte, error) { + type NoMethod GoogleSecuritySafebrowsingV4ThreatHit + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleSecuritySafebrowsingV4ThreatHitThreatSource: A single resource +// related to a threat hit. +type GoogleSecuritySafebrowsingV4ThreatHitThreatSource struct { + // Referrer: Referrer of the resource. Only set if the referrer is + // available. + Referrer string `json:"referrer,omitempty"` + + // RemoteIp: The remote IP of the resource in ASCII format. Either IPv4 + // or IPv6. + RemoteIp string `json:"remoteIp,omitempty"` + + // Type: The type of source reported. + // + // Possible values: + // "THREAT_SOURCE_TYPE_UNSPECIFIED" - Unknown. + // "MATCHING_URL" - The URL that matched the threat list (for which + // GetFullHash returned a valid hash). + // "TAB_URL" - The final top-level URL of the tab that the client was + // browsing when the match occurred. + // "TAB_REDIRECT" - A redirect URL that was fetched before hitting the + // final TAB_URL. + // "TAB_RESOURCE" - A resource loaded within the final TAB_URL. + Type string `json:"type,omitempty"` + + // Url: The URL of the resource. + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Referrer") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Referrer") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleSecuritySafebrowsingV4ThreatHitThreatSource) MarshalJSON() ([]byte, error) { + type NoMethod GoogleSecuritySafebrowsingV4ThreatHitThreatSource + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleSecuritySafebrowsingV4ThreatHitUserInfo: Details about the user +// that encountered the threat. +type GoogleSecuritySafebrowsingV4ThreatHitUserInfo struct { + // RegionCode: The UN M.49 region code associated with the user's + // location. + RegionCode string `json:"regionCode,omitempty"` + + // UserId: Unique user identifier defined by the client. + UserId string `json:"userId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "RegionCode") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "RegionCode") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleSecuritySafebrowsingV4ThreatHitUserInfo) MarshalJSON() ([]byte, error) { + type NoMethod GoogleSecuritySafebrowsingV4ThreatHitUserInfo raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ThreatInfo: The information regarding one or more threats that a -// client submits when checking for matches in threat lists. -type ThreatInfo struct { +// GoogleSecuritySafebrowsingV4ThreatInfo: The information regarding one +// or more threats that a client submits when checking for matches in +// threat lists. +type GoogleSecuritySafebrowsingV4ThreatInfo struct { // PlatformTypes: The platform types to be checked. // // Possible values: @@ -1159,7 +1254,7 @@ type ThreatInfo struct { PlatformTypes []string `json:"platformTypes,omitempty"` // ThreatEntries: The threat entries to be checked. - ThreatEntries []*ThreatEntry `json:"threatEntries,omitempty"` + ThreatEntries []*GoogleSecuritySafebrowsingV4ThreatEntry `json:"threatEntries,omitempty"` // ThreatEntryTypes: The entry types to be checked. // @@ -1220,16 +1315,17 @@ type ThreatInfo struct { NullFields []string `json:"-"` } -func (s *ThreatInfo) MarshalJSON() ([]byte, error) { - type NoMethod ThreatInfo +func (s *GoogleSecuritySafebrowsingV4ThreatInfo) MarshalJSON() ([]byte, error) { + type NoMethod GoogleSecuritySafebrowsingV4ThreatInfo raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ThreatListDescriptor: Describes an individual threat list. A list is -// defined by three parameters: the type of threat posed, the type of -// platform targeted by the threat, and the type of entries in the list. -type ThreatListDescriptor struct { +// GoogleSecuritySafebrowsingV4ThreatListDescriptor: Describes an +// individual threat list. A list is defined by three parameters: the +// type of threat posed, the type of platform targeted by the threat, +// and the type of entries in the list. +type GoogleSecuritySafebrowsingV4ThreatListDescriptor struct { // PlatformType: The platform type targeted by the list's entries. // // Possible values: @@ -1304,15 +1400,15 @@ type ThreatListDescriptor struct { NullFields []string `json:"-"` } -func (s *ThreatListDescriptor) MarshalJSON() ([]byte, error) { - type NoMethod ThreatListDescriptor +func (s *GoogleSecuritySafebrowsingV4ThreatListDescriptor) MarshalJSON() ([]byte, error) { + type NoMethod GoogleSecuritySafebrowsingV4ThreatListDescriptor raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ThreatMatch: A match when checking a threat entry in the Safe -// Browsing threat lists. -type ThreatMatch struct { +// GoogleSecuritySafebrowsingV4ThreatMatch: A match when checking a +// threat entry in the Safe Browsing threat lists. +type GoogleSecuritySafebrowsingV4ThreatMatch struct { // CacheDuration: The cache lifetime for the returned match. Clients // must not cache this response for more than this duration to avoid // false positives. @@ -1334,10 +1430,10 @@ type ThreatMatch struct { PlatformType string `json:"platformType,omitempty"` // Threat: The threat matching this threat. - Threat *ThreatEntry `json:"threat,omitempty"` + Threat *GoogleSecuritySafebrowsingV4ThreatEntry `json:"threat,omitempty"` // ThreatEntryMetadata: Optional metadata associated with this threat. - ThreatEntryMetadata *ThreatEntryMetadata `json:"threatEntryMetadata,omitempty"` + ThreatEntryMetadata *GoogleSecuritySafebrowsingV4ThreatEntryMetadata `json:"threatEntryMetadata,omitempty"` // ThreatEntryType: The threat entry type matching this threat. // @@ -1398,89 +1494,8 @@ type ThreatMatch struct { NullFields []string `json:"-"` } -func (s *ThreatMatch) MarshalJSON() ([]byte, error) { - type NoMethod ThreatMatch - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// ThreatSource: A single resource related to a threat hit. -type ThreatSource struct { - // Referrer: Referrer of the resource. Only set if the referrer is - // available. - Referrer string `json:"referrer,omitempty"` - - // RemoteIp: The remote IP of the resource in ASCII format. Either IPv4 - // or IPv6. - RemoteIp string `json:"remoteIp,omitempty"` - - // Type: The type of source reported. - // - // Possible values: - // "THREAT_SOURCE_TYPE_UNSPECIFIED" - Unknown. - // "MATCHING_URL" - The URL that matched the threat list (for which - // GetFullHash returned a valid hash). - // "TAB_URL" - The final top-level URL of the tab that the client was - // browsing when the match occurred. - // "TAB_REDIRECT" - A redirect URL that was fetched before hitting the - // final TAB_URL. - // "TAB_RESOURCE" - A resource loaded within the final TAB_URL. - Type string `json:"type,omitempty"` - - // Url: The URL of the resource. - Url string `json:"url,omitempty"` - - // ForceSendFields is a list of field names (e.g. "Referrer") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Referrer") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *ThreatSource) MarshalJSON() ([]byte, error) { - type NoMethod ThreatSource - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// UserInfo: Details about the user that encountered the threat. -type UserInfo struct { - // RegionCode: The UN M.49 region code associated with the user's - // location. - RegionCode string `json:"regionCode,omitempty"` - - // UserId: Unique user identifier defined by the client. - UserId string `json:"userId,omitempty"` - - // ForceSendFields is a list of field names (e.g. "RegionCode") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "RegionCode") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *UserInfo) MarshalJSON() ([]byte, error) { - type NoMethod UserInfo +func (s *GoogleSecuritySafebrowsingV4ThreatMatch) MarshalJSON() ([]byte, error) { + type NoMethod GoogleSecuritySafebrowsingV4ThreatMatch raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } @@ -1582,13 +1597,15 @@ func (c *EncodedFullHashesGetCall) doRequest(alt string) (*http.Response, error) } // Do executes the "safebrowsing.encodedFullHashes.get" call. -// Exactly one of *FindFullHashesResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *FindFullHashesResponse.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 *EncodedFullHashesGetCall) Do(opts ...googleapi.CallOption) (*FindFullHashesResponse, error) { +// Exactly one of *GoogleSecuritySafebrowsingV4FindFullHashesResponse or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleSecuritySafebrowsingV4FindFullHashesResponse.ServerResponse.Hea +// der 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 *EncodedFullHashesGetCall) Do(opts ...googleapi.CallOption) (*GoogleSecuritySafebrowsingV4FindFullHashesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -1607,7 +1624,7 @@ func (c *EncodedFullHashesGetCall) Do(opts ...googleapi.CallOption) (*FindFullHa if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &FindFullHashesResponse{ + ret := &GoogleSecuritySafebrowsingV4FindFullHashesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -1647,7 +1664,7 @@ func (c *EncodedFullHashesGetCall) Do(opts ...googleapi.CallOption) (*FindFullHa // }, // "path": "v4/encodedFullHashes/{encodedRequest}", // "response": { - // "$ref": "FindFullHashesResponse" + // "$ref": "GoogleSecuritySafebrowsingV4FindFullHashesResponse" // } // } @@ -1750,13 +1767,16 @@ func (c *EncodedUpdatesGetCall) doRequest(alt string) (*http.Response, error) { } // Do executes the "safebrowsing.encodedUpdates.get" call. -// Exactly one of *FetchThreatListUpdatesResponse or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *FetchThreatListUpdatesResponse.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 *EncodedUpdatesGetCall) Do(opts ...googleapi.CallOption) (*FetchThreatListUpdatesResponse, error) { +// Exactly one of +// *GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponse or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponse.ServerResp +// onse.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 *EncodedUpdatesGetCall) Do(opts ...googleapi.CallOption) (*GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -1775,7 +1795,7 @@ func (c *EncodedUpdatesGetCall) Do(opts ...googleapi.CallOption) (*FetchThreatLi if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &FetchThreatListUpdatesResponse{ + ret := &GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -1815,7 +1835,7 @@ func (c *EncodedUpdatesGetCall) Do(opts ...googleapi.CallOption) (*FetchThreatLi // }, // "path": "v4/encodedUpdates/{encodedRequest}", // "response": { - // "$ref": "FetchThreatListUpdatesResponse" + // "$ref": "GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponse" // } // } @@ -1824,17 +1844,17 @@ func (c *EncodedUpdatesGetCall) Do(opts ...googleapi.CallOption) (*FetchThreatLi // method id "safebrowsing.fullHashes.find": type FullHashesFindCall struct { - s *Service - findfullhashesrequest *FindFullHashesRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header + s *Service + googlesecuritysafebrowsingv4findfullhashesrequest *GoogleSecuritySafebrowsingV4FindFullHashesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } // Find: Finds the full hashes that match the requested hash prefixes. -func (r *FullHashesService) Find(findfullhashesrequest *FindFullHashesRequest) *FullHashesFindCall { +func (r *FullHashesService) Find(googlesecuritysafebrowsingv4findfullhashesrequest *GoogleSecuritySafebrowsingV4FindFullHashesRequest) *FullHashesFindCall { c := &FullHashesFindCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.findfullhashesrequest = findfullhashesrequest + c.googlesecuritysafebrowsingv4findfullhashesrequest = googlesecuritysafebrowsingv4findfullhashesrequest return c } @@ -1871,7 +1891,7 @@ func (c *FullHashesFindCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.findfullhashesrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlesecuritysafebrowsingv4findfullhashesrequest) if err != nil { return nil, err } @@ -1889,13 +1909,15 @@ func (c *FullHashesFindCall) doRequest(alt string) (*http.Response, error) { } // Do executes the "safebrowsing.fullHashes.find" call. -// Exactly one of *FindFullHashesResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *FindFullHashesResponse.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 *FullHashesFindCall) Do(opts ...googleapi.CallOption) (*FindFullHashesResponse, error) { +// Exactly one of *GoogleSecuritySafebrowsingV4FindFullHashesResponse or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleSecuritySafebrowsingV4FindFullHashesResponse.ServerResponse.Hea +// der 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 *FullHashesFindCall) Do(opts ...googleapi.CallOption) (*GoogleSecuritySafebrowsingV4FindFullHashesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -1914,7 +1936,7 @@ func (c *FullHashesFindCall) Do(opts ...googleapi.CallOption) (*FindFullHashesRe if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &FindFullHashesResponse{ + ret := &GoogleSecuritySafebrowsingV4FindFullHashesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -1934,10 +1956,10 @@ func (c *FullHashesFindCall) Do(opts ...googleapi.CallOption) (*FindFullHashesRe // "parameters": {}, // "path": "v4/fullHashes:find", // "request": { - // "$ref": "FindFullHashesRequest" + // "$ref": "GoogleSecuritySafebrowsingV4FindFullHashesRequest" // }, // "response": { - // "$ref": "FindFullHashesResponse" + // "$ref": "GoogleSecuritySafebrowsingV4FindFullHashesResponse" // } // } @@ -1946,18 +1968,18 @@ func (c *FullHashesFindCall) Do(opts ...googleapi.CallOption) (*FindFullHashesRe // method id "safebrowsing.threatHits.create": type ThreatHitsCreateCall struct { - s *Service - threathit *ThreatHit - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header + s *Service + googlesecuritysafebrowsingv4threathit *GoogleSecuritySafebrowsingV4ThreatHit + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } // Create: Reports a Safe Browsing threat list hit to Google. Only // projects with TRUSTED_REPORTER visibility can use this method. -func (r *ThreatHitsService) Create(threathit *ThreatHit) *ThreatHitsCreateCall { +func (r *ThreatHitsService) Create(googlesecuritysafebrowsingv4threathit *GoogleSecuritySafebrowsingV4ThreatHit) *ThreatHitsCreateCall { c := &ThreatHitsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.threathit = threathit + c.googlesecuritysafebrowsingv4threathit = googlesecuritysafebrowsingv4threathit return c } @@ -1994,7 +2016,7 @@ func (c *ThreatHitsCreateCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.threathit) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlesecuritysafebrowsingv4threathit) if err != nil { return nil, err } @@ -2012,13 +2034,13 @@ func (c *ThreatHitsCreateCall) doRequest(alt string) (*http.Response, error) { } // Do executes the "safebrowsing.threatHits.create" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.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 *ThreatHitsCreateCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GoogleProtobufEmpty.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 *ThreatHitsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -2037,7 +2059,7 @@ func (c *ThreatHitsCreateCall) Do(opts ...googleapi.CallOption) (*Empty, error) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &GoogleProtobufEmpty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -2057,10 +2079,10 @@ func (c *ThreatHitsCreateCall) Do(opts ...googleapi.CallOption) (*Empty, error) // "parameters": {}, // "path": "v4/threatHits", // "request": { - // "$ref": "ThreatHit" + // "$ref": "GoogleSecuritySafebrowsingV4ThreatHit" // }, // "response": { - // "$ref": "Empty" + // "$ref": "GoogleProtobufEmpty" // } // } @@ -2069,18 +2091,18 @@ func (c *ThreatHitsCreateCall) Do(opts ...googleapi.CallOption) (*Empty, error) // method id "safebrowsing.threatListUpdates.fetch": type ThreatListUpdatesFetchCall struct { - s *Service - fetchthreatlistupdatesrequest *FetchThreatListUpdatesRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header + s *Service + googlesecuritysafebrowsingv4fetchthreatlistupdatesrequest *GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } // Fetch: Fetches the most recent threat list updates. A client can // request updates for multiple lists at once. -func (r *ThreatListUpdatesService) Fetch(fetchthreatlistupdatesrequest *FetchThreatListUpdatesRequest) *ThreatListUpdatesFetchCall { +func (r *ThreatListUpdatesService) Fetch(googlesecuritysafebrowsingv4fetchthreatlistupdatesrequest *GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequest) *ThreatListUpdatesFetchCall { c := &ThreatListUpdatesFetchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.fetchthreatlistupdatesrequest = fetchthreatlistupdatesrequest + c.googlesecuritysafebrowsingv4fetchthreatlistupdatesrequest = googlesecuritysafebrowsingv4fetchthreatlistupdatesrequest return c } @@ -2117,7 +2139,7 @@ func (c *ThreatListUpdatesFetchCall) doRequest(alt string) (*http.Response, erro } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.fetchthreatlistupdatesrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlesecuritysafebrowsingv4fetchthreatlistupdatesrequest) if err != nil { return nil, err } @@ -2135,13 +2157,16 @@ func (c *ThreatListUpdatesFetchCall) doRequest(alt string) (*http.Response, erro } // Do executes the "safebrowsing.threatListUpdates.fetch" call. -// Exactly one of *FetchThreatListUpdatesResponse or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *FetchThreatListUpdatesResponse.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 *ThreatListUpdatesFetchCall) Do(opts ...googleapi.CallOption) (*FetchThreatListUpdatesResponse, error) { +// Exactly one of +// *GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponse or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponse.ServerResp +// onse.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 *ThreatListUpdatesFetchCall) Do(opts ...googleapi.CallOption) (*GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -2160,7 +2185,7 @@ func (c *ThreatListUpdatesFetchCall) Do(opts ...googleapi.CallOption) (*FetchThr if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &FetchThreatListUpdatesResponse{ + ret := &GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -2180,10 +2205,10 @@ func (c *ThreatListUpdatesFetchCall) Do(opts ...googleapi.CallOption) (*FetchThr // "parameters": {}, // "path": "v4/threatListUpdates:fetch", // "request": { - // "$ref": "FetchThreatListUpdatesRequest" + // "$ref": "GoogleSecuritySafebrowsingV4FetchThreatListUpdatesRequest" // }, // "response": { - // "$ref": "FetchThreatListUpdatesResponse" + // "$ref": "GoogleSecuritySafebrowsingV4FetchThreatListUpdatesResponse" // } // } @@ -2264,13 +2289,15 @@ func (c *ThreatListsListCall) doRequest(alt string) (*http.Response, error) { } // Do executes the "safebrowsing.threatLists.list" call. -// Exactly one of *ListThreatListsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListThreatListsResponse.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 *ThreatListsListCall) Do(opts ...googleapi.CallOption) (*ListThreatListsResponse, error) { +// Exactly one of *GoogleSecuritySafebrowsingV4ListThreatListsResponse +// or error will be non-nil. Any non-2xx status code is an error. +// Response headers are in either +// *GoogleSecuritySafebrowsingV4ListThreatListsResponse.ServerResponse.He +// ader 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 *ThreatListsListCall) Do(opts ...googleapi.CallOption) (*GoogleSecuritySafebrowsingV4ListThreatListsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -2289,7 +2316,7 @@ func (c *ThreatListsListCall) Do(opts ...googleapi.CallOption) (*ListThreatLists if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListThreatListsResponse{ + ret := &GoogleSecuritySafebrowsingV4ListThreatListsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -2309,7 +2336,7 @@ func (c *ThreatListsListCall) Do(opts ...googleapi.CallOption) (*ListThreatLists // "parameters": {}, // "path": "v4/threatLists", // "response": { - // "$ref": "ListThreatListsResponse" + // "$ref": "GoogleSecuritySafebrowsingV4ListThreatListsResponse" // } // } @@ -2318,17 +2345,17 @@ func (c *ThreatListsListCall) Do(opts ...googleapi.CallOption) (*ListThreatLists // method id "safebrowsing.threatMatches.find": type ThreatMatchesFindCall struct { - s *Service - findthreatmatchesrequest *FindThreatMatchesRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header + s *Service + googlesecuritysafebrowsingv4findthreatmatchesrequest *GoogleSecuritySafebrowsingV4FindThreatMatchesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } // Find: Finds the threat entries that match the Safe Browsing lists. -func (r *ThreatMatchesService) Find(findthreatmatchesrequest *FindThreatMatchesRequest) *ThreatMatchesFindCall { +func (r *ThreatMatchesService) Find(googlesecuritysafebrowsingv4findthreatmatchesrequest *GoogleSecuritySafebrowsingV4FindThreatMatchesRequest) *ThreatMatchesFindCall { c := &ThreatMatchesFindCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.findthreatmatchesrequest = findthreatmatchesrequest + c.googlesecuritysafebrowsingv4findthreatmatchesrequest = googlesecuritysafebrowsingv4findthreatmatchesrequest return c } @@ -2365,7 +2392,7 @@ func (c *ThreatMatchesFindCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.findthreatmatchesrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlesecuritysafebrowsingv4findthreatmatchesrequest) if err != nil { return nil, err } @@ -2383,13 +2410,15 @@ func (c *ThreatMatchesFindCall) doRequest(alt string) (*http.Response, error) { } // Do executes the "safebrowsing.threatMatches.find" call. -// Exactly one of *FindThreatMatchesResponse or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *FindThreatMatchesResponse.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 *ThreatMatchesFindCall) Do(opts ...googleapi.CallOption) (*FindThreatMatchesResponse, error) { +// Exactly one of *GoogleSecuritySafebrowsingV4FindThreatMatchesResponse +// or error will be non-nil. Any non-2xx status code is an error. +// Response headers are in either +// *GoogleSecuritySafebrowsingV4FindThreatMatchesResponse.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 *ThreatMatchesFindCall) Do(opts ...googleapi.CallOption) (*GoogleSecuritySafebrowsingV4FindThreatMatchesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -2408,7 +2437,7 @@ func (c *ThreatMatchesFindCall) Do(opts ...googleapi.CallOption) (*FindThreatMat if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &FindThreatMatchesResponse{ + ret := &GoogleSecuritySafebrowsingV4FindThreatMatchesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -2428,10 +2457,10 @@ func (c *ThreatMatchesFindCall) Do(opts ...googleapi.CallOption) (*FindThreatMat // "parameters": {}, // "path": "v4/threatMatches:find", // "request": { - // "$ref": "FindThreatMatchesRequest" + // "$ref": "GoogleSecuritySafebrowsingV4FindThreatMatchesRequest" // }, // "response": { - // "$ref": "FindThreatMatchesResponse" + // "$ref": "GoogleSecuritySafebrowsingV4FindThreatMatchesResponse" // } // } diff --git a/sasportal/v1alpha1/sasportal-api.json b/sasportal/v1alpha1/sasportal-api.json index efa362b82d9..d7456126bc0 100644 --- a/sasportal/v1alpha1/sasportal-api.json +++ b/sasportal/v1alpha1/sasportal-api.json @@ -191,6 +191,24 @@ "scopes": [ "https://www.googleapis.com/auth/sasportal" ] + }, + "provisionDeployment": { + "description": "Creates a new SAS deployment through the GCP workflow. Creates a SAS organization if an organization match is not found.", + "flatPath": "v1alpha1/customers:provisionDeployment", + "httpMethod": "POST", + "id": "sasportal.customers.provisionDeployment", + "parameterOrder": [], + "parameters": {}, + "path": "v1alpha1/customers:provisionDeployment", + "request": { + "$ref": "SasPortalProvisionDeploymentRequest" + }, + "response": { + "$ref": "SasPortalProvisionDeploymentResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/sasportal" + ] } }, "resources": { @@ -2483,7 +2501,7 @@ } } }, - "revision": "20230105", + "revision": "20230219", "rootUrl": "https://sasportal.googleapis.com/", "schemas": { "SasPortalAssignment": { @@ -3292,6 +3310,23 @@ }, "type": "object" }, + "SasPortalProvisionDeploymentRequest": { + "description": "Request for [ProvisionDeployment]. [spectrum.sas.portal.v1alpha1.Provisioning.ProvisionDeployment]. No input is needed, because GCP Project, Organization Info, and caller’s GAIA ID should be retrieved from the RPC handler, and used as inputs to create a new SAS organization (if not exists) and a new SAS deployment.", + "id": "SasPortalProvisionDeploymentRequest", + "properties": {}, + "type": "object" + }, + "SasPortalProvisionDeploymentResponse": { + "description": "Response for [ProvisionDeployment]. [spectrum.sas.portal.v1alpha1.Provisioning.ProvisionDeployment].", + "id": "SasPortalProvisionDeploymentResponse", + "properties": { + "errorMessage": { + "description": "Optional. Optional error message if the provisioning request is not successful.", + "type": "string" + } + }, + "type": "object" + }, "SasPortalSetPolicyRequest": { "description": "Request message for `SetPolicy` method.", "id": "SasPortalSetPolicyRequest", diff --git a/sasportal/v1alpha1/sasportal-gen.go b/sasportal/v1alpha1/sasportal-gen.go index d052599ff2e..711455d6eb1 100644 --- a/sasportal/v1alpha1/sasportal-gen.go +++ b/sasportal/v1alpha1/sasportal-gen.go @@ -1683,6 +1683,51 @@ func (s *SasPortalPolicy) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// SasPortalProvisionDeploymentRequest: Request for +// [ProvisionDeployment]. +// [spectrum.sas.portal.v1alpha1.Provisioning.ProvisionDeployment]. No +// input is needed, because GCP Project, Organization Info, and +// caller’s GAIA ID should be retrieved from the RPC handler, and used +// as inputs to create a new SAS organization (if not exists) and a new +// SAS deployment. +type SasPortalProvisionDeploymentRequest struct { +} + +// SasPortalProvisionDeploymentResponse: Response for +// [ProvisionDeployment]. +// [spectrum.sas.portal.v1alpha1.Provisioning.ProvisionDeployment]. +type SasPortalProvisionDeploymentResponse struct { + // ErrorMessage: Optional. Optional error message if the provisioning + // request is not successful. + ErrorMessage string `json:"errorMessage,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ErrorMessage") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ErrorMessage") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *SasPortalProvisionDeploymentResponse) MarshalJSON() ([]byte, error) { + type NoMethod SasPortalProvisionDeploymentResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // SasPortalSetPolicyRequest: Request message for `SetPolicy` method. type SasPortalSetPolicyRequest struct { // DisableNotification: Optional. Set the field as `true` to disable the @@ -2414,6 +2459,134 @@ func (c *CustomersPatchCall) Do(opts ...googleapi.CallOption) (*SasPortalCustome } +// method id "sasportal.customers.provisionDeployment": + +type CustomersProvisionDeploymentCall struct { + s *Service + sasportalprovisiondeploymentrequest *SasPortalProvisionDeploymentRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// ProvisionDeployment: Creates a new SAS deployment through the GCP +// workflow. Creates a SAS organization if an organization match is not +// found. +func (r *CustomersService) ProvisionDeployment(sasportalprovisiondeploymentrequest *SasPortalProvisionDeploymentRequest) *CustomersProvisionDeploymentCall { + c := &CustomersProvisionDeploymentCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.sasportalprovisiondeploymentrequest = sasportalprovisiondeploymentrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CustomersProvisionDeploymentCall) Fields(s ...googleapi.Field) *CustomersProvisionDeploymentCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *CustomersProvisionDeploymentCall) Context(ctx context.Context) *CustomersProvisionDeploymentCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *CustomersProvisionDeploymentCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *CustomersProvisionDeploymentCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalprovisiondeploymentrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/customers:provisionDeployment") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "sasportal.customers.provisionDeployment" call. +// Exactly one of *SasPortalProvisionDeploymentResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *SasPortalProvisionDeploymentResponse.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 *CustomersProvisionDeploymentCall) Do(opts ...googleapi.CallOption) (*SasPortalProvisionDeploymentResponse, 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 := &SasPortalProvisionDeploymentResponse{ + 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 + // { + // "description": "Creates a new SAS deployment through the GCP workflow. Creates a SAS organization if an organization match is not found.", + // "flatPath": "v1alpha1/customers:provisionDeployment", + // "httpMethod": "POST", + // "id": "sasportal.customers.provisionDeployment", + // "parameterOrder": [], + // "parameters": {}, + // "path": "v1alpha1/customers:provisionDeployment", + // "request": { + // "$ref": "SasPortalProvisionDeploymentRequest" + // }, + // "response": { + // "$ref": "SasPortalProvisionDeploymentResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/sasportal" + // ] + // } + +} + // method id "sasportal.customers.deployments.create": type CustomersDeploymentsCreateCall struct { diff --git a/servicedirectory/v1/servicedirectory-api.json b/servicedirectory/v1/servicedirectory-api.json index bf578e0504e..7455eb0ee78 100644 --- a/servicedirectory/v1/servicedirectory-api.json +++ b/servicedirectory/v1/servicedirectory-api.json @@ -883,7 +883,7 @@ } } }, - "revision": "20220930", + "revision": "20230209", "rootUrl": "https://servicedirectory.googleapis.com/", "schemas": { "Binding": { @@ -895,7 +895,7 @@ "description": "The condition that is associated with this binding. If the condition evaluates to `true`, then this binding applies to the current request. If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the principals in this binding. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies)." }, "members": { - "description": "Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. ", + "description": "Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding.", "items": { "type": "string" }, diff --git a/servicedirectory/v1/servicedirectory-gen.go b/servicedirectory/v1/servicedirectory-gen.go index 68d877310b9..9b1dc543e6c 100644 --- a/servicedirectory/v1/servicedirectory-gen.go +++ b/servicedirectory/v1/servicedirectory-gen.go @@ -223,7 +223,9 @@ type Binding struct { // (https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). // For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. // * `group:{emailid}`: An email address that represents a Google group. - // For example, `admins@example.com`. * + // For example, `admins@example.com`. * `domain:{domain}`: The G Suite + // domain (primary) that represents all the users of that domain. For + // example, `google.com` or `example.com`. * // `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus // unique identifier) representing a user that has been recently // deleted. For example, `alice@example.com?uid=123456789012345678901`. @@ -240,9 +242,7 @@ type Binding struct { // that has been recently deleted. For example, // `admins@example.com?uid=123456789012345678901`. If the group is // recovered, this value reverts to `group:{emailid}` and the recovered - // group retains the role in the binding. * `domain:{domain}`: The G - // Suite domain (primary) that represents all the users of that domain. - // For example, `google.com` or `example.com`. + // group retains the role in the binding. Members []string `json:"members,omitempty"` // Role: Role that is assigned to the list of `members`, or principals. diff --git a/servicedirectory/v1beta1/servicedirectory-api.json b/servicedirectory/v1beta1/servicedirectory-api.json index 4fb4c97176e..841856cf2db 100644 --- a/servicedirectory/v1beta1/servicedirectory-api.json +++ b/servicedirectory/v1beta1/servicedirectory-api.json @@ -963,6 +963,94 @@ } } } + }, + "workloads": { + "methods": { + "getIamPolicy": { + "description": "Gets the IAM Policy for a resource", + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/namespaces/{namespacesId}/workloads/{workloadsId}:getIamPolicy", + "httpMethod": "POST", + "id": "servicedirectory.projects.locations.namespaces.workloads.getIamPolicy", + "parameterOrder": [ + "resource" + ], + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/workloads/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta1/{+resource}:getIamPolicy", + "request": { + "$ref": "GetIamPolicyRequest" + }, + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "setIamPolicy": { + "description": "Sets the IAM Policy for a resource", + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/namespaces/{namespacesId}/workloads/{workloadsId}:setIamPolicy", + "httpMethod": "POST", + "id": "servicedirectory.projects.locations.namespaces.workloads.setIamPolicy", + "parameterOrder": [ + "resource" + ], + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/workloads/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta1/{+resource}:setIamPolicy", + "request": { + "$ref": "SetIamPolicyRequest" + }, + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "testIamPermissions": { + "description": "Tests IAM permissions for a resource (namespace, service or service workload only).", + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/namespaces/{namespacesId}/workloads/{workloadsId}:testIamPermissions", + "httpMethod": "POST", + "id": "servicedirectory.projects.locations.namespaces.workloads.testIamPermissions", + "parameterOrder": [ + "resource" + ], + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/workloads/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta1/{+resource}:testIamPermissions", + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } } } }, @@ -1059,7 +1147,7 @@ } } }, - "revision": "20220824", + "revision": "20230209", "rootUrl": "https://servicedirectory.googleapis.com/", "schemas": { "Binding": { @@ -1071,7 +1159,7 @@ "description": "The condition that is associated with this binding. If the condition evaluates to `true`, then this binding applies to the current request. If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the principals in this binding. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies)." }, "members": { - "description": "Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. ", + "description": "Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding.", "items": { "type": "string" }, diff --git a/servicedirectory/v1beta1/servicedirectory-gen.go b/servicedirectory/v1beta1/servicedirectory-gen.go index 8bc96d84191..f893234a010 100644 --- a/servicedirectory/v1beta1/servicedirectory-gen.go +++ b/servicedirectory/v1beta1/servicedirectory-gen.go @@ -168,6 +168,7 @@ func NewProjectsLocationsNamespacesService(s *APIService) *ProjectsLocationsName rs := &ProjectsLocationsNamespacesService{s: s} rs.ServiceWorkloads = NewProjectsLocationsNamespacesServiceWorkloadsService(s) rs.Services = NewProjectsLocationsNamespacesServicesService(s) + rs.Workloads = NewProjectsLocationsNamespacesWorkloadsService(s) return rs } @@ -177,6 +178,8 @@ type ProjectsLocationsNamespacesService struct { ServiceWorkloads *ProjectsLocationsNamespacesServiceWorkloadsService Services *ProjectsLocationsNamespacesServicesService + + Workloads *ProjectsLocationsNamespacesWorkloadsService } func NewProjectsLocationsNamespacesServiceWorkloadsService(s *APIService) *ProjectsLocationsNamespacesServiceWorkloadsService { @@ -209,6 +212,15 @@ type ProjectsLocationsNamespacesServicesEndpointsService struct { s *APIService } +func NewProjectsLocationsNamespacesWorkloadsService(s *APIService) *ProjectsLocationsNamespacesWorkloadsService { + rs := &ProjectsLocationsNamespacesWorkloadsService{s: s} + return rs +} + +type ProjectsLocationsNamespacesWorkloadsService struct { + s *APIService +} + func NewProjectsLocationsRegistrationPoliciesService(s *APIService) *ProjectsLocationsRegistrationPoliciesService { rs := &ProjectsLocationsRegistrationPoliciesService{s: s} return rs @@ -247,7 +259,9 @@ type Binding struct { // (https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). // For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. // * `group:{emailid}`: An email address that represents a Google group. - // For example, `admins@example.com`. * + // For example, `admins@example.com`. * `domain:{domain}`: The G Suite + // domain (primary) that represents all the users of that domain. For + // example, `google.com` or `example.com`. * // `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus // unique identifier) representing a user that has been recently // deleted. For example, `alice@example.com?uid=123456789012345678901`. @@ -264,9 +278,7 @@ type Binding struct { // that has been recently deleted. For example, // `admins@example.com?uid=123456789012345678901`. If the group is // recovered, this value reverts to `group:{emailid}` and the recovered - // group retains the role in the binding. * `domain:{domain}`: The G - // Suite domain (primary) that represents all the users of that domain. - // For example, `google.com` or `example.com`. + // group retains the role in the binding. Members []string `json:"members,omitempty"` // Role: Role that is assigned to the list of `members`, or principals. @@ -5434,6 +5446,442 @@ func (c *ProjectsLocationsNamespacesServicesEndpointsPatchCall) Do(opts ...googl } +// method id "servicedirectory.projects.locations.namespaces.workloads.getIamPolicy": + +type ProjectsLocationsNamespacesWorkloadsGetIamPolicyCall struct { + s *APIService + resource string + getiampolicyrequest *GetIamPolicyRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// GetIamPolicy: Gets the IAM Policy for a resource +// +// - resource: REQUIRED: The resource for which the policy is being +// requested. See Resource names +// (https://cloud.google.com/apis/design/resource_names) for the +// appropriate value for this field. +func (r *ProjectsLocationsNamespacesWorkloadsService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ProjectsLocationsNamespacesWorkloadsGetIamPolicyCall { + c := &ProjectsLocationsNamespacesWorkloadsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.resource = resource + c.getiampolicyrequest = getiampolicyrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsNamespacesWorkloadsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsNamespacesWorkloadsGetIamPolicyCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsNamespacesWorkloadsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsNamespacesWorkloadsGetIamPolicyCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsNamespacesWorkloadsGetIamPolicyCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNamespacesWorkloadsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "resource": c.resource, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "servicedirectory.projects.locations.namespaces.workloads.getIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Policy.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 *ProjectsLocationsNamespacesWorkloadsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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 := &Policy{ + 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 + // { + // "description": "Gets the IAM Policy for a resource", + // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/namespaces/{namespacesId}/workloads/{workloadsId}:getIamPolicy", + // "httpMethod": "POST", + // "id": "servicedirectory.projects.locations.namespaces.workloads.getIamPolicy", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/workloads/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta1/{+resource}:getIamPolicy", + // "request": { + // "$ref": "GetIamPolicyRequest" + // }, + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "servicedirectory.projects.locations.namespaces.workloads.setIamPolicy": + +type ProjectsLocationsNamespacesWorkloadsSetIamPolicyCall struct { + s *APIService + resource string + setiampolicyrequest *SetIamPolicyRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// SetIamPolicy: Sets the IAM Policy for a resource +// +// - resource: REQUIRED: The resource for which the policy is being +// specified. See Resource names +// (https://cloud.google.com/apis/design/resource_names) for the +// appropriate value for this field. +func (r *ProjectsLocationsNamespacesWorkloadsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsNamespacesWorkloadsSetIamPolicyCall { + c := &ProjectsLocationsNamespacesWorkloadsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.resource = resource + c.setiampolicyrequest = setiampolicyrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsNamespacesWorkloadsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsNamespacesWorkloadsSetIamPolicyCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsNamespacesWorkloadsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsNamespacesWorkloadsSetIamPolicyCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsNamespacesWorkloadsSetIamPolicyCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNamespacesWorkloadsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:setIamPolicy") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "resource": c.resource, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "servicedirectory.projects.locations.namespaces.workloads.setIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Policy.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 *ProjectsLocationsNamespacesWorkloadsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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 := &Policy{ + 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 + // { + // "description": "Sets the IAM Policy for a resource", + // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/namespaces/{namespacesId}/workloads/{workloadsId}:setIamPolicy", + // "httpMethod": "POST", + // "id": "servicedirectory.projects.locations.namespaces.workloads.setIamPolicy", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/workloads/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta1/{+resource}:setIamPolicy", + // "request": { + // "$ref": "SetIamPolicyRequest" + // }, + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "servicedirectory.projects.locations.namespaces.workloads.testIamPermissions": + +type ProjectsLocationsNamespacesWorkloadsTestIamPermissionsCall struct { + s *APIService + resource string + testiampermissionsrequest *TestIamPermissionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// TestIamPermissions: Tests IAM permissions for a resource (namespace, +// service or service workload only). +// +// - resource: REQUIRED: The resource for which the policy detail is +// being requested. See Resource names +// (https://cloud.google.com/apis/design/resource_names) for the +// appropriate value for this field. +func (r *ProjectsLocationsNamespacesWorkloadsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsNamespacesWorkloadsTestIamPermissionsCall { + c := &ProjectsLocationsNamespacesWorkloadsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.resource = resource + c.testiampermissionsrequest = testiampermissionsrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsNamespacesWorkloadsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsNamespacesWorkloadsTestIamPermissionsCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsNamespacesWorkloadsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsNamespacesWorkloadsTestIamPermissionsCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsNamespacesWorkloadsTestIamPermissionsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNamespacesWorkloadsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "resource": c.resource, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "servicedirectory.projects.locations.namespaces.workloads.testIamPermissions" call. +// Exactly one of *TestIamPermissionsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *TestIamPermissionsResponse.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 *ProjectsLocationsNamespacesWorkloadsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, 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 := &TestIamPermissionsResponse{ + 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 + // { + // "description": "Tests IAM permissions for a resource (namespace, service or service workload only).", + // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/namespaces/{namespacesId}/workloads/{workloadsId}:testIamPermissions", + // "httpMethod": "POST", + // "id": "servicedirectory.projects.locations.namespaces.workloads.testIamPermissions", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/workloads/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta1/{+resource}:testIamPermissions", + // "request": { + // "$ref": "TestIamPermissionsRequest" + // }, + // "response": { + // "$ref": "TestIamPermissionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + // method id "servicedirectory.projects.locations.registrationPolicies.getIamPolicy": type ProjectsLocationsRegistrationPoliciesGetIamPolicyCall struct { diff --git a/spanner/v1/spanner-api.json b/spanner/v1/spanner-api.json index e8024501bd6..7fc7a413c9e 100644 --- a/spanner/v1/spanner-api.json +++ b/spanner/v1/spanner-api.json @@ -2578,7 +2578,7 @@ "description": "The condition that is associated with this binding. If the condition evaluates to `true`, then this binding applies to the current request. If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the principals in this binding. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies)." }, "members": { - "description": "Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. ", + "description": "Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding.", "items": { "type": "string" }, diff --git a/spanner/v1/spanner-gen.go b/spanner/v1/spanner-gen.go index 6d3ecbd688f..bfd0c1d01ea 100644 --- a/spanner/v1/spanner-gen.go +++ b/spanner/v1/spanner-gen.go @@ -613,7 +613,9 @@ type Binding struct { // (https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). // For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. // * `group:{emailid}`: An email address that represents a Google group. - // For example, `admins@example.com`. * + // For example, `admins@example.com`. * `domain:{domain}`: The G Suite + // domain (primary) that represents all the users of that domain. For + // example, `google.com` or `example.com`. * // `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus // unique identifier) representing a user that has been recently // deleted. For example, `alice@example.com?uid=123456789012345678901`. @@ -630,9 +632,7 @@ type Binding struct { // that has been recently deleted. For example, // `admins@example.com?uid=123456789012345678901`. If the group is // recovered, this value reverts to `group:{emailid}` and the recovered - // group retains the role in the binding. * `domain:{domain}`: The G - // Suite domain (primary) that represents all the users of that domain. - // For example, `google.com` or `example.com`. + // group retains the role in the binding. Members []string `json:"members,omitempty"` // Role: Role that is assigned to the list of `members`, or principals. diff --git a/transcoder/v1/transcoder-api.json b/transcoder/v1/transcoder-api.json index 3ad32601264..26bec971c67 100644 --- a/transcoder/v1/transcoder-api.json +++ b/transcoder/v1/transcoder-api.json @@ -385,7 +385,7 @@ } } }, - "revision": "20221201", + "revision": "20230215", "rootUrl": "https://transcoder.googleapis.com/", "schemas": { "AdBreak": { @@ -562,6 +562,14 @@ "description": "The codec for this audio stream. The default is `aac`. Supported audio codecs: - `aac` - `aac-he` - `aac-he-v2` - `mp3` - `ac3` - `eac3`", "type": "string" }, + "displayName": { + "description": "The name for this particular audio stream that will be added to the HLS/DASH manifest.", + "type": "string" + }, + "languageCode": { + "description": "The BCP-47 language code, such as `en-US` or `sr-Latn`. For more information, see https://www.unicode.org/reports/tr35/#Unicode_locale_identifier.", + "type": "string" + }, "mapping": { "description": "The mapping for the `Job.edit_list` atoms with audio `EditAtom.inputs`.", "items": { @@ -1516,6 +1524,14 @@ "description": "The codec for this text stream. The default is `webvtt`. Supported text codecs: - `srt` - `ttml` - `cea608` - `cea708` - `webvtt`", "type": "string" }, + "displayName": { + "description": "The name for this particular text stream that will be added to the HLS/DASH manifest.", + "type": "string" + }, + "languageCode": { + "description": "The BCP-47 language code, such as `en-US` or `sr-Latn`. For more information, see https://www.unicode.org/reports/tr35/#Unicode_locale_identifier.", + "type": "string" + }, "mapping": { "description": "The mapping for the `Job.edit_list` atoms with text `EditAtom.inputs`.", "items": { diff --git a/transcoder/v1/transcoder-gen.go b/transcoder/v1/transcoder-gen.go index 49ab0a91285..a50b0ee1d41 100644 --- a/transcoder/v1/transcoder-gen.go +++ b/transcoder/v1/transcoder-gen.go @@ -506,6 +506,15 @@ type AudioStream struct { // `ac3` - `eac3` Codec string `json:"codec,omitempty"` + // DisplayName: The name for this particular audio stream that will be + // added to the HLS/DASH manifest. + DisplayName string `json:"displayName,omitempty"` + + // LanguageCode: The BCP-47 language code, such as `en-US` or `sr-Latn`. + // For more information, see + // https://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + LanguageCode string `json:"languageCode,omitempty"` + // Mapping: The mapping for the `Job.edit_list` atoms with audio // `EditAtom.inputs`. Mapping []*AudioMapping `json:"mapping,omitempty"` @@ -2126,6 +2135,15 @@ type TextStream struct { // `webvtt` Codec string `json:"codec,omitempty"` + // DisplayName: The name for this particular text stream that will be + // added to the HLS/DASH manifest. + DisplayName string `json:"displayName,omitempty"` + + // LanguageCode: The BCP-47 language code, such as `en-US` or `sr-Latn`. + // For more information, see + // https://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + LanguageCode string `json:"languageCode,omitempty"` + // Mapping: The mapping for the `Job.edit_list` atoms with text // `EditAtom.inputs`. Mapping []*TextMapping `json:"mapping,omitempty"` diff --git a/vmmigration/v1/vmmigration-api.json b/vmmigration/v1/vmmigration-api.json index 3f31a84bfae..098db1d762b 100644 --- a/vmmigration/v1/vmmigration-api.json +++ b/vmmigration/v1/vmmigration-api.json @@ -1972,7 +1972,7 @@ } } }, - "revision": "20230209", + "revision": "20230216", "rootUrl": "https://vmmigration.googleapis.com/", "schemas": { "AccessKeyCredentials": { @@ -3473,6 +3473,11 @@ "description": "The labels of the migrating VM.", "type": "object" }, + "lastReplicationCycle": { + "$ref": "ReplicationCycle", + "description": "Output only. Details of the last replication cycle. This will be updated whenever a replication cycle is finished and is not to be confused with last_sync which is only updated on successful replication cycles.", + "readOnly": true + }, "lastSync": { "$ref": "ReplicationSync", "description": "Output only. The most updated snapshot created time in the source that finished replication.", @@ -3615,6 +3620,45 @@ }, "type": "object" }, + "MigrationWarning": { + "description": "Represents migration resource warning information that can be used with google.rpc.Status message. MigrationWarning is used to present the user with warning information in migration operations.", + "id": "MigrationWarning", + "properties": { + "actionItem": { + "$ref": "LocalizedMessage", + "description": "Suggested action for solving the warning." + }, + "code": { + "description": "The warning code.", + "enum": [ + "WARNING_CODE_UNSPECIFIED", + "ADAPTATION_WARNING" + ], + "enumDescriptions": [ + "Default value. This value is not used.", + "A warning originated from OS Adaptation." + ], + "type": "string" + }, + "helpLinks": { + "description": "URL(s) pointing to additional information on handling the current warning.", + "items": { + "$ref": "Link" + }, + "type": "array" + }, + "warningMessage": { + "$ref": "LocalizedMessage", + "description": "The localized warning message." + }, + "warningTime": { + "description": "The time the warning occurred.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, "NetworkInterface": { "description": "NetworkInterface represents a NIC of a VM.", "id": "NetworkInterface", @@ -3834,6 +3878,14 @@ "description": "The accumulated duration the replication cycle was paused.", "format": "google-duration", "type": "string" + }, + "warnings": { + "description": "Output only. Warnings that occurred during the cycle.", + "items": { + "$ref": "MigrationWarning" + }, + "readOnly": true, + "type": "array" } }, "type": "object" diff --git a/vmmigration/v1/vmmigration-gen.go b/vmmigration/v1/vmmigration-gen.go index 88bb0f80c02..0fc50fb3060 100644 --- a/vmmigration/v1/vmmigration-gen.go +++ b/vmmigration/v1/vmmigration-gen.go @@ -2133,6 +2133,12 @@ type MigratingVm struct { // Labels: The labels of the migrating VM. Labels map[string]string `json:"labels,omitempty"` + // LastReplicationCycle: Output only. Details of the last replication + // cycle. This will be updated whenever a replication cycle is finished + // and is not to be confused with last_sync which is only updated on + // successful replication cycles. + LastReplicationCycle *ReplicationCycle `json:"lastReplicationCycle,omitempty"` + // LastSync: Output only. The most updated snapshot created time in the // source that finished replication. LastSync *ReplicationSync `json:"lastSync,omitempty"` @@ -2288,6 +2294,54 @@ func (s *MigrationError) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// MigrationWarning: Represents migration resource warning information +// that can be used with google.rpc.Status message. MigrationWarning is +// used to present the user with warning information in migration +// operations. +type MigrationWarning struct { + // ActionItem: Suggested action for solving the warning. + ActionItem *LocalizedMessage `json:"actionItem,omitempty"` + + // Code: The warning code. + // + // Possible values: + // "WARNING_CODE_UNSPECIFIED" - Default value. This value is not used. + // "ADAPTATION_WARNING" - A warning originated from OS Adaptation. + Code string `json:"code,omitempty"` + + // HelpLinks: URL(s) pointing to additional information on handling the + // current warning. + HelpLinks []*Link `json:"helpLinks,omitempty"` + + // WarningMessage: The localized warning message. + WarningMessage *LocalizedMessage `json:"warningMessage,omitempty"` + + // WarningTime: The time the warning occurred. + WarningTime string `json:"warningTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ActionItem") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ActionItem") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *MigrationWarning) MarshalJSON() ([]byte, error) { + type NoMethod MigrationWarning + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // NetworkInterface: NetworkInterface represents a NIC of a VM. type NetworkInterface struct { // ExternalIp: The external IP to define in the NIC. @@ -2567,6 +2621,9 @@ type ReplicationCycle struct { // was paused. TotalPauseDuration string `json:"totalPauseDuration,omitempty"` + // Warnings: Output only. Warnings that occurred during the cycle. + Warnings []*MigrationWarning `json:"warnings,omitempty"` + // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` diff --git a/vmmigration/v1alpha1/vmmigration-api.json b/vmmigration/v1alpha1/vmmigration-api.json index 2b4c3bd920c..f81e9ef0e22 100644 --- a/vmmigration/v1alpha1/vmmigration-api.json +++ b/vmmigration/v1alpha1/vmmigration-api.json @@ -1972,7 +1972,7 @@ } } }, - "revision": "20230209", + "revision": "20230216", "rootUrl": "https://vmmigration.googleapis.com/", "schemas": { "AccessKeyCredentials": { @@ -3506,6 +3506,11 @@ "description": "The labels of the migrating VM.", "type": "object" }, + "lastReplicationCycle": { + "$ref": "ReplicationCycle", + "description": "Output only. Details of the last replication cycle. This will be updated whenever a replication cycle is finished and is not to be confused with last_sync which is only updated on successful replication cycles.", + "readOnly": true + }, "lastSync": { "$ref": "ReplicationSync", "description": "Output only. The most updated snapshot created time in the source that finished replication.", @@ -3652,6 +3657,45 @@ }, "type": "object" }, + "MigrationWarning": { + "description": "Represents migration resource warning information that can be used with google.rpc.Status message. MigrationWarning is used to present the user with warning information in migration operations.", + "id": "MigrationWarning", + "properties": { + "actionItem": { + "$ref": "LocalizedMessage", + "description": "Suggested action for solving the warning." + }, + "code": { + "description": "The warning code.", + "enum": [ + "WARNING_CODE_UNSPECIFIED", + "ADAPTATION_WARNING" + ], + "enumDescriptions": [ + "Default value. This value is not used.", + "A warning originated from OS Adaptation." + ], + "type": "string" + }, + "helpLinks": { + "description": "URL(s) pointing to additional information on handling the current warning.", + "items": { + "$ref": "Link" + }, + "type": "array" + }, + "warningMessage": { + "$ref": "LocalizedMessage", + "description": "The localized warning message." + }, + "warningTime": { + "description": "The time the warning occurred.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, "NetworkInterface": { "description": "NetworkInterface represents a NIC of a VM.", "id": "NetworkInterface", @@ -3876,6 +3920,14 @@ "description": "The accumulated duration the replication cycle was paused.", "format": "google-duration", "type": "string" + }, + "warnings": { + "description": "Output only. Warnings that occurred during the cycle.", + "items": { + "$ref": "MigrationWarning" + }, + "readOnly": true, + "type": "array" } }, "type": "object" diff --git a/vmmigration/v1alpha1/vmmigration-gen.go b/vmmigration/v1alpha1/vmmigration-gen.go index a0d36c4261e..999e8a01a13 100644 --- a/vmmigration/v1alpha1/vmmigration-gen.go +++ b/vmmigration/v1alpha1/vmmigration-gen.go @@ -2162,6 +2162,12 @@ type MigratingVm struct { // Labels: The labels of the migrating VM. Labels map[string]string `json:"labels,omitempty"` + // LastReplicationCycle: Output only. Details of the last replication + // cycle. This will be updated whenever a replication cycle is finished + // and is not to be confused with last_sync which is only updated on + // successful replication cycles. + LastReplicationCycle *ReplicationCycle `json:"lastReplicationCycle,omitempty"` + // LastSync: Output only. The most updated snapshot created time in the // source that finished replication. LastSync *ReplicationSync `json:"lastSync,omitempty"` @@ -2322,6 +2328,54 @@ func (s *MigrationError) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// MigrationWarning: Represents migration resource warning information +// that can be used with google.rpc.Status message. MigrationWarning is +// used to present the user with warning information in migration +// operations. +type MigrationWarning struct { + // ActionItem: Suggested action for solving the warning. + ActionItem *LocalizedMessage `json:"actionItem,omitempty"` + + // Code: The warning code. + // + // Possible values: + // "WARNING_CODE_UNSPECIFIED" - Default value. This value is not used. + // "ADAPTATION_WARNING" - A warning originated from OS Adaptation. + Code string `json:"code,omitempty"` + + // HelpLinks: URL(s) pointing to additional information on handling the + // current warning. + HelpLinks []*Link `json:"helpLinks,omitempty"` + + // WarningMessage: The localized warning message. + WarningMessage *LocalizedMessage `json:"warningMessage,omitempty"` + + // WarningTime: The time the warning occurred. + WarningTime string `json:"warningTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ActionItem") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ActionItem") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *MigrationWarning) MarshalJSON() ([]byte, error) { + type NoMethod MigrationWarning + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // NetworkInterface: NetworkInterface represents a NIC of a VM. type NetworkInterface struct { // ExternalIp: The external IP to define in the NIC. @@ -2604,6 +2658,9 @@ type ReplicationCycle struct { // was paused. TotalPauseDuration string `json:"totalPauseDuration,omitempty"` + // Warnings: Output only. Warnings that occurred during the cycle. + Warnings []*MigrationWarning `json:"warnings,omitempty"` + // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"`