From f990a2af6cd6210c8764bbe273a575886ea97038 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 18 Oct 2022 07:30:57 -0700 Subject: [PATCH] feat(all): auto-regenerate discovery clients (#1717) --- .../v1/androidmanagement-api.json | 12 +- androidmanagement/v1/androidmanagement-gen.go | 21 +- chat/v1/chat-api.json | 19 +- chat/v1/chat-gen.go | 50 +- language/v1/language-api.json | 4 +- language/v1/language-gen.go | 4 +- language/v1beta1/language-api.json | 4 +- language/v1beta1/language-gen.go | 4 +- language/v1beta2/language-api.json | 4 +- language/v1beta2/language-gen.go | 4 +- orgpolicy/v2/orgpolicy-api.json | 14 +- orgpolicy/v2/orgpolicy-gen.go | 23 +- securitycenter/v1/securitycenter-api.json | 445 +- securitycenter/v1/securitycenter-gen.go | 10110 +++++++++------- .../v1beta1/securitycenter-api.json | 127 +- securitycenter/v1beta1/securitycenter-gen.go | 198 +- .../v1beta2/securitycenter-api.json | 127 +- securitycenter/v1beta2/securitycenter-gen.go | 198 +- servicecontrol/v1/servicecontrol-api.json | 6 +- servicecontrol/v1/servicecontrol-gen.go | 20 +- webrisk/v1/webrisk-api.json | 22 +- webrisk/v1/webrisk-gen.go | 42 +- 22 files changed, 7177 insertions(+), 4281 deletions(-) diff --git a/androidmanagement/v1/androidmanagement-api.json b/androidmanagement/v1/androidmanagement-api.json index 1e6fd1a1360..158c1f18f94 100644 --- a/androidmanagement/v1/androidmanagement-api.json +++ b/androidmanagement/v1/androidmanagement-api.json @@ -314,7 +314,7 @@ "devices": { "methods": { "delete": { - "description": "Deletes a device. This operation wipes the device.", + "description": "Deletes a device. This operation wipes the device. Deleted devices do not show up in enterprises.devices.list calls and a 404 is returned from enterprises.devices.get.", "flatPath": "v1/enterprises/{enterprisesId}/devices/{devicesId}", "httpMethod": "DELETE", "id": "androidmanagement.enterprises.devices.delete", @@ -360,7 +360,7 @@ ] }, "get": { - "description": "Gets a device.", + "description": "Gets a device. Deleted devices will respond with a 404 error.", "flatPath": "v1/enterprises/{enterprisesId}/devices/{devicesId}", "httpMethod": "GET", "id": "androidmanagement.enterprises.devices.get", @@ -413,7 +413,7 @@ ] }, "list": { - "description": "Lists devices for a given enterprise.", + "description": "Lists devices for a given enterprise. Deleted devices are not returned in the response.", "flatPath": "v1/enterprises/{enterprisesId}/devices", "httpMethod": "GET", "id": "androidmanagement.enterprises.devices.list", @@ -1065,7 +1065,7 @@ } } }, - "revision": "20220921", + "revision": "20221010", "rootUrl": "https://androidmanagement.googleapis.com/", "schemas": { "AdbShellCommandEvent": { @@ -4065,7 +4065,7 @@ "type": "array" }, "cameraDisabled": { - "description": "Whether camera is disabled.", + "description": "If true, the camera is disabled on the personal profile.", "type": "boolean" }, "maxDaysWithWorkOff": { @@ -4097,7 +4097,7 @@ "type": "string" }, "screenCaptureDisabled": { - "description": "Whether screen capture is disabled.", + "description": "If true, screen capture is disabled for all users.", "type": "boolean" } }, diff --git a/androidmanagement/v1/androidmanagement-gen.go b/androidmanagement/v1/androidmanagement-gen.go index d922ceba94b..2a8aa1ee2e1 100644 --- a/androidmanagement/v1/androidmanagement-gen.go +++ b/androidmanagement/v1/androidmanagement-gen.go @@ -4605,7 +4605,8 @@ type PersonalUsagePolicies struct { // managed by the user. AccountTypesWithManagementDisabled []string `json:"accountTypesWithManagementDisabled,omitempty"` - // CameraDisabled: Whether camera is disabled. + // CameraDisabled: If true, the camera is disabled on the personal + // profile. CameraDisabled bool `json:"cameraDisabled,omitempty"` // MaxDaysWithWorkOff: Controls how long the work profile can stay off. @@ -4632,7 +4633,8 @@ type PersonalUsagePolicies struct { // be installed in the personal profile. PersonalPlayStoreMode string `json:"personalPlayStoreMode,omitempty"` - // ScreenCaptureDisabled: Whether screen capture is disabled. + // ScreenCaptureDisabled: If true, screen capture is disabled for all + // users. ScreenCaptureDisabled bool `json:"screenCaptureDisabled,omitempty"` // ForceSendFields is a list of field names (e.g. @@ -7620,7 +7622,9 @@ type EnterprisesDevicesDeleteCall struct { header_ http.Header } -// Delete: Deletes a device. This operation wipes the device. +// Delete: Deletes a device. This operation wipes the device. Deleted +// devices do not show up in enterprises.devices.list calls and a 404 is +// returned from enterprises.devices.get. // // - name: The name of the device in the form // enterprises/{enterpriseId}/devices/{deviceId}. @@ -7743,7 +7747,7 @@ func (c *EnterprisesDevicesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, } return ret, nil // { - // "description": "Deletes a device. This operation wipes the device.", + // "description": "Deletes a device. This operation wipes the device. Deleted devices do not show up in enterprises.devices.list calls and a 404 is returned from enterprises.devices.get.", // "flatPath": "v1/enterprises/{enterprisesId}/devices/{devicesId}", // "httpMethod": "DELETE", // "id": "androidmanagement.enterprises.devices.delete", @@ -7802,7 +7806,7 @@ type EnterprisesDevicesGetCall struct { header_ http.Header } -// Get: Gets a device. +// Get: Gets a device. Deleted devices will respond with a 404 error. // // - name: The name of the device in the form // enterprises/{enterpriseId}/devices/{deviceId}. @@ -7911,7 +7915,7 @@ func (c *EnterprisesDevicesGetCall) Do(opts ...googleapi.CallOption) (*Device, e } return ret, nil // { - // "description": "Gets a device.", + // "description": "Gets a device. Deleted devices will respond with a 404 error.", // "flatPath": "v1/enterprises/{enterprisesId}/devices/{devicesId}", // "httpMethod": "GET", // "id": "androidmanagement.enterprises.devices.get", @@ -8094,7 +8098,8 @@ type EnterprisesDevicesListCall struct { header_ http.Header } -// List: Lists devices for a given enterprise. +// List: Lists devices for a given enterprise. Deleted devices are not +// returned in the response. // // - parent: The name of the enterprise in the form // enterprises/{enterpriseId}. @@ -8217,7 +8222,7 @@ func (c *EnterprisesDevicesListCall) Do(opts ...googleapi.CallOption) (*ListDevi } return ret, nil // { - // "description": "Lists devices for a given enterprise.", + // "description": "Lists devices for a given enterprise. Deleted devices are not returned in the response.", // "flatPath": "v1/enterprises/{enterprisesId}/devices", // "httpMethod": "GET", // "id": "androidmanagement.enterprises.devices.list", diff --git a/chat/v1/chat-api.json b/chat/v1/chat-api.json index 7657c8443b9..2ae8677cb18 100644 --- a/chat/v1/chat-api.json +++ b/chat/v1/chat-api.json @@ -424,13 +424,13 @@ "parameterOrder": [], "parameters": { "pageSize": { - "description": "Optional. Requested page size. The value is capped at 1000. Server may return fewer results than requested. If unspecified, server will default to 100.", + "description": "Optional. The maximum number of spaces to return. The service may return fewer than this value. If unspecified, at most 100 spaces are returned. The maximum value is 1000; values above 1000 are coerced to 1000. Negative values return an INVALID_ARGUMENT error.", "format": "int32", "location": "query", "type": "integer" }, "pageToken": { - "description": "Optional. A token identifying a page of results the server should return.", + "description": "Optional. A page token, received from a previous list spaces call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided must match the call that provided the page token.", "location": "query", "type": "string" } @@ -504,7 +504,10 @@ "path": "v1/{+name}", "response": { "$ref": "Membership" - } + }, + "scopes": [ + "https://www.googleapis.com/auth/chat.memberships" + ] }, "list": { "description": "Lists human memberships in a space for joined members. Requires [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts).", @@ -516,13 +519,13 @@ ], "parameters": { "pageSize": { - "description": "Requested page size. The value is capped at 1000. Server may return fewer results than requested. If unspecified, server will default to 100.", + "description": "The maximum number of memberships to return. The service may return fewer than this value. If unspecified, at most 100 memberships are returned. The maximum value is 1000; values above 1000 are coerced to 1000. Negative values return an INVALID_ARGUMENT error.", "format": "int32", "location": "query", "type": "integer" }, "pageToken": { - "description": "A token identifying a page of results the server should return.", + "description": "A page token, received from a previous list memberships call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided must match the call that provided the page token.", "location": "query", "type": "string" }, @@ -699,7 +702,7 @@ } } }, - "revision": "20221011", + "revision": "20221013", "rootUrl": "https://chat.googleapis.com/", "schemas": { "ActionParameter": { @@ -2407,7 +2410,7 @@ "type": "array" }, "nextPageToken": { - "description": "Continuation token to retrieve the next page of results. It will be empty for the last page of results.", + "description": "A token that can be sent as `pageToken` to retrieve the next page of results. If empty, there are no subsequent pages.", "type": "string" } }, @@ -2417,7 +2420,7 @@ "id": "ListSpacesResponse", "properties": { "nextPageToken": { - "description": "Continuation token to retrieve the next page of results. It will be empty for the last page of results. Tokens expire in an hour. An error is thrown if an expired token is passed.", + "description": "A token that can be sent as `pageToken` to retrieve the next page of results. If empty, there are no subsequent pages.", "type": "string" }, "spaces": { diff --git a/chat/v1/chat-gen.go b/chat/v1/chat-gen.go index 21b49e0f767..4599e2a7b0f 100644 --- a/chat/v1/chat-gen.go +++ b/chat/v1/chat-gen.go @@ -2940,8 +2940,8 @@ type ListMembershipsResponse struct { // Memberships: List of memberships in the requested (or first) page. Memberships []*Membership `json:"memberships,omitempty"` - // NextPageToken: Continuation token to retrieve the next page of - // results. It will be empty for the last page of results. + // NextPageToken: A token that can be sent as `pageToken` to retrieve + // the next page of results. If empty, there are no subsequent pages. NextPageToken string `json:"nextPageToken,omitempty"` // ServerResponse contains the HTTP response code and headers from the @@ -2972,9 +2972,8 @@ func (s *ListMembershipsResponse) MarshalJSON() ([]byte, error) { } type ListSpacesResponse struct { - // NextPageToken: Continuation token to retrieve the next page of - // results. It will be empty for the last page of results. Tokens expire - // in an hour. An error is thrown if an expired token is passed. + // NextPageToken: A token that can be sent as `pageToken` to retrieve + // the next page of results. If empty, there are no subsequent pages. NextPageToken string `json:"nextPageToken,omitempty"` // Spaces: List of spaces in the requested (or first) page. @@ -5310,16 +5309,20 @@ func (r *SpacesService) List() *SpacesListCall { return c } -// PageSize sets the optional parameter "pageSize": Requested page size. -// The value is capped at 1000. Server may return fewer results than -// requested. If unspecified, server will default to 100. +// PageSize sets the optional parameter "pageSize": The maximum number +// of spaces to return. The service may return fewer than this value. If +// unspecified, at most 100 spaces are returned. The maximum value is +// 1000; values above 1000 are coerced to 1000. Negative values return +// an INVALID_ARGUMENT error. func (c *SpacesListCall) PageSize(pageSize int64) *SpacesListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } -// PageToken sets the optional parameter "pageToken": A token -// identifying a page of results the server should return. +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous list spaces call. Provide this to retrieve +// the subsequent page. When paginating, all other parameters provided +// must match the call that provided the page token. func (c *SpacesListCall) PageToken(pageToken string) *SpacesListCall { c.urlParams_.Set("pageToken", pageToken) return c @@ -5428,13 +5431,13 @@ func (c *SpacesListCall) Do(opts ...googleapi.CallOption) (*ListSpacesResponse, // "parameterOrder": [], // "parameters": { // "pageSize": { - // "description": "Optional. Requested page size. The value is capped at 1000. Server may return fewer results than requested. If unspecified, server will default to 100.", + // "description": "Optional. The maximum number of spaces to return. The service may return fewer than this value. If unspecified, at most 100 spaces are returned. The maximum value is 1000; values above 1000 are coerced to 1000. Negative values return an INVALID_ARGUMENT error.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "Optional. A token identifying a page of results the server should return.", + // "description": "Optional. A page token, received from a previous list spaces call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided must match the call that provided the page token.", // "location": "query", // "type": "string" // } @@ -5795,7 +5798,10 @@ func (c *SpacesMembersGetCall) Do(opts ...googleapi.CallOption) (*Membership, er // "path": "v1/{+name}", // "response": { // "$ref": "Membership" - // } + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/chat.memberships" + // ] // } } @@ -5823,16 +5829,20 @@ func (r *SpacesMembersService) List(parent string) *SpacesMembersListCall { return c } -// PageSize sets the optional parameter "pageSize": Requested page size. -// The value is capped at 1000. Server may return fewer results than -// requested. If unspecified, server will default to 100. +// PageSize sets the optional parameter "pageSize": The maximum number +// of memberships to return. The service may return fewer than this +// value. If unspecified, at most 100 memberships are returned. The +// maximum value is 1000; values above 1000 are coerced to 1000. +// Negative values return an INVALID_ARGUMENT error. func (c *SpacesMembersListCall) PageSize(pageSize int64) *SpacesMembersListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } -// PageToken sets the optional parameter "pageToken": A token -// identifying a page of results the server should return. +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous list memberships call. Provide this to +// retrieve the subsequent page. When paginating, all other parameters +// provided must match the call that provided the page token. func (c *SpacesMembersListCall) PageToken(pageToken string) *SpacesMembersListCall { c.urlParams_.Set("pageToken", pageToken) return c @@ -5946,13 +5956,13 @@ func (c *SpacesMembersListCall) Do(opts ...googleapi.CallOption) (*ListMembershi // ], // "parameters": { // "pageSize": { - // "description": "Requested page size. The value is capped at 1000. Server may return fewer results than requested. If unspecified, server will default to 100.", + // "description": "The maximum number of memberships to return. The service may return fewer than this value. If unspecified, at most 100 memberships are returned. The maximum value is 1000; values above 1000 are coerced to 1000. Negative values return an INVALID_ARGUMENT error.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "A token identifying a page of results the server should return.", + // "description": "A page token, received from a previous list memberships call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided must match the call that provided the page token.", // "location": "query", // "type": "string" // }, diff --git a/language/v1/language-api.json b/language/v1/language-api.json index 257eb8025ab..9a7b6ff3027 100644 --- a/language/v1/language-api.json +++ b/language/v1/language-api.json @@ -227,7 +227,7 @@ } } }, - "revision": "20220916", + "revision": "20221015", "rootUrl": "https://language.googleapis.com/", "schemas": { "AnalyzeEntitiesRequest": { @@ -742,7 +742,7 @@ "type": "object" }, "Document": { - "description": "################################################################ # Represents the input to API methods.", + "description": "Represents the input to API methods.", "id": "Document", "properties": { "content": { diff --git a/language/v1/language-gen.go b/language/v1/language-gen.go index ffde86cae72..d75a4f44a7e 100644 --- a/language/v1/language-gen.go +++ b/language/v1/language-gen.go @@ -880,9 +880,7 @@ func (s *DependencyEdge) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// Document: -// ################################################################ # -// Represents the input to API methods. +// Document: Represents the input to API methods. type Document struct { // Content: The content of the input in string format. Cloud audit // logging exempt since it is based on user data. diff --git a/language/v1beta1/language-api.json b/language/v1beta1/language-api.json index f5fff0cf9b0..eec3ebc46c6 100644 --- a/language/v1beta1/language-api.json +++ b/language/v1beta1/language-api.json @@ -189,7 +189,7 @@ } } }, - "revision": "20210807", + "revision": "20221015", "rootUrl": "https://language.googleapis.com/", "schemas": { "AnalyzeEntitiesRequest": { @@ -592,7 +592,7 @@ "type": "object" }, "Document": { - "description": "################################################################ # Represents the input to API methods.", + "description": "Represents the input to API methods.", "id": "Document", "properties": { "content": { diff --git a/language/v1beta1/language-gen.go b/language/v1beta1/language-gen.go index 4f8e517a16e..e5fc898e5f2 100644 --- a/language/v1beta1/language-gen.go +++ b/language/v1beta1/language-gen.go @@ -640,9 +640,7 @@ func (s *DependencyEdge) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// Document: -// ################################################################ # -// Represents the input to API methods. +// Document: Represents the input to API methods. type Document struct { // Content: The content of the input in string format. Cloud audit // logging exempt since it is based on user data. diff --git a/language/v1beta2/language-api.json b/language/v1beta2/language-api.json index 4ef0c3b3566..39f679e0877 100644 --- a/language/v1beta2/language-api.json +++ b/language/v1beta2/language-api.json @@ -227,7 +227,7 @@ } } }, - "revision": "20220916", + "revision": "20221015", "rootUrl": "https://language.googleapis.com/", "schemas": { "AnalyzeEntitiesRequest": { @@ -742,7 +742,7 @@ "type": "object" }, "Document": { - "description": "################################################################ # Represents the input to API methods.", + "description": "Represents the input to API methods.", "id": "Document", "properties": { "boilerplateHandling": { diff --git a/language/v1beta2/language-gen.go b/language/v1beta2/language-gen.go index be1be6a8731..d438505f725 100644 --- a/language/v1beta2/language-gen.go +++ b/language/v1beta2/language-gen.go @@ -879,9 +879,7 @@ func (s *DependencyEdge) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// Document: -// ################################################################ # -// Represents the input to API methods. +// Document: Represents the input to API methods. type Document struct { // BoilerplateHandling: Indicates how detected boilerplate(e.g. // advertisements, copyright declarations, banners) should be handled diff --git a/orgpolicy/v2/orgpolicy-api.json b/orgpolicy/v2/orgpolicy-api.json index 160014b08e7..a3e1148d02b 100644 --- a/orgpolicy/v2/orgpolicy-api.json +++ b/orgpolicy/v2/orgpolicy-api.json @@ -488,7 +488,7 @@ ], "parameters": { "name": { - "description": "Immutable. Name of the constraint. This is unique within the organization. Format of the name should be * `organizations/{organization_id}/customConstraints/{custom_constraint_id}` Example : \"organizations/123/customConstraints/custom.createOnlyE2TypeVms\"", + "description": "Immutable. Name of the constraint. This is unique within the organization. Format of the name should be * `organizations/{organization_id}/customConstraints/{custom_constraint_id}` Example : \"organizations/123/customConstraints/custom.createOnlyE2TypeVms\" The max length is 100 characters and the min length is 1. Note that the prefix \"organizations/{organization_id}/customConstraints/\" is not counted.", "location": "path", "pattern": "^organizations/[^/]+/customConstraints/[^/]+$", "required": true, @@ -897,7 +897,7 @@ } } }, - "revision": "20220913", + "revision": "20221016", "rootUrl": "https://orgpolicy.googleapis.com/", "schemas": { "GoogleCloudOrgpolicyV2AlternatePolicySpec": { @@ -996,15 +996,15 @@ "type": "string" }, "condition": { - "description": "Org policy condition/expression. For example: `resource.instanceName.matches(\"[production|test]_.*_(\\d)+\")'` or, `resource.management.auto_upgrade == true`", + "description": "Org policy condition/expression. For example: `resource.instanceName.matches(\"[production|test]_.*_(\\d)+\")'` or, `resource.management.auto_upgrade == true` The max length of the condition is 1000 characters.", "type": "string" }, "description": { - "description": "Detailed information about this custom policy constraint.", + "description": "Detailed information about this custom policy constraint. The max length of the description is 2000 characters.", "type": "string" }, "displayName": { - "description": "One line display name for the UI.", + "description": "One line display name for the UI. The max length of the display_name is 200 characters.", "type": "string" }, "methodTypes": { @@ -1020,14 +1020,14 @@ "Unspecified. Will results in user error.", "Constraint applied when creating the resource.", "Constraint applied when updating the resource.", - "Constraint applied when deleting the resource." + "Constraint applied when deleting the resource. Not supported yet." ], "type": "string" }, "type": "array" }, "name": { - "description": "Immutable. Name of the constraint. This is unique within the organization. Format of the name should be * `organizations/{organization_id}/customConstraints/{custom_constraint_id}` Example : \"organizations/123/customConstraints/custom.createOnlyE2TypeVms\"", + "description": "Immutable. Name of the constraint. This is unique within the organization. Format of the name should be * `organizations/{organization_id}/customConstraints/{custom_constraint_id}` Example : \"organizations/123/customConstraints/custom.createOnlyE2TypeVms\" The max length is 100 characters and the min length is 1. Note that the prefix \"organizations/{organization_id}/customConstraints/\" is not counted.", "type": "string" }, "resourceTypes": { diff --git a/orgpolicy/v2/orgpolicy-gen.go b/orgpolicy/v2/orgpolicy-gen.go index 35500717b30..82b0395332d 100644 --- a/orgpolicy/v2/orgpolicy-gen.go +++ b/orgpolicy/v2/orgpolicy-gen.go @@ -427,14 +427,16 @@ type GoogleCloudOrgpolicyV2CustomConstraint struct { // Condition: Org policy condition/expression. For example: // `resource.instanceName.matches("[production|test]_.*_(\d)+")'` or, - // `resource.management.auto_upgrade == true` + // `resource.management.auto_upgrade == true` The max length of the + // condition is 1000 characters. Condition string `json:"condition,omitempty"` // Description: Detailed information about this custom policy - // constraint. + // constraint. The max length of the description is 2000 characters. Description string `json:"description,omitempty"` - // DisplayName: One line display name for the UI. + // DisplayName: One line display name for the UI. The max length of the + // display_name is 200 characters. DisplayName string `json:"displayName,omitempty"` // MethodTypes: All the operations being applied for this constraint. @@ -444,14 +446,18 @@ type GoogleCloudOrgpolicyV2CustomConstraint struct { // error. // "CREATE" - Constraint applied when creating the resource. // "UPDATE" - Constraint applied when updating the resource. - // "DELETE" - Constraint applied when deleting the resource. + // "DELETE" - Constraint applied when deleting the resource. Not + // supported yet. MethodTypes []string `json:"methodTypes,omitempty"` // Name: Immutable. Name of the constraint. This is unique within the // organization. Format of the name should be * // `organizations/{organization_id}/customConstraints/{custom_constraint_ // id}` Example : - // "organizations/123/customConstraints/custom.createOnlyE2TypeVms" + // "organizations/123/customConstraints/custom.createOnlyE2TypeVms" The + // max length is 100 characters and the min length is 1. Note that the + // prefix "organizations/{organization_id}/customConstraints/" is not + // counted. Name string `json:"name,omitempty"` // ResourceTypes: Immutable. The Resource Instance type on which this @@ -2884,7 +2890,10 @@ type OrganizationsCustomConstraintsPatchCall struct { // organization. Format of the name should be * // `organizations/{organization_id}/customConstraints/{custom_constrain // t_id}` Example : -// "organizations/123/customConstraints/custom.createOnlyE2TypeVms". +// "organizations/123/customConstraints/custom.createOnlyE2TypeVms" +// The max length is 100 characters and the min length is 1. Note that +// the prefix "organizations/{organization_id}/customConstraints/" is +// not counted. func (r *OrganizationsCustomConstraintsService) Patch(name string, googlecloudorgpolicyv2customconstraint *GoogleCloudOrgpolicyV2CustomConstraint) *OrganizationsCustomConstraintsPatchCall { c := &OrganizationsCustomConstraintsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name @@ -2993,7 +3002,7 @@ func (c *OrganizationsCustomConstraintsPatchCall) Do(opts ...googleapi.CallOptio // ], // "parameters": { // "name": { - // "description": "Immutable. Name of the constraint. This is unique within the organization. Format of the name should be * `organizations/{organization_id}/customConstraints/{custom_constraint_id}` Example : \"organizations/123/customConstraints/custom.createOnlyE2TypeVms\"", + // "description": "Immutable. Name of the constraint. This is unique within the organization. Format of the name should be * `organizations/{organization_id}/customConstraints/{custom_constraint_id}` Example : \"organizations/123/customConstraints/custom.createOnlyE2TypeVms\" The max length is 100 characters and the min length is 1. Note that the prefix \"organizations/{organization_id}/customConstraints/\" is not counted.", // "location": "path", // "pattern": "^organizations/[^/]+/customConstraints/[^/]+$", // "required": true, diff --git a/securitycenter/v1/securitycenter-api.json b/securitycenter/v1/securitycenter-api.json index 178ce3fbbba..02c80ce548a 100644 --- a/securitycenter/v1/securitycenter-api.json +++ b/securitycenter/v1/securitycenter-api.json @@ -589,6 +589,163 @@ } } }, + "notificationConfigs": { + "methods": { + "create": { + "description": "Creates a notification config.", + "flatPath": "v1/folders/{foldersId}/notificationConfigs", + "httpMethod": "POST", + "id": "securitycenter.folders.notificationConfigs.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "configId": { + "description": "Required. Unique identifier provided by the client within the parent scope. It must be between 1 and 128 characters, and contains alphanumeric characters, underscores or hyphens only.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. Resource name of the new notification config's parent. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + "location": "path", + "pattern": "^folders/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/notificationConfigs", + "request": { + "$ref": "NotificationConfig" + }, + "response": { + "$ref": "NotificationConfig" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "description": "Deletes a notification config.", + "flatPath": "v1/folders/{foldersId}/notificationConfigs/{notificationConfigsId}", + "httpMethod": "DELETE", + "id": "securitycenter.folders.notificationConfigs.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Name of the notification config to delete. Its format is \"organizations/[organization_id]/notificationConfigs/[config_id]\".", + "location": "path", + "pattern": "^folders/[^/]+/notificationConfigs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Gets a notification config.", + "flatPath": "v1/folders/{foldersId}/notificationConfigs/{notificationConfigsId}", + "httpMethod": "GET", + "id": "securitycenter.folders.notificationConfigs.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Name of the notification config to get. Its format is \"organizations/[organization_id]/notificationConfigs/[config_id]\".", + "location": "path", + "pattern": "^folders/[^/]+/notificationConfigs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "NotificationConfig" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Lists notification configs.", + "flatPath": "v1/folders/{foldersId}/notificationConfigs", + "httpMethod": "GET", + "id": "securitycenter.folders.notificationConfigs.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "The value returned by the last `ListNotificationConfigsResponse`; indicates that this is a continuation of a prior `ListNotificationConfigs` call, and that the system should return the next page of data.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. Name of the organization to list notification configs. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + "location": "path", + "pattern": "^folders/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/notificationConfigs", + "response": { + "$ref": "ListNotificationConfigsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "patch": { + "description": " Updates a notification config. The following update fields are allowed: description, pubsub_topic, streaming_config.filter", + "flatPath": "v1/folders/{foldersId}/notificationConfigs/{notificationConfigsId}", + "httpMethod": "PATCH", + "id": "securitycenter.folders.notificationConfigs.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The relative resource name of this notification config. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/notificationConfigs/notify_public_bucket\".", + "location": "path", + "pattern": "^folders/[^/]+/notificationConfigs/[^/]+$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "The FieldMask to use when updating the notification config. If empty all mutable fields will be updated.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "v1/{+name}", + "request": { + "$ref": "NotificationConfig" + }, + "response": { + "$ref": "NotificationConfig" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, "sources": { "methods": { "list": { @@ -1489,7 +1646,7 @@ "type": "string" }, "parent": { - "description": "Required. Resource name of the new notification config's parent. Its format is \"organizations/[organization_id]\" or \"projects/[project_id]\".", + "description": "Required. Resource name of the new notification config's parent. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", "location": "path", "pattern": "^organizations/[^/]+$", "required": true, @@ -1578,7 +1735,7 @@ "type": "string" }, "parent": { - "description": "Required. Name of the organization to list notification configs. Its format is \"organizations/[organization_id]\" or \"projects/[project_id]\".", + "description": "Required. Name of the organization to list notification configs. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", "location": "path", "pattern": "^organizations/[^/]+$", "required": true, @@ -2747,6 +2904,163 @@ } } }, + "notificationConfigs": { + "methods": { + "create": { + "description": "Creates a notification config.", + "flatPath": "v1/projects/{projectsId}/notificationConfigs", + "httpMethod": "POST", + "id": "securitycenter.projects.notificationConfigs.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "configId": { + "description": "Required. Unique identifier provided by the client within the parent scope. It must be between 1 and 128 characters, and contains alphanumeric characters, underscores or hyphens only.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. Resource name of the new notification config's parent. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + "location": "path", + "pattern": "^projects/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/notificationConfigs", + "request": { + "$ref": "NotificationConfig" + }, + "response": { + "$ref": "NotificationConfig" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "description": "Deletes a notification config.", + "flatPath": "v1/projects/{projectsId}/notificationConfigs/{notificationConfigsId}", + "httpMethod": "DELETE", + "id": "securitycenter.projects.notificationConfigs.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Name of the notification config to delete. Its format is \"organizations/[organization_id]/notificationConfigs/[config_id]\".", + "location": "path", + "pattern": "^projects/[^/]+/notificationConfigs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Gets a notification config.", + "flatPath": "v1/projects/{projectsId}/notificationConfigs/{notificationConfigsId}", + "httpMethod": "GET", + "id": "securitycenter.projects.notificationConfigs.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Name of the notification config to get. Its format is \"organizations/[organization_id]/notificationConfigs/[config_id]\".", + "location": "path", + "pattern": "^projects/[^/]+/notificationConfigs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "NotificationConfig" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Lists notification configs.", + "flatPath": "v1/projects/{projectsId}/notificationConfigs", + "httpMethod": "GET", + "id": "securitycenter.projects.notificationConfigs.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "The value returned by the last `ListNotificationConfigsResponse`; indicates that this is a continuation of a prior `ListNotificationConfigs` call, and that the system should return the next page of data.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. Name of the organization to list notification configs. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + "location": "path", + "pattern": "^projects/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/notificationConfigs", + "response": { + "$ref": "ListNotificationConfigsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "patch": { + "description": " Updates a notification config. The following update fields are allowed: description, pubsub_topic, streaming_config.filter", + "flatPath": "v1/projects/{projectsId}/notificationConfigs/{notificationConfigsId}", + "httpMethod": "PATCH", + "id": "securitycenter.projects.notificationConfigs.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The relative resource name of this notification config. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/notificationConfigs/notify_public_bucket\".", + "location": "path", + "pattern": "^projects/[^/]+/notificationConfigs/[^/]+$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "The FieldMask to use when updating the notification config. If empty all mutable fields will be updated.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "v1/{+name}", + "request": { + "$ref": "NotificationConfig" + }, + "response": { + "$ref": "NotificationConfig" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, "sources": { "methods": { "list": { @@ -3058,7 +3372,7 @@ } } }, - "revision": "20220921", + "revision": "20221014", "rootUrl": "https://securitycenter.googleapis.com/", "schemas": { "Access": { @@ -3104,7 +3418,7 @@ "description": "What kind of user agent is associated, e.g. operating system shells, embedded or stand-alone applications, etc.", "type": "string" }, - "username": { + "userName": { "description": "A string representing a username. This is likely not an IAM principal. For instance, this may be the system user name if the finding is VM-related, or this may be some type of application login user name, depending on the type of finding.", "type": "string" } @@ -3225,6 +3539,21 @@ }, "type": "object" }, + "AssociatedFinding": { + "description": "A finding that is associated with this node in the exposure path.", + "id": "AssociatedFinding", + "properties": { + "canonicalFindingName": { + "description": "Canonical name of the associated findings. Example: organizations/123/sources/456/findings/789", + "type": "string" + }, + "findingCategory": { + "description": "The additional taxonomy group within findings from a given source.", + "type": "string" + } + }, + "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", @@ -3636,6 +3965,21 @@ }, "type": "object" }, + "Edge": { + "description": "Represents a connection between a source node and a destination node in this exposure path.", + "id": "Edge", + "properties": { + "destination": { + "description": "This is the resource name of the destination node.", + "type": "string" + }, + "source": { + "description": "This is the resource name of the source node.", + "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", @@ -4104,13 +4448,76 @@ "GoogleCloudSecuritycenterV1ExposedResource": { "description": "A resource that is exposed as a result of a finding.", "id": "GoogleCloudSecuritycenterV1ExposedResource", - "properties": {}, + "properties": { + "displayName": { + "description": "Human readable name of the resource that is exposed.", + "type": "string" + }, + "methods": { + "description": "The ways in which this resource is exposed. Examples: Read, Write", + "items": { + "type": "string" + }, + "type": "array" + }, + "name": { + "description": "Exposed Resource Name e.g.: `organizations/123/attackExposureResults/456/exposedResources/789`", + "type": "string" + }, + "resource": { + "description": "The name of the resource that is exposed. See: https://cloud.google.com/apis/design/resource_names#full_resource_name", + "type": "string" + }, + "resourceType": { + "description": "The resource type of the exposed resource. See: https://cloud.google.com/asset-inventory/docs/supported-asset-types", + "type": "string" + }, + "resourceValue": { + "description": "How valuable this resource is.", + "enum": [ + "RESOURCE_VALUE_UNSPECIFIED", + "RESOURCE_VALUE_LOW", + "RESOURCE_VALUE_MEDIUM", + "RESOURCE_VALUE_HIGH" + ], + "enumDescriptions": [ + "The resource value isn't specified.", + "This is a low value resource.", + "This is a medium value resource.", + "This is a high value resource." + ], + "type": "string" + } + }, "type": "object" }, "GoogleCloudSecuritycenterV1ExposurePath": { "description": "A path that an attacker could take to reach an exposed resource.", "id": "GoogleCloudSecuritycenterV1ExposurePath", - "properties": {}, + "properties": { + "edges": { + "description": "A list of the edges between nodes in this exposure path.", + "items": { + "$ref": "Edge" + }, + "type": "array" + }, + "exposedResource": { + "$ref": "GoogleCloudSecuritycenterV1ExposedResource", + "description": "The leaf node of this exposure path." + }, + "name": { + "description": "Exposure Path Name e.g.: `organizations/123/attackExposureResults/456/exposurePaths/789`", + "type": "string" + }, + "pathNodes": { + "description": "A list of nodes that exist in this exposure path.", + "items": { + "$ref": "PathNode" + }, + "type": "array" + } + }, "type": "object" }, "GoogleCloudSecuritycenterV1ExternalSystem": { @@ -5412,6 +5819,32 @@ }, "type": "object" }, + "PathNode": { + "description": "Represents one point that an attacker passes through in this exposure path.", + "id": "PathNode", + "properties": { + "associatedFindings": { + "description": "The findings associated with this node in the exposure path.", + "items": { + "$ref": "AssociatedFinding" + }, + "type": "array" + }, + "displayName": { + "description": "Human readable name of this resource.", + "type": "string" + }, + "resource": { + "description": "The name of the resource at this point in the exposure path. The format of the name is: https://cloud.google.com/apis/design/resource_names#full_resource_name", + "type": "string" + }, + "resourceType": { + "description": "The resource type of this resource. See: https://cloud.google.com/asset-inventory/docs/supported-asset-types", + "type": "string" + } + }, + "type": "object" + }, "Pod": { "description": "Kubernetes Pod.", "id": "Pod", diff --git a/securitycenter/v1/securitycenter-gen.go b/securitycenter/v1/securitycenter-gen.go index 2757a714728..e8ee875927e 100644 --- a/securitycenter/v1/securitycenter-gen.go +++ b/securitycenter/v1/securitycenter-gen.go @@ -149,6 +149,7 @@ func NewFoldersService(s *Service) *FoldersService { rs.BigQueryExports = NewFoldersBigQueryExportsService(s) rs.Findings = NewFoldersFindingsService(s) rs.MuteConfigs = NewFoldersMuteConfigsService(s) + rs.NotificationConfigs = NewFoldersNotificationConfigsService(s) rs.Sources = NewFoldersSourcesService(s) return rs } @@ -164,6 +165,8 @@ type FoldersService struct { MuteConfigs *FoldersMuteConfigsService + NotificationConfigs *FoldersNotificationConfigsService + Sources *FoldersSourcesService } @@ -203,6 +206,15 @@ type FoldersMuteConfigsService struct { s *Service } +func NewFoldersNotificationConfigsService(s *Service) *FoldersNotificationConfigsService { + rs := &FoldersNotificationConfigsService{s: s} + return rs +} + +type FoldersNotificationConfigsService struct { + s *Service +} + func NewFoldersSourcesService(s *Service) *FoldersSourcesService { rs := &FoldersSourcesService{s: s} rs.Findings = NewFoldersSourcesFindingsService(s) @@ -359,6 +371,7 @@ func NewProjectsService(s *Service) *ProjectsService { rs.BigQueryExports = NewProjectsBigQueryExportsService(s) rs.Findings = NewProjectsFindingsService(s) rs.MuteConfigs = NewProjectsMuteConfigsService(s) + rs.NotificationConfigs = NewProjectsNotificationConfigsService(s) rs.Sources = NewProjectsSourcesService(s) return rs } @@ -374,6 +387,8 @@ type ProjectsService struct { MuteConfigs *ProjectsMuteConfigsService + NotificationConfigs *ProjectsNotificationConfigsService + Sources *ProjectsSourcesService } @@ -413,6 +428,15 @@ type ProjectsMuteConfigsService struct { s *Service } +func NewProjectsNotificationConfigsService(s *Service) *ProjectsNotificationConfigsService { + rs := &ProjectsNotificationConfigsService{s: s} + return rs +} + +type ProjectsNotificationConfigsService struct { + s *Service +} + func NewProjectsSourcesService(s *Service) *ProjectsSourcesService { rs := &ProjectsSourcesService{s: s} rs.Findings = NewProjectsSourcesFindingsService(s) @@ -502,11 +526,11 @@ type Access struct { // operating system shells, embedded or stand-alone applications, etc. UserAgentFamily string `json:"userAgentFamily,omitempty"` - // Username: A string representing a username. This is likely not an IAM + // UserName: A string representing a username. This is likely not an IAM // principal. For instance, this may be the system user name if the // finding is VM-related, or this may be some type of application login // user name, depending on the type of finding. - Username string `json:"username,omitempty"` + UserName string `json:"userName,omitempty"` // ForceSendFields is a list of field names (e.g. "CallerIp") to // unconditionally include in API requests. By default, fields with @@ -698,6 +722,42 @@ func (s *AssetDiscoveryConfig) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// AssociatedFinding: A finding that is associated with this node in the +// exposure path. +type AssociatedFinding struct { + // CanonicalFindingName: Canonical name of the associated findings. + // Example: organizations/123/sources/456/findings/789 + CanonicalFindingName string `json:"canonicalFindingName,omitempty"` + + // FindingCategory: The additional taxonomy group within findings from a + // given source. + FindingCategory string `json:"findingCategory,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "CanonicalFindingName") 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. "CanonicalFindingName") 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 *AssociatedFinding) MarshalJSON() ([]byte, error) { + type NoMethod AssociatedFinding + raw := NoMethod(*s) + 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 @@ -1398,6 +1458,38 @@ func (s *Detection) UnmarshalJSON(data []byte) error { return nil } +// Edge: Represents a connection between a source node and a destination +// node in this exposure path. +type Edge struct { + // Destination: This is the resource name of the destination node. + Destination string `json:"destination,omitempty"` + + // Source: This is the resource name of the source node. + Source string `json:"source,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Destination") 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. "Destination") 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 *Edge) MarshalJSON() ([]byte, error) { + type NoMethod Edge + 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 @@ -2148,11 +2240,94 @@ type GoogleCloudSecuritycenterV1BulkMuteFindingsResponse struct { // GoogleCloudSecuritycenterV1ExposedResource: A resource that is // exposed as a result of a finding. type GoogleCloudSecuritycenterV1ExposedResource struct { + // DisplayName: Human readable name of the resource that is exposed. + DisplayName string `json:"displayName,omitempty"` + + // Methods: The ways in which this resource is exposed. Examples: Read, + // Write + Methods []string `json:"methods,omitempty"` + + // Name: Exposed Resource Name e.g.: + // `organizations/123/attackExposureResults/456/exposedResources/789` + Name string `json:"name,omitempty"` + + // Resource: The name of the resource that is exposed. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + Resource string `json:"resource,omitempty"` + + // ResourceType: The resource type of the exposed resource. See: + // https://cloud.google.com/asset-inventory/docs/supported-asset-types + ResourceType string `json:"resourceType,omitempty"` + + // ResourceValue: How valuable this resource is. + // + // Possible values: + // "RESOURCE_VALUE_UNSPECIFIED" - The resource value isn't specified. + // "RESOURCE_VALUE_LOW" - This is a low value resource. + // "RESOURCE_VALUE_MEDIUM" - This is a medium value resource. + // "RESOURCE_VALUE_HIGH" - This is a high value resource. + ResourceValue string `json:"resourceValue,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DisplayName") 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. "DisplayName") 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 *GoogleCloudSecuritycenterV1ExposedResource) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudSecuritycenterV1ExposedResource + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // GoogleCloudSecuritycenterV1ExposurePath: A path that an attacker // could take to reach an exposed resource. type GoogleCloudSecuritycenterV1ExposurePath struct { + // Edges: A list of the edges between nodes in this exposure path. + Edges []*Edge `json:"edges,omitempty"` + + // ExposedResource: The leaf node of this exposure path. + ExposedResource *GoogleCloudSecuritycenterV1ExposedResource `json:"exposedResource,omitempty"` + + // Name: Exposure Path Name e.g.: + // `organizations/123/attackExposureResults/456/exposurePaths/789` + Name string `json:"name,omitempty"` + + // PathNodes: A list of nodes that exist in this exposure path. + PathNodes []*PathNode `json:"pathNodes,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Edges") 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. "Edges") 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 *GoogleCloudSecuritycenterV1ExposurePath) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudSecuritycenterV1ExposurePath + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // GoogleCloudSecuritycenterV1ExternalSystem: Representation of third @@ -4148,6 +4323,49 @@ func (s *OrganizationSettings) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// PathNode: Represents one point that an attacker passes through in +// this exposure path. +type PathNode struct { + // AssociatedFindings: The findings associated with this node in the + // exposure path. + AssociatedFindings []*AssociatedFinding `json:"associatedFindings,omitempty"` + + // DisplayName: Human readable name of this resource. + DisplayName string `json:"displayName,omitempty"` + + // Resource: The name of the resource at this point in the exposure + // path. The format of the name is: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + Resource string `json:"resource,omitempty"` + + // ResourceType: The resource type of this resource. See: + // https://cloud.google.com/asset-inventory/docs/supported-asset-types + ResourceType string `json:"resourceType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AssociatedFindings") + // 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. "AssociatedFindings") 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 *PathNode) MarshalJSON() ([]byte, error) { + type NoMethod PathNode + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // Pod: Kubernetes Pod. type Pod struct { // Containers: Pod containers associated with this finding, if any. @@ -7545,96 +7763,81 @@ func (c *FoldersMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleC } -// method id "securitycenter.folders.sources.list": +// method id "securitycenter.folders.notificationConfigs.create": -type FoldersSourcesListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type FoldersNotificationConfigsCreateCall struct { + s *Service + parent string + notificationconfig *NotificationConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists all sources belonging to an organization. +// Create: Creates a notification config. // -// - parent: Resource name of the parent of sources to list. Its format -// should be "organizations/[organization_id], folders/[folder_id], or -// projects/[project_id]". -func (r *FoldersSourcesService) List(parent string) *FoldersSourcesListCall { - c := &FoldersSourcesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: Resource name of the new notification config's parent. Its +// format is "organizations/[organization_id]", "folders/[folder_id]", +// or "projects/[project_id]". +func (r *FoldersNotificationConfigsService) Create(parent string, notificationconfig *NotificationConfig) *FoldersNotificationConfigsCreateCall { + c := &FoldersNotificationConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent + c.notificationconfig = notificationconfig return c } -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return in a single response. Default is 10, minimum is -// 1, maximum is 1000. -func (c *FoldersSourcesListCall) PageSize(pageSize int64) *FoldersSourcesListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The value returned -// by the last `ListSourcesResponse`; indicates that this is a -// continuation of a prior `ListSources` call, and that the system -// should return the next page of data. -func (c *FoldersSourcesListCall) PageToken(pageToken string) *FoldersSourcesListCall { - c.urlParams_.Set("pageToken", pageToken) +// ConfigId sets the optional parameter "configId": Required. Unique +// identifier provided by the client within the parent scope. It must be +// between 1 and 128 characters, and contains alphanumeric characters, +// underscores or hyphens only. +func (c *FoldersNotificationConfigsCreateCall) ConfigId(configId string) *FoldersNotificationConfigsCreateCall { + c.urlParams_.Set("configId", configId) 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 *FoldersSourcesListCall) Fields(s ...googleapi.Field) *FoldersSourcesListCall { +func (c *FoldersNotificationConfigsCreateCall) Fields(s ...googleapi.Field) *FoldersNotificationConfigsCreateCall { 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 *FoldersSourcesListCall) IfNoneMatch(entityTag string) *FoldersSourcesListCall { - 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 *FoldersSourcesListCall) Context(ctx context.Context) *FoldersSourcesListCall { +func (c *FoldersNotificationConfigsCreateCall) Context(ctx context.Context) *FoldersNotificationConfigsCreateCall { 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 *FoldersSourcesListCall) Header() http.Header { +func (c *FoldersNotificationConfigsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSourcesListCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersNotificationConfigsCreateCall) 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.notificationconfig) + 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/{+parent}/sources") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/notificationConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -7645,14 +7848,14 @@ func (c *FoldersSourcesListCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.sources.list" call. -// Exactly one of *ListSourcesResponse or error will be non-nil. Any +// Do executes the "securitycenter.folders.notificationConfigs.create" call. +// Exactly one of *NotificationConfig or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either -// *ListSourcesResponse.ServerResponse.Header or (if a response was +// *NotificationConfig.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *FoldersSourcesListCall) Do(opts ...googleapi.CallOption) (*ListSourcesResponse, error) { +func (c *FoldersNotificationConfigsCreateCall) Do(opts ...googleapi.CallOption) (*NotificationConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7671,7 +7874,7 @@ func (c *FoldersSourcesListCall) Do(opts ...googleapi.CallOption) (*ListSourcesR if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &ListSourcesResponse{ + ret := &NotificationConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7683,36 +7886,33 @@ func (c *FoldersSourcesListCall) Do(opts ...googleapi.CallOption) (*ListSourcesR } return ret, nil // { - // "description": "Lists all sources belonging to an organization.", - // "flatPath": "v1/folders/{foldersId}/sources", - // "httpMethod": "GET", - // "id": "securitycenter.folders.sources.list", + // "description": "Creates a notification config.", + // "flatPath": "v1/folders/{foldersId}/notificationConfigs", + // "httpMethod": "POST", + // "id": "securitycenter.folders.notificationConfigs.create", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "pageSize": { - // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The value returned by the last `ListSourcesResponse`; indicates that this is a continuation of a prior `ListSources` call, and that the system should return the next page of data.", + // "configId": { + // "description": "Required. Unique identifier provided by the client within the parent scope. It must be between 1 and 128 characters, and contains alphanumeric characters, underscores or hyphens only.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. Resource name of the parent of sources to list. Its format should be \"organizations/[organization_id], folders/[folder_id], or projects/[project_id]\".", + // "description": "Required. Resource name of the new notification config's parent. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", // "location": "path", // "pattern": "^folders/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/sources", + // "path": "v1/{+parent}/notificationConfigs", + // "request": { + // "$ref": "NotificationConfig" + // }, // "response": { - // "$ref": "ListSourcesResponse" + // "$ref": "NotificationConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -7721,63 +7921,30 @@ func (c *FoldersSourcesListCall) Do(opts ...googleapi.CallOption) (*ListSourcesR } -// 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 *FoldersSourcesListCall) Pages(ctx context.Context, f func(*ListSourcesResponse) 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 "securitycenter.folders.sources.findings.group": +// method id "securitycenter.folders.notificationConfigs.delete": -type FoldersSourcesFindingsGroupCall struct { - s *Service - parent string - groupfindingsrequest *GroupFindingsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersNotificationConfigsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Group: Filters an organization or source's findings and groups them -// by their specified properties. To group across all sources provide a -// `-` as the source id. Example: -// /v1/organizations/{organization_id}/sources/-/findings, -// /v1/folders/{folder_id}/sources/-/findings, -// /v1/projects/{project_id}/sources/-/findings +// Delete: Deletes a notification config. // -// - parent: Name of the source to groupBy. Its format is -// "organizations/[organization_id]/sources/[source_id]", -// folders/[folder_id]/sources/[source_id], or -// projects/[project_id]/sources/[source_id]. To groupBy across all -// sources provide a source_id of `-`. For example: -// organizations/{organization_id}/sources/-, -// folders/{folder_id}/sources/-, or projects/{project_id}/sources/-. -func (r *FoldersSourcesFindingsService) Group(parent string, groupfindingsrequest *GroupFindingsRequest) *FoldersSourcesFindingsGroupCall { - c := &FoldersSourcesFindingsGroupCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.groupfindingsrequest = groupfindingsrequest +// - name: Name of the notification config to delete. Its format is +// "organizations/[organization_id]/notificationConfigs/[config_id]". +func (r *FoldersNotificationConfigsService) Delete(name string) *FoldersNotificationConfigsDeleteCall { + c := &FoldersNotificationConfigsDeleteCall{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 *FoldersSourcesFindingsGroupCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsGroupCall { +func (c *FoldersNotificationConfigsDeleteCall) Fields(s ...googleapi.Field) *FoldersNotificationConfigsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -7785,21 +7952,21 @@ func (c *FoldersSourcesFindingsGroupCall) Fields(s ...googleapi.Field) *FoldersS // 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 *FoldersSourcesFindingsGroupCall) Context(ctx context.Context) *FoldersSourcesFindingsGroupCall { +func (c *FoldersNotificationConfigsDeleteCall) Context(ctx context.Context) *FoldersNotificationConfigsDeleteCall { 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 *FoldersSourcesFindingsGroupCall) Header() http.Header { +func (c *FoldersNotificationConfigsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSourcesFindingsGroupCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersNotificationConfigsDeleteCall) 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_ { @@ -7807,34 +7974,29 @@ func (c *FoldersSourcesFindingsGroupCall) doRequest(alt string) (*http.Response, } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupfindingsrequest) - 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/{+parent}/findings:group") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+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 "securitycenter.folders.sources.findings.group" call. -// Exactly one of *GroupFindingsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *GroupFindingsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *FoldersSourcesFindingsGroupCall) Do(opts ...googleapi.CallOption) (*GroupFindingsResponse, error) { +// Do executes the "securitycenter.folders.notificationConfigs.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 *FoldersNotificationConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7853,7 +8015,7 @@ func (c *FoldersSourcesFindingsGroupCall) Do(opts ...googleapi.CallOption) (*Gro if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GroupFindingsResponse{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7865,28 +8027,25 @@ func (c *FoldersSourcesFindingsGroupCall) Do(opts ...googleapi.CallOption) (*Gro } return ret, nil // { - // "description": "Filters an organization or source's findings and groups them by their specified properties. To group across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings, /v1/folders/{folder_id}/sources/-/findings, /v1/projects/{project_id}/sources/-/findings", - // "flatPath": "v1/folders/{foldersId}/sources/{sourcesId}/findings:group", - // "httpMethod": "POST", - // "id": "securitycenter.folders.sources.findings.group", + // "description": "Deletes a notification config.", + // "flatPath": "v1/folders/{foldersId}/notificationConfigs/{notificationConfigsId}", + // "httpMethod": "DELETE", + // "id": "securitycenter.folders.notificationConfigs.delete", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. Name of the source to groupBy. Its format is \"organizations/[organization_id]/sources/[source_id]\", folders/[folder_id]/sources/[source_id], or projects/[project_id]/sources/[source_id]. To groupBy across all sources provide a source_id of `-`. For example: organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, or projects/{project_id}/sources/-", + // "name": { + // "description": "Required. Name of the notification config to delete. Its format is \"organizations/[organization_id]/notificationConfigs/[config_id]\".", // "location": "path", - // "pattern": "^folders/[^/]+/sources/[^/]+$", + // "pattern": "^folders/[^/]+/notificationConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/findings:group", - // "request": { - // "$ref": "GroupFindingsRequest" - // }, + // "path": "v1/{+name}", // "response": { - // "$ref": "GroupFindingsResponse" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -7895,173 +8054,31 @@ func (c *FoldersSourcesFindingsGroupCall) Do(opts ...googleapi.CallOption) (*Gro } -// 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 *FoldersSourcesFindingsGroupCall) Pages(ctx context.Context, f func(*GroupFindingsResponse) error) error { - c.ctx_ = ctx - defer func(pt string) { c.groupfindingsrequest.PageToken = pt }(c.groupfindingsrequest.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.groupfindingsrequest.PageToken = x.NextPageToken - } -} - -// method id "securitycenter.folders.sources.findings.list": +// method id "securitycenter.folders.notificationConfigs.get": -type FoldersSourcesFindingsListCall struct { +type FoldersNotificationConfigsGetCall struct { s *Service - parent string + name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists an organization or source's findings. To list across all -// sources provide a `-` as the source id. Example: -// /v1/organizations/{organization_id}/sources/-/findings +// Get: Gets a notification config. // -// - parent: Name of the source the findings belong to. Its format is -// "organizations/[organization_id]/sources/[source_id], -// folders/[folder_id]/sources/[source_id], or -// projects/[project_id]/sources/[source_id]". To list across all -// sources provide a source_id of `-`. For example: -// organizations/{organization_id}/sources/-, -// folders/{folder_id}/sources/- or projects/{projects_id}/sources/-. -func (r *FoldersSourcesFindingsService) List(parent string) *FoldersSourcesFindingsListCall { - c := &FoldersSourcesFindingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// CompareDuration sets the optional parameter "compareDuration": When -// compare_duration is set, the ListFindingsResult's "state_change" -// attribute is updated to indicate whether the finding had its state -// changed, the finding's state remained unchanged, or if the finding -// was added in any state during the compare_duration period of time -// that precedes the read_time. This is the time between (read_time - -// compare_duration) and read_time. The state_change value is derived -// based on the presence and state of the finding at the two points in -// time. Intermediate state changes between the two times don't affect -// the result. For example, the results aren't affected if the finding -// is made inactive and then active again. Possible "state_change" -// values when compare_duration is specified: * "CHANGED": indicates -// that the finding was present and matched the given filter at the -// start of compare_duration, but changed its state at read_time. * -// "UNCHANGED": indicates that the finding was present and matched the -// given filter at the start of compare_duration and did not change -// state at read_time. * "ADDED": indicates that the finding did not -// match the given filter or was not present at the start of -// compare_duration, but was present at read_time. * "REMOVED": -// indicates that the finding was present and matched the filter at the -// start of compare_duration, but did not match the filter at read_time. -// If compare_duration is not specified, then the only possible -// state_change is "UNUSED", which will be the state_change set for all -// findings present at read_time. -func (c *FoldersSourcesFindingsListCall) CompareDuration(compareDuration string) *FoldersSourcesFindingsListCall { - c.urlParams_.Set("compareDuration", compareDuration) - return c -} - -// FieldMask sets the optional parameter "fieldMask": A field mask to -// specify the Finding fields to be listed in the response. An empty -// field mask will list all fields. -func (c *FoldersSourcesFindingsListCall) FieldMask(fieldMask string) *FoldersSourcesFindingsListCall { - c.urlParams_.Set("fieldMask", fieldMask) - return c -} - -// Filter sets the optional parameter "filter": Expression that defines -// the filter to apply across findings. The expression is a list of one -// or more restrictions combined via logical operators `AND` and `OR`. -// Parentheses are supported, and `OR` has higher precedence than `AND`. -// Restrictions have the form ` ` and may have a `-` character in front -// of them to indicate negation. Examples include: * name * -// source_properties.a_property * security_marks.marks.marka The -// supported operators are: * `=` for all value types. * `>`, `<`, `>=`, -// `<=` for integer values. * `:`, meaning substring matching, for -// strings. The supported value types are: * string literals in quotes. -// * integer literals without quotes. * boolean literals `true` and -// `false` without quotes. The following field and operator combinations -// are supported: * name: `=` * parent: `=`, `:` * resource_name: `=`, -// `:` * state: `=`, `:` * category: `=`, `:` * external_uri: `=`, `:` * -// event_time: `=`, `>`, `<`, `>=`, `<=` Usage: This should be -// milliseconds since epoch or an RFC3339 string. Examples: `event_time -// = "2019-06-10T16:07:18-07:00" `event_time = 1560208038000` * -// severity: `=`, `:` * workflow_state: `=`, `:` * security_marks.marks: -// `=`, `:` * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` For -// example, `source_properties.size = 100` is a valid filter string. Use -// a partial match on the empty string to filter based on a property -// existing: `source_properties.my_property : "" Use a negated partial -// match on the empty string to filter based on a property not existing: -// `-source_properties.my_property : "" * resource: * resource.name: -// `=`, `:` * resource.parent_name: `=`, `:` * -// resource.parent_display_name: `=`, `:` * resource.project_name: `=`, -// `:` * resource.project_display_name: `=`, `:` * resource.type: `=`, -// `:` * resource.folders.resource_folder: `=`, `:` * -// resource.display_name: `=`, `:` -func (c *FoldersSourcesFindingsListCall) Filter(filter string) *FoldersSourcesFindingsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// OrderBy sets the optional parameter "orderBy": Expression that -// defines what fields and order to use for sorting. The string value -// should follow SQL syntax: comma separated list of fields. For -// example: "name,resource_properties.a_property". The default sorting -// order is ascending. To specify descending order for a field, a suffix -// " desc" should be appended to the field name. For example: "name -// desc,source_properties.a_property". Redundant space characters in the -// syntax are insignificant. "name desc,source_properties.a_property" -// and " name desc , source_properties.a_property " are equivalent. The -// following fields are supported: name parent state category -// resource_name event_time source_properties security_marks.marks -func (c *FoldersSourcesFindingsListCall) OrderBy(orderBy string) *FoldersSourcesFindingsListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return in a single response. Default is 10, minimum is -// 1, maximum is 1000. -func (c *FoldersSourcesFindingsListCall) PageSize(pageSize int64) *FoldersSourcesFindingsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The value returned -// by the last `ListFindingsResponse`; indicates that this is a -// continuation of a prior `ListFindings` call, and that the system -// should return the next page of data. -func (c *FoldersSourcesFindingsListCall) PageToken(pageToken string) *FoldersSourcesFindingsListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// ReadTime sets the optional parameter "readTime": Time used as a -// reference point when filtering findings. The filter is limited to -// findings existing at the supplied time and their values are those at -// that specific time. Absence of this field will default to the API's -// version of NOW. -func (c *FoldersSourcesFindingsListCall) ReadTime(readTime string) *FoldersSourcesFindingsListCall { - c.urlParams_.Set("readTime", readTime) +// - name: Name of the notification config to get. Its format is +// "organizations/[organization_id]/notificationConfigs/[config_id]". +func (r *FoldersNotificationConfigsService) Get(name string) *FoldersNotificationConfigsGetCall { + c := &FoldersNotificationConfigsGetCall{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 *FoldersSourcesFindingsListCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsListCall { +func (c *FoldersNotificationConfigsGetCall) Fields(s ...googleapi.Field) *FoldersNotificationConfigsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -8071,7 +8088,7 @@ func (c *FoldersSourcesFindingsListCall) Fields(s ...googleapi.Field) *FoldersSo // 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 *FoldersSourcesFindingsListCall) IfNoneMatch(entityTag string) *FoldersSourcesFindingsListCall { +func (c *FoldersNotificationConfigsGetCall) IfNoneMatch(entityTag string) *FoldersNotificationConfigsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -8079,21 +8096,21 @@ func (c *FoldersSourcesFindingsListCall) IfNoneMatch(entityTag string) *FoldersS // 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 *FoldersSourcesFindingsListCall) Context(ctx context.Context) *FoldersSourcesFindingsListCall { +func (c *FoldersNotificationConfigsGetCall) Context(ctx context.Context) *FoldersNotificationConfigsGetCall { 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 *FoldersSourcesFindingsListCall) Header() http.Header { +func (c *FoldersNotificationConfigsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSourcesFindingsListCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersNotificationConfigsGetCall) 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_ { @@ -8106,7 +8123,7 @@ func (c *FoldersSourcesFindingsListCall) 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, "v1/{+parent}/findings") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -8114,19 +8131,19 @@ func (c *FoldersSourcesFindingsListCall) 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 "securitycenter.folders.sources.findings.list" call. -// Exactly one of *ListFindingsResponse or error will be non-nil. Any +// Do executes the "securitycenter.folders.notificationConfigs.get" call. +// Exactly one of *NotificationConfig or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either -// *ListFindingsResponse.ServerResponse.Header or (if a response was +// *NotificationConfig.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *FoldersSourcesFindingsListCall) Do(opts ...googleapi.CallOption) (*ListFindingsResponse, error) { +func (c *FoldersNotificationConfigsGetCall) Do(opts ...googleapi.CallOption) (*NotificationConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8145,7 +8162,7 @@ func (c *FoldersSourcesFindingsListCall) Do(opts ...googleapi.CallOption) (*List if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &ListFindingsResponse{ + ret := &NotificationConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8157,64 +8174,25 @@ func (c *FoldersSourcesFindingsListCall) Do(opts ...googleapi.CallOption) (*List } return ret, nil // { - // "description": "Lists an organization or source's findings. To list across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings", - // "flatPath": "v1/folders/{foldersId}/sources/{sourcesId}/findings", + // "description": "Gets a notification config.", + // "flatPath": "v1/folders/{foldersId}/notificationConfigs/{notificationConfigsId}", // "httpMethod": "GET", - // "id": "securitycenter.folders.sources.findings.list", + // "id": "securitycenter.folders.notificationConfigs.get", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "compareDuration": { - // "description": "When compare_duration is set, the ListFindingsResult's \"state_change\" attribute is updated to indicate whether the finding had its state changed, the finding's state remained unchanged, or if the finding was added in any state during the compare_duration period of time that precedes the read_time. This is the time between (read_time - compare_duration) and read_time. The state_change value is derived based on the presence and state of the finding at the two points in time. Intermediate state changes between the two times don't affect the result. For example, the results aren't affected if the finding is made inactive and then active again. Possible \"state_change\" values when compare_duration is specified: * \"CHANGED\": indicates that the finding was present and matched the given filter at the start of compare_duration, but changed its state at read_time. * \"UNCHANGED\": indicates that the finding was present and matched the given filter at the start of compare_duration and did not change state at read_time. * \"ADDED\": indicates that the finding did not match the given filter or was not present at the start of compare_duration, but was present at read_time. * \"REMOVED\": indicates that the finding was present and matched the filter at the start of compare_duration, but did not match the filter at read_time. If compare_duration is not specified, then the only possible state_change is \"UNUSED\", which will be the state_change set for all findings present at read_time.", - // "format": "google-duration", - // "location": "query", - // "type": "string" - // }, - // "fieldMask": { - // "description": "A field mask to specify the Finding fields to be listed in the response. An empty field mask will list all fields.", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" - // }, - // "filter": { - // "description": "Expression that defines the filter to apply across findings. The expression is a list of one or more restrictions combined via logical operators `AND` and `OR`. Parentheses are supported, and `OR` has higher precedence than `AND`. Restrictions have the form ` ` and may have a `-` character in front of them to indicate negation. Examples include: * name * source_properties.a_property * security_marks.marks.marka The supported operators are: * `=` for all value types. * `\u003e`, `\u003c`, `\u003e=`, `\u003c=` for integer values. * `:`, meaning substring matching, for strings. The supported value types are: * string literals in quotes. * integer literals without quotes. * boolean literals `true` and `false` without quotes. The following field and operator combinations are supported: * name: `=` * parent: `=`, `:` * resource_name: `=`, `:` * state: `=`, `:` * category: `=`, `:` * external_uri: `=`, `:` * event_time: `=`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: `event_time = \"2019-06-10T16:07:18-07:00\"` `event_time = 1560208038000` * severity: `=`, `:` * workflow_state: `=`, `:` * security_marks.marks: `=`, `:` * source_properties: `=`, `:`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` For example, `source_properties.size = 100` is a valid filter string. Use a partial match on the empty string to filter based on a property existing: `source_properties.my_property : \"\"` Use a negated partial match on the empty string to filter based on a property not existing: `-source_properties.my_property : \"\"` * resource: * resource.name: `=`, `:` * resource.parent_name: `=`, `:` * resource.parent_display_name: `=`, `:` * resource.project_name: `=`, `:` * resource.project_display_name: `=`, `:` * resource.type: `=`, `:` * resource.folders.resource_folder: `=`, `:` * resource.display_name: `=`, `:`", - // "location": "query", - // "type": "string" - // }, - // "orderBy": { - // "description": "Expression that defines what fields and order to use for sorting. The string value should follow SQL syntax: comma separated list of fields. For example: \"name,resource_properties.a_property\". The default sorting order is ascending. To specify descending order for a field, a suffix \" desc\" should be appended to the field name. For example: \"name desc,source_properties.a_property\". Redundant space characters in the syntax are insignificant. \"name desc,source_properties.a_property\" and \" name desc , source_properties.a_property \" are equivalent. The following fields are supported: name parent state category resource_name event_time source_properties security_marks.marks", - // "location": "query", - // "type": "string" - // }, - // "pageSize": { - // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The value returned by the last `ListFindingsResponse`; indicates that this is a continuation of a prior `ListFindings` call, and that the system should return the next page of data.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. Name of the source the findings belong to. Its format is \"organizations/[organization_id]/sources/[source_id], folders/[folder_id]/sources/[source_id], or projects/[project_id]/sources/[source_id]\". To list across all sources provide a source_id of `-`. For example: organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or projects/{projects_id}/sources/-", + // "name": { + // "description": "Required. Name of the notification config to get. Its format is \"organizations/[organization_id]/notificationConfigs/[config_id]\".", // "location": "path", - // "pattern": "^folders/[^/]+/sources/[^/]+$", + // "pattern": "^folders/[^/]+/notificationConfigs/[^/]+$", // "required": true, // "type": "string" - // }, - // "readTime": { - // "description": "Time used as a reference point when filtering findings. The filter is limited to findings existing at the supplied time and their values are those at that specific time. Absence of this field will default to the API's version of NOW.", - // "format": "google-datetime", - // "location": "query", - // "type": "string" // } // }, - // "path": "v1/{+parent}/findings", + // "path": "v1/{+name}", // "response": { - // "$ref": "ListFindingsResponse" + // "$ref": "NotificationConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -8223,125 +8201,114 @@ func (c *FoldersSourcesFindingsListCall) Do(opts ...googleapi.CallOption) (*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 *FoldersSourcesFindingsListCall) Pages(ctx context.Context, f func(*ListFindingsResponse) 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 "securitycenter.folders.sources.findings.patch": +// method id "securitycenter.folders.notificationConfigs.list": -type FoldersSourcesFindingsPatchCall struct { - s *Service - name string - finding *Finding - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersNotificationConfigsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Patch: Creates or updates a finding. The corresponding source must -// exist for a finding creation to succeed. +// List: Lists notification configs. // -// - name: The relative resource name of this finding. See: -// https://cloud.google.com/apis/design/resource_names#relative_resource_name -// Example: -// "organizations/{organization_id}/sources/{source_id}/findings/{findi -// ng_id}". -func (r *FoldersSourcesFindingsService) Patch(name string, finding *Finding) *FoldersSourcesFindingsPatchCall { - c := &FoldersSourcesFindingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.finding = finding +// - parent: Name of the organization to list notification configs. Its +// format is "organizations/[organization_id]", "folders/[folder_id]", +// or "projects/[project_id]". +func (r *FoldersNotificationConfigsService) List(parent string) *FoldersNotificationConfigsListCall { + c := &FoldersNotificationConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent return c } -// UpdateMask sets the optional parameter "updateMask": The FieldMask to -// use when updating the finding resource. This field should not be -// specified when creating a finding. When updating a finding, an empty -// mask is treated as updating all mutable fields and replacing -// source_properties. Individual source_properties can be added/updated -// by using "source_properties." in the field mask. -func (c *FoldersSourcesFindingsPatchCall) UpdateMask(updateMask string) *FoldersSourcesFindingsPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return in a single response. Default is 10, minimum is +// 1, maximum is 1000. +func (c *FoldersNotificationConfigsListCall) PageSize(pageSize int64) *FoldersNotificationConfigsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last `ListNotificationConfigsResponse`; indicates that this is +// a continuation of a prior `ListNotificationConfigs` call, and that +// the system should return the next page of data. +func (c *FoldersNotificationConfigsListCall) PageToken(pageToken string) *FoldersNotificationConfigsListCall { + 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 *FoldersSourcesFindingsPatchCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsPatchCall { +func (c *FoldersNotificationConfigsListCall) Fields(s ...googleapi.Field) *FoldersNotificationConfigsListCall { 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 *FoldersNotificationConfigsListCall) IfNoneMatch(entityTag string) *FoldersNotificationConfigsListCall { + 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 *FoldersSourcesFindingsPatchCall) Context(ctx context.Context) *FoldersSourcesFindingsPatchCall { +func (c *FoldersNotificationConfigsListCall) Context(ctx context.Context) *FoldersNotificationConfigsListCall { 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 *FoldersSourcesFindingsPatchCall) Header() http.Header { +func (c *FoldersNotificationConfigsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSourcesFindingsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersNotificationConfigsListCall) 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.finding) - 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, "v1/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/notificationConfigs") 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 "securitycenter.folders.sources.findings.patch" call. -// Exactly one of *Finding or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Finding.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *FoldersSourcesFindingsPatchCall) Do(opts ...googleapi.CallOption) (*Finding, error) { +// Do executes the "securitycenter.folders.notificationConfigs.list" call. +// Exactly one of *ListNotificationConfigsResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ListNotificationConfigsResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FoldersNotificationConfigsListCall) Do(opts ...googleapi.CallOption) (*ListNotificationConfigsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8360,7 +8327,7 @@ func (c *FoldersSourcesFindingsPatchCall) Do(opts ...googleapi.CallOption) (*Fin if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &Finding{ + ret := &ListNotificationConfigsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8372,34 +8339,36 @@ func (c *FoldersSourcesFindingsPatchCall) Do(opts ...googleapi.CallOption) (*Fin } return ret, nil // { - // "description": "Creates or updates a finding. The corresponding source must exist for a finding creation to succeed.", - // "flatPath": "v1/folders/{foldersId}/sources/{sourcesId}/findings/{findingsId}", - // "httpMethod": "PATCH", - // "id": "securitycenter.folders.sources.findings.patch", + // "description": "Lists notification configs.", + // "flatPath": "v1/folders/{foldersId}/notificationConfigs", + // "httpMethod": "GET", + // "id": "securitycenter.folders.notificationConfigs.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "The relative resource name of this finding. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}\"", - // "location": "path", - // "pattern": "^folders/[^/]+/sources/[^/]+/findings/[^/]+$", - // "required": true, - // "type": "string" + // "pageSize": { + // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" // }, - // "updateMask": { - // "description": "The FieldMask to use when updating the finding resource. This field should not be specified when creating a finding. When updating a finding, an empty mask is treated as updating all mutable fields and replacing source_properties. Individual source_properties can be added/updated by using \"source_properties.\" in the field mask.", - // "format": "google-fieldmask", + // "pageToken": { + // "description": "The value returned by the last `ListNotificationConfigsResponse`; indicates that this is a continuation of a prior `ListNotificationConfigs` call, and that the system should return the next page of data.", // "location": "query", // "type": "string" + // }, + // "parent": { + // "description": "Required. Name of the organization to list notification configs. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "location": "path", + // "pattern": "^folders/[^/]+$", + // "required": true, + // "type": "string" // } // }, - // "path": "v1/{+name}", - // "request": { - // "$ref": "Finding" - // }, + // "path": "v1/{+parent}/notificationConfigs", // "response": { - // "$ref": "Finding" + // "$ref": "ListNotificationConfigsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -8408,37 +8377,65 @@ func (c *FoldersSourcesFindingsPatchCall) Do(opts ...googleapi.CallOption) (*Fin } -// method id "securitycenter.folders.sources.findings.setMute": +// 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 *FoldersNotificationConfigsListCall) Pages(ctx context.Context, f func(*ListNotificationConfigsResponse) 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 FoldersSourcesFindingsSetMuteCall struct { - s *Service - name string - setmuterequest *SetMuteRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "securitycenter.folders.notificationConfigs.patch": + +type FoldersNotificationConfigsPatchCall struct { + s *Service + name string + notificationconfig *NotificationConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// SetMute: Updates the mute state of a finding. +// Patch: Updates a notification config. The following update fields +// are allowed: description, pubsub_topic, streaming_config.filter // -// - name: The relative resource name of the finding. See: +// - name: The relative resource name of this notification config. See: // https://cloud.google.com/apis/design/resource_names#relative_resource_name // Example: -// "organizations/{organization_id}/sources/{source_id}/finding/{findin -// g_id}", -// "folders/{folder_id}/sources/{source_id}/finding/{finding_id}", -// "projects/{project_id}/sources/{source_id}/finding/{finding_id}". -func (r *FoldersSourcesFindingsService) SetMute(name string, setmuterequest *SetMuteRequest) *FoldersSourcesFindingsSetMuteCall { - c := &FoldersSourcesFindingsSetMuteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// "organizations/{organization_id}/notificationConfigs/notify_public_b +// ucket". +func (r *FoldersNotificationConfigsService) Patch(name string, notificationconfig *NotificationConfig) *FoldersNotificationConfigsPatchCall { + c := &FoldersNotificationConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.setmuterequest = setmuterequest + c.notificationconfig = notificationconfig + return c +} + +// UpdateMask sets the optional parameter "updateMask": The FieldMask to +// use when updating the notification config. If empty all mutable +// fields will be updated. +func (c *FoldersNotificationConfigsPatchCall) UpdateMask(updateMask string) *FoldersNotificationConfigsPatchCall { + 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 *FoldersSourcesFindingsSetMuteCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsSetMuteCall { +func (c *FoldersNotificationConfigsPatchCall) Fields(s ...googleapi.Field) *FoldersNotificationConfigsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -8446,21 +8443,21 @@ func (c *FoldersSourcesFindingsSetMuteCall) 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 *FoldersSourcesFindingsSetMuteCall) Context(ctx context.Context) *FoldersSourcesFindingsSetMuteCall { +func (c *FoldersNotificationConfigsPatchCall) Context(ctx context.Context) *FoldersNotificationConfigsPatchCall { 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 *FoldersSourcesFindingsSetMuteCall) Header() http.Header { +func (c *FoldersNotificationConfigsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSourcesFindingsSetMuteCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersNotificationConfigsPatchCall) 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_ { @@ -8468,16 +8465,16 @@ func (c *FoldersSourcesFindingsSetMuteCall) doRequest(alt string) (*http.Respons } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmuterequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationconfig) 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}:setMute") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+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 } @@ -8488,14 +8485,14 @@ func (c *FoldersSourcesFindingsSetMuteCall) doRequest(alt string) (*http.Respons return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.sources.findings.setMute" call. -// Exactly one of *Finding or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Finding.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *FoldersSourcesFindingsSetMuteCall) Do(opts ...googleapi.CallOption) (*Finding, error) { +// Do executes the "securitycenter.folders.notificationConfigs.patch" call. +// Exactly one of *NotificationConfig or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *NotificationConfig.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FoldersNotificationConfigsPatchCall) Do(opts ...googleapi.CallOption) (*NotificationConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8514,7 +8511,7 @@ func (c *FoldersSourcesFindingsSetMuteCall) Do(opts ...googleapi.CallOption) (*F if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &Finding{ + ret := &NotificationConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8526,28 +8523,34 @@ func (c *FoldersSourcesFindingsSetMuteCall) Do(opts ...googleapi.CallOption) (*F } return ret, nil // { - // "description": "Updates the mute state of a finding.", - // "flatPath": "v1/folders/{foldersId}/sources/{sourcesId}/findings/{findingsId}:setMute", - // "httpMethod": "POST", - // "id": "securitycenter.folders.sources.findings.setMute", + // "description": " Updates a notification config. The following update fields are allowed: description, pubsub_topic, streaming_config.filter", + // "flatPath": "v1/folders/{foldersId}/notificationConfigs/{notificationConfigsId}", + // "httpMethod": "PATCH", + // "id": "securitycenter.folders.notificationConfigs.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The relative resource name of the finding. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/sources/{source_id}/finding/{finding_id}\", \"folders/{folder_id}/sources/{source_id}/finding/{finding_id}\", \"projects/{project_id}/sources/{source_id}/finding/{finding_id}\".", + // "description": "The relative resource name of this notification config. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/notificationConfigs/notify_public_bucket\".", // "location": "path", - // "pattern": "^folders/[^/]+/sources/[^/]+/findings/[^/]+$", + // "pattern": "^folders/[^/]+/notificationConfigs/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "The FieldMask to use when updating the notification config. If empty all mutable fields will be updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v1/{+name}:setMute", + // "path": "v1/{+name}", // "request": { - // "$ref": "SetMuteRequest" + // "$ref": "NotificationConfig" // }, // "response": { - // "$ref": "Finding" + // "$ref": "NotificationConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -8556,92 +8559,114 @@ func (c *FoldersSourcesFindingsSetMuteCall) Do(opts ...googleapi.CallOption) (*F } -// method id "securitycenter.folders.sources.findings.setState": +// method id "securitycenter.folders.sources.list": -type FoldersSourcesFindingsSetStateCall struct { - s *Service - name string - setfindingstaterequest *SetFindingStateRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersSourcesListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// SetState: Updates the state of a finding. +// List: Lists all sources belonging to an organization. // -// - name: The relative resource name of the finding. See: -// https://cloud.google.com/apis/design/resource_names#relative_resource_name -// Example: -// "organizations/{organization_id}/sources/{source_id}/finding/{findin -// g_id}". -func (r *FoldersSourcesFindingsService) SetState(name string, setfindingstaterequest *SetFindingStateRequest) *FoldersSourcesFindingsSetStateCall { - c := &FoldersSourcesFindingsSetStateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.setfindingstaterequest = setfindingstaterequest +// - parent: Resource name of the parent of sources to list. Its format +// should be "organizations/[organization_id], folders/[folder_id], or +// projects/[project_id]". +func (r *FoldersSourcesService) List(parent string) *FoldersSourcesListCall { + c := &FoldersSourcesListCall{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 in a single response. Default is 10, minimum is +// 1, maximum is 1000. +func (c *FoldersSourcesListCall) PageSize(pageSize int64) *FoldersSourcesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last `ListSourcesResponse`; indicates that this is a +// continuation of a prior `ListSources` call, and that the system +// should return the next page of data. +func (c *FoldersSourcesListCall) PageToken(pageToken string) *FoldersSourcesListCall { + 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 *FoldersSourcesFindingsSetStateCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsSetStateCall { +func (c *FoldersSourcesListCall) Fields(s ...googleapi.Field) *FoldersSourcesListCall { 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 *FoldersSourcesListCall) IfNoneMatch(entityTag string) *FoldersSourcesListCall { + 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 *FoldersSourcesFindingsSetStateCall) Context(ctx context.Context) *FoldersSourcesFindingsSetStateCall { +func (c *FoldersSourcesListCall) Context(ctx context.Context) *FoldersSourcesListCall { 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 *FoldersSourcesFindingsSetStateCall) Header() http.Header { +func (c *FoldersSourcesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSourcesFindingsSetStateCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSourcesListCall) 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.setfindingstaterequest) - 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, "v1/{+name}:setState") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/sources") 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 "securitycenter.folders.sources.findings.setState" call. -// Exactly one of *Finding or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Finding.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *FoldersSourcesFindingsSetStateCall) Do(opts ...googleapi.CallOption) (*Finding, error) { +// Do executes the "securitycenter.folders.sources.list" call. +// Exactly one of *ListSourcesResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListSourcesResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FoldersSourcesListCall) Do(opts ...googleapi.CallOption) (*ListSourcesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8660,7 +8685,7 @@ func (c *FoldersSourcesFindingsSetStateCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &Finding{ + ret := &ListSourcesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8672,28 +8697,36 @@ func (c *FoldersSourcesFindingsSetStateCall) Do(opts ...googleapi.CallOption) (* } return ret, nil // { - // "description": "Updates the state of a finding.", - // "flatPath": "v1/folders/{foldersId}/sources/{sourcesId}/findings/{findingsId}:setState", - // "httpMethod": "POST", - // "id": "securitycenter.folders.sources.findings.setState", + // "description": "Lists all sources belonging to an organization.", + // "flatPath": "v1/folders/{foldersId}/sources", + // "httpMethod": "GET", + // "id": "securitycenter.folders.sources.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The relative resource name of the finding. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/sources/{source_id}/finding/{finding_id}\".", + // "pageSize": { + // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value returned by the last `ListSourcesResponse`; indicates that this is a continuation of a prior `ListSources` call, and that the system should return the next page of data.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. Resource name of the parent of sources to list. Its format should be \"organizations/[organization_id], folders/[folder_id], or projects/[project_id]\".", // "location": "path", - // "pattern": "^folders/[^/]+/sources/[^/]+/findings/[^/]+$", + // "pattern": "^folders/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}:setState", - // "request": { - // "$ref": "SetFindingStateRequest" - // }, + // "path": "v1/{+parent}/sources", // "response": { - // "$ref": "Finding" + // "$ref": "ListSourcesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -8702,55 +8735,63 @@ func (c *FoldersSourcesFindingsSetStateCall) Do(opts ...googleapi.CallOption) (* } -// method id "securitycenter.folders.sources.findings.updateSecurityMarks": - -type FoldersSourcesFindingsUpdateSecurityMarksCall struct { - s *Service - name string - securitymarks *SecurityMarks - urlParams_ gensupport.URLParams - 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 *FoldersSourcesListCall) Pages(ctx context.Context, f func(*ListSourcesResponse) 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) + } } -// UpdateSecurityMarks: Updates security marks. -// -// - name: The relative resource name of the SecurityMarks. See: -// https://cloud.google.com/apis/design/resource_names#relative_resource_name -// Examples: -// "organizations/{organization_id}/assets/{asset_id}/securityMarks" -// "organizations/{organization_id}/sources/{source_id}/findings/{findi -// ng_id}/securityMarks". -func (r *FoldersSourcesFindingsService) UpdateSecurityMarks(name string, securitymarks *SecurityMarks) *FoldersSourcesFindingsUpdateSecurityMarksCall { - c := &FoldersSourcesFindingsUpdateSecurityMarksCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.securitymarks = securitymarks - return c -} +// method id "securitycenter.folders.sources.findings.group": -// StartTime sets the optional parameter "startTime": The time at which -// the updated SecurityMarks take effect. If not set uses current server -// time. Updates will be applied to the SecurityMarks that are active -// immediately preceding this time. Must be earlier or equal to the -// server time. -func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) StartTime(startTime string) *FoldersSourcesFindingsUpdateSecurityMarksCall { - c.urlParams_.Set("startTime", startTime) - return c +type FoldersSourcesFindingsGroupCall struct { + s *Service + parent string + groupfindingsrequest *GroupFindingsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// UpdateMask sets the optional parameter "updateMask": The FieldMask to -// use when updating the security marks resource. The field mask must -// not contain duplicate fields. If empty or set to "marks", all marks -// will be replaced. Individual marks can be updated using "marks.". -func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) UpdateMask(updateMask string) *FoldersSourcesFindingsUpdateSecurityMarksCall { - c.urlParams_.Set("updateMask", updateMask) +// Group: Filters an organization or source's findings and groups them +// by their specified properties. To group across all sources provide a +// `-` as the source id. Example: +// /v1/organizations/{organization_id}/sources/-/findings, +// /v1/folders/{folder_id}/sources/-/findings, +// /v1/projects/{project_id}/sources/-/findings +// +// - parent: Name of the source to groupBy. Its format is +// "organizations/[organization_id]/sources/[source_id]", +// folders/[folder_id]/sources/[source_id], or +// projects/[project_id]/sources/[source_id]. To groupBy across all +// sources provide a source_id of `-`. For example: +// organizations/{organization_id}/sources/-, +// folders/{folder_id}/sources/-, or projects/{project_id}/sources/-. +func (r *FoldersSourcesFindingsService) Group(parent string, groupfindingsrequest *GroupFindingsRequest) *FoldersSourcesFindingsGroupCall { + c := &FoldersSourcesFindingsGroupCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.groupfindingsrequest = groupfindingsrequest 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 *FoldersSourcesFindingsUpdateSecurityMarksCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsUpdateSecurityMarksCall { +func (c *FoldersSourcesFindingsGroupCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsGroupCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -8758,21 +8799,21 @@ func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) 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 *FoldersSourcesFindingsUpdateSecurityMarksCall) Context(ctx context.Context) *FoldersSourcesFindingsUpdateSecurityMarksCall { +func (c *FoldersSourcesFindingsGroupCall) Context(ctx context.Context) *FoldersSourcesFindingsGroupCall { 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 *FoldersSourcesFindingsUpdateSecurityMarksCall) Header() http.Header { +func (c *FoldersSourcesFindingsGroupCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSourcesFindingsGroupCall) 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_ { @@ -8780,34 +8821,34 @@ func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) doRequest(alt string) (* } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitymarks) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupfindingsrequest) 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 := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findings:group") 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 "securitycenter.folders.sources.findings.updateSecurityMarks" call. -// Exactly one of *SecurityMarks or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *SecurityMarks.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use +// Do executes the "securitycenter.folders.sources.findings.group" call. +// Exactly one of *GroupFindingsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GroupFindingsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOption) (*SecurityMarks, error) { +func (c *FoldersSourcesFindingsGroupCall) Do(opts ...googleapi.CallOption) (*GroupFindingsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8826,7 +8867,7 @@ func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) Do(opts ...googleapi.Cal if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &SecurityMarks{ + ret := &GroupFindingsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8838,40 +8879,28 @@ func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) Do(opts ...googleapi.Cal } return ret, nil // { - // "description": "Updates security marks.", - // "flatPath": "v1/folders/{foldersId}/sources/{sourcesId}/findings/{findingsId}/securityMarks", - // "httpMethod": "PATCH", - // "id": "securitycenter.folders.sources.findings.updateSecurityMarks", + // "description": "Filters an organization or source's findings and groups them by their specified properties. To group across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings, /v1/folders/{folder_id}/sources/-/findings, /v1/projects/{project_id}/sources/-/findings", + // "flatPath": "v1/folders/{foldersId}/sources/{sourcesId}/findings:group", + // "httpMethod": "POST", + // "id": "securitycenter.folders.sources.findings.group", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "The relative resource name of the SecurityMarks. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Examples: \"organizations/{organization_id}/assets/{asset_id}/securityMarks\" \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks\".", + // "parent": { + // "description": "Required. Name of the source to groupBy. Its format is \"organizations/[organization_id]/sources/[source_id]\", folders/[folder_id]/sources/[source_id], or projects/[project_id]/sources/[source_id]. To groupBy across all sources provide a source_id of `-`. For example: organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, or projects/{project_id}/sources/-", // "location": "path", - // "pattern": "^folders/[^/]+/sources/[^/]+/findings/[^/]+/securityMarks$", + // "pattern": "^folders/[^/]+/sources/[^/]+$", // "required": true, // "type": "string" - // }, - // "startTime": { - // "description": "The time at which the updated SecurityMarks take effect. If not set uses current server time. Updates will be applied to the SecurityMarks that are active immediately preceding this time. Must be earlier or equal to the server time.", - // "format": "google-datetime", - // "location": "query", - // "type": "string" - // }, - // "updateMask": { - // "description": "The FieldMask to use when updating the security marks resource. The field mask must not contain duplicate fields. If empty or set to \"marks\", all marks will be replaced. Individual marks can be updated using \"marks.\".", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/findings:group", // "request": { - // "$ref": "SecurityMarks" + // "$ref": "GroupFindingsRequest" // }, // "response": { - // "$ref": "SecurityMarks" + // "$ref": "GroupFindingsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -8880,193 +8909,173 @@ func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) Do(opts ...googleapi.Cal } -// method id "securitycenter.folders.sources.findings.externalSystems.patch": +// 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 *FoldersSourcesFindingsGroupCall) Pages(ctx context.Context, f func(*GroupFindingsResponse) error) error { + c.ctx_ = ctx + defer func(pt string) { c.groupfindingsrequest.PageToken = pt }(c.groupfindingsrequest.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.groupfindingsrequest.PageToken = x.NextPageToken + } +} -type FoldersSourcesFindingsExternalSystemsPatchCall struct { - s *Service - name string - googlecloudsecuritycenterv1externalsystem *GoogleCloudSecuritycenterV1ExternalSystem - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "securitycenter.folders.sources.findings.list": + +type FoldersSourcesFindingsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Patch: Updates external system. This is for a given finding. +// List: Lists an organization or source's findings. To list across all +// sources provide a `-` as the source id. Example: +// /v1/organizations/{organization_id}/sources/-/findings // -// - name: External System Name e.g. jira, demisto, etc. e.g.: -// `organizations/1234/sources/5678/findings/123456/externalSystems/jir -// a` `folders/1234/sources/5678/findings/123456/externalSystems/jira` -// `projects/1234/sources/5678/findings/123456/externalSystems/jira`. -func (r *FoldersSourcesFindingsExternalSystemsService) Patch(name string, googlecloudsecuritycenterv1externalsystem *GoogleCloudSecuritycenterV1ExternalSystem) *FoldersSourcesFindingsExternalSystemsPatchCall { - c := &FoldersSourcesFindingsExternalSystemsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.googlecloudsecuritycenterv1externalsystem = googlecloudsecuritycenterv1externalsystem +// - parent: Name of the source the findings belong to. Its format is +// "organizations/[organization_id]/sources/[source_id], +// folders/[folder_id]/sources/[source_id], or +// projects/[project_id]/sources/[source_id]". To list across all +// sources provide a source_id of `-`. For example: +// organizations/{organization_id}/sources/-, +// folders/{folder_id}/sources/- or projects/{projects_id}/sources/-. +func (r *FoldersSourcesFindingsService) List(parent string) *FoldersSourcesFindingsListCall { + c := &FoldersSourcesFindingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent return c } -// UpdateMask sets the optional parameter "updateMask": The FieldMask to -// use when updating the external system resource. If empty all mutable -// fields will be updated. -func (c *FoldersSourcesFindingsExternalSystemsPatchCall) UpdateMask(updateMask string) *FoldersSourcesFindingsExternalSystemsPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// CompareDuration sets the optional parameter "compareDuration": When +// compare_duration is set, the ListFindingsResult's "state_change" +// attribute is updated to indicate whether the finding had its state +// changed, the finding's state remained unchanged, or if the finding +// was added in any state during the compare_duration period of time +// that precedes the read_time. This is the time between (read_time - +// compare_duration) and read_time. The state_change value is derived +// based on the presence and state of the finding at the two points in +// time. Intermediate state changes between the two times don't affect +// the result. For example, the results aren't affected if the finding +// is made inactive and then active again. Possible "state_change" +// values when compare_duration is specified: * "CHANGED": indicates +// that the finding was present and matched the given filter at the +// start of compare_duration, but changed its state at read_time. * +// "UNCHANGED": indicates that the finding was present and matched the +// given filter at the start of compare_duration and did not change +// state at read_time. * "ADDED": indicates that the finding did not +// match the given filter or was not present at the start of +// compare_duration, but was present at read_time. * "REMOVED": +// indicates that the finding was present and matched the filter at the +// start of compare_duration, but did not match the filter at read_time. +// If compare_duration is not specified, then the only possible +// state_change is "UNUSED", which will be the state_change set for all +// findings present at read_time. +func (c *FoldersSourcesFindingsListCall) CompareDuration(compareDuration string) *FoldersSourcesFindingsListCall { + c.urlParams_.Set("compareDuration", compareDuration) 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 *FoldersSourcesFindingsExternalSystemsPatchCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsExternalSystemsPatchCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) +// FieldMask sets the optional parameter "fieldMask": A field mask to +// specify the Finding fields to be listed in the response. An empty +// field mask will list all fields. +func (c *FoldersSourcesFindingsListCall) FieldMask(fieldMask string) *FoldersSourcesFindingsListCall { + c.urlParams_.Set("fieldMask", fieldMask) 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 *FoldersSourcesFindingsExternalSystemsPatchCall) Context(ctx context.Context) *FoldersSourcesFindingsExternalSystemsPatchCall { - c.ctx_ = ctx +// Filter sets the optional parameter "filter": Expression that defines +// the filter to apply across findings. The expression is a list of one +// or more restrictions combined via logical operators `AND` and `OR`. +// Parentheses are supported, and `OR` has higher precedence than `AND`. +// Restrictions have the form ` ` and may have a `-` character in front +// of them to indicate negation. Examples include: * name * +// source_properties.a_property * security_marks.marks.marka The +// supported operators are: * `=` for all value types. * `>`, `<`, `>=`, +// `<=` for integer values. * `:`, meaning substring matching, for +// strings. The supported value types are: * string literals in quotes. +// * integer literals without quotes. * boolean literals `true` and +// `false` without quotes. The following field and operator combinations +// are supported: * name: `=` * parent: `=`, `:` * resource_name: `=`, +// `:` * state: `=`, `:` * category: `=`, `:` * external_uri: `=`, `:` * +// event_time: `=`, `>`, `<`, `>=`, `<=` Usage: This should be +// milliseconds since epoch or an RFC3339 string. Examples: `event_time +// = "2019-06-10T16:07:18-07:00" `event_time = 1560208038000` * +// severity: `=`, `:` * workflow_state: `=`, `:` * security_marks.marks: +// `=`, `:` * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` For +// example, `source_properties.size = 100` is a valid filter string. Use +// a partial match on the empty string to filter based on a property +// existing: `source_properties.my_property : "" Use a negated partial +// match on the empty string to filter based on a property not existing: +// `-source_properties.my_property : "" * resource: * resource.name: +// `=`, `:` * resource.parent_name: `=`, `:` * +// resource.parent_display_name: `=`, `:` * resource.project_name: `=`, +// `:` * resource.project_display_name: `=`, `:` * resource.type: `=`, +// `:` * resource.folders.resource_folder: `=`, `:` * +// resource.display_name: `=`, `:` +func (c *FoldersSourcesFindingsListCall) Filter(filter string) *FoldersSourcesFindingsListCall { + c.urlParams_.Set("filter", filter) return c } -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *FoldersSourcesFindingsExternalSystemsPatchCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ +// OrderBy sets the optional parameter "orderBy": Expression that +// defines what fields and order to use for sorting. The string value +// should follow SQL syntax: comma separated list of fields. For +// example: "name,resource_properties.a_property". The default sorting +// order is ascending. To specify descending order for a field, a suffix +// " desc" should be appended to the field name. For example: "name +// desc,source_properties.a_property". Redundant space characters in the +// syntax are insignificant. "name desc,source_properties.a_property" +// and " name desc , source_properties.a_property " are equivalent. The +// following fields are supported: name parent state category +// resource_name event_time source_properties security_marks.marks +func (c *FoldersSourcesFindingsListCall) OrderBy(orderBy string) *FoldersSourcesFindingsListCall { + c.urlParams_.Set("orderBy", orderBy) + return c } -func (c *FoldersSourcesFindingsExternalSystemsPatchCall) 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.googlecloudsecuritycenterv1externalsystem) - 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 "securitycenter.folders.sources.findings.externalSystems.patch" call. -// Exactly one of *GoogleCloudSecuritycenterV1ExternalSystem or error -// will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudSecuritycenterV1ExternalSystem.ServerResponse.Header or -// (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *FoldersSourcesFindingsExternalSystemsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1ExternalSystem, 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, &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, err - } - ret := &GoogleCloudSecuritycenterV1ExternalSystem{ - 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 external system. This is for a given finding.", - // "flatPath": "v1/folders/{foldersId}/sources/{sourcesId}/findings/{findingsId}/externalSystems/{externalSystemsId}", - // "httpMethod": "PATCH", - // "id": "securitycenter.folders.sources.findings.externalSystems.patch", - // "parameterOrder": [ - // "name" - // ], - // "parameters": { - // "name": { - // "description": "External System Name e.g. jira, demisto, etc. e.g.: `organizations/1234/sources/5678/findings/123456/externalSystems/jira` `folders/1234/sources/5678/findings/123456/externalSystems/jira` `projects/1234/sources/5678/findings/123456/externalSystems/jira`", - // "location": "path", - // "pattern": "^folders/[^/]+/sources/[^/]+/findings/[^/]+/externalSystems/[^/]+$", - // "required": true, - // "type": "string" - // }, - // "updateMask": { - // "description": "The FieldMask to use when updating the external system resource. If empty all mutable fields will be updated.", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "v1/{+name}", - // "request": { - // "$ref": "GoogleCloudSecuritycenterV1ExternalSystem" - // }, - // "response": { - // "$ref": "GoogleCloudSecuritycenterV1ExternalSystem" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform" - // ] - // } - +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return in a single response. Default is 10, minimum is +// 1, maximum is 1000. +func (c *FoldersSourcesFindingsListCall) PageSize(pageSize int64) *FoldersSourcesFindingsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c } -// method id "securitycenter.organizations.getOrganizationSettings": - -type OrganizationsGetOrganizationSettingsCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// PageToken sets the optional parameter "pageToken": The value returned +// by the last `ListFindingsResponse`; indicates that this is a +// continuation of a prior `ListFindings` call, and that the system +// should return the next page of data. +func (c *FoldersSourcesFindingsListCall) PageToken(pageToken string) *FoldersSourcesFindingsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c } -// GetOrganizationSettings: Gets the settings for an organization. -// -// - name: Name of the organization to get organization settings for. -// Its format is -// "organizations/[organization_id]/organizationSettings". -func (r *OrganizationsService) GetOrganizationSettings(name string) *OrganizationsGetOrganizationSettingsCall { - c := &OrganizationsGetOrganizationSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// ReadTime sets the optional parameter "readTime": Time used as a +// reference point when filtering findings. The filter is limited to +// findings existing at the supplied time and their values are those at +// that specific time. Absence of this field will default to the API's +// version of NOW. +func (c *FoldersSourcesFindingsListCall) ReadTime(readTime string) *FoldersSourcesFindingsListCall { + c.urlParams_.Set("readTime", readTime) 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 *OrganizationsGetOrganizationSettingsCall) Fields(s ...googleapi.Field) *OrganizationsGetOrganizationSettingsCall { +func (c *FoldersSourcesFindingsListCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -9076,7 +9085,7 @@ func (c *OrganizationsGetOrganizationSettingsCall) 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 *OrganizationsGetOrganizationSettingsCall) IfNoneMatch(entityTag string) *OrganizationsGetOrganizationSettingsCall { +func (c *FoldersSourcesFindingsListCall) IfNoneMatch(entityTag string) *FoldersSourcesFindingsListCall { c.ifNoneMatch_ = entityTag return c } @@ -9084,21 +9093,21 @@ func (c *OrganizationsGetOrganizationSettingsCall) 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 *OrganizationsGetOrganizationSettingsCall) Context(ctx context.Context) *OrganizationsGetOrganizationSettingsCall { +func (c *FoldersSourcesFindingsListCall) Context(ctx context.Context) *FoldersSourcesFindingsListCall { 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 *OrganizationsGetOrganizationSettingsCall) Header() http.Header { +func (c *FoldersSourcesFindingsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsGetOrganizationSettingsCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSourcesFindingsListCall) 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_ { @@ -9111,7 +9120,7 @@ func (c *OrganizationsGetOrganizationSettingsCall) 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, "v1/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findings") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -9119,19 +9128,19 @@ func (c *OrganizationsGetOrganizationSettingsCall) 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 "securitycenter.organizations.getOrganizationSettings" call. -// Exactly one of *OrganizationSettings or error will be non-nil. Any +// Do executes the "securitycenter.folders.sources.findings.list" call. +// Exactly one of *ListFindingsResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either -// *OrganizationSettings.ServerResponse.Header or (if a response was +// *ListFindingsResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *OrganizationsGetOrganizationSettingsCall) Do(opts ...googleapi.CallOption) (*OrganizationSettings, error) { +func (c *FoldersSourcesFindingsListCall) Do(opts ...googleapi.CallOption) (*ListFindingsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9150,7 +9159,7 @@ func (c *OrganizationsGetOrganizationSettingsCall) Do(opts ...googleapi.CallOpti if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &OrganizationSettings{ + ret := &ListFindingsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9162,25 +9171,64 @@ func (c *OrganizationsGetOrganizationSettingsCall) Do(opts ...googleapi.CallOpti } return ret, nil // { - // "description": "Gets the settings for an organization.", - // "flatPath": "v1/organizations/{organizationsId}/organizationSettings", + // "description": "Lists an organization or source's findings. To list across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings", + // "flatPath": "v1/folders/{foldersId}/sources/{sourcesId}/findings", // "httpMethod": "GET", - // "id": "securitycenter.organizations.getOrganizationSettings", + // "id": "securitycenter.folders.sources.findings.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. Name of the organization to get organization settings for. Its format is \"organizations/[organization_id]/organizationSettings\".", + // "compareDuration": { + // "description": "When compare_duration is set, the ListFindingsResult's \"state_change\" attribute is updated to indicate whether the finding had its state changed, the finding's state remained unchanged, or if the finding was added in any state during the compare_duration period of time that precedes the read_time. This is the time between (read_time - compare_duration) and read_time. The state_change value is derived based on the presence and state of the finding at the two points in time. Intermediate state changes between the two times don't affect the result. For example, the results aren't affected if the finding is made inactive and then active again. Possible \"state_change\" values when compare_duration is specified: * \"CHANGED\": indicates that the finding was present and matched the given filter at the start of compare_duration, but changed its state at read_time. * \"UNCHANGED\": indicates that the finding was present and matched the given filter at the start of compare_duration and did not change state at read_time. * \"ADDED\": indicates that the finding did not match the given filter or was not present at the start of compare_duration, but was present at read_time. * \"REMOVED\": indicates that the finding was present and matched the filter at the start of compare_duration, but did not match the filter at read_time. If compare_duration is not specified, then the only possible state_change is \"UNUSED\", which will be the state_change set for all findings present at read_time.", + // "format": "google-duration", + // "location": "query", + // "type": "string" + // }, + // "fieldMask": { + // "description": "A field mask to specify the Finding fields to be listed in the response. An empty field mask will list all fields.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // }, + // "filter": { + // "description": "Expression that defines the filter to apply across findings. The expression is a list of one or more restrictions combined via logical operators `AND` and `OR`. Parentheses are supported, and `OR` has higher precedence than `AND`. Restrictions have the form ` ` and may have a `-` character in front of them to indicate negation. Examples include: * name * source_properties.a_property * security_marks.marks.marka The supported operators are: * `=` for all value types. * `\u003e`, `\u003c`, `\u003e=`, `\u003c=` for integer values. * `:`, meaning substring matching, for strings. The supported value types are: * string literals in quotes. * integer literals without quotes. * boolean literals `true` and `false` without quotes. The following field and operator combinations are supported: * name: `=` * parent: `=`, `:` * resource_name: `=`, `:` * state: `=`, `:` * category: `=`, `:` * external_uri: `=`, `:` * event_time: `=`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: `event_time = \"2019-06-10T16:07:18-07:00\"` `event_time = 1560208038000` * severity: `=`, `:` * workflow_state: `=`, `:` * security_marks.marks: `=`, `:` * source_properties: `=`, `:`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` For example, `source_properties.size = 100` is a valid filter string. Use a partial match on the empty string to filter based on a property existing: `source_properties.my_property : \"\"` Use a negated partial match on the empty string to filter based on a property not existing: `-source_properties.my_property : \"\"` * resource: * resource.name: `=`, `:` * resource.parent_name: `=`, `:` * resource.parent_display_name: `=`, `:` * resource.project_name: `=`, `:` * resource.project_display_name: `=`, `:` * resource.type: `=`, `:` * resource.folders.resource_folder: `=`, `:` * resource.display_name: `=`, `:`", + // "location": "query", + // "type": "string" + // }, + // "orderBy": { + // "description": "Expression that defines what fields and order to use for sorting. The string value should follow SQL syntax: comma separated list of fields. For example: \"name,resource_properties.a_property\". The default sorting order is ascending. To specify descending order for a field, a suffix \" desc\" should be appended to the field name. For example: \"name desc,source_properties.a_property\". Redundant space characters in the syntax are insignificant. \"name desc,source_properties.a_property\" and \" name desc , source_properties.a_property \" are equivalent. The following fields are supported: name parent state category resource_name event_time source_properties security_marks.marks", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value returned by the last `ListFindingsResponse`; indicates that this is a continuation of a prior `ListFindings` call, and that the system should return the next page of data.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. Name of the source the findings belong to. Its format is \"organizations/[organization_id]/sources/[source_id], folders/[folder_id]/sources/[source_id], or projects/[project_id]/sources/[source_id]\". To list across all sources provide a source_id of `-`. For example: organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or projects/{projects_id}/sources/-", // "location": "path", - // "pattern": "^organizations/[^/]+/organizationSettings$", + // "pattern": "^folders/[^/]+/sources/[^/]+$", // "required": true, // "type": "string" + // }, + // "readTime": { + // "description": "Time used as a reference point when filtering findings. The filter is limited to findings existing at the supplied time and their values are those at that specific time. Absence of this field will default to the API's version of NOW.", + // "format": "google-datetime", + // "location": "query", + // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/findings", // "response": { - // "$ref": "OrganizationSettings" + // "$ref": "ListFindingsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -9189,33 +9237,60 @@ func (c *OrganizationsGetOrganizationSettingsCall) Do(opts ...googleapi.CallOpti } -// method id "securitycenter.organizations.updateOrganizationSettings": +// 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 *FoldersSourcesFindingsListCall) Pages(ctx context.Context, f func(*ListFindingsResponse) 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 OrganizationsUpdateOrganizationSettingsCall struct { - s *Service - name string - organizationsettings *OrganizationSettings - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "securitycenter.folders.sources.findings.patch": + +type FoldersSourcesFindingsPatchCall struct { + s *Service + name string + finding *Finding + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// UpdateOrganizationSettings: Updates an organization's settings. +// Patch: Creates or updates a finding. The corresponding source must +// exist for a finding creation to succeed. // -// - name: The relative resource name of the settings. See: +// - name: The relative resource name of this finding. See: // https://cloud.google.com/apis/design/resource_names#relative_resource_name -// Example: "organizations/{organization_id}/organizationSettings". -func (r *OrganizationsService) UpdateOrganizationSettings(name string, organizationsettings *OrganizationSettings) *OrganizationsUpdateOrganizationSettingsCall { - c := &OrganizationsUpdateOrganizationSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.organizationsettings = organizationsettings +// Example: +// "organizations/{organization_id}/sources/{source_id}/findings/{findi +// ng_id}". +func (r *FoldersSourcesFindingsService) Patch(name string, finding *Finding) *FoldersSourcesFindingsPatchCall { + c := &FoldersSourcesFindingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.finding = finding return c } // UpdateMask sets the optional parameter "updateMask": The FieldMask to -// use when updating the settings resource. If empty all mutable fields -// will be updated. -func (c *OrganizationsUpdateOrganizationSettingsCall) UpdateMask(updateMask string) *OrganizationsUpdateOrganizationSettingsCall { +// use when updating the finding resource. This field should not be +// specified when creating a finding. When updating a finding, an empty +// mask is treated as updating all mutable fields and replacing +// source_properties. Individual source_properties can be added/updated +// by using "source_properties." in the field mask. +func (c *FoldersSourcesFindingsPatchCall) UpdateMask(updateMask string) *FoldersSourcesFindingsPatchCall { c.urlParams_.Set("updateMask", updateMask) return c } @@ -9223,7 +9298,7 @@ func (c *OrganizationsUpdateOrganizationSettingsCall) UpdateMask(updateMask stri // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsUpdateOrganizationSettingsCall) Fields(s ...googleapi.Field) *OrganizationsUpdateOrganizationSettingsCall { +func (c *FoldersSourcesFindingsPatchCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -9231,21 +9306,21 @@ func (c *OrganizationsUpdateOrganizationSettingsCall) 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 *OrganizationsUpdateOrganizationSettingsCall) Context(ctx context.Context) *OrganizationsUpdateOrganizationSettingsCall { +func (c *FoldersSourcesFindingsPatchCall) Context(ctx context.Context) *FoldersSourcesFindingsPatchCall { 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 *OrganizationsUpdateOrganizationSettingsCall) Header() http.Header { +func (c *FoldersSourcesFindingsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsUpdateOrganizationSettingsCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSourcesFindingsPatchCall) 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_ { @@ -9253,7 +9328,7 @@ func (c *OrganizationsUpdateOrganizationSettingsCall) doRequest(alt string) (*ht } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.organizationsettings) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.finding) if err != nil { return nil, err } @@ -9273,14 +9348,14 @@ func (c *OrganizationsUpdateOrganizationSettingsCall) doRequest(alt string) (*ht return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.updateOrganizationSettings" call. -// Exactly one of *OrganizationSettings or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *OrganizationSettings.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsUpdateOrganizationSettingsCall) Do(opts ...googleapi.CallOption) (*OrganizationSettings, error) { +// Do executes the "securitycenter.folders.sources.findings.patch" call. +// Exactly one of *Finding or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Finding.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *FoldersSourcesFindingsPatchCall) Do(opts ...googleapi.CallOption) (*Finding, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9299,7 +9374,7 @@ func (c *OrganizationsUpdateOrganizationSettingsCall) Do(opts ...googleapi.CallO if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &OrganizationSettings{ + ret := &Finding{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9311,23 +9386,23 @@ func (c *OrganizationsUpdateOrganizationSettingsCall) Do(opts ...googleapi.CallO } return ret, nil // { - // "description": "Updates an organization's settings.", - // "flatPath": "v1/organizations/{organizationsId}/organizationSettings", + // "description": "Creates or updates a finding. The corresponding source must exist for a finding creation to succeed.", + // "flatPath": "v1/folders/{foldersId}/sources/{sourcesId}/findings/{findingsId}", // "httpMethod": "PATCH", - // "id": "securitycenter.organizations.updateOrganizationSettings", + // "id": "securitycenter.folders.sources.findings.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "The relative resource name of the settings. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/organizationSettings\".", + // "description": "The relative resource name of this finding. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}\"", // "location": "path", - // "pattern": "^organizations/[^/]+/organizationSettings$", + // "pattern": "^folders/[^/]+/sources/[^/]+/findings/[^/]+$", // "required": true, // "type": "string" // }, // "updateMask": { - // "description": "The FieldMask to use when updating the settings resource. If empty all mutable fields will be updated.", + // "description": "The FieldMask to use when updating the finding resource. This field should not be specified when creating a finding. When updating a finding, an empty mask is treated as updating all mutable fields and replacing source_properties. Individual source_properties can be added/updated by using \"source_properties.\" in the field mask.", // "format": "google-fieldmask", // "location": "query", // "type": "string" @@ -9335,10 +9410,10 @@ func (c *OrganizationsUpdateOrganizationSettingsCall) Do(opts ...googleapi.CallO // }, // "path": "v1/{+name}", // "request": { - // "$ref": "OrganizationSettings" + // "$ref": "Finding" // }, // "response": { - // "$ref": "OrganizationSettings" + // "$ref": "Finding" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -9347,34 +9422,37 @@ func (c *OrganizationsUpdateOrganizationSettingsCall) Do(opts ...googleapi.CallO } -// method id "securitycenter.organizations.assets.group": +// method id "securitycenter.folders.sources.findings.setMute": -type OrganizationsAssetsGroupCall struct { - s *Service - parent string - groupassetsrequest *GroupAssetsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersSourcesFindingsSetMuteCall struct { + s *Service + name string + setmuterequest *SetMuteRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Group: Filters an organization's assets and groups them by their -// specified properties. +// SetMute: Updates the mute state of a finding. // -// - parent: Name of the organization to groupBy. Its format is -// "organizations/[organization_id], folders/[folder_id], or -// projects/[project_id]". -func (r *OrganizationsAssetsService) Group(parent string, groupassetsrequest *GroupAssetsRequest) *OrganizationsAssetsGroupCall { - c := &OrganizationsAssetsGroupCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.groupassetsrequest = groupassetsrequest +// - name: The relative resource name of the finding. See: +// https://cloud.google.com/apis/design/resource_names#relative_resource_name +// Example: +// "organizations/{organization_id}/sources/{source_id}/finding/{findin +// g_id}", +// "folders/{folder_id}/sources/{source_id}/finding/{finding_id}", +// "projects/{project_id}/sources/{source_id}/finding/{finding_id}". +func (r *FoldersSourcesFindingsService) SetMute(name string, setmuterequest *SetMuteRequest) *FoldersSourcesFindingsSetMuteCall { + c := &FoldersSourcesFindingsSetMuteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.setmuterequest = setmuterequest 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 *OrganizationsAssetsGroupCall) Fields(s ...googleapi.Field) *OrganizationsAssetsGroupCall { +func (c *FoldersSourcesFindingsSetMuteCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsSetMuteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -9382,21 +9460,21 @@ func (c *OrganizationsAssetsGroupCall) 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 *OrganizationsAssetsGroupCall) Context(ctx context.Context) *OrganizationsAssetsGroupCall { +func (c *FoldersSourcesFindingsSetMuteCall) Context(ctx context.Context) *FoldersSourcesFindingsSetMuteCall { 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 *OrganizationsAssetsGroupCall) Header() http.Header { +func (c *FoldersSourcesFindingsSetMuteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsAssetsGroupCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSourcesFindingsSetMuteCall) 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_ { @@ -9404,14 +9482,14 @@ func (c *OrganizationsAssetsGroupCall) doRequest(alt string) (*http.Response, er } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupassetsrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmuterequest) 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/{+parent}/assets:group") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setMute") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -9419,19 +9497,19 @@ func (c *OrganizationsAssetsGroupCall) doRequest(alt string) (*http.Response, er } 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 "securitycenter.organizations.assets.group" call. -// Exactly one of *GroupAssetsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *GroupAssetsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsAssetsGroupCall) Do(opts ...googleapi.CallOption) (*GroupAssetsResponse, error) { +// Do executes the "securitycenter.folders.sources.findings.setMute" call. +// Exactly one of *Finding or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Finding.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *FoldersSourcesFindingsSetMuteCall) Do(opts ...googleapi.CallOption) (*Finding, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9450,7 +9528,7 @@ func (c *OrganizationsAssetsGroupCall) Do(opts ...googleapi.CallOption) (*GroupA if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GroupAssetsResponse{ + ret := &Finding{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9462,28 +9540,28 @@ func (c *OrganizationsAssetsGroupCall) Do(opts ...googleapi.CallOption) (*GroupA } return ret, nil // { - // "description": "Filters an organization's assets and groups them by their specified properties.", - // "flatPath": "v1/organizations/{organizationsId}/assets:group", + // "description": "Updates the mute state of a finding.", + // "flatPath": "v1/folders/{foldersId}/sources/{sourcesId}/findings/{findingsId}:setMute", // "httpMethod": "POST", - // "id": "securitycenter.organizations.assets.group", + // "id": "securitycenter.folders.sources.findings.setMute", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. Name of the organization to groupBy. Its format is \"organizations/[organization_id], folders/[folder_id], or projects/[project_id]\".", + // "name": { + // "description": "Required. The relative resource name of the finding. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/sources/{source_id}/finding/{finding_id}\", \"folders/{folder_id}/sources/{source_id}/finding/{finding_id}\", \"projects/{project_id}/sources/{source_id}/finding/{finding_id}\".", // "location": "path", - // "pattern": "^organizations/[^/]+$", + // "pattern": "^folders/[^/]+/sources/[^/]+/findings/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/assets:group", + // "path": "v1/{+name}:setMute", // "request": { - // "$ref": "GroupAssetsRequest" + // "$ref": "SetMuteRequest" // }, // "response": { - // "$ref": "GroupAssetsResponse" + // "$ref": "Finding" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -9492,241 +9570,258 @@ func (c *OrganizationsAssetsGroupCall) Do(opts ...googleapi.CallOption) (*GroupA } -// 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 *OrganizationsAssetsGroupCall) Pages(ctx context.Context, f func(*GroupAssetsResponse) error) error { - c.ctx_ = ctx - defer func(pt string) { c.groupassetsrequest.PageToken = pt }(c.groupassetsrequest.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.groupassetsrequest.PageToken = x.NextPageToken - } -} - -// method id "securitycenter.organizations.assets.list": +// method id "securitycenter.folders.sources.findings.setState": -type OrganizationsAssetsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type FoldersSourcesFindingsSetStateCall struct { + s *Service + name string + setfindingstaterequest *SetFindingStateRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists an organization's assets. +// SetState: Updates the state of a finding. // -// - parent: Name of the organization assets should belong to. Its -// format is "organizations/[organization_id], folders/[folder_id], or -// projects/[project_id]". -func (r *OrganizationsAssetsService) List(parent string) *OrganizationsAssetsListCall { - c := &OrganizationsAssetsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent +// - name: The relative resource name of the finding. See: +// https://cloud.google.com/apis/design/resource_names#relative_resource_name +// Example: +// "organizations/{organization_id}/sources/{source_id}/finding/{findin +// g_id}". +func (r *FoldersSourcesFindingsService) SetState(name string, setfindingstaterequest *SetFindingStateRequest) *FoldersSourcesFindingsSetStateCall { + c := &FoldersSourcesFindingsSetStateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.setfindingstaterequest = setfindingstaterequest return c } -// CompareDuration sets the optional parameter "compareDuration": When -// compare_duration is set, the ListAssetsResult's "state_change" -// attribute is updated to indicate whether the asset was added, -// removed, or remained present during the compare_duration period of -// time that precedes the read_time. This is the time between (read_time -// - compare_duration) and read_time. The state_change value is derived -// based on the presence of the asset at the two points in time. -// Intermediate state changes between the two times don't affect the -// result. For example, the results aren't affected if the asset is -// removed and re-created again. Possible "state_change" values when -// compare_duration is specified: * "ADDED": indicates that the asset -// was not present at the start of compare_duration, but present at -// read_time. * "REMOVED": indicates that the asset was present at the -// start of compare_duration, but not present at read_time. * "ACTIVE": -// indicates that the asset was present at both the start and the end of -// the time period defined by compare_duration and read_time. If -// compare_duration is not specified, then the only possible -// state_change is "UNUSED", which will be the state_change set for all -// assets present at read_time. -func (c *OrganizationsAssetsListCall) CompareDuration(compareDuration string) *OrganizationsAssetsListCall { - c.urlParams_.Set("compareDuration", compareDuration) +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FoldersSourcesFindingsSetStateCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsSetStateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// FieldMask sets the optional parameter "fieldMask": A field mask to -// specify the ListAssetsResult fields to be listed in the response. An -// empty field mask will list all fields. -func (c *OrganizationsAssetsListCall) FieldMask(fieldMask string) *OrganizationsAssetsListCall { - c.urlParams_.Set("fieldMask", fieldMask) +// 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 *FoldersSourcesFindingsSetStateCall) Context(ctx context.Context) *FoldersSourcesFindingsSetStateCall { + c.ctx_ = ctx return c } -// Filter sets the optional parameter "filter": Expression that defines -// the filter to apply across assets. The expression is a list of zero -// or more restrictions combined via logical operators `AND` and `OR`. -// Parentheses are supported, and `OR` has higher precedence than `AND`. -// Restrictions have the form ` ` and may have a `-` character in front -// of them to indicate negation. The fields map to those defined in the -// Asset resource. Examples include: * name * -// security_center_properties.resource_name * -// resource_properties.a_property * security_marks.marks.marka The -// supported operators are: * `=` for all value types. * `>`, `<`, `>=`, -// `<=` for integer values. * `:`, meaning substring matching, for -// strings. The supported value types are: * string literals in quotes. -// * integer literals without quotes. * boolean literals `true` and -// `false` without quotes. The following are the allowed field and -// operator combinations: * name: `=` * update_time: `=`, `>`, `<`, -// `>=`, `<=` Usage: This should be milliseconds since epoch or an -// RFC3339 string. Examples: `update_time = "2019-06-10T16:07:18-07:00" -// `update_time = 1560208038000` * create_time: `=`, `>`, `<`, `>=`, -// `<=` Usage: This should be milliseconds since epoch or an RFC3339 -// string. Examples: `create_time = "2019-06-10T16:07:18-07:00" -// `create_time = 1560208038000` * iam_policy.policy_blob: `=`, `:` * -// resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * -// security_marks.marks: `=`, `:` * -// security_center_properties.resource_name: `=`, `:` * -// security_center_properties.resource_display_name: `=`, `:` * -// security_center_properties.resource_type: `=`, `:` * -// security_center_properties.resource_parent: `=`, `:` * -// security_center_properties.resource_parent_display_name: `=`, `:` * -// security_center_properties.resource_project: `=`, `:` * -// security_center_properties.resource_project_display_name: `=`, `:` * -// security_center_properties.resource_owners: `=`, `:` For example, -// `resource_properties.size = 100` is a valid filter string. Use a -// partial match on the empty string to filter based on a property -// existing: `resource_properties.my_property : "" Use a negated -// partial match on the empty string to filter based on a property not -// existing: `-resource_properties.my_property : "" -func (c *OrganizationsAssetsListCall) Filter(filter string) *OrganizationsAssetsListCall { - c.urlParams_.Set("filter", filter) - return c +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *FoldersSourcesFindingsSetStateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ } -// OrderBy sets the optional parameter "orderBy": Expression that -// defines what fields and order to use for sorting. The string value -// should follow SQL syntax: comma separated list of fields. For -// example: "name,resource_properties.a_property". The default sorting -// order is ascending. To specify descending order for a field, a suffix -// " desc" should be appended to the field name. For example: "name -// desc,resource_properties.a_property". Redundant space characters in -// the syntax are insignificant. "name -// desc,resource_properties.a_property" and " name desc , -// resource_properties.a_property " are equivalent. The following fields -// are supported: name update_time resource_properties -// security_marks.marks security_center_properties.resource_name -// security_center_properties.resource_display_name -// security_center_properties.resource_parent -// security_center_properties.resource_parent_display_name -// security_center_properties.resource_project -// security_center_properties.resource_project_display_name -// security_center_properties.resource_type -func (c *OrganizationsAssetsListCall) OrderBy(orderBy string) *OrganizationsAssetsListCall { - c.urlParams_.Set("orderBy", orderBy) - return c +func (c *FoldersSourcesFindingsSetStateCall) 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.setfindingstaterequest) + 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}:setState") + 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) } -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return in a single response. Default is 10, minimum is -// 1, maximum is 1000. -func (c *OrganizationsAssetsListCall) PageSize(pageSize int64) *OrganizationsAssetsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) +// Do executes the "securitycenter.folders.sources.findings.setState" call. +// Exactly one of *Finding or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Finding.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *FoldersSourcesFindingsSetStateCall) Do(opts ...googleapi.CallOption) (*Finding, 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, &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, err + } + ret := &Finding{ + 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 state of a finding.", + // "flatPath": "v1/folders/{foldersId}/sources/{sourcesId}/findings/{findingsId}:setState", + // "httpMethod": "POST", + // "id": "securitycenter.folders.sources.findings.setState", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The relative resource name of the finding. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/sources/{source_id}/finding/{finding_id}\".", + // "location": "path", + // "pattern": "^folders/[^/]+/sources/[^/]+/findings/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}:setState", + // "request": { + // "$ref": "SetFindingStateRequest" + // }, + // "response": { + // "$ref": "Finding" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "securitycenter.folders.sources.findings.updateSecurityMarks": + +type FoldersSourcesFindingsUpdateSecurityMarksCall struct { + s *Service + name string + securitymarks *SecurityMarks + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// UpdateSecurityMarks: Updates security marks. +// +// - name: The relative resource name of the SecurityMarks. See: +// https://cloud.google.com/apis/design/resource_names#relative_resource_name +// Examples: +// "organizations/{organization_id}/assets/{asset_id}/securityMarks" +// "organizations/{organization_id}/sources/{source_id}/findings/{findi +// ng_id}/securityMarks". +func (r *FoldersSourcesFindingsService) UpdateSecurityMarks(name string, securitymarks *SecurityMarks) *FoldersSourcesFindingsUpdateSecurityMarksCall { + c := &FoldersSourcesFindingsUpdateSecurityMarksCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.securitymarks = securitymarks return c } -// PageToken sets the optional parameter "pageToken": The value returned -// by the last `ListAssetsResponse`; indicates that this is a -// continuation of a prior `ListAssets` call, and that the system should -// return the next page of data. -func (c *OrganizationsAssetsListCall) PageToken(pageToken string) *OrganizationsAssetsListCall { - c.urlParams_.Set("pageToken", pageToken) +// StartTime sets the optional parameter "startTime": The time at which +// the updated SecurityMarks take effect. If not set uses current server +// time. Updates will be applied to the SecurityMarks that are active +// immediately preceding this time. Must be earlier or equal to the +// server time. +func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) StartTime(startTime string) *FoldersSourcesFindingsUpdateSecurityMarksCall { + c.urlParams_.Set("startTime", startTime) return c } -// ReadTime sets the optional parameter "readTime": Time used as a -// reference point when filtering assets. The filter is limited to -// assets existing at the supplied time and their values are those at -// that specific time. Absence of this field will default to the API's -// version of NOW. -func (c *OrganizationsAssetsListCall) ReadTime(readTime string) *OrganizationsAssetsListCall { - c.urlParams_.Set("readTime", readTime) +// UpdateMask sets the optional parameter "updateMask": The FieldMask to +// use when updating the security marks resource. The field mask must +// not contain duplicate fields. If empty or set to "marks", all marks +// will be replaced. Individual marks can be updated using "marks.". +func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) UpdateMask(updateMask string) *FoldersSourcesFindingsUpdateSecurityMarksCall { + 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 *OrganizationsAssetsListCall) Fields(s ...googleapi.Field) *OrganizationsAssetsListCall { +func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsUpdateSecurityMarksCall { 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 *OrganizationsAssetsListCall) IfNoneMatch(entityTag string) *OrganizationsAssetsListCall { - 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 *OrganizationsAssetsListCall) Context(ctx context.Context) *OrganizationsAssetsListCall { +func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) Context(ctx context.Context) *FoldersSourcesFindingsUpdateSecurityMarksCall { 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 *OrganizationsAssetsListCall) Header() http.Header { +func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsAssetsListCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) 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.securitymarks) + 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/{+parent}/assets") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+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, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.assets.list" call. -// Exactly one of *ListAssetsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListAssetsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use +// Do executes the "securitycenter.folders.sources.findings.updateSecurityMarks" call. +// Exactly one of *SecurityMarks or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SecurityMarks.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *OrganizationsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAssetsResponse, error) { +func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOption) (*SecurityMarks, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9745,7 +9840,7 @@ func (c *OrganizationsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAss if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &ListAssetsResponse{ + ret := &SecurityMarks{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9757,64 +9852,40 @@ func (c *OrganizationsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAss } return ret, nil // { - // "description": "Lists an organization's assets.", - // "flatPath": "v1/organizations/{organizationsId}/assets", - // "httpMethod": "GET", - // "id": "securitycenter.organizations.assets.list", + // "description": "Updates security marks.", + // "flatPath": "v1/folders/{foldersId}/sources/{sourcesId}/findings/{findingsId}/securityMarks", + // "httpMethod": "PATCH", + // "id": "securitycenter.folders.sources.findings.updateSecurityMarks", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "compareDuration": { - // "description": "When compare_duration is set, the ListAssetsResult's \"state_change\" attribute is updated to indicate whether the asset was added, removed, or remained present during the compare_duration period of time that precedes the read_time. This is the time between (read_time - compare_duration) and read_time. The state_change value is derived based on the presence of the asset at the two points in time. Intermediate state changes between the two times don't affect the result. For example, the results aren't affected if the asset is removed and re-created again. Possible \"state_change\" values when compare_duration is specified: * \"ADDED\": indicates that the asset was not present at the start of compare_duration, but present at read_time. * \"REMOVED\": indicates that the asset was present at the start of compare_duration, but not present at read_time. * \"ACTIVE\": indicates that the asset was present at both the start and the end of the time period defined by compare_duration and read_time. If compare_duration is not specified, then the only possible state_change is \"UNUSED\", which will be the state_change set for all assets present at read_time.", - // "format": "google-duration", - // "location": "query", - // "type": "string" - // }, - // "fieldMask": { - // "description": "A field mask to specify the ListAssetsResult fields to be listed in the response. An empty field mask will list all fields.", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" - // }, - // "filter": { - // "description": "Expression that defines the filter to apply across assets. The expression is a list of zero or more restrictions combined via logical operators `AND` and `OR`. Parentheses are supported, and `OR` has higher precedence than `AND`. Restrictions have the form ` ` and may have a `-` character in front of them to indicate negation. The fields map to those defined in the Asset resource. Examples include: * name * security_center_properties.resource_name * resource_properties.a_property * security_marks.marks.marka The supported operators are: * `=` for all value types. * `\u003e`, `\u003c`, `\u003e=`, `\u003c=` for integer values. * `:`, meaning substring matching, for strings. The supported value types are: * string literals in quotes. * integer literals without quotes. * boolean literals `true` and `false` without quotes. The following are the allowed field and operator combinations: * name: `=` * update_time: `=`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: `update_time = \"2019-06-10T16:07:18-07:00\"` `update_time = 1560208038000` * create_time: `=`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: `create_time = \"2019-06-10T16:07:18-07:00\"` `create_time = 1560208038000` * iam_policy.policy_blob: `=`, `:` * resource_properties: `=`, `:`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` * security_marks.marks: `=`, `:` * security_center_properties.resource_name: `=`, `:` * security_center_properties.resource_display_name: `=`, `:` * security_center_properties.resource_type: `=`, `:` * security_center_properties.resource_parent: `=`, `:` * security_center_properties.resource_parent_display_name: `=`, `:` * security_center_properties.resource_project: `=`, `:` * security_center_properties.resource_project_display_name: `=`, `:` * security_center_properties.resource_owners: `=`, `:` For example, `resource_properties.size = 100` is a valid filter string. Use a partial match on the empty string to filter based on a property existing: `resource_properties.my_property : \"\"` Use a negated partial match on the empty string to filter based on a property not existing: `-resource_properties.my_property : \"\"`", - // "location": "query", - // "type": "string" - // }, - // "orderBy": { - // "description": "Expression that defines what fields and order to use for sorting. The string value should follow SQL syntax: comma separated list of fields. For example: \"name,resource_properties.a_property\". The default sorting order is ascending. To specify descending order for a field, a suffix \" desc\" should be appended to the field name. For example: \"name desc,resource_properties.a_property\". Redundant space characters in the syntax are insignificant. \"name desc,resource_properties.a_property\" and \" name desc , resource_properties.a_property \" are equivalent. The following fields are supported: name update_time resource_properties security_marks.marks security_center_properties.resource_name security_center_properties.resource_display_name security_center_properties.resource_parent security_center_properties.resource_parent_display_name security_center_properties.resource_project security_center_properties.resource_project_display_name security_center_properties.resource_type", - // "location": "query", - // "type": "string" - // }, - // "pageSize": { - // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The value returned by the last `ListAssetsResponse`; indicates that this is a continuation of a prior `ListAssets` call, and that the system should return the next page of data.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. Name of the organization assets should belong to. Its format is \"organizations/[organization_id], folders/[folder_id], or projects/[project_id]\".", + // "name": { + // "description": "The relative resource name of the SecurityMarks. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Examples: \"organizations/{organization_id}/assets/{asset_id}/securityMarks\" \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks\".", // "location": "path", - // "pattern": "^organizations/[^/]+$", + // "pattern": "^folders/[^/]+/sources/[^/]+/findings/[^/]+/securityMarks$", // "required": true, // "type": "string" // }, - // "readTime": { - // "description": "Time used as a reference point when filtering assets. The filter is limited to assets existing at the supplied time and their values are those at that specific time. Absence of this field will default to the API's version of NOW.", + // "startTime": { + // "description": "The time at which the updated SecurityMarks take effect. If not set uses current server time. Updates will be applied to the SecurityMarks that are active immediately preceding this time. Must be earlier or equal to the server time.", // "format": "google-datetime", // "location": "query", // "type": "string" + // }, + // "updateMask": { + // "description": "The FieldMask to use when updating the security marks resource. The field mask must not contain duplicate fields. If empty or set to \"marks\", all marks will be replaced. Individual marks can be updated using \"marks.\".", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v1/{+parent}/assets", + // "path": "v1/{+name}", + // "request": { + // "$ref": "SecurityMarks" + // }, // "response": { - // "$ref": "ListAssetsResponse" + // "$ref": "SecurityMarks" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -9823,56 +9894,42 @@ func (c *OrganizationsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAss } -// 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 *OrganizationsAssetsListCall) Pages(ctx context.Context, f func(*ListAssetsResponse) 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 "securitycenter.organizations.assets.runDiscovery": +// method id "securitycenter.folders.sources.findings.externalSystems.patch": -type OrganizationsAssetsRunDiscoveryCall struct { - s *Service - parent string - runassetdiscoveryrequest *RunAssetDiscoveryRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersSourcesFindingsExternalSystemsPatchCall struct { + s *Service + name string + googlecloudsecuritycenterv1externalsystem *GoogleCloudSecuritycenterV1ExternalSystem + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// RunDiscovery: Runs asset discovery. The discovery is tracked with a -// long-running operation. This API can only be called with limited -// frequency for an organization. If it is called too frequently the -// caller will receive a TOO_MANY_REQUESTS error. +// Patch: Updates external system. This is for a given finding. // -// - parent: Name of the organization to run asset discovery for. Its -// format is "organizations/[organization_id]". -func (r *OrganizationsAssetsService) RunDiscovery(parent string, runassetdiscoveryrequest *RunAssetDiscoveryRequest) *OrganizationsAssetsRunDiscoveryCall { - c := &OrganizationsAssetsRunDiscoveryCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.runassetdiscoveryrequest = runassetdiscoveryrequest +// - name: External System Name e.g. jira, demisto, etc. e.g.: +// `organizations/1234/sources/5678/findings/123456/externalSystems/jir +// a` `folders/1234/sources/5678/findings/123456/externalSystems/jira` +// `projects/1234/sources/5678/findings/123456/externalSystems/jira`. +func (r *FoldersSourcesFindingsExternalSystemsService) Patch(name string, googlecloudsecuritycenterv1externalsystem *GoogleCloudSecuritycenterV1ExternalSystem) *FoldersSourcesFindingsExternalSystemsPatchCall { + c := &FoldersSourcesFindingsExternalSystemsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googlecloudsecuritycenterv1externalsystem = googlecloudsecuritycenterv1externalsystem + return c +} + +// UpdateMask sets the optional parameter "updateMask": The FieldMask to +// use when updating the external system resource. If empty all mutable +// fields will be updated. +func (c *FoldersSourcesFindingsExternalSystemsPatchCall) UpdateMask(updateMask string) *FoldersSourcesFindingsExternalSystemsPatchCall { + 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 *OrganizationsAssetsRunDiscoveryCall) Fields(s ...googleapi.Field) *OrganizationsAssetsRunDiscoveryCall { +func (c *FoldersSourcesFindingsExternalSystemsPatchCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsExternalSystemsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -9880,21 +9937,21 @@ func (c *OrganizationsAssetsRunDiscoveryCall) Fields(s ...googleapi.Field) *Orga // 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 *OrganizationsAssetsRunDiscoveryCall) Context(ctx context.Context) *OrganizationsAssetsRunDiscoveryCall { +func (c *FoldersSourcesFindingsExternalSystemsPatchCall) Context(ctx context.Context) *FoldersSourcesFindingsExternalSystemsPatchCall { 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 *OrganizationsAssetsRunDiscoveryCall) Header() http.Header { +func (c *FoldersSourcesFindingsExternalSystemsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsAssetsRunDiscoveryCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSourcesFindingsExternalSystemsPatchCall) 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_ { @@ -9902,34 +9959,36 @@ func (c *OrganizationsAssetsRunDiscoveryCall) doRequest(alt string) (*http.Respo } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runassetdiscoveryrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1externalsystem) 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/{+parent}/assets:runDiscovery") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+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 "securitycenter.organizations.assets.runDiscovery" 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 *OrganizationsAssetsRunDiscoveryCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// Do executes the "securitycenter.folders.sources.findings.externalSystems.patch" call. +// Exactly one of *GoogleCloudSecuritycenterV1ExternalSystem or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudSecuritycenterV1ExternalSystem.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FoldersSourcesFindingsExternalSystemsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1ExternalSystem, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9948,7 +10007,7 @@ func (c *OrganizationsAssetsRunDiscoveryCall) Do(opts ...googleapi.CallOption) ( if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &Operation{ + ret := &GoogleCloudSecuritycenterV1ExternalSystem{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9960,28 +10019,34 @@ func (c *OrganizationsAssetsRunDiscoveryCall) Do(opts ...googleapi.CallOption) ( } return ret, nil // { - // "description": "Runs asset discovery. The discovery is tracked with a long-running operation. This API can only be called with limited frequency for an organization. If it is called too frequently the caller will receive a TOO_MANY_REQUESTS error.", - // "flatPath": "v1/organizations/{organizationsId}/assets:runDiscovery", - // "httpMethod": "POST", - // "id": "securitycenter.organizations.assets.runDiscovery", + // "description": "Updates external system. This is for a given finding.", + // "flatPath": "v1/folders/{foldersId}/sources/{sourcesId}/findings/{findingsId}/externalSystems/{externalSystemsId}", + // "httpMethod": "PATCH", + // "id": "securitycenter.folders.sources.findings.externalSystems.patch", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. Name of the organization to run asset discovery for. Its format is \"organizations/[organization_id]\".", + // "name": { + // "description": "External System Name e.g. jira, demisto, etc. e.g.: `organizations/1234/sources/5678/findings/123456/externalSystems/jira` `folders/1234/sources/5678/findings/123456/externalSystems/jira` `projects/1234/sources/5678/findings/123456/externalSystems/jira`", // "location": "path", - // "pattern": "^organizations/[^/]+$", + // "pattern": "^folders/[^/]+/sources/[^/]+/findings/[^/]+/externalSystems/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "The FieldMask to use when updating the external system resource. If empty all mutable fields will be updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v1/{+parent}/assets:runDiscovery", + // "path": "v1/{+name}", // "request": { - // "$ref": "RunAssetDiscoveryRequest" + // "$ref": "GoogleCloudSecuritycenterV1ExternalSystem" // }, // "response": { - // "$ref": "Operation" + // "$ref": "GoogleCloudSecuritycenterV1ExternalSystem" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -9990,94 +10055,79 @@ func (c *OrganizationsAssetsRunDiscoveryCall) Do(opts ...googleapi.CallOption) ( } -// method id "securitycenter.organizations.assets.updateSecurityMarks": +// method id "securitycenter.organizations.getOrganizationSettings": -type OrganizationsAssetsUpdateSecurityMarksCall struct { - s *Service - name string - securitymarks *SecurityMarks - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsGetOrganizationSettingsCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// UpdateSecurityMarks: Updates security marks. +// GetOrganizationSettings: Gets the settings for an organization. // -// - name: The relative resource name of the SecurityMarks. See: -// https://cloud.google.com/apis/design/resource_names#relative_resource_name -// Examples: -// "organizations/{organization_id}/assets/{asset_id}/securityMarks" -// "organizations/{organization_id}/sources/{source_id}/findings/{findi -// ng_id}/securityMarks". -func (r *OrganizationsAssetsService) UpdateSecurityMarks(name string, securitymarks *SecurityMarks) *OrganizationsAssetsUpdateSecurityMarksCall { - c := &OrganizationsAssetsUpdateSecurityMarksCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Name of the organization to get organization settings for. +// Its format is +// "organizations/[organization_id]/organizationSettings". +func (r *OrganizationsService) GetOrganizationSettings(name string) *OrganizationsGetOrganizationSettingsCall { + c := &OrganizationsGetOrganizationSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.securitymarks = securitymarks - return c -} - -// StartTime sets the optional parameter "startTime": The time at which -// the updated SecurityMarks take effect. If not set uses current server -// time. Updates will be applied to the SecurityMarks that are active -// immediately preceding this time. Must be earlier or equal to the -// server time. -func (c *OrganizationsAssetsUpdateSecurityMarksCall) StartTime(startTime string) *OrganizationsAssetsUpdateSecurityMarksCall { - c.urlParams_.Set("startTime", startTime) - return c -} - -// UpdateMask sets the optional parameter "updateMask": The FieldMask to -// use when updating the security marks resource. The field mask must -// not contain duplicate fields. If empty or set to "marks", all marks -// will be replaced. Individual marks can be updated using "marks.". -func (c *OrganizationsAssetsUpdateSecurityMarksCall) UpdateMask(updateMask string) *OrganizationsAssetsUpdateSecurityMarksCall { - 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 *OrganizationsAssetsUpdateSecurityMarksCall) Fields(s ...googleapi.Field) *OrganizationsAssetsUpdateSecurityMarksCall { +func (c *OrganizationsGetOrganizationSettingsCall) Fields(s ...googleapi.Field) *OrganizationsGetOrganizationSettingsCall { 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 *OrganizationsGetOrganizationSettingsCall) IfNoneMatch(entityTag string) *OrganizationsGetOrganizationSettingsCall { + 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 *OrganizationsAssetsUpdateSecurityMarksCall) Context(ctx context.Context) *OrganizationsAssetsUpdateSecurityMarksCall { +func (c *OrganizationsGetOrganizationSettingsCall) Context(ctx context.Context) *OrganizationsGetOrganizationSettingsCall { 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 *OrganizationsAssetsUpdateSecurityMarksCall) Header() http.Header { +func (c *OrganizationsGetOrganizationSettingsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsAssetsUpdateSecurityMarksCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsGetOrganizationSettingsCall) 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.securitymarks) - 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) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -10088,14 +10138,14 @@ func (c *OrganizationsAssetsUpdateSecurityMarksCall) doRequest(alt string) (*htt return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.assets.updateSecurityMarks" call. -// Exactly one of *SecurityMarks or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *SecurityMarks.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use +// Do executes the "securitycenter.organizations.getOrganizationSettings" call. +// Exactly one of *OrganizationSettings or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *OrganizationSettings.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *OrganizationsAssetsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOption) (*SecurityMarks, error) { +func (c *OrganizationsGetOrganizationSettingsCall) Do(opts ...googleapi.CallOption) (*OrganizationSettings, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10114,7 +10164,7 @@ func (c *OrganizationsAssetsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOp if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &SecurityMarks{ + ret := &OrganizationSettings{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10126,40 +10176,25 @@ func (c *OrganizationsAssetsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOp } return ret, nil // { - // "description": "Updates security marks.", - // "flatPath": "v1/organizations/{organizationsId}/assets/{assetsId}/securityMarks", - // "httpMethod": "PATCH", - // "id": "securitycenter.organizations.assets.updateSecurityMarks", + // "description": "Gets the settings for an organization.", + // "flatPath": "v1/organizations/{organizationsId}/organizationSettings", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.getOrganizationSettings", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "The relative resource name of the SecurityMarks. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Examples: \"organizations/{organization_id}/assets/{asset_id}/securityMarks\" \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks\".", + // "description": "Required. Name of the organization to get organization settings for. Its format is \"organizations/[organization_id]/organizationSettings\".", // "location": "path", - // "pattern": "^organizations/[^/]+/assets/[^/]+/securityMarks$", + // "pattern": "^organizations/[^/]+/organizationSettings$", // "required": true, // "type": "string" - // }, - // "startTime": { - // "description": "The time at which the updated SecurityMarks take effect. If not set uses current server time. Updates will be applied to the SecurityMarks that are active immediately preceding this time. Must be earlier or equal to the server time.", - // "format": "google-datetime", - // "location": "query", - // "type": "string" - // }, - // "updateMask": { - // "description": "The FieldMask to use when updating the security marks resource. The field mask must not contain duplicate fields. If empty or set to \"marks\", all marks will be replaced. Individual marks can be updated using \"marks.\".", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, // "path": "v1/{+name}", - // "request": { - // "$ref": "SecurityMarks" - // }, // "response": { - // "$ref": "SecurityMarks" + // "$ref": "OrganizationSettings" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -10168,43 +10203,41 @@ func (c *OrganizationsAssetsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOp } -// method id "securitycenter.organizations.bigQueryExports.create": +// method id "securitycenter.organizations.updateOrganizationSettings": -type OrganizationsBigQueryExportsCreateCall struct { - s *Service - parent string - googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsUpdateOrganizationSettingsCall struct { + s *Service + name string + organizationsettings *OrganizationSettings + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates a big query export. +// UpdateOrganizationSettings: Updates an organization's settings. // -// - parent: Resource name of the new big query export's parent. Its -// format is "organizations/[organization_id]", "folders/[folder_id]", -// or "projects/[project_id]". -func (r *OrganizationsBigQueryExportsService) Create(parent string, googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport) *OrganizationsBigQueryExportsCreateCall { - c := &OrganizationsBigQueryExportsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.googlecloudsecuritycenterv1bigqueryexport = googlecloudsecuritycenterv1bigqueryexport +// - name: The relative resource name of the settings. See: +// https://cloud.google.com/apis/design/resource_names#relative_resource_name +// Example: "organizations/{organization_id}/organizationSettings". +func (r *OrganizationsService) UpdateOrganizationSettings(name string, organizationsettings *OrganizationSettings) *OrganizationsUpdateOrganizationSettingsCall { + c := &OrganizationsUpdateOrganizationSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.organizationsettings = organizationsettings return c } -// BigQueryExportId sets the optional parameter "bigQueryExportId": -// Required. Unique identifier provided by the client within the parent -// scope. It must consist of lower case letters, numbers, and hyphen, -// with the first character a letter, the last a letter or a number, and -// a 63 character maximum. -func (c *OrganizationsBigQueryExportsCreateCall) BigQueryExportId(bigQueryExportId string) *OrganizationsBigQueryExportsCreateCall { - c.urlParams_.Set("bigQueryExportId", bigQueryExportId) +// UpdateMask sets the optional parameter "updateMask": The FieldMask to +// use when updating the settings resource. If empty all mutable fields +// will be updated. +func (c *OrganizationsUpdateOrganizationSettingsCall) UpdateMask(updateMask string) *OrganizationsUpdateOrganizationSettingsCall { + 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 *OrganizationsBigQueryExportsCreateCall) Fields(s ...googleapi.Field) *OrganizationsBigQueryExportsCreateCall { +func (c *OrganizationsUpdateOrganizationSettingsCall) Fields(s ...googleapi.Field) *OrganizationsUpdateOrganizationSettingsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -10212,21 +10245,21 @@ func (c *OrganizationsBigQueryExportsCreateCall) Fields(s ...googleapi.Field) *O // 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 *OrganizationsBigQueryExportsCreateCall) Context(ctx context.Context) *OrganizationsBigQueryExportsCreateCall { +func (c *OrganizationsUpdateOrganizationSettingsCall) Context(ctx context.Context) *OrganizationsUpdateOrganizationSettingsCall { 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 *OrganizationsBigQueryExportsCreateCall) Header() http.Header { +func (c *OrganizationsUpdateOrganizationSettingsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsBigQueryExportsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsUpdateOrganizationSettingsCall) 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_ { @@ -10234,36 +10267,34 @@ func (c *OrganizationsBigQueryExportsCreateCall) doRequest(alt string) (*http.Re } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1bigqueryexport) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.organizationsettings) 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/{+parent}/bigQueryExports") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+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 "securitycenter.organizations.bigQueryExports.create" call. -// Exactly one of *GoogleCloudSecuritycenterV1BigQueryExport or error -// will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudSecuritycenterV1BigQueryExport.ServerResponse.Header or -// (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *OrganizationsBigQueryExportsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1BigQueryExport, error) { +// Do executes the "securitycenter.organizations.updateOrganizationSettings" call. +// Exactly one of *OrganizationSettings or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *OrganizationSettings.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsUpdateOrganizationSettingsCall) Do(opts ...googleapi.CallOption) (*OrganizationSettings, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10282,7 +10313,7 @@ func (c *OrganizationsBigQueryExportsCreateCall) Do(opts ...googleapi.CallOption if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleCloudSecuritycenterV1BigQueryExport{ + ret := &OrganizationSettings{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10294,33 +10325,34 @@ func (c *OrganizationsBigQueryExportsCreateCall) Do(opts ...googleapi.CallOption } return ret, nil // { - // "description": "Creates a big query export.", - // "flatPath": "v1/organizations/{organizationsId}/bigQueryExports", - // "httpMethod": "POST", - // "id": "securitycenter.organizations.bigQueryExports.create", + // "description": "Updates an organization's settings.", + // "flatPath": "v1/organizations/{organizationsId}/organizationSettings", + // "httpMethod": "PATCH", + // "id": "securitycenter.organizations.updateOrganizationSettings", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "bigQueryExportId": { - // "description": "Required. Unique identifier provided by the client within the parent scope. It must consist of lower case letters, numbers, and hyphen, with the first character a letter, the last a letter or a number, and a 63 character maximum.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. Resource name of the new big query export's parent. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "name": { + // "description": "The relative resource name of the settings. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/organizationSettings\".", // "location": "path", - // "pattern": "^organizations/[^/]+$", + // "pattern": "^organizations/[^/]+/organizationSettings$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "The FieldMask to use when updating the settings resource. If empty all mutable fields will be updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v1/{+parent}/bigQueryExports", + // "path": "v1/{+name}", // "request": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // "$ref": "OrganizationSettings" // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // "$ref": "OrganizationSettings" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -10329,32 +10361,34 @@ func (c *OrganizationsBigQueryExportsCreateCall) Do(opts ...googleapi.CallOption } -// method id "securitycenter.organizations.bigQueryExports.delete": +// method id "securitycenter.organizations.assets.group": -type OrganizationsBigQueryExportsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsAssetsGroupCall struct { + s *Service + parent string + groupassetsrequest *GroupAssetsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes an existing big query export. +// Group: Filters an organization's assets and groups them by their +// specified properties. // -// - name: Name of the big query export to delete. Its format is -// organizations/{organization}/bigQueryExports/{export_id}, -// folders/{folder}/bigQueryExports/{export_id}, or -// projects/{project}/bigQueryExports/{export_id}. -func (r *OrganizationsBigQueryExportsService) Delete(name string) *OrganizationsBigQueryExportsDeleteCall { - c := &OrganizationsBigQueryExportsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: Name of the organization to groupBy. Its format is +// "organizations/[organization_id], folders/[folder_id], or +// projects/[project_id]". +func (r *OrganizationsAssetsService) Group(parent string, groupassetsrequest *GroupAssetsRequest) *OrganizationsAssetsGroupCall { + c := &OrganizationsAssetsGroupCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.groupassetsrequest = groupassetsrequest 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 *OrganizationsBigQueryExportsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsBigQueryExportsDeleteCall { +func (c *OrganizationsAssetsGroupCall) Fields(s ...googleapi.Field) *OrganizationsAssetsGroupCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -10362,21 +10396,21 @@ func (c *OrganizationsBigQueryExportsDeleteCall) Fields(s ...googleapi.Field) *O // 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 *OrganizationsBigQueryExportsDeleteCall) Context(ctx context.Context) *OrganizationsBigQueryExportsDeleteCall { +func (c *OrganizationsAssetsGroupCall) Context(ctx context.Context) *OrganizationsAssetsGroupCall { 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 *OrganizationsBigQueryExportsDeleteCall) Header() http.Header { +func (c *OrganizationsAssetsGroupCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsBigQueryExportsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsAssetsGroupCall) 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_ { @@ -10384,29 +10418,34 @@ func (c *OrganizationsBigQueryExportsDeleteCall) doRequest(alt string) (*http.Re } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupassetsrequest) + 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 := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/assets:group") 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 "securitycenter.organizations.bigQueryExports.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 *OrganizationsBigQueryExportsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "securitycenter.organizations.assets.group" call. +// Exactly one of *GroupAssetsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GroupAssetsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsAssetsGroupCall) Do(opts ...googleapi.CallOption) (*GroupAssetsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10425,7 +10464,7 @@ func (c *OrganizationsBigQueryExportsDeleteCall) Do(opts ...googleapi.CallOption if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &Empty{ + ret := &GroupAssetsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10437,25 +10476,28 @@ func (c *OrganizationsBigQueryExportsDeleteCall) Do(opts ...googleapi.CallOption } return ret, nil // { - // "description": "Deletes an existing big query export.", - // "flatPath": "v1/organizations/{organizationsId}/bigQueryExports/{bigQueryExportsId}", - // "httpMethod": "DELETE", - // "id": "securitycenter.organizations.bigQueryExports.delete", + // "description": "Filters an organization's assets and groups them by their specified properties.", + // "flatPath": "v1/organizations/{organizationsId}/assets:group", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.assets.group", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. Name of the big query export to delete. Its format is organizations/{organization}/bigQueryExports/{export_id}, folders/{folder}/bigQueryExports/{export_id}, or projects/{project}/bigQueryExports/{export_id}", + // "parent": { + // "description": "Required. Name of the organization to groupBy. Its format is \"organizations/[organization_id], folders/[folder_id], or projects/[project_id]\".", // "location": "path", - // "pattern": "^organizations/[^/]+/bigQueryExports/[^/]+$", + // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/assets:group", + // "request": { + // "$ref": "GroupAssetsRequest" + // }, // "response": { - // "$ref": "Empty" + // "$ref": "GroupAssetsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -10464,33 +10506,176 @@ func (c *OrganizationsBigQueryExportsDeleteCall) Do(opts ...googleapi.CallOption } -// method id "securitycenter.organizations.bigQueryExports.get": - -type OrganizationsBigQueryExportsGetCall struct { +// 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 *OrganizationsAssetsGroupCall) Pages(ctx context.Context, f func(*GroupAssetsResponse) error) error { + c.ctx_ = ctx + defer func(pt string) { c.groupassetsrequest.PageToken = pt }(c.groupassetsrequest.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.groupassetsrequest.PageToken = x.NextPageToken + } +} + +// method id "securitycenter.organizations.assets.list": + +type OrganizationsAssetsListCall struct { s *Service - name string + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Gets a big query export. +// List: Lists an organization's assets. // -// - name: Name of the big query export to retrieve. Its format is -// organizations/{organization}/bigQueryExports/{export_id}, -// folders/{folder}/bigQueryExports/{export_id}, or -// projects/{project}/bigQueryExports/{export_id}. -func (r *OrganizationsBigQueryExportsService) Get(name string) *OrganizationsBigQueryExportsGetCall { - c := &OrganizationsBigQueryExportsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: Name of the organization assets should belong to. Its +// format is "organizations/[organization_id], folders/[folder_id], or +// projects/[project_id]". +func (r *OrganizationsAssetsService) List(parent string) *OrganizationsAssetsListCall { + c := &OrganizationsAssetsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// CompareDuration sets the optional parameter "compareDuration": When +// compare_duration is set, the ListAssetsResult's "state_change" +// attribute is updated to indicate whether the asset was added, +// removed, or remained present during the compare_duration period of +// time that precedes the read_time. This is the time between (read_time +// - compare_duration) and read_time. The state_change value is derived +// based on the presence of the asset at the two points in time. +// Intermediate state changes between the two times don't affect the +// result. For example, the results aren't affected if the asset is +// removed and re-created again. Possible "state_change" values when +// compare_duration is specified: * "ADDED": indicates that the asset +// was not present at the start of compare_duration, but present at +// read_time. * "REMOVED": indicates that the asset was present at the +// start of compare_duration, but not present at read_time. * "ACTIVE": +// indicates that the asset was present at both the start and the end of +// the time period defined by compare_duration and read_time. If +// compare_duration is not specified, then the only possible +// state_change is "UNUSED", which will be the state_change set for all +// assets present at read_time. +func (c *OrganizationsAssetsListCall) CompareDuration(compareDuration string) *OrganizationsAssetsListCall { + c.urlParams_.Set("compareDuration", compareDuration) + return c +} + +// FieldMask sets the optional parameter "fieldMask": A field mask to +// specify the ListAssetsResult fields to be listed in the response. An +// empty field mask will list all fields. +func (c *OrganizationsAssetsListCall) FieldMask(fieldMask string) *OrganizationsAssetsListCall { + c.urlParams_.Set("fieldMask", fieldMask) + return c +} + +// Filter sets the optional parameter "filter": Expression that defines +// the filter to apply across assets. The expression is a list of zero +// or more restrictions combined via logical operators `AND` and `OR`. +// Parentheses are supported, and `OR` has higher precedence than `AND`. +// Restrictions have the form ` ` and may have a `-` character in front +// of them to indicate negation. The fields map to those defined in the +// Asset resource. Examples include: * name * +// security_center_properties.resource_name * +// resource_properties.a_property * security_marks.marks.marka The +// supported operators are: * `=` for all value types. * `>`, `<`, `>=`, +// `<=` for integer values. * `:`, meaning substring matching, for +// strings. The supported value types are: * string literals in quotes. +// * integer literals without quotes. * boolean literals `true` and +// `false` without quotes. The following are the allowed field and +// operator combinations: * name: `=` * update_time: `=`, `>`, `<`, +// `>=`, `<=` Usage: This should be milliseconds since epoch or an +// RFC3339 string. Examples: `update_time = "2019-06-10T16:07:18-07:00" +// `update_time = 1560208038000` * create_time: `=`, `>`, `<`, `>=`, +// `<=` Usage: This should be milliseconds since epoch or an RFC3339 +// string. Examples: `create_time = "2019-06-10T16:07:18-07:00" +// `create_time = 1560208038000` * iam_policy.policy_blob: `=`, `:` * +// resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * +// security_marks.marks: `=`, `:` * +// security_center_properties.resource_name: `=`, `:` * +// security_center_properties.resource_display_name: `=`, `:` * +// security_center_properties.resource_type: `=`, `:` * +// security_center_properties.resource_parent: `=`, `:` * +// security_center_properties.resource_parent_display_name: `=`, `:` * +// security_center_properties.resource_project: `=`, `:` * +// security_center_properties.resource_project_display_name: `=`, `:` * +// security_center_properties.resource_owners: `=`, `:` For example, +// `resource_properties.size = 100` is a valid filter string. Use a +// partial match on the empty string to filter based on a property +// existing: `resource_properties.my_property : "" Use a negated +// partial match on the empty string to filter based on a property not +// existing: `-resource_properties.my_property : "" +func (c *OrganizationsAssetsListCall) Filter(filter string) *OrganizationsAssetsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// OrderBy sets the optional parameter "orderBy": Expression that +// defines what fields and order to use for sorting. The string value +// should follow SQL syntax: comma separated list of fields. For +// example: "name,resource_properties.a_property". The default sorting +// order is ascending. To specify descending order for a field, a suffix +// " desc" should be appended to the field name. For example: "name +// desc,resource_properties.a_property". Redundant space characters in +// the syntax are insignificant. "name +// desc,resource_properties.a_property" and " name desc , +// resource_properties.a_property " are equivalent. The following fields +// are supported: name update_time resource_properties +// security_marks.marks security_center_properties.resource_name +// security_center_properties.resource_display_name +// security_center_properties.resource_parent +// security_center_properties.resource_parent_display_name +// security_center_properties.resource_project +// security_center_properties.resource_project_display_name +// security_center_properties.resource_type +func (c *OrganizationsAssetsListCall) OrderBy(orderBy string) *OrganizationsAssetsListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return in a single response. Default is 10, minimum is +// 1, maximum is 1000. +func (c *OrganizationsAssetsListCall) PageSize(pageSize int64) *OrganizationsAssetsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last `ListAssetsResponse`; indicates that this is a +// continuation of a prior `ListAssets` call, and that the system should +// return the next page of data. +func (c *OrganizationsAssetsListCall) PageToken(pageToken string) *OrganizationsAssetsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReadTime sets the optional parameter "readTime": Time used as a +// reference point when filtering assets. The filter is limited to +// assets existing at the supplied time and their values are those at +// that specific time. Absence of this field will default to the API's +// version of NOW. +func (c *OrganizationsAssetsListCall) ReadTime(readTime string) *OrganizationsAssetsListCall { + c.urlParams_.Set("readTime", readTime) 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 *OrganizationsBigQueryExportsGetCall) Fields(s ...googleapi.Field) *OrganizationsBigQueryExportsGetCall { +func (c *OrganizationsAssetsListCall) Fields(s ...googleapi.Field) *OrganizationsAssetsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -10500,7 +10685,7 @@ func (c *OrganizationsBigQueryExportsGetCall) Fields(s ...googleapi.Field) *Orga // 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 *OrganizationsBigQueryExportsGetCall) IfNoneMatch(entityTag string) *OrganizationsBigQueryExportsGetCall { +func (c *OrganizationsAssetsListCall) IfNoneMatch(entityTag string) *OrganizationsAssetsListCall { c.ifNoneMatch_ = entityTag return c } @@ -10508,21 +10693,21 @@ func (c *OrganizationsBigQueryExportsGetCall) IfNoneMatch(entityTag string) *Org // 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 *OrganizationsBigQueryExportsGetCall) Context(ctx context.Context) *OrganizationsBigQueryExportsGetCall { +func (c *OrganizationsAssetsListCall) Context(ctx context.Context) *OrganizationsAssetsListCall { 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 *OrganizationsBigQueryExportsGetCall) Header() http.Header { +func (c *OrganizationsAssetsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsBigQueryExportsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsAssetsListCall) 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_ { @@ -10535,7 +10720,7 @@ func (c *OrganizationsBigQueryExportsGetCall) 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, "v1/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/assets") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -10543,21 +10728,19 @@ func (c *OrganizationsBigQueryExportsGetCall) 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 "securitycenter.organizations.bigQueryExports.get" call. -// Exactly one of *GoogleCloudSecuritycenterV1BigQueryExport or error -// will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudSecuritycenterV1BigQueryExport.ServerResponse.Header or -// (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *OrganizationsBigQueryExportsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1BigQueryExport, error) { +// Do executes the "securitycenter.organizations.assets.list" call. +// Exactly one of *ListAssetsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListAssetsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAssetsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10576,7 +10759,7 @@ func (c *OrganizationsBigQueryExportsGetCall) Do(opts ...googleapi.CallOption) ( if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleCloudSecuritycenterV1BigQueryExport{ + ret := &ListAssetsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10588,25 +10771,64 @@ func (c *OrganizationsBigQueryExportsGetCall) Do(opts ...googleapi.CallOption) ( } return ret, nil // { - // "description": "Gets a big query export.", - // "flatPath": "v1/organizations/{organizationsId}/bigQueryExports/{bigQueryExportsId}", + // "description": "Lists an organization's assets.", + // "flatPath": "v1/organizations/{organizationsId}/assets", // "httpMethod": "GET", - // "id": "securitycenter.organizations.bigQueryExports.get", + // "id": "securitycenter.organizations.assets.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. Name of the big query export to retrieve. Its format is organizations/{organization}/bigQueryExports/{export_id}, folders/{folder}/bigQueryExports/{export_id}, or projects/{project}/bigQueryExports/{export_id}", + // "compareDuration": { + // "description": "When compare_duration is set, the ListAssetsResult's \"state_change\" attribute is updated to indicate whether the asset was added, removed, or remained present during the compare_duration period of time that precedes the read_time. This is the time between (read_time - compare_duration) and read_time. The state_change value is derived based on the presence of the asset at the two points in time. Intermediate state changes between the two times don't affect the result. For example, the results aren't affected if the asset is removed and re-created again. Possible \"state_change\" values when compare_duration is specified: * \"ADDED\": indicates that the asset was not present at the start of compare_duration, but present at read_time. * \"REMOVED\": indicates that the asset was present at the start of compare_duration, but not present at read_time. * \"ACTIVE\": indicates that the asset was present at both the start and the end of the time period defined by compare_duration and read_time. If compare_duration is not specified, then the only possible state_change is \"UNUSED\", which will be the state_change set for all assets present at read_time.", + // "format": "google-duration", + // "location": "query", + // "type": "string" + // }, + // "fieldMask": { + // "description": "A field mask to specify the ListAssetsResult fields to be listed in the response. An empty field mask will list all fields.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // }, + // "filter": { + // "description": "Expression that defines the filter to apply across assets. The expression is a list of zero or more restrictions combined via logical operators `AND` and `OR`. Parentheses are supported, and `OR` has higher precedence than `AND`. Restrictions have the form ` ` and may have a `-` character in front of them to indicate negation. The fields map to those defined in the Asset resource. Examples include: * name * security_center_properties.resource_name * resource_properties.a_property * security_marks.marks.marka The supported operators are: * `=` for all value types. * `\u003e`, `\u003c`, `\u003e=`, `\u003c=` for integer values. * `:`, meaning substring matching, for strings. The supported value types are: * string literals in quotes. * integer literals without quotes. * boolean literals `true` and `false` without quotes. The following are the allowed field and operator combinations: * name: `=` * update_time: `=`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: `update_time = \"2019-06-10T16:07:18-07:00\"` `update_time = 1560208038000` * create_time: `=`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: `create_time = \"2019-06-10T16:07:18-07:00\"` `create_time = 1560208038000` * iam_policy.policy_blob: `=`, `:` * resource_properties: `=`, `:`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` * security_marks.marks: `=`, `:` * security_center_properties.resource_name: `=`, `:` * security_center_properties.resource_display_name: `=`, `:` * security_center_properties.resource_type: `=`, `:` * security_center_properties.resource_parent: `=`, `:` * security_center_properties.resource_parent_display_name: `=`, `:` * security_center_properties.resource_project: `=`, `:` * security_center_properties.resource_project_display_name: `=`, `:` * security_center_properties.resource_owners: `=`, `:` For example, `resource_properties.size = 100` is a valid filter string. Use a partial match on the empty string to filter based on a property existing: `resource_properties.my_property : \"\"` Use a negated partial match on the empty string to filter based on a property not existing: `-resource_properties.my_property : \"\"`", + // "location": "query", + // "type": "string" + // }, + // "orderBy": { + // "description": "Expression that defines what fields and order to use for sorting. The string value should follow SQL syntax: comma separated list of fields. For example: \"name,resource_properties.a_property\". The default sorting order is ascending. To specify descending order for a field, a suffix \" desc\" should be appended to the field name. For example: \"name desc,resource_properties.a_property\". Redundant space characters in the syntax are insignificant. \"name desc,resource_properties.a_property\" and \" name desc , resource_properties.a_property \" are equivalent. The following fields are supported: name update_time resource_properties security_marks.marks security_center_properties.resource_name security_center_properties.resource_display_name security_center_properties.resource_parent security_center_properties.resource_parent_display_name security_center_properties.resource_project security_center_properties.resource_project_display_name security_center_properties.resource_type", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value returned by the last `ListAssetsResponse`; indicates that this is a continuation of a prior `ListAssets` call, and that the system should return the next page of data.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. Name of the organization assets should belong to. Its format is \"organizations/[organization_id], folders/[folder_id], or projects/[project_id]\".", // "location": "path", - // "pattern": "^organizations/[^/]+/bigQueryExports/[^/]+$", + // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" + // }, + // "readTime": { + // "description": "Time used as a reference point when filtering assets. The filter is limited to assets existing at the supplied time and their values are those at that specific time. Absence of this field will default to the API's version of NOW.", + // "format": "google-datetime", + // "location": "query", + // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/assets", // "response": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // "$ref": "ListAssetsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -10615,102 +10837,95 @@ func (c *OrganizationsBigQueryExportsGetCall) Do(opts ...googleapi.CallOption) ( } -// method id "securitycenter.organizations.bigQueryExports.list": - -type OrganizationsBigQueryExportsListCall 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 *OrganizationsAssetsListCall) Pages(ctx context.Context, f func(*ListAssetsResponse) 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 BigQuery exports. Note that when requesting BigQuery -// exports at a given level all exports under that level are also -// returned e.g. if requesting BigQuery exports under a folder, then all -// BigQuery exports immediately under the folder plus the ones created -// under the projects within the folder are returned. -// -// - parent: The parent, which owns the collection of BigQuery exports. -// Its format is "organizations/[organization_id]", -// "folders/[folder_id]", "projects/[project_id]". -func (r *OrganizationsBigQueryExportsService) List(parent string) *OrganizationsBigQueryExportsListCall { - c := &OrganizationsBigQueryExportsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} +// method id "securitycenter.organizations.assets.runDiscovery": -// PageSize sets the optional parameter "pageSize": The maximum number -// of configs to return. The service may return fewer than this value. -// If unspecified, at most 10 configs will be returned. The maximum -// value is 1000; values above 1000 will be coerced to 1000. -func (c *OrganizationsBigQueryExportsListCall) PageSize(pageSize int64) *OrganizationsBigQueryExportsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c +type OrganizationsAssetsRunDiscoveryCall struct { + s *Service + parent string + runassetdiscoveryrequest *RunAssetDiscoveryRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// PageToken sets the optional parameter "pageToken": A page token, -// received from a previous `ListBigQueryExports` call. Provide this to -// retrieve the subsequent page. When paginating, all other parameters -// provided to `ListBigQueryExports` must match the call that provided -// the page token. -func (c *OrganizationsBigQueryExportsListCall) PageToken(pageToken string) *OrganizationsBigQueryExportsListCall { - c.urlParams_.Set("pageToken", pageToken) +// RunDiscovery: Runs asset discovery. The discovery is tracked with a +// long-running operation. This API can only be called with limited +// frequency for an organization. If it is called too frequently the +// caller will receive a TOO_MANY_REQUESTS error. +// +// - parent: Name of the organization to run asset discovery for. Its +// format is "organizations/[organization_id]". +func (r *OrganizationsAssetsService) RunDiscovery(parent string, runassetdiscoveryrequest *RunAssetDiscoveryRequest) *OrganizationsAssetsRunDiscoveryCall { + c := &OrganizationsAssetsRunDiscoveryCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.runassetdiscoveryrequest = runassetdiscoveryrequest 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 *OrganizationsBigQueryExportsListCall) Fields(s ...googleapi.Field) *OrganizationsBigQueryExportsListCall { +func (c *OrganizationsAssetsRunDiscoveryCall) Fields(s ...googleapi.Field) *OrganizationsAssetsRunDiscoveryCall { 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 *OrganizationsBigQueryExportsListCall) IfNoneMatch(entityTag string) *OrganizationsBigQueryExportsListCall { - 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 *OrganizationsBigQueryExportsListCall) Context(ctx context.Context) *OrganizationsBigQueryExportsListCall { +func (c *OrganizationsAssetsRunDiscoveryCall) Context(ctx context.Context) *OrganizationsAssetsRunDiscoveryCall { 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 *OrganizationsBigQueryExportsListCall) Header() http.Header { +func (c *OrganizationsAssetsRunDiscoveryCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsBigQueryExportsListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsAssetsRunDiscoveryCall) 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.runassetdiscoveryrequest) + 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/{+parent}/bigQueryExports") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/assets:runDiscovery") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -10721,14 +10936,14 @@ func (c *OrganizationsBigQueryExportsListCall) doRequest(alt string) (*http.Resp return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.bigQueryExports.list" call. -// Exactly one of *ListBigQueryExportsResponse or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *ListBigQueryExportsResponse.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsBigQueryExportsListCall) Do(opts ...googleapi.CallOption) (*ListBigQueryExportsResponse, error) { +// Do executes the "securitycenter.organizations.assets.runDiscovery" 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 *OrganizationsAssetsRunDiscoveryCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10747,7 +10962,7 @@ func (c *OrganizationsBigQueryExportsListCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &ListBigQueryExportsResponse{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10759,36 +10974,28 @@ func (c *OrganizationsBigQueryExportsListCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Lists BigQuery exports. Note that when requesting BigQuery exports at a given level all exports under that level are also returned e.g. if requesting BigQuery exports under a folder, then all BigQuery exports immediately under the folder plus the ones created under the projects within the folder are returned.", - // "flatPath": "v1/organizations/{organizationsId}/bigQueryExports", - // "httpMethod": "GET", - // "id": "securitycenter.organizations.bigQueryExports.list", + // "description": "Runs asset discovery. The discovery is tracked with a long-running operation. This API can only be called with limited frequency for an organization. If it is called too frequently the caller will receive a TOO_MANY_REQUESTS error.", + // "flatPath": "v1/organizations/{organizationsId}/assets:runDiscovery", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.assets.runDiscovery", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "pageSize": { - // "description": "The maximum number of configs to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "A page token, received from a previous `ListBigQueryExports` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListBigQueryExports` must match the call that provided the page token.", - // "location": "query", - // "type": "string" - // }, // "parent": { - // "description": "Required. The parent, which owns the collection of BigQuery exports. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", \"projects/[project_id]\".", + // "description": "Required. Name of the organization to run asset discovery for. Its format is \"organizations/[organization_id]\".", // "location": "path", // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/bigQueryExports", + // "path": "v1/{+parent}/assets:runDiscovery", + // "request": { + // "$ref": "RunAssetDiscoveryRequest" + // }, // "response": { - // "$ref": "ListBigQueryExportsResponse" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -10797,58 +11004,47 @@ func (c *OrganizationsBigQueryExportsListCall) 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 *OrganizationsBigQueryExportsListCall) Pages(ctx context.Context, f func(*ListBigQueryExportsResponse) 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 "securitycenter.organizations.bigQueryExports.patch": +// method id "securitycenter.organizations.assets.updateSecurityMarks": -type OrganizationsBigQueryExportsPatchCall struct { - s *Service - name string - googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsAssetsUpdateSecurityMarksCall struct { + s *Service + name string + securitymarks *SecurityMarks + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates a BigQuery export. +// UpdateSecurityMarks: Updates security marks. // -// - name: The relative resource name of this export. See: -// https://cloud.google.com/apis/design/resource_names#relative_resource_name. -// Example format: -// "organizations/{organization_id}/bigQueryExports/{export_id}" -// Example format: "folders/{folder_id}/bigQueryExports/{export_id}" -// Example format: "projects/{project_id}/bigQueryExports/{export_id}" -// This field is provided in responses, and is ignored when provided -// in create requests. -func (r *OrganizationsBigQueryExportsService) Patch(name string, googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport) *OrganizationsBigQueryExportsPatchCall { - c := &OrganizationsBigQueryExportsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The relative resource name of the SecurityMarks. See: +// https://cloud.google.com/apis/design/resource_names#relative_resource_name +// Examples: +// "organizations/{organization_id}/assets/{asset_id}/securityMarks" +// "organizations/{organization_id}/sources/{source_id}/findings/{findi +// ng_id}/securityMarks". +func (r *OrganizationsAssetsService) UpdateSecurityMarks(name string, securitymarks *SecurityMarks) *OrganizationsAssetsUpdateSecurityMarksCall { + c := &OrganizationsAssetsUpdateSecurityMarksCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.googlecloudsecuritycenterv1bigqueryexport = googlecloudsecuritycenterv1bigqueryexport + c.securitymarks = securitymarks return c } -// UpdateMask sets the optional parameter "updateMask": The list of -// fields to be updated. If empty all mutable fields will be updated. -func (c *OrganizationsBigQueryExportsPatchCall) UpdateMask(updateMask string) *OrganizationsBigQueryExportsPatchCall { +// StartTime sets the optional parameter "startTime": The time at which +// the updated SecurityMarks take effect. If not set uses current server +// time. Updates will be applied to the SecurityMarks that are active +// immediately preceding this time. Must be earlier or equal to the +// server time. +func (c *OrganizationsAssetsUpdateSecurityMarksCall) StartTime(startTime string) *OrganizationsAssetsUpdateSecurityMarksCall { + c.urlParams_.Set("startTime", startTime) + return c +} + +// UpdateMask sets the optional parameter "updateMask": The FieldMask to +// use when updating the security marks resource. The field mask must +// not contain duplicate fields. If empty or set to "marks", all marks +// will be replaced. Individual marks can be updated using "marks.". +func (c *OrganizationsAssetsUpdateSecurityMarksCall) UpdateMask(updateMask string) *OrganizationsAssetsUpdateSecurityMarksCall { c.urlParams_.Set("updateMask", updateMask) return c } @@ -10856,7 +11052,7 @@ func (c *OrganizationsBigQueryExportsPatchCall) UpdateMask(updateMask string) *O // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsBigQueryExportsPatchCall) Fields(s ...googleapi.Field) *OrganizationsBigQueryExportsPatchCall { +func (c *OrganizationsAssetsUpdateSecurityMarksCall) Fields(s ...googleapi.Field) *OrganizationsAssetsUpdateSecurityMarksCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -10864,21 +11060,21 @@ func (c *OrganizationsBigQueryExportsPatchCall) Fields(s ...googleapi.Field) *Or // 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 *OrganizationsBigQueryExportsPatchCall) Context(ctx context.Context) *OrganizationsBigQueryExportsPatchCall { +func (c *OrganizationsAssetsUpdateSecurityMarksCall) Context(ctx context.Context) *OrganizationsAssetsUpdateSecurityMarksCall { 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 *OrganizationsBigQueryExportsPatchCall) Header() http.Header { +func (c *OrganizationsAssetsUpdateSecurityMarksCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsBigQueryExportsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsAssetsUpdateSecurityMarksCall) 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_ { @@ -10886,7 +11082,7 @@ func (c *OrganizationsBigQueryExportsPatchCall) doRequest(alt string) (*http.Res } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1bigqueryexport) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitymarks) if err != nil { return nil, err } @@ -10906,16 +11102,14 @@ func (c *OrganizationsBigQueryExportsPatchCall) doRequest(alt string) (*http.Res return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.bigQueryExports.patch" call. -// Exactly one of *GoogleCloudSecuritycenterV1BigQueryExport or error -// will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudSecuritycenterV1BigQueryExport.ServerResponse.Header or -// (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *OrganizationsBigQueryExportsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1BigQueryExport, error) { +// Do executes the "securitycenter.organizations.assets.updateSecurityMarks" call. +// Exactly one of *SecurityMarks or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SecurityMarks.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsAssetsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOption) (*SecurityMarks, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10934,7 +11128,7 @@ func (c *OrganizationsBigQueryExportsPatchCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleCloudSecuritycenterV1BigQueryExport{ + ret := &SecurityMarks{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10946,23 +11140,29 @@ func (c *OrganizationsBigQueryExportsPatchCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Updates a BigQuery export.", - // "flatPath": "v1/organizations/{organizationsId}/bigQueryExports/{bigQueryExportsId}", + // "description": "Updates security marks.", + // "flatPath": "v1/organizations/{organizationsId}/assets/{assetsId}/securityMarks", // "httpMethod": "PATCH", - // "id": "securitycenter.organizations.bigQueryExports.patch", + // "id": "securitycenter.organizations.assets.updateSecurityMarks", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "The relative resource name of this export. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name. Example format: \"organizations/{organization_id}/bigQueryExports/{export_id}\" Example format: \"folders/{folder_id}/bigQueryExports/{export_id}\" Example format: \"projects/{project_id}/bigQueryExports/{export_id}\" This field is provided in responses, and is ignored when provided in create requests.", + // "description": "The relative resource name of the SecurityMarks. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Examples: \"organizations/{organization_id}/assets/{asset_id}/securityMarks\" \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks\".", // "location": "path", - // "pattern": "^organizations/[^/]+/bigQueryExports/[^/]+$", + // "pattern": "^organizations/[^/]+/assets/[^/]+/securityMarks$", // "required": true, // "type": "string" // }, + // "startTime": { + // "description": "The time at which the updated SecurityMarks take effect. If not set uses current server time. Updates will be applied to the SecurityMarks that are active immediately preceding this time. Must be earlier or equal to the server time.", + // "format": "google-datetime", + // "location": "query", + // "type": "string" + // }, // "updateMask": { - // "description": "The list of fields to be updated. If empty all mutable fields will be updated.", + // "description": "The FieldMask to use when updating the security marks resource. The field mask must not contain duplicate fields. If empty or set to \"marks\", all marks will be replaced. Individual marks can be updated using \"marks.\".", // "format": "google-fieldmask", // "location": "query", // "type": "string" @@ -10970,10 +11170,10 @@ func (c *OrganizationsBigQueryExportsPatchCall) Do(opts ...googleapi.CallOption) // }, // "path": "v1/{+name}", // "request": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // "$ref": "SecurityMarks" // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // "$ref": "SecurityMarks" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -10982,36 +11182,43 @@ func (c *OrganizationsBigQueryExportsPatchCall) Do(opts ...googleapi.CallOption) } -// method id "securitycenter.organizations.findings.bulkMute": +// method id "securitycenter.organizations.bigQueryExports.create": -type OrganizationsFindingsBulkMuteCall struct { - s *Service - parent string - bulkmutefindingsrequest *BulkMuteFindingsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsBigQueryExportsCreateCall struct { + s *Service + parent string + googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// BulkMute: Kicks off an LRO to bulk mute findings for a parent based -// on a filter. The parent can be either an organization, folder or -// project. The findings matched by the filter will be muted after the -// LRO is done. +// Create: Creates a big query export. // -// - parent: The parent, at which bulk action needs to be applied. Its +// - parent: Resource name of the new big query export's parent. Its // format is "organizations/[organization_id]", "folders/[folder_id]", -// "projects/[project_id]". -func (r *OrganizationsFindingsService) BulkMute(parent string, bulkmutefindingsrequest *BulkMuteFindingsRequest) *OrganizationsFindingsBulkMuteCall { - c := &OrganizationsFindingsBulkMuteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// or "projects/[project_id]". +func (r *OrganizationsBigQueryExportsService) Create(parent string, googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport) *OrganizationsBigQueryExportsCreateCall { + c := &OrganizationsBigQueryExportsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.bulkmutefindingsrequest = bulkmutefindingsrequest + c.googlecloudsecuritycenterv1bigqueryexport = googlecloudsecuritycenterv1bigqueryexport + return c +} + +// BigQueryExportId sets the optional parameter "bigQueryExportId": +// Required. Unique identifier provided by the client within the parent +// scope. It must consist of lower case letters, numbers, and hyphen, +// with the first character a letter, the last a letter or a number, and +// a 63 character maximum. +func (c *OrganizationsBigQueryExportsCreateCall) BigQueryExportId(bigQueryExportId string) *OrganizationsBigQueryExportsCreateCall { + c.urlParams_.Set("bigQueryExportId", bigQueryExportId) 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 *OrganizationsFindingsBulkMuteCall) Fields(s ...googleapi.Field) *OrganizationsFindingsBulkMuteCall { +func (c *OrganizationsBigQueryExportsCreateCall) Fields(s ...googleapi.Field) *OrganizationsBigQueryExportsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -11019,21 +11226,21 @@ func (c *OrganizationsFindingsBulkMuteCall) 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 *OrganizationsFindingsBulkMuteCall) Context(ctx context.Context) *OrganizationsFindingsBulkMuteCall { +func (c *OrganizationsBigQueryExportsCreateCall) Context(ctx context.Context) *OrganizationsBigQueryExportsCreateCall { 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 *OrganizationsFindingsBulkMuteCall) Header() http.Header { +func (c *OrganizationsBigQueryExportsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsFindingsBulkMuteCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsBigQueryExportsCreateCall) 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_ { @@ -11041,14 +11248,14 @@ func (c *OrganizationsFindingsBulkMuteCall) doRequest(alt string) (*http.Respons } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkmutefindingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1bigqueryexport) 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/{+parent}/findings:bulkMute") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/bigQueryExports") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -11061,14 +11268,16 @@ func (c *OrganizationsFindingsBulkMuteCall) doRequest(alt string) (*http.Respons return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.findings.bulkMute" 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 *OrganizationsFindingsBulkMuteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// Do executes the "securitycenter.organizations.bigQueryExports.create" call. +// Exactly one of *GoogleCloudSecuritycenterV1BigQueryExport or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudSecuritycenterV1BigQueryExport.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrganizationsBigQueryExportsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1BigQueryExport, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -11087,7 +11296,7 @@ func (c *OrganizationsFindingsBulkMuteCall) Do(opts ...googleapi.CallOption) (*O if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &Operation{ + ret := &GoogleCloudSecuritycenterV1BigQueryExport{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11099,28 +11308,33 @@ func (c *OrganizationsFindingsBulkMuteCall) Do(opts ...googleapi.CallOption) (*O } return ret, nil // { - // "description": "Kicks off an LRO to bulk mute findings for a parent based on a filter. The parent can be either an organization, folder or project. The findings matched by the filter will be muted after the LRO is done.", - // "flatPath": "v1/organizations/{organizationsId}/findings:bulkMute", + // "description": "Creates a big query export.", + // "flatPath": "v1/organizations/{organizationsId}/bigQueryExports", // "httpMethod": "POST", - // "id": "securitycenter.organizations.findings.bulkMute", + // "id": "securitycenter.organizations.bigQueryExports.create", // "parameterOrder": [ // "parent" // ], // "parameters": { + // "bigQueryExportId": { + // "description": "Required. Unique identifier provided by the client within the parent scope. It must consist of lower case letters, numbers, and hyphen, with the first character a letter, the last a letter or a number, and a 63 character maximum.", + // "location": "query", + // "type": "string" + // }, // "parent": { - // "description": "Required. The parent, at which bulk action needs to be applied. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", \"projects/[project_id]\".", + // "description": "Required. Resource name of the new big query export's parent. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", // "location": "path", // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/findings:bulkMute", + // "path": "v1/{+parent}/bigQueryExports", // "request": { - // "$ref": "BulkMuteFindingsRequest" + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" // }, // "response": { - // "$ref": "Operation" + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -11129,43 +11343,32 @@ func (c *OrganizationsFindingsBulkMuteCall) Do(opts ...googleapi.CallOption) (*O } -// method id "securitycenter.organizations.muteConfigs.create": +// method id "securitycenter.organizations.bigQueryExports.delete": -type OrganizationsMuteConfigsCreateCall struct { - s *Service - parent string - googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsBigQueryExportsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates a mute config. +// Delete: Deletes an existing big query export. // -// - parent: Resource name of the new mute configs's parent. Its format -// is "organizations/[organization_id]", "folders/[folder_id]", or -// "projects/[project_id]". -func (r *OrganizationsMuteConfigsService) Create(parent string, googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig) *OrganizationsMuteConfigsCreateCall { - c := &OrganizationsMuteConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.googlecloudsecuritycenterv1muteconfig = googlecloudsecuritycenterv1muteconfig - return c -} - -// MuteConfigId sets the optional parameter "muteConfigId": Required. -// Unique identifier provided by the client within the parent scope. It -// must consist of lower case letters, numbers, and hyphen, with the -// first character a letter, the last a letter or a number, and a 63 -// character maximum. -func (c *OrganizationsMuteConfigsCreateCall) MuteConfigId(muteConfigId string) *OrganizationsMuteConfigsCreateCall { - c.urlParams_.Set("muteConfigId", muteConfigId) +// - name: Name of the big query export to delete. Its format is +// organizations/{organization}/bigQueryExports/{export_id}, +// folders/{folder}/bigQueryExports/{export_id}, or +// projects/{project}/bigQueryExports/{export_id}. +func (r *OrganizationsBigQueryExportsService) Delete(name string) *OrganizationsBigQueryExportsDeleteCall { + c := &OrganizationsBigQueryExportsDeleteCall{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 *OrganizationsMuteConfigsCreateCall) Fields(s ...googleapi.Field) *OrganizationsMuteConfigsCreateCall { +func (c *OrganizationsBigQueryExportsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsBigQueryExportsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -11173,21 +11376,21 @@ func (c *OrganizationsMuteConfigsCreateCall) Fields(s ...googleapi.Field) *Organ // 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 *OrganizationsMuteConfigsCreateCall) Context(ctx context.Context) *OrganizationsMuteConfigsCreateCall { +func (c *OrganizationsBigQueryExportsDeleteCall) Context(ctx context.Context) *OrganizationsBigQueryExportsDeleteCall { 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 *OrganizationsMuteConfigsCreateCall) Header() http.Header { +func (c *OrganizationsBigQueryExportsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsMuteConfigsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsBigQueryExportsDeleteCall) 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_ { @@ -11195,35 +11398,29 @@ func (c *OrganizationsMuteConfigsCreateCall) doRequest(alt string) (*http.Respon } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1muteconfig) - 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/{+parent}/muteConfigs") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+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 "securitycenter.organizations.muteConfigs.create" call. -// Exactly one of *GoogleCloudSecuritycenterV1MuteConfig or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleCloudSecuritycenterV1MuteConfig.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsMuteConfigsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { +// Do executes the "securitycenter.organizations.bigQueryExports.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 *OrganizationsBigQueryExportsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -11242,7 +11439,7 @@ func (c *OrganizationsMuteConfigsCreateCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleCloudSecuritycenterV1MuteConfig{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11254,33 +11451,25 @@ func (c *OrganizationsMuteConfigsCreateCall) Do(opts ...googleapi.CallOption) (* } return ret, nil // { - // "description": "Creates a mute config.", - // "flatPath": "v1/organizations/{organizationsId}/muteConfigs", - // "httpMethod": "POST", - // "id": "securitycenter.organizations.muteConfigs.create", + // "description": "Deletes an existing big query export.", + // "flatPath": "v1/organizations/{organizationsId}/bigQueryExports/{bigQueryExportsId}", + // "httpMethod": "DELETE", + // "id": "securitycenter.organizations.bigQueryExports.delete", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "muteConfigId": { - // "description": "Required. Unique identifier provided by the client within the parent scope. It must consist of lower case letters, numbers, and hyphen, with the first character a letter, the last a letter or a number, and a 63 character maximum.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. Resource name of the new mute configs's parent. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "name": { + // "description": "Required. Name of the big query export to delete. Its format is organizations/{organization}/bigQueryExports/{export_id}, folders/{folder}/bigQueryExports/{export_id}, or projects/{project}/bigQueryExports/{export_id}", // "location": "path", - // "pattern": "^organizations/[^/]+$", + // "pattern": "^organizations/[^/]+/bigQueryExports/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/muteConfigs", - // "request": { - // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" - // }, + // "path": "v1/{+name}", // "response": { - // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -11289,24 +11478,25 @@ func (c *OrganizationsMuteConfigsCreateCall) Do(opts ...googleapi.CallOption) (* } -// method id "securitycenter.organizations.muteConfigs.delete": +// method id "securitycenter.organizations.bigQueryExports.get": -type OrganizationsMuteConfigsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsBigQueryExportsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes an existing mute config. +// Get: Gets a big query export. // -// - name: Name of the mute config to delete. Its format is -// organizations/{organization}/muteConfigs/{config_id}, -// folders/{folder}/muteConfigs/{config_id}, or -// projects/{project}/muteConfigs/{config_id}. -func (r *OrganizationsMuteConfigsService) Delete(name string) *OrganizationsMuteConfigsDeleteCall { - c := &OrganizationsMuteConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Name of the big query export to retrieve. Its format is +// organizations/{organization}/bigQueryExports/{export_id}, +// folders/{folder}/bigQueryExports/{export_id}, or +// projects/{project}/bigQueryExports/{export_id}. +func (r *OrganizationsBigQueryExportsService) Get(name string) *OrganizationsBigQueryExportsGetCall { + c := &OrganizationsBigQueryExportsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -11314,143 +11504,7 @@ func (r *OrganizationsMuteConfigsService) Delete(name string) *OrganizationsMute // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsMuteConfigsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsMuteConfigsDeleteCall { - 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 *OrganizationsMuteConfigsDeleteCall) Context(ctx context.Context) *OrganizationsMuteConfigsDeleteCall { - 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 *OrganizationsMuteConfigsDeleteCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *OrganizationsMuteConfigsDeleteCall) 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 "securitycenter.organizations.muteConfigs.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 *OrganizationsMuteConfigsDeleteCall) 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, &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, 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 existing mute config.", - // "flatPath": "v1/organizations/{organizationsId}/muteConfigs/{muteConfigsId}", - // "httpMethod": "DELETE", - // "id": "securitycenter.organizations.muteConfigs.delete", - // "parameterOrder": [ - // "name" - // ], - // "parameters": { - // "name": { - // "description": "Required. Name of the mute config to delete. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, or projects/{project}/muteConfigs/{config_id}", - // "location": "path", - // "pattern": "^organizations/[^/]+/muteConfigs/[^/]+$", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v1/{+name}", - // "response": { - // "$ref": "Empty" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform" - // ] - // } - -} - -// method id "securitycenter.organizations.muteConfigs.get": - -type OrganizationsMuteConfigsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// Get: Gets a mute config. -// -// - name: Name of the mute config to retrieve. Its format is -// organizations/{organization}/muteConfigs/{config_id}, -// folders/{folder}/muteConfigs/{config_id}, or -// projects/{project}/muteConfigs/{config_id}. -func (r *OrganizationsMuteConfigsService) Get(name string) *OrganizationsMuteConfigsGetCall { - c := &OrganizationsMuteConfigsGetCall{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 *OrganizationsMuteConfigsGetCall) Fields(s ...googleapi.Field) *OrganizationsMuteConfigsGetCall { +func (c *OrganizationsBigQueryExportsGetCall) Fields(s ...googleapi.Field) *OrganizationsBigQueryExportsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -11460,7 +11514,7 @@ func (c *OrganizationsMuteConfigsGetCall) 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 *OrganizationsMuteConfigsGetCall) IfNoneMatch(entityTag string) *OrganizationsMuteConfigsGetCall { +func (c *OrganizationsBigQueryExportsGetCall) IfNoneMatch(entityTag string) *OrganizationsBigQueryExportsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -11468,21 +11522,21 @@ func (c *OrganizationsMuteConfigsGetCall) 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 *OrganizationsMuteConfigsGetCall) Context(ctx context.Context) *OrganizationsMuteConfigsGetCall { +func (c *OrganizationsBigQueryExportsGetCall) Context(ctx context.Context) *OrganizationsBigQueryExportsGetCall { 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 *OrganizationsMuteConfigsGetCall) Header() http.Header { +func (c *OrganizationsBigQueryExportsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsMuteConfigsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsBigQueryExportsGetCall) 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_ { @@ -11508,15 +11562,16 @@ func (c *OrganizationsMuteConfigsGetCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.muteConfigs.get" call. -// Exactly one of *GoogleCloudSecuritycenterV1MuteConfig or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleCloudSecuritycenterV1MuteConfig.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { +// Do executes the "securitycenter.organizations.bigQueryExports.get" call. +// Exactly one of *GoogleCloudSecuritycenterV1BigQueryExport or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudSecuritycenterV1BigQueryExport.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrganizationsBigQueryExportsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1BigQueryExport, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -11535,7 +11590,7 @@ func (c *OrganizationsMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*Goo if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleCloudSecuritycenterV1MuteConfig{ + ret := &GoogleCloudSecuritycenterV1BigQueryExport{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11547,25 +11602,25 @@ func (c *OrganizationsMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*Goo } return ret, nil // { - // "description": "Gets a mute config.", - // "flatPath": "v1/organizations/{organizationsId}/muteConfigs/{muteConfigsId}", + // "description": "Gets a big query export.", + // "flatPath": "v1/organizations/{organizationsId}/bigQueryExports/{bigQueryExportsId}", // "httpMethod": "GET", - // "id": "securitycenter.organizations.muteConfigs.get", + // "id": "securitycenter.organizations.bigQueryExports.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the mute config to retrieve. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, or projects/{project}/muteConfigs/{config_id}", + // "description": "Required. Name of the big query export to retrieve. Its format is organizations/{organization}/bigQueryExports/{export_id}, folders/{folder}/bigQueryExports/{export_id}, or projects/{project}/bigQueryExports/{export_id}", // "location": "path", - // "pattern": "^organizations/[^/]+/muteConfigs/[^/]+$", + // "pattern": "^organizations/[^/]+/bigQueryExports/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1/{+name}", // "response": { - // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -11574,9 +11629,9 @@ func (c *OrganizationsMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*Goo } -// method id "securitycenter.organizations.muteConfigs.list": +// method id "securitycenter.organizations.bigQueryExports.list": -type OrganizationsMuteConfigsListCall struct { +type OrganizationsBigQueryExportsListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -11585,13 +11640,17 @@ type OrganizationsMuteConfigsListCall struct { header_ http.Header } -// List: Lists mute configs. +// List: Lists BigQuery exports. Note that when requesting BigQuery +// exports at a given level all exports under that level are also +// returned e.g. if requesting BigQuery exports under a folder, then all +// BigQuery exports immediately under the folder plus the ones created +// under the projects within the folder are returned. // -// - parent: The parent, which owns the collection of mute configs. Its -// format is "organizations/[organization_id]", "folders/[folder_id]", -// "projects/[project_id]". -func (r *OrganizationsMuteConfigsService) List(parent string) *OrganizationsMuteConfigsListCall { - c := &OrganizationsMuteConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The parent, which owns the collection of BigQuery exports. +// Its format is "organizations/[organization_id]", +// "folders/[folder_id]", "projects/[project_id]". +func (r *OrganizationsBigQueryExportsService) List(parent string) *OrganizationsBigQueryExportsListCall { + c := &OrganizationsBigQueryExportsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } @@ -11600,17 +11659,17 @@ func (r *OrganizationsMuteConfigsService) List(parent string) *OrganizationsMute // of configs to return. The service may return fewer than this value. // If unspecified, at most 10 configs will be returned. The maximum // value is 1000; values above 1000 will be coerced to 1000. -func (c *OrganizationsMuteConfigsListCall) PageSize(pageSize int64) *OrganizationsMuteConfigsListCall { +func (c *OrganizationsBigQueryExportsListCall) PageSize(pageSize int64) *OrganizationsBigQueryExportsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } // PageToken sets the optional parameter "pageToken": A page token, -// received from a previous `ListMuteConfigs` call. Provide this to +// received from a previous `ListBigQueryExports` call. Provide this to // retrieve the subsequent page. When paginating, all other parameters -// provided to `ListMuteConfigs` must match the call that provided the -// page token. -func (c *OrganizationsMuteConfigsListCall) PageToken(pageToken string) *OrganizationsMuteConfigsListCall { +// provided to `ListBigQueryExports` must match the call that provided +// the page token. +func (c *OrganizationsBigQueryExportsListCall) PageToken(pageToken string) *OrganizationsBigQueryExportsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -11618,7 +11677,7 @@ func (c *OrganizationsMuteConfigsListCall) PageToken(pageToken string) *Organiza // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsMuteConfigsListCall) Fields(s ...googleapi.Field) *OrganizationsMuteConfigsListCall { +func (c *OrganizationsBigQueryExportsListCall) Fields(s ...googleapi.Field) *OrganizationsBigQueryExportsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -11628,7 +11687,7 @@ func (c *OrganizationsMuteConfigsListCall) Fields(s ...googleapi.Field) *Organiz // 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 *OrganizationsMuteConfigsListCall) IfNoneMatch(entityTag string) *OrganizationsMuteConfigsListCall { +func (c *OrganizationsBigQueryExportsListCall) IfNoneMatch(entityTag string) *OrganizationsBigQueryExportsListCall { c.ifNoneMatch_ = entityTag return c } @@ -11636,21 +11695,21 @@ func (c *OrganizationsMuteConfigsListCall) IfNoneMatch(entityTag string) *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 *OrganizationsMuteConfigsListCall) Context(ctx context.Context) *OrganizationsMuteConfigsListCall { +func (c *OrganizationsBigQueryExportsListCall) Context(ctx context.Context) *OrganizationsBigQueryExportsListCall { 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 *OrganizationsMuteConfigsListCall) Header() http.Header { +func (c *OrganizationsBigQueryExportsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsMuteConfigsListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsBigQueryExportsListCall) 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_ { @@ -11663,7 +11722,7 @@ func (c *OrganizationsMuteConfigsListCall) 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, "v1/{+parent}/muteConfigs") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/bigQueryExports") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -11676,14 +11735,14 @@ func (c *OrganizationsMuteConfigsListCall) doRequest(alt string) (*http.Response return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.muteConfigs.list" call. -// Exactly one of *ListMuteConfigsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListMuteConfigsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use +// Do executes the "securitycenter.organizations.bigQueryExports.list" call. +// Exactly one of *ListBigQueryExportsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ListBigQueryExportsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *OrganizationsMuteConfigsListCall) Do(opts ...googleapi.CallOption) (*ListMuteConfigsResponse, error) { +func (c *OrganizationsBigQueryExportsListCall) Do(opts ...googleapi.CallOption) (*ListBigQueryExportsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -11702,7 +11761,7 @@ func (c *OrganizationsMuteConfigsListCall) Do(opts ...googleapi.CallOption) (*Li if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &ListMuteConfigsResponse{ + ret := &ListBigQueryExportsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11714,10 +11773,10 @@ func (c *OrganizationsMuteConfigsListCall) Do(opts ...googleapi.CallOption) (*Li } return ret, nil // { - // "description": "Lists mute configs.", - // "flatPath": "v1/organizations/{organizationsId}/muteConfigs", + // "description": "Lists BigQuery exports. Note that when requesting BigQuery exports at a given level all exports under that level are also returned e.g. if requesting BigQuery exports under a folder, then all BigQuery exports immediately under the folder plus the ones created under the projects within the folder are returned.", + // "flatPath": "v1/organizations/{organizationsId}/bigQueryExports", // "httpMethod": "GET", - // "id": "securitycenter.organizations.muteConfigs.list", + // "id": "securitycenter.organizations.bigQueryExports.list", // "parameterOrder": [ // "parent" // ], @@ -11729,21 +11788,21 @@ func (c *OrganizationsMuteConfigsListCall) Do(opts ...googleapi.CallOption) (*Li // "type": "integer" // }, // "pageToken": { - // "description": "A page token, received from a previous `ListMuteConfigs` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListMuteConfigs` must match the call that provided the page token.", + // "description": "A page token, received from a previous `ListBigQueryExports` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListBigQueryExports` must match the call that provided the page token.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. The parent, which owns the collection of mute configs. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", \"projects/[project_id]\".", + // "description": "Required. The parent, which owns the collection of BigQuery exports. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", \"projects/[project_id]\".", // "location": "path", // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/muteConfigs", + // "path": "v1/{+parent}/bigQueryExports", // "response": { - // "$ref": "ListMuteConfigsResponse" + // "$ref": "ListBigQueryExportsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -11755,7 +11814,7 @@ func (c *OrganizationsMuteConfigsListCall) Do(opts ...googleapi.CallOption) (*Li // 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 *OrganizationsMuteConfigsListCall) Pages(ctx context.Context, f func(*ListMuteConfigsResponse) error) error { +func (c *OrganizationsBigQueryExportsListCall) Pages(ctx context.Context, f func(*ListBigQueryExportsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -11773,33 +11832,37 @@ func (c *OrganizationsMuteConfigsListCall) Pages(ctx context.Context, f func(*Li } } -// method id "securitycenter.organizations.muteConfigs.patch": +// method id "securitycenter.organizations.bigQueryExports.patch": -type OrganizationsMuteConfigsPatchCall struct { - s *Service - name string - googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} +type OrganizationsBigQueryExportsPatchCall struct { + s *Service + name string + googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} -// Patch: Updates a mute config. +// Patch: Updates a BigQuery export. // -// - name: This field will be ignored if provided on config creation. -// Format "organizations/{organization}/muteConfigs/{mute_config}" -// "folders/{folder}/muteConfigs/{mute_config}" -// "projects/{project}/muteConfigs/{mute_config}". -func (r *OrganizationsMuteConfigsService) Patch(name string, googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig) *OrganizationsMuteConfigsPatchCall { - c := &OrganizationsMuteConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The relative resource name of this export. See: +// https://cloud.google.com/apis/design/resource_names#relative_resource_name. +// Example format: +// "organizations/{organization_id}/bigQueryExports/{export_id}" +// Example format: "folders/{folder_id}/bigQueryExports/{export_id}" +// Example format: "projects/{project_id}/bigQueryExports/{export_id}" +// This field is provided in responses, and is ignored when provided +// in create requests. +func (r *OrganizationsBigQueryExportsService) Patch(name string, googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport) *OrganizationsBigQueryExportsPatchCall { + c := &OrganizationsBigQueryExportsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.googlecloudsecuritycenterv1muteconfig = googlecloudsecuritycenterv1muteconfig + c.googlecloudsecuritycenterv1bigqueryexport = googlecloudsecuritycenterv1bigqueryexport return c } // UpdateMask sets the optional parameter "updateMask": The list of // fields to be updated. If empty all mutable fields will be updated. -func (c *OrganizationsMuteConfigsPatchCall) UpdateMask(updateMask string) *OrganizationsMuteConfigsPatchCall { +func (c *OrganizationsBigQueryExportsPatchCall) UpdateMask(updateMask string) *OrganizationsBigQueryExportsPatchCall { c.urlParams_.Set("updateMask", updateMask) return c } @@ -11807,7 +11870,7 @@ func (c *OrganizationsMuteConfigsPatchCall) UpdateMask(updateMask string) *Organ // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsMuteConfigsPatchCall) Fields(s ...googleapi.Field) *OrganizationsMuteConfigsPatchCall { +func (c *OrganizationsBigQueryExportsPatchCall) Fields(s ...googleapi.Field) *OrganizationsBigQueryExportsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -11815,21 +11878,21 @@ func (c *OrganizationsMuteConfigsPatchCall) 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 *OrganizationsMuteConfigsPatchCall) Context(ctx context.Context) *OrganizationsMuteConfigsPatchCall { +func (c *OrganizationsBigQueryExportsPatchCall) Context(ctx context.Context) *OrganizationsBigQueryExportsPatchCall { 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 *OrganizationsMuteConfigsPatchCall) Header() http.Header { +func (c *OrganizationsBigQueryExportsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsMuteConfigsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsBigQueryExportsPatchCall) 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_ { @@ -11837,7 +11900,7 @@ func (c *OrganizationsMuteConfigsPatchCall) doRequest(alt string) (*http.Respons } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1muteconfig) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1bigqueryexport) if err != nil { return nil, err } @@ -11857,15 +11920,16 @@ func (c *OrganizationsMuteConfigsPatchCall) doRequest(alt string) (*http.Respons return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.muteConfigs.patch" call. -// Exactly one of *GoogleCloudSecuritycenterV1MuteConfig or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleCloudSecuritycenterV1MuteConfig.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { +// Do executes the "securitycenter.organizations.bigQueryExports.patch" call. +// Exactly one of *GoogleCloudSecuritycenterV1BigQueryExport or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudSecuritycenterV1BigQueryExport.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrganizationsBigQueryExportsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1BigQueryExport, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -11884,7 +11948,7 @@ func (c *OrganizationsMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*G if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleCloudSecuritycenterV1MuteConfig{ + ret := &GoogleCloudSecuritycenterV1BigQueryExport{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11896,18 +11960,18 @@ func (c *OrganizationsMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*G } return ret, nil // { - // "description": "Updates a mute config.", - // "flatPath": "v1/organizations/{organizationsId}/muteConfigs/{muteConfigsId}", + // "description": "Updates a BigQuery export.", + // "flatPath": "v1/organizations/{organizationsId}/bigQueryExports/{bigQueryExportsId}", // "httpMethod": "PATCH", - // "id": "securitycenter.organizations.muteConfigs.patch", + // "id": "securitycenter.organizations.bigQueryExports.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "This field will be ignored if provided on config creation. Format \"organizations/{organization}/muteConfigs/{mute_config}\" \"folders/{folder}/muteConfigs/{mute_config}\" \"projects/{project}/muteConfigs/{mute_config}\"", + // "description": "The relative resource name of this export. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name. Example format: \"organizations/{organization_id}/bigQueryExports/{export_id}\" Example format: \"folders/{folder_id}/bigQueryExports/{export_id}\" Example format: \"projects/{project_id}/bigQueryExports/{export_id}\" This field is provided in responses, and is ignored when provided in create requests.", // "location": "path", - // "pattern": "^organizations/[^/]+/muteConfigs/[^/]+$", + // "pattern": "^organizations/[^/]+/bigQueryExports/[^/]+$", // "required": true, // "type": "string" // }, @@ -11920,10 +11984,10 @@ func (c *OrganizationsMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*G // }, // "path": "v1/{+name}", // "request": { - // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -11932,42 +11996,36 @@ func (c *OrganizationsMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*G } -// method id "securitycenter.organizations.notificationConfigs.create": +// method id "securitycenter.organizations.findings.bulkMute": -type OrganizationsNotificationConfigsCreateCall struct { - s *Service - parent string - notificationconfig *NotificationConfig - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsFindingsBulkMuteCall struct { + s *Service + parent string + bulkmutefindingsrequest *BulkMuteFindingsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates a notification config. +// BulkMute: Kicks off an LRO to bulk mute findings for a parent based +// on a filter. The parent can be either an organization, folder or +// project. The findings matched by the filter will be muted after the +// LRO is done. // -// - parent: Resource name of the new notification config's parent. Its -// format is "organizations/[organization_id]" or +// - parent: The parent, at which bulk action needs to be applied. Its +// format is "organizations/[organization_id]", "folders/[folder_id]", // "projects/[project_id]". -func (r *OrganizationsNotificationConfigsService) Create(parent string, notificationconfig *NotificationConfig) *OrganizationsNotificationConfigsCreateCall { - c := &OrganizationsNotificationConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *OrganizationsFindingsService) BulkMute(parent string, bulkmutefindingsrequest *BulkMuteFindingsRequest) *OrganizationsFindingsBulkMuteCall { + c := &OrganizationsFindingsBulkMuteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.notificationconfig = notificationconfig - return c -} - -// ConfigId sets the optional parameter "configId": Required. Unique -// identifier provided by the client within the parent scope. It must be -// between 1 and 128 characters, and contains alphanumeric characters, -// underscores or hyphens only. -func (c *OrganizationsNotificationConfigsCreateCall) ConfigId(configId string) *OrganizationsNotificationConfigsCreateCall { - c.urlParams_.Set("configId", configId) + c.bulkmutefindingsrequest = bulkmutefindingsrequest 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 *OrganizationsNotificationConfigsCreateCall) Fields(s ...googleapi.Field) *OrganizationsNotificationConfigsCreateCall { +func (c *OrganizationsFindingsBulkMuteCall) Fields(s ...googleapi.Field) *OrganizationsFindingsBulkMuteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -11975,21 +12033,21 @@ func (c *OrganizationsNotificationConfigsCreateCall) 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 *OrganizationsNotificationConfigsCreateCall) Context(ctx context.Context) *OrganizationsNotificationConfigsCreateCall { +func (c *OrganizationsFindingsBulkMuteCall) Context(ctx context.Context) *OrganizationsFindingsBulkMuteCall { 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 *OrganizationsNotificationConfigsCreateCall) Header() http.Header { +func (c *OrganizationsFindingsBulkMuteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsNotificationConfigsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsFindingsBulkMuteCall) 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_ { @@ -11997,14 +12055,14 @@ func (c *OrganizationsNotificationConfigsCreateCall) doRequest(alt string) (*htt } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationconfig) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkmutefindingsrequest) 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/{+parent}/notificationConfigs") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findings:bulkMute") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -12017,14 +12075,14 @@ func (c *OrganizationsNotificationConfigsCreateCall) doRequest(alt string) (*htt return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.notificationConfigs.create" call. -// Exactly one of *NotificationConfig or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *NotificationConfig.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsNotificationConfigsCreateCall) Do(opts ...googleapi.CallOption) (*NotificationConfig, error) { +// Do executes the "securitycenter.organizations.findings.bulkMute" 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 *OrganizationsFindingsBulkMuteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12043,7 +12101,7 @@ func (c *OrganizationsNotificationConfigsCreateCall) Do(opts ...googleapi.CallOp if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &NotificationConfig{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12055,33 +12113,28 @@ func (c *OrganizationsNotificationConfigsCreateCall) Do(opts ...googleapi.CallOp } return ret, nil // { - // "description": "Creates a notification config.", - // "flatPath": "v1/organizations/{organizationsId}/notificationConfigs", + // "description": "Kicks off an LRO to bulk mute findings for a parent based on a filter. The parent can be either an organization, folder or project. The findings matched by the filter will be muted after the LRO is done.", + // "flatPath": "v1/organizations/{organizationsId}/findings:bulkMute", // "httpMethod": "POST", - // "id": "securitycenter.organizations.notificationConfigs.create", + // "id": "securitycenter.organizations.findings.bulkMute", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "configId": { - // "description": "Required. Unique identifier provided by the client within the parent scope. It must be between 1 and 128 characters, and contains alphanumeric characters, underscores or hyphens only.", - // "location": "query", - // "type": "string" - // }, // "parent": { - // "description": "Required. Resource name of the new notification config's parent. Its format is \"organizations/[organization_id]\" or \"projects/[project_id]\".", + // "description": "Required. The parent, at which bulk action needs to be applied. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", \"projects/[project_id]\".", // "location": "path", // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/notificationConfigs", + // "path": "v1/{+parent}/findings:bulkMute", // "request": { - // "$ref": "NotificationConfig" + // "$ref": "BulkMuteFindingsRequest" // }, // "response": { - // "$ref": "NotificationConfig" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -12090,30 +12143,43 @@ func (c *OrganizationsNotificationConfigsCreateCall) Do(opts ...googleapi.CallOp } -// method id "securitycenter.organizations.notificationConfigs.delete": +// method id "securitycenter.organizations.muteConfigs.create": -type OrganizationsNotificationConfigsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsMuteConfigsCreateCall struct { + s *Service + parent string + googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a notification config. +// Create: Creates a mute config. // -// - name: Name of the notification config to delete. Its format is -// "organizations/[organization_id]/notificationConfigs/[config_id]". -func (r *OrganizationsNotificationConfigsService) Delete(name string) *OrganizationsNotificationConfigsDeleteCall { - c := &OrganizationsNotificationConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: Resource name of the new mute configs's parent. Its format +// is "organizations/[organization_id]", "folders/[folder_id]", or +// "projects/[project_id]". +func (r *OrganizationsMuteConfigsService) Create(parent string, googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig) *OrganizationsMuteConfigsCreateCall { + c := &OrganizationsMuteConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googlecloudsecuritycenterv1muteconfig = googlecloudsecuritycenterv1muteconfig + return c +} + +// MuteConfigId sets the optional parameter "muteConfigId": Required. +// Unique identifier provided by the client within the parent scope. It +// must consist of lower case letters, numbers, and hyphen, with the +// first character a letter, the last a letter or a number, and a 63 +// character maximum. +func (c *OrganizationsMuteConfigsCreateCall) MuteConfigId(muteConfigId string) *OrganizationsMuteConfigsCreateCall { + c.urlParams_.Set("muteConfigId", muteConfigId) 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 *OrganizationsNotificationConfigsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsNotificationConfigsDeleteCall { +func (c *OrganizationsMuteConfigsCreateCall) Fields(s ...googleapi.Field) *OrganizationsMuteConfigsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -12121,21 +12187,21 @@ func (c *OrganizationsNotificationConfigsDeleteCall) 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 *OrganizationsNotificationConfigsDeleteCall) Context(ctx context.Context) *OrganizationsNotificationConfigsDeleteCall { +func (c *OrganizationsMuteConfigsCreateCall) Context(ctx context.Context) *OrganizationsMuteConfigsCreateCall { 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 *OrganizationsNotificationConfigsDeleteCall) Header() http.Header { +func (c *OrganizationsMuteConfigsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsNotificationConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsMuteConfigsCreateCall) 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_ { @@ -12143,29 +12209,35 @@ func (c *OrganizationsNotificationConfigsDeleteCall) doRequest(alt string) (*htt } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1muteconfig) + 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 := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/muteConfigs") 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 "securitycenter.organizations.notificationConfigs.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 *OrganizationsNotificationConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "securitycenter.organizations.muteConfigs.create" call. +// Exactly one of *GoogleCloudSecuritycenterV1MuteConfig or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudSecuritycenterV1MuteConfig.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsMuteConfigsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12184,7 +12256,7 @@ func (c *OrganizationsNotificationConfigsDeleteCall) Do(opts ...googleapi.CallOp if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &Empty{ + ret := &GoogleCloudSecuritycenterV1MuteConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12196,25 +12268,33 @@ func (c *OrganizationsNotificationConfigsDeleteCall) Do(opts ...googleapi.CallOp } return ret, nil // { - // "description": "Deletes a notification config.", - // "flatPath": "v1/organizations/{organizationsId}/notificationConfigs/{notificationConfigsId}", - // "httpMethod": "DELETE", - // "id": "securitycenter.organizations.notificationConfigs.delete", + // "description": "Creates a mute config.", + // "flatPath": "v1/organizations/{organizationsId}/muteConfigs", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.muteConfigs.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. Name of the notification config to delete. Its format is \"organizations/[organization_id]/notificationConfigs/[config_id]\".", - // "location": "path", - // "pattern": "^organizations/[^/]+/notificationConfigs/[^/]+$", - // "required": true, - // "type": "string" - // } + // "muteConfigId": { + // "description": "Required. Unique identifier provided by the client within the parent scope. It must consist of lower case letters, numbers, and hyphen, with the first character a letter, the last a letter or a number, and a 63 character maximum.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. Resource name of the new mute configs's parent. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "location": "path", + // "pattern": "^organizations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+parent}/muteConfigs", + // "request": { + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, - // "path": "v1/{+name}", // "response": { - // "$ref": "Empty" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -12223,23 +12303,24 @@ func (c *OrganizationsNotificationConfigsDeleteCall) Do(opts ...googleapi.CallOp } -// method id "securitycenter.organizations.notificationConfigs.get": +// method id "securitycenter.organizations.muteConfigs.delete": -type OrganizationsNotificationConfigsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsMuteConfigsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a notification config. +// Delete: Deletes an existing mute config. // -// - name: Name of the notification config to get. Its format is -// "organizations/[organization_id]/notificationConfigs/[config_id]". -func (r *OrganizationsNotificationConfigsService) Get(name string) *OrganizationsNotificationConfigsGetCall { - c := &OrganizationsNotificationConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Name of the mute config to delete. Its format is +// organizations/{organization}/muteConfigs/{config_id}, +// folders/{folder}/muteConfigs/{config_id}, or +// projects/{project}/muteConfigs/{config_id}. +func (r *OrganizationsMuteConfigsService) Delete(name string) *OrganizationsMuteConfigsDeleteCall { + c := &OrganizationsMuteConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -12247,54 +12328,41 @@ func (r *OrganizationsNotificationConfigsService) Get(name string) *Organization // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsNotificationConfigsGetCall) Fields(s ...googleapi.Field) *OrganizationsNotificationConfigsGetCall { +func (c *OrganizationsMuteConfigsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsMuteConfigsDeleteCall { 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 *OrganizationsNotificationConfigsGetCall) IfNoneMatch(entityTag string) *OrganizationsNotificationConfigsGetCall { - 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 *OrganizationsNotificationConfigsGetCall) Context(ctx context.Context) *OrganizationsNotificationConfigsGetCall { +func (c *OrganizationsMuteConfigsDeleteCall) Context(ctx context.Context) *OrganizationsMuteConfigsDeleteCall { 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 *OrganizationsNotificationConfigsGetCall) Header() http.Header { +func (c *OrganizationsMuteConfigsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsNotificationConfigsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsMuteConfigsDeleteCall) 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) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -12305,14 +12373,14 @@ func (c *OrganizationsNotificationConfigsGetCall) doRequest(alt string) (*http.R return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.notificationConfigs.get" call. -// Exactly one of *NotificationConfig or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *NotificationConfig.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsNotificationConfigsGetCall) Do(opts ...googleapi.CallOption) (*NotificationConfig, error) { +// Do executes the "securitycenter.organizations.muteConfigs.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 *OrganizationsMuteConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12331,7 +12399,7 @@ func (c *OrganizationsNotificationConfigsGetCall) Do(opts ...googleapi.CallOptio if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &NotificationConfig{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12343,25 +12411,25 @@ func (c *OrganizationsNotificationConfigsGetCall) Do(opts ...googleapi.CallOptio } return ret, nil // { - // "description": "Gets a notification config.", - // "flatPath": "v1/organizations/{organizationsId}/notificationConfigs/{notificationConfigsId}", - // "httpMethod": "GET", - // "id": "securitycenter.organizations.notificationConfigs.get", + // "description": "Deletes an existing mute config.", + // "flatPath": "v1/organizations/{organizationsId}/muteConfigs/{muteConfigsId}", + // "httpMethod": "DELETE", + // "id": "securitycenter.organizations.muteConfigs.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the notification config to get. Its format is \"organizations/[organization_id]/notificationConfigs/[config_id]\".", + // "description": "Required. Name of the mute config to delete. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, or projects/{project}/muteConfigs/{config_id}", // "location": "path", - // "pattern": "^organizations/[^/]+/notificationConfigs/[^/]+$", + // "pattern": "^organizations/[^/]+/muteConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1/{+name}", // "response": { - // "$ref": "NotificationConfig" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -12370,49 +12438,33 @@ func (c *OrganizationsNotificationConfigsGetCall) Do(opts ...googleapi.CallOptio } -// method id "securitycenter.organizations.notificationConfigs.list": +// method id "securitycenter.organizations.muteConfigs.get": -type OrganizationsNotificationConfigsListCall struct { +type OrganizationsMuteConfigsGetCall struct { s *Service - parent string + name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists notification configs. +// Get: Gets a mute config. // -// - parent: Name of the organization to list notification configs. Its -// format is "organizations/[organization_id]" or -// "projects/[project_id]". -func (r *OrganizationsNotificationConfigsService) List(parent string) *OrganizationsNotificationConfigsListCall { - c := &OrganizationsNotificationConfigsListCall{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 in a single response. Default is 10, minimum is -// 1, maximum is 1000. -func (c *OrganizationsNotificationConfigsListCall) PageSize(pageSize int64) *OrganizationsNotificationConfigsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The value returned -// by the last `ListNotificationConfigsResponse`; indicates that this is -// a continuation of a prior `ListNotificationConfigs` call, and that -// the system should return the next page of data. -func (c *OrganizationsNotificationConfigsListCall) PageToken(pageToken string) *OrganizationsNotificationConfigsListCall { - c.urlParams_.Set("pageToken", pageToken) +// - name: Name of the mute config to retrieve. Its format is +// organizations/{organization}/muteConfigs/{config_id}, +// folders/{folder}/muteConfigs/{config_id}, or +// projects/{project}/muteConfigs/{config_id}. +func (r *OrganizationsMuteConfigsService) Get(name string) *OrganizationsMuteConfigsGetCall { + c := &OrganizationsMuteConfigsGetCall{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 *OrganizationsNotificationConfigsListCall) Fields(s ...googleapi.Field) *OrganizationsNotificationConfigsListCall { +func (c *OrganizationsMuteConfigsGetCall) Fields(s ...googleapi.Field) *OrganizationsMuteConfigsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -12422,7 +12474,7 @@ func (c *OrganizationsNotificationConfigsListCall) 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 *OrganizationsNotificationConfigsListCall) IfNoneMatch(entityTag string) *OrganizationsNotificationConfigsListCall { +func (c *OrganizationsMuteConfigsGetCall) IfNoneMatch(entityTag string) *OrganizationsMuteConfigsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -12430,21 +12482,21 @@ func (c *OrganizationsNotificationConfigsListCall) 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 *OrganizationsNotificationConfigsListCall) Context(ctx context.Context) *OrganizationsNotificationConfigsListCall { +func (c *OrganizationsMuteConfigsGetCall) Context(ctx context.Context) *OrganizationsMuteConfigsGetCall { 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 *OrganizationsNotificationConfigsListCall) Header() http.Header { +func (c *OrganizationsMuteConfigsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsNotificationConfigsListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsMuteConfigsGetCall) 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_ { @@ -12457,7 +12509,7 @@ func (c *OrganizationsNotificationConfigsListCall) 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, "v1/{+parent}/notificationConfigs") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -12465,19 +12517,20 @@ func (c *OrganizationsNotificationConfigsListCall) 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 "securitycenter.organizations.notificationConfigs.list" call. -// Exactly one of *ListNotificationConfigsResponse or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *ListNotificationConfigsResponse.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was +// Do executes the "securitycenter.organizations.muteConfigs.get" call. +// Exactly one of *GoogleCloudSecuritycenterV1MuteConfig or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudSecuritycenterV1MuteConfig.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *OrganizationsNotificationConfigsListCall) Do(opts ...googleapi.CallOption) (*ListNotificationConfigsResponse, error) { +func (c *OrganizationsMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12496,7 +12549,7 @@ func (c *OrganizationsNotificationConfigsListCall) Do(opts ...googleapi.CallOpti if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &ListNotificationConfigsResponse{ + ret := &GoogleCloudSecuritycenterV1MuteConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12508,36 +12561,25 @@ func (c *OrganizationsNotificationConfigsListCall) Do(opts ...googleapi.CallOpti } return ret, nil // { - // "description": "Lists notification configs.", - // "flatPath": "v1/organizations/{organizationsId}/notificationConfigs", + // "description": "Gets a mute config.", + // "flatPath": "v1/organizations/{organizationsId}/muteConfigs/{muteConfigsId}", // "httpMethod": "GET", - // "id": "securitycenter.organizations.notificationConfigs.list", + // "id": "securitycenter.organizations.muteConfigs.get", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "pageSize": { - // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The value returned by the last `ListNotificationConfigsResponse`; indicates that this is a continuation of a prior `ListNotificationConfigs` call, and that the system should return the next page of data.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. Name of the organization to list notification configs. Its format is \"organizations/[organization_id]\" or \"projects/[project_id]\".", + // "name": { + // "description": "Required. Name of the mute config to retrieve. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, or projects/{project}/muteConfigs/{config_id}", // "location": "path", - // "pattern": "^organizations/[^/]+$", + // "pattern": "^organizations/[^/]+/muteConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/notificationConfigs", + // "path": "v1/{+name}", // "response": { - // "$ref": "ListNotificationConfigsResponse" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -12546,122 +12588,116 @@ func (c *OrganizationsNotificationConfigsListCall) 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 *OrganizationsNotificationConfigsListCall) Pages(ctx context.Context, f func(*ListNotificationConfigsResponse) 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 "securitycenter.organizations.notificationConfigs.patch": +// method id "securitycenter.organizations.muteConfigs.list": -type OrganizationsNotificationConfigsPatchCall struct { - s *Service - name string - notificationconfig *NotificationConfig - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsMuteConfigsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Patch: Updates a notification config. The following update fields -// are allowed: description, pubsub_topic, streaming_config.filter +// List: Lists mute configs. // -// - name: The relative resource name of this notification config. See: -// https://cloud.google.com/apis/design/resource_names#relative_resource_name -// Example: -// "organizations/{organization_id}/notificationConfigs/notify_public_b -// ucket". -func (r *OrganizationsNotificationConfigsService) Patch(name string, notificationconfig *NotificationConfig) *OrganizationsNotificationConfigsPatchCall { - c := &OrganizationsNotificationConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.notificationconfig = notificationconfig +// - parent: The parent, which owns the collection of mute configs. Its +// format is "organizations/[organization_id]", "folders/[folder_id]", +// "projects/[project_id]". +func (r *OrganizationsMuteConfigsService) List(parent string) *OrganizationsMuteConfigsListCall { + c := &OrganizationsMuteConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent return c } -// UpdateMask sets the optional parameter "updateMask": The FieldMask to -// use when updating the notification config. If empty all mutable -// fields will be updated. -func (c *OrganizationsNotificationConfigsPatchCall) UpdateMask(updateMask string) *OrganizationsNotificationConfigsPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// PageSize sets the optional parameter "pageSize": The maximum number +// of configs to return. The service may return fewer than this value. +// If unspecified, at most 10 configs will be returned. The maximum +// value is 1000; values above 1000 will be coerced to 1000. +func (c *OrganizationsMuteConfigsListCall) PageSize(pageSize int64) *OrganizationsMuteConfigsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous `ListMuteConfigs` call. Provide this to +// retrieve the subsequent page. When paginating, all other parameters +// provided to `ListMuteConfigs` must match the call that provided the +// page token. +func (c *OrganizationsMuteConfigsListCall) PageToken(pageToken string) *OrganizationsMuteConfigsListCall { + 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 *OrganizationsNotificationConfigsPatchCall) Fields(s ...googleapi.Field) *OrganizationsNotificationConfigsPatchCall { +func (c *OrganizationsMuteConfigsListCall) Fields(s ...googleapi.Field) *OrganizationsMuteConfigsListCall { 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 *OrganizationsMuteConfigsListCall) IfNoneMatch(entityTag string) *OrganizationsMuteConfigsListCall { + 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 *OrganizationsNotificationConfigsPatchCall) Context(ctx context.Context) *OrganizationsNotificationConfigsPatchCall { +func (c *OrganizationsMuteConfigsListCall) Context(ctx context.Context) *OrganizationsMuteConfigsListCall { 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 *OrganizationsNotificationConfigsPatchCall) Header() http.Header { +func (c *OrganizationsMuteConfigsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsNotificationConfigsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsMuteConfigsListCall) 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.notificationconfig) - 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, "v1/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/muteConfigs") 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 "securitycenter.organizations.notificationConfigs.patch" call. -// Exactly one of *NotificationConfig or error will be non-nil. Any +// Do executes the "securitycenter.organizations.muteConfigs.list" call. +// Exactly one of *ListMuteConfigsResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either -// *NotificationConfig.ServerResponse.Header or (if a response was +// *ListMuteConfigsResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *OrganizationsNotificationConfigsPatchCall) Do(opts ...googleapi.CallOption) (*NotificationConfig, error) { +func (c *OrganizationsMuteConfigsListCall) Do(opts ...googleapi.CallOption) (*ListMuteConfigsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12680,7 +12716,7 @@ func (c *OrganizationsNotificationConfigsPatchCall) Do(opts ...googleapi.CallOpt if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &NotificationConfig{ + ret := &ListMuteConfigsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12692,34 +12728,36 @@ func (c *OrganizationsNotificationConfigsPatchCall) Do(opts ...googleapi.CallOpt } return ret, nil // { - // "description": " Updates a notification config. The following update fields are allowed: description, pubsub_topic, streaming_config.filter", - // "flatPath": "v1/organizations/{organizationsId}/notificationConfigs/{notificationConfigsId}", - // "httpMethod": "PATCH", - // "id": "securitycenter.organizations.notificationConfigs.patch", + // "description": "Lists mute configs.", + // "flatPath": "v1/organizations/{organizationsId}/muteConfigs", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.muteConfigs.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "The relative resource name of this notification config. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/notificationConfigs/notify_public_bucket\".", - // "location": "path", - // "pattern": "^organizations/[^/]+/notificationConfigs/[^/]+$", - // "required": true, - // "type": "string" + // "pageSize": { + // "description": "The maximum number of configs to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" // }, - // "updateMask": { - // "description": "The FieldMask to use when updating the notification config. If empty all mutable fields will be updated.", - // "format": "google-fieldmask", + // "pageToken": { + // "description": "A page token, received from a previous `ListMuteConfigs` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListMuteConfigs` must match the call that provided the page token.", // "location": "query", // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent, which owns the collection of mute configs. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", \"projects/[project_id]\".", + // "location": "path", + // "pattern": "^organizations/[^/]+$", + // "required": true, + // "type": "string" // } // }, - // "path": "v1/{+name}", - // "request": { - // "$ref": "NotificationConfig" - // }, + // "path": "v1/{+parent}/muteConfigs", // "response": { - // "$ref": "NotificationConfig" + // "$ref": "ListMuteConfigsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -12728,38 +12766,62 @@ func (c *OrganizationsNotificationConfigsPatchCall) Do(opts ...googleapi.CallOpt } -// method id "securitycenter.organizations.operations.cancel": +// 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 *OrganizationsMuteConfigsListCall) Pages(ctx context.Context, f func(*ListMuteConfigsResponse) 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 OrganizationsOperationsCancelCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "securitycenter.organizations.muteConfigs.patch": + +type OrganizationsMuteConfigsPatchCall struct { + s *Service + name string + googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig + 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`. +// Patch: Updates a mute config. // -// - name: The name of the operation resource to be cancelled. -func (r *OrganizationsOperationsService) Cancel(name string) *OrganizationsOperationsCancelCall { - c := &OrganizationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: This field will be ignored if provided on config creation. +// Format "organizations/{organization}/muteConfigs/{mute_config}" +// "folders/{folder}/muteConfigs/{mute_config}" +// "projects/{project}/muteConfigs/{mute_config}". +func (r *OrganizationsMuteConfigsService) Patch(name string, googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig) *OrganizationsMuteConfigsPatchCall { + c := &OrganizationsMuteConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.googlecloudsecuritycenterv1muteconfig = googlecloudsecuritycenterv1muteconfig + return c +} + +// UpdateMask sets the optional parameter "updateMask": The list of +// fields to be updated. If empty all mutable fields will be updated. +func (c *OrganizationsMuteConfigsPatchCall) UpdateMask(updateMask string) *OrganizationsMuteConfigsPatchCall { + 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 *OrganizationsOperationsCancelCall) Fields(s ...googleapi.Field) *OrganizationsOperationsCancelCall { +func (c *OrganizationsMuteConfigsPatchCall) Fields(s ...googleapi.Field) *OrganizationsMuteConfigsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -12767,21 +12829,21 @@ func (c *OrganizationsOperationsCancelCall) 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 *OrganizationsOperationsCancelCall) Context(ctx context.Context) *OrganizationsOperationsCancelCall { +func (c *OrganizationsMuteConfigsPatchCall) Context(ctx context.Context) *OrganizationsMuteConfigsPatchCall { 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 *OrganizationsOperationsCancelCall) Header() http.Header { +func (c *OrganizationsMuteConfigsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsMuteConfigsPatchCall) 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_ { @@ -12789,11 +12851,16 @@ func (c *OrganizationsOperationsCancelCall) doRequest(alt string) (*http.Respons } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1muteconfig) + 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}:cancel") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+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 } @@ -12804,14 +12871,15 @@ func (c *OrganizationsOperationsCancelCall) doRequest(alt string) (*http.Respons return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.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 *OrganizationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "securitycenter.organizations.muteConfigs.patch" call. +// Exactly one of *GoogleCloudSecuritycenterV1MuteConfig or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudSecuritycenterV1MuteConfig.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12830,7 +12898,7 @@ func (c *OrganizationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*E if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &Empty{ + ret := &GoogleCloudSecuritycenterV1MuteConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12842,25 +12910,34 @@ func (c *OrganizationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*E } 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": "v1/organizations/{organizationsId}/operations/{operationsId}:cancel", - // "httpMethod": "POST", - // "id": "securitycenter.organizations.operations.cancel", + // "description": "Updates a mute config.", + // "flatPath": "v1/organizations/{organizationsId}/muteConfigs/{muteConfigsId}", + // "httpMethod": "PATCH", + // "id": "securitycenter.organizations.muteConfigs.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "The name of the operation resource to be cancelled.", + // "description": "This field will be ignored if provided on config creation. Format \"organizations/{organization}/muteConfigs/{mute_config}\" \"folders/{folder}/muteConfigs/{mute_config}\" \"projects/{project}/muteConfigs/{mute_config}\"", // "location": "path", - // "pattern": "^organizations/[^/]+/operations/[^/]+$", + // "pattern": "^organizations/[^/]+/muteConfigs/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "The list of fields to be updated. If empty all mutable fields will be updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v1/{+name}:cancel", + // "path": "v1/{+name}", + // "request": { + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // }, // "response": { - // "$ref": "Empty" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -12869,32 +12946,42 @@ func (c *OrganizationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*E } -// method id "securitycenter.organizations.operations.delete": +// method id "securitycenter.organizations.notificationConfigs.create": -type OrganizationsOperationsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsNotificationConfigsCreateCall struct { + s *Service + parent string + notificationconfig *NotificationConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a long-running operation. This method indicates that -// the client is no longer interested in the operation result. It does -// not cancel the operation. If the server doesn't support this method, -// it returns `google.rpc.Code.UNIMPLEMENTED`. +// Create: Creates a notification config. // -// - name: The name of the operation resource to be deleted. -func (r *OrganizationsOperationsService) Delete(name string) *OrganizationsOperationsDeleteCall { - c := &OrganizationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: Resource name of the new notification config's parent. Its +// format is "organizations/[organization_id]", "folders/[folder_id]", +// or "projects/[project_id]". +func (r *OrganizationsNotificationConfigsService) Create(parent string, notificationconfig *NotificationConfig) *OrganizationsNotificationConfigsCreateCall { + c := &OrganizationsNotificationConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.notificationconfig = notificationconfig return c } -// Fields allows partial responses to be retrieved. See +// ConfigId sets the optional parameter "configId": Required. Unique +// identifier provided by the client within the parent scope. It must be +// between 1 and 128 characters, and contains alphanumeric characters, +// underscores or hyphens only. +func (c *OrganizationsNotificationConfigsCreateCall) ConfigId(configId string) *OrganizationsNotificationConfigsCreateCall { + c.urlParams_.Set("configId", configId) + 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 *OrganizationsOperationsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsOperationsDeleteCall { +func (c *OrganizationsNotificationConfigsCreateCall) Fields(s ...googleapi.Field) *OrganizationsNotificationConfigsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -12902,21 +12989,21 @@ func (c *OrganizationsOperationsDeleteCall) 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 *OrganizationsOperationsDeleteCall) Context(ctx context.Context) *OrganizationsOperationsDeleteCall { +func (c *OrganizationsNotificationConfigsCreateCall) Context(ctx context.Context) *OrganizationsNotificationConfigsCreateCall { 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 *OrganizationsOperationsDeleteCall) Header() http.Header { +func (c *OrganizationsNotificationConfigsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsNotificationConfigsCreateCall) 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_ { @@ -12924,29 +13011,34 @@ func (c *OrganizationsOperationsDeleteCall) doRequest(alt string) (*http.Respons } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationconfig) + 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 := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/notificationConfigs") 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 "securitycenter.organizations.operations.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 *OrganizationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "securitycenter.organizations.notificationConfigs.create" call. +// Exactly one of *NotificationConfig or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *NotificationConfig.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsNotificationConfigsCreateCall) Do(opts ...googleapi.CallOption) (*NotificationConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12965,7 +13057,7 @@ func (c *OrganizationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*E if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &Empty{ + ret := &NotificationConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12977,25 +13069,33 @@ func (c *OrganizationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*E } return ret, nil // { - // "description": "Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.", - // "flatPath": "v1/organizations/{organizationsId}/operations/{operationsId}", - // "httpMethod": "DELETE", - // "id": "securitycenter.organizations.operations.delete", + // "description": "Creates a notification config.", + // "flatPath": "v1/organizations/{organizationsId}/notificationConfigs", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.notificationConfigs.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "The name of the operation resource to be deleted.", + // "configId": { + // "description": "Required. Unique identifier provided by the client within the parent scope. It must be between 1 and 128 characters, and contains alphanumeric characters, underscores or hyphens only.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. Resource name of the new notification config's parent. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", // "location": "path", - // "pattern": "^organizations/[^/]+/operations/[^/]+$", + // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/notificationConfigs", + // "request": { + // "$ref": "NotificationConfig" + // }, // "response": { - // "$ref": "Empty" + // "$ref": "NotificationConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -13004,24 +13104,22 @@ func (c *OrganizationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*E } -// method id "securitycenter.organizations.operations.get": +// method id "securitycenter.organizations.notificationConfigs.delete": -type OrganizationsOperationsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsNotificationConfigsDeleteCall struct { + s *Service + name string + 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. +// Delete: Deletes a notification config. // -// - name: The name of the operation resource. -func (r *OrganizationsOperationsService) Get(name string) *OrganizationsOperationsGetCall { - c := &OrganizationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Name of the notification config to delete. Its format is +// "organizations/[organization_id]/notificationConfigs/[config_id]". +func (r *OrganizationsNotificationConfigsService) Delete(name string) *OrganizationsNotificationConfigsDeleteCall { + c := &OrganizationsNotificationConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -13029,54 +13127,41 @@ func (r *OrganizationsOperationsService) Get(name string) *OrganizationsOperatio // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsOperationsGetCall) Fields(s ...googleapi.Field) *OrganizationsOperationsGetCall { +func (c *OrganizationsNotificationConfigsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsNotificationConfigsDeleteCall { 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 *OrganizationsOperationsGetCall) IfNoneMatch(entityTag string) *OrganizationsOperationsGetCall { - 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 *OrganizationsOperationsGetCall) Context(ctx context.Context) *OrganizationsOperationsGetCall { +func (c *OrganizationsNotificationConfigsDeleteCall) Context(ctx context.Context) *OrganizationsNotificationConfigsDeleteCall { 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 *OrganizationsOperationsGetCall) Header() http.Header { +func (c *OrganizationsNotificationConfigsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsNotificationConfigsDeleteCall) 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) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -13087,14 +13172,14 @@ func (c *OrganizationsOperationsGetCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.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 *OrganizationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// Do executes the "securitycenter.organizations.notificationConfigs.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 *OrganizationsNotificationConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13113,7 +13198,7 @@ func (c *OrganizationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Oper if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &Operation{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13125,25 +13210,25 @@ func (c *OrganizationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Oper } 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": "v1/organizations/{organizationsId}/operations/{operationsId}", - // "httpMethod": "GET", - // "id": "securitycenter.organizations.operations.get", + // "description": "Deletes a notification config.", + // "flatPath": "v1/organizations/{organizationsId}/notificationConfigs/{notificationConfigsId}", + // "httpMethod": "DELETE", + // "id": "securitycenter.organizations.notificationConfigs.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "The name of the operation resource.", + // "description": "Required. Name of the notification config to delete. Its format is \"organizations/[organization_id]/notificationConfigs/[config_id]\".", // "location": "path", - // "pattern": "^organizations/[^/]+/operations/[^/]+$", + // "pattern": "^organizations/[^/]+/notificationConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1/{+name}", // "response": { - // "$ref": "Operation" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -13152,9 +13237,9 @@ func (c *OrganizationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Oper } -// method id "securitycenter.organizations.operations.list": +// method id "securitycenter.organizations.notificationConfigs.get": -type OrganizationsOperationsListCall struct { +type OrganizationsNotificationConfigsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -13163,49 +13248,20 @@ type OrganizationsOperationsListCall struct { 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. +// Get: Gets a notification config. // -// - name: The name of the operation's parent resource. -func (r *OrganizationsOperationsService) List(name string) *OrganizationsOperationsListCall { - c := &OrganizationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Name of the notification config to get. Its format is +// "organizations/[organization_id]/notificationConfigs/[config_id]". +func (r *OrganizationsNotificationConfigsService) Get(name string) *OrganizationsNotificationConfigsGetCall { + c := &OrganizationsNotificationConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } -// Filter sets the optional parameter "filter": The standard list -// filter. -func (c *OrganizationsOperationsListCall) Filter(filter string) *OrganizationsOperationsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// PageSize sets the optional parameter "pageSize": The standard list -// page size. -func (c *OrganizationsOperationsListCall) PageSize(pageSize int64) *OrganizationsOperationsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The standard list -// page token. -func (c *OrganizationsOperationsListCall) PageToken(pageToken string) *OrganizationsOperationsListCall { - 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 *OrganizationsOperationsListCall) Fields(s ...googleapi.Field) *OrganizationsOperationsListCall { +func (c *OrganizationsNotificationConfigsGetCall) Fields(s ...googleapi.Field) *OrganizationsNotificationConfigsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -13215,7 +13271,7 @@ func (c *OrganizationsOperationsListCall) 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 *OrganizationsOperationsListCall) IfNoneMatch(entityTag string) *OrganizationsOperationsListCall { +func (c *OrganizationsNotificationConfigsGetCall) IfNoneMatch(entityTag string) *OrganizationsNotificationConfigsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -13223,21 +13279,21 @@ func (c *OrganizationsOperationsListCall) 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 *OrganizationsOperationsListCall) Context(ctx context.Context) *OrganizationsOperationsListCall { +func (c *OrganizationsNotificationConfigsGetCall) Context(ctx context.Context) *OrganizationsNotificationConfigsGetCall { 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 *OrganizationsOperationsListCall) Header() http.Header { +func (c *OrganizationsNotificationConfigsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsOperationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsNotificationConfigsGetCall) 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_ { @@ -13263,14 +13319,14 @@ func (c *OrganizationsOperationsListCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.operations.list" call. -// Exactly one of *ListOperationsResponse or error will be non-nil. Any +// Do executes the "securitycenter.organizations.notificationConfigs.get" call. +// Exactly one of *NotificationConfig 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 +// *NotificationConfig.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *OrganizationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { +func (c *OrganizationsNotificationConfigsGetCall) Do(opts ...googleapi.CallOption) (*NotificationConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13289,7 +13345,7 @@ func (c *OrganizationsOperationsListCall) Do(opts ...googleapi.CallOption) (*Lis if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &ListOperationsResponse{ + ret := &NotificationConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13301,41 +13357,25 @@ func (c *OrganizationsOperationsListCall) Do(opts ...googleapi.CallOption) (*Lis } 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": "v1/organizations/{organizationsId}/operations", + // "description": "Gets a notification config.", + // "flatPath": "v1/organizations/{organizationsId}/notificationConfigs/{notificationConfigsId}", // "httpMethod": "GET", - // "id": "securitycenter.organizations.operations.list", + // "id": "securitycenter.organizations.notificationConfigs.get", // "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. Name of the notification config to get. Its format is \"organizations/[organization_id]/notificationConfigs/[config_id]\".", // "location": "path", - // "pattern": "^organizations/[^/]+/operations$", + // "pattern": "^organizations/[^/]+/notificationConfigs/[^/]+$", // "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": "v1/{+name}", // "response": { - // "$ref": "ListOperationsResponse" + // "$ref": "NotificationConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -13344,92 +13384,96 @@ func (c *OrganizationsOperationsListCall) 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 *OrganizationsOperationsListCall) 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 "securitycenter.organizations.sources.create": +// method id "securitycenter.organizations.notificationConfigs.list": -type OrganizationsSourcesCreateCall struct { - s *Service - parent string - source *Source - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsNotificationConfigsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Create: Creates a source. +// List: Lists notification configs. // -// - parent: Resource name of the new source's parent. Its format should -// be "organizations/[organization_id]". -func (r *OrganizationsSourcesService) Create(parent string, source *Source) *OrganizationsSourcesCreateCall { - c := &OrganizationsSourcesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: Name of the organization to list notification configs. Its +// format is "organizations/[organization_id]", "folders/[folder_id]", +// or "projects/[project_id]". +func (r *OrganizationsNotificationConfigsService) List(parent string) *OrganizationsNotificationConfigsListCall { + c := &OrganizationsNotificationConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.source = source + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return in a single response. Default is 10, minimum is +// 1, maximum is 1000. +func (c *OrganizationsNotificationConfigsListCall) PageSize(pageSize int64) *OrganizationsNotificationConfigsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last `ListNotificationConfigsResponse`; indicates that this is +// a continuation of a prior `ListNotificationConfigs` call, and that +// the system should return the next page of data. +func (c *OrganizationsNotificationConfigsListCall) PageToken(pageToken string) *OrganizationsNotificationConfigsListCall { + 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 *OrganizationsSourcesCreateCall) Fields(s ...googleapi.Field) *OrganizationsSourcesCreateCall { +func (c *OrganizationsNotificationConfigsListCall) Fields(s ...googleapi.Field) *OrganizationsNotificationConfigsListCall { 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 *OrganizationsNotificationConfigsListCall) IfNoneMatch(entityTag string) *OrganizationsNotificationConfigsListCall { + 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 *OrganizationsSourcesCreateCall) Context(ctx context.Context) *OrganizationsSourcesCreateCall { +func (c *OrganizationsNotificationConfigsListCall) Context(ctx context.Context) *OrganizationsNotificationConfigsListCall { 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 *OrganizationsSourcesCreateCall) Header() http.Header { +func (c *OrganizationsNotificationConfigsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSourcesCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsNotificationConfigsListCall) 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.source) - 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, "v1/{+parent}/sources") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/notificationConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -13440,14 +13484,14 @@ func (c *OrganizationsSourcesCreateCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.sources.create" call. -// Exactly one of *Source or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Source.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *OrganizationsSourcesCreateCall) Do(opts ...googleapi.CallOption) (*Source, error) { +// Do executes the "securitycenter.organizations.notificationConfigs.list" call. +// Exactly one of *ListNotificationConfigsResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ListNotificationConfigsResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsNotificationConfigsListCall) Do(opts ...googleapi.CallOption) (*ListNotificationConfigsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13466,7 +13510,7 @@ func (c *OrganizationsSourcesCreateCall) Do(opts ...googleapi.CallOption) (*Sour if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &Source{ + ret := &ListNotificationConfigsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13478,28 +13522,36 @@ func (c *OrganizationsSourcesCreateCall) Do(opts ...googleapi.CallOption) (*Sour } return ret, nil // { - // "description": "Creates a source.", - // "flatPath": "v1/organizations/{organizationsId}/sources", - // "httpMethod": "POST", - // "id": "securitycenter.organizations.sources.create", + // "description": "Lists notification configs.", + // "flatPath": "v1/organizations/{organizationsId}/notificationConfigs", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.notificationConfigs.list", // "parameterOrder": [ // "parent" // ], // "parameters": { + // "pageSize": { + // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value returned by the last `ListNotificationConfigsResponse`; indicates that this is a continuation of a prior `ListNotificationConfigs` call, and that the system should return the next page of data.", + // "location": "query", + // "type": "string" + // }, // "parent": { - // "description": "Required. Resource name of the new source's parent. Its format should be \"organizations/[organization_id]\".", + // "description": "Required. Name of the organization to list notification configs. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", // "location": "path", // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/sources", - // "request": { - // "$ref": "Source" - // }, + // "path": "v1/{+parent}/notificationConfigs", // "response": { - // "$ref": "Source" + // "$ref": "ListNotificationConfigsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -13508,78 +13560,104 @@ func (c *OrganizationsSourcesCreateCall) Do(opts ...googleapi.CallOption) (*Sour } -// method id "securitycenter.organizations.sources.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 *OrganizationsNotificationConfigsListCall) Pages(ctx context.Context, f func(*ListNotificationConfigsResponse) 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 OrganizationsSourcesGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// method id "securitycenter.organizations.notificationConfigs.patch": + +type OrganizationsNotificationConfigsPatchCall struct { + s *Service + name string + notificationconfig *NotificationConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a source. +// Patch: Updates a notification config. The following update fields +// are allowed: description, pubsub_topic, streaming_config.filter // -// - name: Relative resource name of the source. Its format is -// "organizations/[organization_id]/source/[source_id]". -func (r *OrganizationsSourcesService) Get(name string) *OrganizationsSourcesGetCall { - c := &OrganizationsSourcesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The relative resource name of this notification config. See: +// https://cloud.google.com/apis/design/resource_names#relative_resource_name +// Example: +// "organizations/{organization_id}/notificationConfigs/notify_public_b +// ucket". +func (r *OrganizationsNotificationConfigsService) Patch(name string, notificationconfig *NotificationConfig) *OrganizationsNotificationConfigsPatchCall { + c := &OrganizationsNotificationConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.notificationconfig = notificationconfig + return c +} + +// UpdateMask sets the optional parameter "updateMask": The FieldMask to +// use when updating the notification config. If empty all mutable +// fields will be updated. +func (c *OrganizationsNotificationConfigsPatchCall) UpdateMask(updateMask string) *OrganizationsNotificationConfigsPatchCall { + 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 *OrganizationsSourcesGetCall) Fields(s ...googleapi.Field) *OrganizationsSourcesGetCall { +func (c *OrganizationsNotificationConfigsPatchCall) Fields(s ...googleapi.Field) *OrganizationsNotificationConfigsPatchCall { 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 *OrganizationsSourcesGetCall) IfNoneMatch(entityTag string) *OrganizationsSourcesGetCall { - 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 *OrganizationsSourcesGetCall) Context(ctx context.Context) *OrganizationsSourcesGetCall { +func (c *OrganizationsNotificationConfigsPatchCall) Context(ctx context.Context) *OrganizationsNotificationConfigsPatchCall { 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 *OrganizationsSourcesGetCall) Header() http.Header { +func (c *OrganizationsNotificationConfigsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSourcesGetCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsNotificationConfigsPatchCall) 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.notificationconfig) + 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("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -13590,14 +13668,14 @@ func (c *OrganizationsSourcesGetCall) doRequest(alt string) (*http.Response, err return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.sources.get" call. -// Exactly one of *Source or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Source.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *OrganizationsSourcesGetCall) Do(opts ...googleapi.CallOption) (*Source, error) { +// Do executes the "securitycenter.organizations.notificationConfigs.patch" call. +// Exactly one of *NotificationConfig or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *NotificationConfig.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsNotificationConfigsPatchCall) Do(opts ...googleapi.CallOption) (*NotificationConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13616,7 +13694,7 @@ func (c *OrganizationsSourcesGetCall) Do(opts ...googleapi.CallOption) (*Source, if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &Source{ + ret := &NotificationConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13628,25 +13706,34 @@ func (c *OrganizationsSourcesGetCall) Do(opts ...googleapi.CallOption) (*Source, } return ret, nil // { - // "description": "Gets a source.", - // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}", - // "httpMethod": "GET", - // "id": "securitycenter.organizations.sources.get", + // "description": " Updates a notification config. The following update fields are allowed: description, pubsub_topic, streaming_config.filter", + // "flatPath": "v1/organizations/{organizationsId}/notificationConfigs/{notificationConfigsId}", + // "httpMethod": "PATCH", + // "id": "securitycenter.organizations.notificationConfigs.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Relative resource name of the source. Its format is \"organizations/[organization_id]/source/[source_id]\".", + // "description": "The relative resource name of this notification config. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/notificationConfigs/notify_public_bucket\".", // "location": "path", - // "pattern": "^organizations/[^/]+/sources/[^/]+$", + // "pattern": "^organizations/[^/]+/notificationConfigs/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "The FieldMask to use when updating the notification config. If empty all mutable fields will be updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, // "path": "v1/{+name}", - // "response": { - // "$ref": "Source" + // "request": { + // "$ref": "NotificationConfig" + // }, + // "response": { + // "$ref": "NotificationConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -13655,34 +13742,38 @@ func (c *OrganizationsSourcesGetCall) Do(opts ...googleapi.CallOption) (*Source, } -// method id "securitycenter.organizations.sources.getIamPolicy": +// method id "securitycenter.organizations.operations.cancel": -type OrganizationsSourcesGetIamPolicyCall struct { - s *Service - resource string - getiampolicyrequest *GetIamPolicyRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsOperationsCancelCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// GetIamPolicy: Gets the access control policy on the specified Source. +// 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`. // -// - 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 *OrganizationsSourcesService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *OrganizationsSourcesGetIamPolicyCall { - c := &OrganizationsSourcesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.resource = resource - c.getiampolicyrequest = getiampolicyrequest +// - name: The name of the operation resource to be cancelled. +func (r *OrganizationsOperationsService) Cancel(name string) *OrganizationsOperationsCancelCall { + c := &OrganizationsOperationsCancelCall{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 *OrganizationsSourcesGetIamPolicyCall) Fields(s ...googleapi.Field) *OrganizationsSourcesGetIamPolicyCall { +func (c *OrganizationsOperationsCancelCall) Fields(s ...googleapi.Field) *OrganizationsOperationsCancelCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -13690,21 +13781,21 @@ func (c *OrganizationsSourcesGetIamPolicyCall) Fields(s ...googleapi.Field) *Org // 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 *OrganizationsSourcesGetIamPolicyCall) Context(ctx context.Context) *OrganizationsSourcesGetIamPolicyCall { +func (c *OrganizationsOperationsCancelCall) Context(ctx context.Context) *OrganizationsOperationsCancelCall { 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 *OrganizationsSourcesGetIamPolicyCall) Header() http.Header { +func (c *OrganizationsOperationsCancelCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSourcesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsOperationsCancelCall) 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_ { @@ -13712,14 +13803,9 @@ func (c *OrganizationsSourcesGetIamPolicyCall) doRequest(alt string) (*http.Resp } 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, "v1/{+resource}:getIamPolicy") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -13727,19 +13813,19 @@ func (c *OrganizationsSourcesGetIamPolicyCall) doRequest(alt string) (*http.Resp } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "resource": c.resource, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.sources.getIamPolicy" call. -// Exactly one of *Policy or error will be non-nil. Any non-2xx status +// Do executes the "securitycenter.organizations.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 -// *Policy.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 *OrganizationsSourcesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { +func (c *OrganizationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13758,7 +13844,7 @@ func (c *OrganizationsSourcesGetIamPolicyCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &Policy{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13770,28 +13856,25 @@ func (c *OrganizationsSourcesGetIamPolicyCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Gets the access control policy on the specified Source.", - // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}:getIamPolicy", + // "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": "v1/organizations/{organizationsId}/operations/{operationsId}:cancel", // "httpMethod": "POST", - // "id": "securitycenter.organizations.sources.getIamPolicy", + // "id": "securitycenter.organizations.operations.cancel", // "parameterOrder": [ - // "resource" + // "name" // ], // "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.", + // "name": { + // "description": "The name of the operation resource to be cancelled.", // "location": "path", - // "pattern": "^organizations/[^/]+/sources/[^/]+$", + // "pattern": "^organizations/[^/]+/operations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+resource}:getIamPolicy", - // "request": { - // "$ref": "GetIamPolicyRequest" - // }, + // "path": "v1/{+name}:cancel", // "response": { - // "$ref": "Policy" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -13800,114 +13883,84 @@ func (c *OrganizationsSourcesGetIamPolicyCall) Do(opts ...googleapi.CallOption) } -// method id "securitycenter.organizations.sources.list": +// method id "securitycenter.organizations.operations.delete": -type OrganizationsSourcesListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsOperationsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists all sources belonging to an organization. +// Delete: Deletes a long-running operation. This method indicates that +// the client is no longer interested in the operation result. It does +// not cancel the operation. If the server doesn't support this method, +// it returns `google.rpc.Code.UNIMPLEMENTED`. // -// - parent: Resource name of the parent of sources to list. Its format -// should be "organizations/[organization_id], folders/[folder_id], or -// projects/[project_id]". -func (r *OrganizationsSourcesService) List(parent string) *OrganizationsSourcesListCall { - c := &OrganizationsSourcesListCall{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 in a single response. Default is 10, minimum is -// 1, maximum is 1000. -func (c *OrganizationsSourcesListCall) PageSize(pageSize int64) *OrganizationsSourcesListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The value returned -// by the last `ListSourcesResponse`; indicates that this is a -// continuation of a prior `ListSources` call, and that the system -// should return the next page of data. -func (c *OrganizationsSourcesListCall) PageToken(pageToken string) *OrganizationsSourcesListCall { - c.urlParams_.Set("pageToken", pageToken) +// - name: The name of the operation resource to be deleted. +func (r *OrganizationsOperationsService) Delete(name string) *OrganizationsOperationsDeleteCall { + c := &OrganizationsOperationsDeleteCall{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 *OrganizationsSourcesListCall) Fields(s ...googleapi.Field) *OrganizationsSourcesListCall { +func (c *OrganizationsOperationsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsOperationsDeleteCall { 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 *OrganizationsSourcesListCall) IfNoneMatch(entityTag string) *OrganizationsSourcesListCall { - 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 *OrganizationsSourcesListCall) Context(ctx context.Context) *OrganizationsSourcesListCall { +func (c *OrganizationsOperationsDeleteCall) Context(ctx context.Context) *OrganizationsOperationsDeleteCall { 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 *OrganizationsSourcesListCall) Header() http.Header { +func (c *OrganizationsOperationsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSourcesListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsOperationsDeleteCall) 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}/sources") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+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 "securitycenter.organizations.sources.list" call. -// Exactly one of *ListSourcesResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListSourcesResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsSourcesListCall) Do(opts ...googleapi.CallOption) (*ListSourcesResponse, error) { +// Do executes the "securitycenter.organizations.operations.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 *OrganizationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13926,7 +13979,7 @@ func (c *OrganizationsSourcesListCall) Do(opts ...googleapi.CallOption) (*ListSo if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &ListSourcesResponse{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13938,36 +13991,25 @@ func (c *OrganizationsSourcesListCall) Do(opts ...googleapi.CallOption) (*ListSo } return ret, nil // { - // "description": "Lists all sources belonging to an organization.", - // "flatPath": "v1/organizations/{organizationsId}/sources", - // "httpMethod": "GET", - // "id": "securitycenter.organizations.sources.list", + // "description": "Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.", + // "flatPath": "v1/organizations/{organizationsId}/operations/{operationsId}", + // "httpMethod": "DELETE", + // "id": "securitycenter.organizations.operations.delete", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "pageSize": { - // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The value returned by the last `ListSourcesResponse`; indicates that this is a continuation of a prior `ListSources` call, and that the system should return the next page of data.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. Resource name of the parent of sources to list. Its format should be \"organizations/[organization_id], folders/[folder_id], or projects/[project_id]\".", + // "name": { + // "description": "The name of the operation resource to be deleted.", // "location": "path", - // "pattern": "^organizations/[^/]+$", + // "pattern": "^organizations/[^/]+/operations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/sources", + // "path": "v1/{+name}", // "response": { - // "$ref": "ListSourcesResponse" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -13976,101 +14018,79 @@ func (c *OrganizationsSourcesListCall) Do(opts ...googleapi.CallOption) (*ListSo } -// 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 *OrganizationsSourcesListCall) Pages(ctx context.Context, f func(*ListSourcesResponse) 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 "securitycenter.organizations.sources.patch": +// method id "securitycenter.organizations.operations.get": -type OrganizationsSourcesPatchCall struct { - s *Service - name string - source *Source - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsOperationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Patch: Updates a source. +// 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 relative resource name of this source. See: -// https://cloud.google.com/apis/design/resource_names#relative_resource_name -// Example: "organizations/{organization_id}/sources/{source_id}". -func (r *OrganizationsSourcesService) Patch(name string, source *Source) *OrganizationsSourcesPatchCall { - c := &OrganizationsSourcesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the operation resource. +func (r *OrganizationsOperationsService) Get(name string) *OrganizationsOperationsGetCall { + c := &OrganizationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.source = source - return c -} - -// UpdateMask sets the optional parameter "updateMask": The FieldMask to -// use when updating the source resource. If empty all mutable fields -// will be updated. -func (c *OrganizationsSourcesPatchCall) UpdateMask(updateMask string) *OrganizationsSourcesPatchCall { - 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 *OrganizationsSourcesPatchCall) Fields(s ...googleapi.Field) *OrganizationsSourcesPatchCall { +func (c *OrganizationsOperationsGetCall) Fields(s ...googleapi.Field) *OrganizationsOperationsGetCall { 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 *OrganizationsOperationsGetCall) IfNoneMatch(entityTag string) *OrganizationsOperationsGetCall { + 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 *OrganizationsSourcesPatchCall) Context(ctx context.Context) *OrganizationsSourcesPatchCall { +func (c *OrganizationsOperationsGetCall) Context(ctx context.Context) *OrganizationsOperationsGetCall { 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 *OrganizationsSourcesPatchCall) Header() http.Header { +func (c *OrganizationsOperationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSourcesPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsOperationsGetCall) 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.source) - 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, "v1/{+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 } @@ -14081,14 +14101,14 @@ func (c *OrganizationsSourcesPatchCall) doRequest(alt string) (*http.Response, e return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.sources.patch" call. -// Exactly one of *Source or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Source.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *OrganizationsSourcesPatchCall) Do(opts ...googleapi.CallOption) (*Source, error) { +// Do executes the "securitycenter.organizations.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 *OrganizationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14107,7 +14127,7 @@ func (c *OrganizationsSourcesPatchCall) Do(opts ...googleapi.CallOption) (*Sourc if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &Source{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14119,34 +14139,25 @@ func (c *OrganizationsSourcesPatchCall) Do(opts ...googleapi.CallOption) (*Sourc } return ret, nil // { - // "description": "Updates a source.", - // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}", - // "httpMethod": "PATCH", - // "id": "securitycenter.organizations.sources.patch", + // "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": "v1/organizations/{organizationsId}/operations/{operationsId}", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.operations.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "The relative resource name of this source. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/sources/{source_id}\"", + // "description": "The name of the operation resource.", // "location": "path", - // "pattern": "^organizations/[^/]+/sources/[^/]+$", + // "pattern": "^organizations/[^/]+/operations/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "The FieldMask to use when updating the source resource. If empty all mutable fields will be updated.", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, // "path": "v1/{+name}", - // "request": { - // "$ref": "Source" - // }, // "response": { - // "$ref": "Source" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -14155,91 +14166,125 @@ func (c *OrganizationsSourcesPatchCall) Do(opts ...googleapi.CallOption) (*Sourc } -// method id "securitycenter.organizations.sources.setIamPolicy": +// method id "securitycenter.organizations.operations.list": -type OrganizationsSourcesSetIamPolicyCall struct { - s *Service - resource string - setiampolicyrequest *SetIamPolicyRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsOperationsListCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// SetIamPolicy: Sets the access control policy on the specified Source. +// 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. // -// - 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 *OrganizationsSourcesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *OrganizationsSourcesSetIamPolicyCall { - c := &OrganizationsSourcesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.resource = resource - c.setiampolicyrequest = setiampolicyrequest +// - name: The name of the operation's parent resource. +func (r *OrganizationsOperationsService) List(name string) *OrganizationsOperationsListCall { + c := &OrganizationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Filter sets the optional parameter "filter": The standard list +// filter. +func (c *OrganizationsOperationsListCall) Filter(filter string) *OrganizationsOperationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The standard list +// page size. +func (c *OrganizationsOperationsListCall) PageSize(pageSize int64) *OrganizationsOperationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The standard list +// page token. +func (c *OrganizationsOperationsListCall) PageToken(pageToken string) *OrganizationsOperationsListCall { + 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 *OrganizationsSourcesSetIamPolicyCall) Fields(s ...googleapi.Field) *OrganizationsSourcesSetIamPolicyCall { +func (c *OrganizationsOperationsListCall) Fields(s ...googleapi.Field) *OrganizationsOperationsListCall { 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 *OrganizationsOperationsListCall) IfNoneMatch(entityTag string) *OrganizationsOperationsListCall { + 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 *OrganizationsSourcesSetIamPolicyCall) Context(ctx context.Context) *OrganizationsSourcesSetIamPolicyCall { +func (c *OrganizationsOperationsListCall) Context(ctx context.Context) *OrganizationsOperationsListCall { 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 *OrganizationsSourcesSetIamPolicyCall) Header() http.Header { +func (c *OrganizationsOperationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSourcesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsOperationsListCall) 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 + 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, "v1/{+resource}:setIamPolicy") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+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{ - "resource": c.resource, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.sources.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 *OrganizationsSourcesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { +// Do executes the "securitycenter.organizations.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 *OrganizationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14258,7 +14303,7 @@ func (c *OrganizationsSourcesSetIamPolicyCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &Policy{ + ret := &ListOperationsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14270,28 +14315,41 @@ func (c *OrganizationsSourcesSetIamPolicyCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Sets the access control policy on the specified Source.", - // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}:setIamPolicy", - // "httpMethod": "POST", - // "id": "securitycenter.organizations.sources.setIamPolicy", + // "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": "v1/organizations/{organizationsId}/operations", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.operations.list", // "parameterOrder": [ - // "resource" + // "name" // ], // "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.", + // "filter": { + // "description": "The standard list filter.", + // "location": "query", + // "type": "string" + // }, + // "name": { + // "description": "The name of the operation's parent resource.", // "location": "path", - // "pattern": "^organizations/[^/]+/sources/[^/]+$", + // "pattern": "^organizations/[^/]+/operations$", // "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": "v1/{+resource}:setIamPolicy", - // "request": { - // "$ref": "SetIamPolicyRequest" - // }, + // "path": "v1/{+name}", // "response": { - // "$ref": "Policy" + // "$ref": "ListOperationsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -14300,35 +14358,53 @@ func (c *OrganizationsSourcesSetIamPolicyCall) Do(opts ...googleapi.CallOption) } -// method id "securitycenter.organizations.sources.testIamPermissions": +// 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 *OrganizationsOperationsListCall) 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 OrganizationsSourcesTestIamPermissionsCall struct { - s *Service - resource string - testiampermissionsrequest *TestIamPermissionsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "securitycenter.organizations.sources.create": + +type OrganizationsSourcesCreateCall struct { + s *Service + parent string + source *Source + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// TestIamPermissions: Returns the permissions that a caller has on the -// specified source. +// Create: Creates a source. // -// - 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 *OrganizationsSourcesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *OrganizationsSourcesTestIamPermissionsCall { - c := &OrganizationsSourcesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.resource = resource - c.testiampermissionsrequest = testiampermissionsrequest +// - parent: Resource name of the new source's parent. Its format should +// be "organizations/[organization_id]". +func (r *OrganizationsSourcesService) Create(parent string, source *Source) *OrganizationsSourcesCreateCall { + c := &OrganizationsSourcesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.source = source 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 *OrganizationsSourcesTestIamPermissionsCall) Fields(s ...googleapi.Field) *OrganizationsSourcesTestIamPermissionsCall { +func (c *OrganizationsSourcesCreateCall) Fields(s ...googleapi.Field) *OrganizationsSourcesCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -14336,21 +14412,21 @@ func (c *OrganizationsSourcesTestIamPermissionsCall) 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 *OrganizationsSourcesTestIamPermissionsCall) Context(ctx context.Context) *OrganizationsSourcesTestIamPermissionsCall { +func (c *OrganizationsSourcesCreateCall) Context(ctx context.Context) *OrganizationsSourcesCreateCall { 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 *OrganizationsSourcesTestIamPermissionsCall) Header() http.Header { +func (c *OrganizationsSourcesCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSourcesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSourcesCreateCall) 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_ { @@ -14358,14 +14434,14 @@ func (c *OrganizationsSourcesTestIamPermissionsCall) doRequest(alt string) (*htt } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.source) 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 := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/sources") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -14373,19 +14449,19 @@ func (c *OrganizationsSourcesTestIamPermissionsCall) doRequest(alt string) (*htt } 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 "securitycenter.organizations.sources.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 *OrganizationsSourcesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { +// Do executes the "securitycenter.organizations.sources.create" call. +// Exactly one of *Source or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Source.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrganizationsSourcesCreateCall) Do(opts ...googleapi.CallOption) (*Source, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14404,7 +14480,7 @@ func (c *OrganizationsSourcesTestIamPermissionsCall) Do(opts ...googleapi.CallOp if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &TestIamPermissionsResponse{ + ret := &Source{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14416,28 +14492,28 @@ func (c *OrganizationsSourcesTestIamPermissionsCall) Do(opts ...googleapi.CallOp } return ret, nil // { - // "description": "Returns the permissions that a caller has on the specified source.", - // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}:testIamPermissions", + // "description": "Creates a source.", + // "flatPath": "v1/organizations/{organizationsId}/sources", // "httpMethod": "POST", - // "id": "securitycenter.organizations.sources.testIamPermissions", + // "id": "securitycenter.organizations.sources.create", // "parameterOrder": [ - // "resource" + // "parent" // ], // "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.", + // "parent": { + // "description": "Required. Resource name of the new source's parent. Its format should be \"organizations/[organization_id]\".", // "location": "path", - // "pattern": "^organizations/[^/]+/sources/[^/]+$", + // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+resource}:testIamPermissions", + // "path": "v1/{+parent}/sources", // "request": { - // "$ref": "TestIamPermissionsRequest" + // "$ref": "Source" // }, // "response": { - // "$ref": "TestIamPermissionsResponse" + // "$ref": "Source" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -14446,99 +14522,96 @@ func (c *OrganizationsSourcesTestIamPermissionsCall) Do(opts ...googleapi.CallOp } -// method id "securitycenter.organizations.sources.findings.create": +// method id "securitycenter.organizations.sources.get": -type OrganizationsSourcesFindingsCreateCall struct { - s *Service - parent string - finding *Finding - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsSourcesGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Create: Creates a finding. The corresponding source must exist for -// finding creation to succeed. +// Get: Gets a source. // -// - parent: Resource name of the new finding's parent. Its format -// should be "organizations/[organization_id]/sources/[source_id]". -func (r *OrganizationsSourcesFindingsService) Create(parent string, finding *Finding) *OrganizationsSourcesFindingsCreateCall { - c := &OrganizationsSourcesFindingsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.finding = finding - return c -} - -// FindingId sets the optional parameter "findingId": Required. Unique -// identifier provided by the client within the parent scope. It must be -// alphanumeric and less than or equal to 32 characters and greater than -// 0 characters in length. -func (c *OrganizationsSourcesFindingsCreateCall) FindingId(findingId string) *OrganizationsSourcesFindingsCreateCall { - c.urlParams_.Set("findingId", findingId) +// - name: Relative resource name of the source. Its format is +// "organizations/[organization_id]/source/[source_id]". +func (r *OrganizationsSourcesService) Get(name string) *OrganizationsSourcesGetCall { + c := &OrganizationsSourcesGetCall{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 *OrganizationsSourcesFindingsCreateCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsCreateCall { +func (c *OrganizationsSourcesGetCall) Fields(s ...googleapi.Field) *OrganizationsSourcesGetCall { 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 *OrganizationsSourcesGetCall) IfNoneMatch(entityTag string) *OrganizationsSourcesGetCall { + 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 *OrganizationsSourcesFindingsCreateCall) Context(ctx context.Context) *OrganizationsSourcesFindingsCreateCall { +func (c *OrganizationsSourcesGetCall) Context(ctx context.Context) *OrganizationsSourcesGetCall { 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 *OrganizationsSourcesFindingsCreateCall) Header() http.Header { +func (c *OrganizationsSourcesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSourcesFindingsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSourcesGetCall) 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.finding) - 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, "v1/{+parent}/findings") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+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 "securitycenter.organizations.sources.findings.create" call. -// Exactly one of *Finding or error will be non-nil. Any non-2xx status +// Do executes the "securitycenter.organizations.sources.get" call. +// Exactly one of *Source or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *Finding.ServerResponse.Header or (if a response was returned at all) +// *Source.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. -func (c *OrganizationsSourcesFindingsCreateCall) Do(opts ...googleapi.CallOption) (*Finding, error) { +func (c *OrganizationsSourcesGetCall) Do(opts ...googleapi.CallOption) (*Source, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14557,7 +14630,7 @@ func (c *OrganizationsSourcesFindingsCreateCall) Do(opts ...googleapi.CallOption if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &Finding{ + ret := &Source{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14569,33 +14642,25 @@ func (c *OrganizationsSourcesFindingsCreateCall) Do(opts ...googleapi.CallOption } return ret, nil // { - // "description": "Creates a finding. The corresponding source must exist for finding creation to succeed.", - // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings", - // "httpMethod": "POST", - // "id": "securitycenter.organizations.sources.findings.create", + // "description": "Gets a source.", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.sources.get", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "findingId": { - // "description": "Required. Unique identifier provided by the client within the parent scope. It must be alphanumeric and less than or equal to 32 characters and greater than 0 characters in length.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. Resource name of the new finding's parent. Its format should be \"organizations/[organization_id]/sources/[source_id]\".", + // "name": { + // "description": "Required. Relative resource name of the source. Its format is \"organizations/[organization_id]/source/[source_id]\".", // "location": "path", // "pattern": "^organizations/[^/]+/sources/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/findings", - // "request": { - // "$ref": "Finding" - // }, + // "path": "v1/{+name}", // "response": { - // "$ref": "Finding" + // "$ref": "Source" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -14604,42 +14669,34 @@ func (c *OrganizationsSourcesFindingsCreateCall) Do(opts ...googleapi.CallOption } -// method id "securitycenter.organizations.sources.findings.group": +// method id "securitycenter.organizations.sources.getIamPolicy": -type OrganizationsSourcesFindingsGroupCall struct { - s *Service - parent string - groupfindingsrequest *GroupFindingsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsSourcesGetIamPolicyCall struct { + s *Service + resource string + getiampolicyrequest *GetIamPolicyRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Group: Filters an organization or source's findings and groups them -// by their specified properties. To group across all sources provide a -// `-` as the source id. Example: -// /v1/organizations/{organization_id}/sources/-/findings, -// /v1/folders/{folder_id}/sources/-/findings, -// /v1/projects/{project_id}/sources/-/findings +// GetIamPolicy: Gets the access control policy on the specified Source. // -// - parent: Name of the source to groupBy. Its format is -// "organizations/[organization_id]/sources/[source_id]", -// folders/[folder_id]/sources/[source_id], or -// projects/[project_id]/sources/[source_id]. To groupBy across all -// sources provide a source_id of `-`. For example: -// organizations/{organization_id}/sources/-, -// folders/{folder_id}/sources/-, or projects/{project_id}/sources/-. -func (r *OrganizationsSourcesFindingsService) Group(parent string, groupfindingsrequest *GroupFindingsRequest) *OrganizationsSourcesFindingsGroupCall { - c := &OrganizationsSourcesFindingsGroupCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.groupfindingsrequest = groupfindingsrequest +// - 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 *OrganizationsSourcesService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *OrganizationsSourcesGetIamPolicyCall { + c := &OrganizationsSourcesGetIamPolicyCall{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 *OrganizationsSourcesFindingsGroupCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsGroupCall { +func (c *OrganizationsSourcesGetIamPolicyCall) Fields(s ...googleapi.Field) *OrganizationsSourcesGetIamPolicyCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -14647,21 +14704,21 @@ func (c *OrganizationsSourcesFindingsGroupCall) Fields(s ...googleapi.Field) *Or // 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 *OrganizationsSourcesFindingsGroupCall) Context(ctx context.Context) *OrganizationsSourcesFindingsGroupCall { +func (c *OrganizationsSourcesGetIamPolicyCall) Context(ctx context.Context) *OrganizationsSourcesGetIamPolicyCall { 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 *OrganizationsSourcesFindingsGroupCall) Header() http.Header { +func (c *OrganizationsSourcesGetIamPolicyCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSourcesFindingsGroupCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSourcesGetIamPolicyCall) 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_ { @@ -14669,14 +14726,14 @@ func (c *OrganizationsSourcesFindingsGroupCall) doRequest(alt string) (*http.Res } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupfindingsrequest) + 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, "v1/{+parent}/findings:group") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -14684,19 +14741,19 @@ func (c *OrganizationsSourcesFindingsGroupCall) doRequest(alt string) (*http.Res } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "resource": c.resource, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.sources.findings.group" call. -// Exactly one of *GroupFindingsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *GroupFindingsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsSourcesFindingsGroupCall) Do(opts ...googleapi.CallOption) (*GroupFindingsResponse, error) { +// Do executes the "securitycenter.organizations.sources.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 *OrganizationsSourcesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14715,7 +14772,7 @@ func (c *OrganizationsSourcesFindingsGroupCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GroupFindingsResponse{ + ret := &Policy{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14727,28 +14784,28 @@ func (c *OrganizationsSourcesFindingsGroupCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Filters an organization or source's findings and groups them by their specified properties. To group across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings, /v1/folders/{folder_id}/sources/-/findings, /v1/projects/{project_id}/sources/-/findings", - // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings:group", + // "description": "Gets the access control policy on the specified Source.", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}:getIamPolicy", // "httpMethod": "POST", - // "id": "securitycenter.organizations.sources.findings.group", + // "id": "securitycenter.organizations.sources.getIamPolicy", // "parameterOrder": [ - // "parent" + // "resource" // ], // "parameters": { - // "parent": { - // "description": "Required. Name of the source to groupBy. Its format is \"organizations/[organization_id]/sources/[source_id]\", folders/[folder_id]/sources/[source_id], or projects/[project_id]/sources/[source_id]. To groupBy across all sources provide a source_id of `-`. For example: organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, or projects/{project_id}/sources/-", + // "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": "^organizations/[^/]+/sources/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/findings:group", + // "path": "v1/{+resource}:getIamPolicy", // "request": { - // "$ref": "GroupFindingsRequest" + // "$ref": "GetIamPolicyRequest" // }, // "response": { - // "$ref": "GroupFindingsResponse" + // "$ref": "Policy" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -14757,30 +14814,9 @@ func (c *OrganizationsSourcesFindingsGroupCall) 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 *OrganizationsSourcesFindingsGroupCall) Pages(ctx context.Context, f func(*GroupFindingsResponse) error) error { - c.ctx_ = ctx - defer func(pt string) { c.groupfindingsrequest.PageToken = pt }(c.groupfindingsrequest.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.groupfindingsrequest.PageToken = x.NextPageToken - } -} - -// method id "securitycenter.organizations.sources.findings.list": +// method id "securitycenter.organizations.sources.list": -type OrganizationsSourcesFindingsListCall struct { +type OrganizationsSourcesListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -14789,141 +14825,38 @@ type OrganizationsSourcesFindingsListCall struct { header_ http.Header } -// List: Lists an organization or source's findings. To list across all -// sources provide a `-` as the source id. Example: -// /v1/organizations/{organization_id}/sources/-/findings +// List: Lists all sources belonging to an organization. // -// - parent: Name of the source the findings belong to. Its format is -// "organizations/[organization_id]/sources/[source_id], -// folders/[folder_id]/sources/[source_id], or -// projects/[project_id]/sources/[source_id]". To list across all -// sources provide a source_id of `-`. For example: -// organizations/{organization_id}/sources/-, -// folders/{folder_id}/sources/- or projects/{projects_id}/sources/-. -func (r *OrganizationsSourcesFindingsService) List(parent string) *OrganizationsSourcesFindingsListCall { - c := &OrganizationsSourcesFindingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: Resource name of the parent of sources to list. Its format +// should be "organizations/[organization_id], folders/[folder_id], or +// projects/[project_id]". +func (r *OrganizationsSourcesService) List(parent string) *OrganizationsSourcesListCall { + c := &OrganizationsSourcesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } -// CompareDuration sets the optional parameter "compareDuration": When -// compare_duration is set, the ListFindingsResult's "state_change" -// attribute is updated to indicate whether the finding had its state -// changed, the finding's state remained unchanged, or if the finding -// was added in any state during the compare_duration period of time -// that precedes the read_time. This is the time between (read_time - -// compare_duration) and read_time. The state_change value is derived -// based on the presence and state of the finding at the two points in -// time. Intermediate state changes between the two times don't affect -// the result. For example, the results aren't affected if the finding -// is made inactive and then active again. Possible "state_change" -// values when compare_duration is specified: * "CHANGED": indicates -// that the finding was present and matched the given filter at the -// start of compare_duration, but changed its state at read_time. * -// "UNCHANGED": indicates that the finding was present and matched the -// given filter at the start of compare_duration and did not change -// state at read_time. * "ADDED": indicates that the finding did not -// match the given filter or was not present at the start of -// compare_duration, but was present at read_time. * "REMOVED": -// indicates that the finding was present and matched the filter at the -// start of compare_duration, but did not match the filter at read_time. -// If compare_duration is not specified, then the only possible -// state_change is "UNUSED", which will be the state_change set for all -// findings present at read_time. -func (c *OrganizationsSourcesFindingsListCall) CompareDuration(compareDuration string) *OrganizationsSourcesFindingsListCall { - c.urlParams_.Set("compareDuration", compareDuration) - return c -} - -// FieldMask sets the optional parameter "fieldMask": A field mask to -// specify the Finding fields to be listed in the response. An empty -// field mask will list all fields. -func (c *OrganizationsSourcesFindingsListCall) FieldMask(fieldMask string) *OrganizationsSourcesFindingsListCall { - c.urlParams_.Set("fieldMask", fieldMask) - return c -} - -// Filter sets the optional parameter "filter": Expression that defines -// the filter to apply across findings. The expression is a list of one -// or more restrictions combined via logical operators `AND` and `OR`. -// Parentheses are supported, and `OR` has higher precedence than `AND`. -// Restrictions have the form ` ` and may have a `-` character in front -// of them to indicate negation. Examples include: * name * -// source_properties.a_property * security_marks.marks.marka The -// supported operators are: * `=` for all value types. * `>`, `<`, `>=`, -// `<=` for integer values. * `:`, meaning substring matching, for -// strings. The supported value types are: * string literals in quotes. -// * integer literals without quotes. * boolean literals `true` and -// `false` without quotes. The following field and operator combinations -// are supported: * name: `=` * parent: `=`, `:` * resource_name: `=`, -// `:` * state: `=`, `:` * category: `=`, `:` * external_uri: `=`, `:` * -// event_time: `=`, `>`, `<`, `>=`, `<=` Usage: This should be -// milliseconds since epoch or an RFC3339 string. Examples: `event_time -// = "2019-06-10T16:07:18-07:00" `event_time = 1560208038000` * -// severity: `=`, `:` * workflow_state: `=`, `:` * security_marks.marks: -// `=`, `:` * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` For -// example, `source_properties.size = 100` is a valid filter string. Use -// a partial match on the empty string to filter based on a property -// existing: `source_properties.my_property : "" Use a negated partial -// match on the empty string to filter based on a property not existing: -// `-source_properties.my_property : "" * resource: * resource.name: -// `=`, `:` * resource.parent_name: `=`, `:` * -// resource.parent_display_name: `=`, `:` * resource.project_name: `=`, -// `:` * resource.project_display_name: `=`, `:` * resource.type: `=`, -// `:` * resource.folders.resource_folder: `=`, `:` * -// resource.display_name: `=`, `:` -func (c *OrganizationsSourcesFindingsListCall) Filter(filter string) *OrganizationsSourcesFindingsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// OrderBy sets the optional parameter "orderBy": Expression that -// defines what fields and order to use for sorting. The string value -// should follow SQL syntax: comma separated list of fields. For -// example: "name,resource_properties.a_property". The default sorting -// order is ascending. To specify descending order for a field, a suffix -// " desc" should be appended to the field name. For example: "name -// desc,source_properties.a_property". Redundant space characters in the -// syntax are insignificant. "name desc,source_properties.a_property" -// and " name desc , source_properties.a_property " are equivalent. The -// following fields are supported: name parent state category -// resource_name event_time source_properties security_marks.marks -func (c *OrganizationsSourcesFindingsListCall) OrderBy(orderBy string) *OrganizationsSourcesFindingsListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - // PageSize sets the optional parameter "pageSize": The maximum number // of results to return in a single response. Default is 10, minimum is // 1, maximum is 1000. -func (c *OrganizationsSourcesFindingsListCall) PageSize(pageSize int64) *OrganizationsSourcesFindingsListCall { +func (c *OrganizationsSourcesListCall) PageSize(pageSize int64) *OrganizationsSourcesListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } // PageToken sets the optional parameter "pageToken": The value returned -// by the last `ListFindingsResponse`; indicates that this is a -// continuation of a prior `ListFindings` call, and that the system +// by the last `ListSourcesResponse`; indicates that this is a +// continuation of a prior `ListSources` call, and that the system // should return the next page of data. -func (c *OrganizationsSourcesFindingsListCall) PageToken(pageToken string) *OrganizationsSourcesFindingsListCall { +func (c *OrganizationsSourcesListCall) PageToken(pageToken string) *OrganizationsSourcesListCall { c.urlParams_.Set("pageToken", pageToken) return c } -// ReadTime sets the optional parameter "readTime": Time used as a -// reference point when filtering findings. The filter is limited to -// findings existing at the supplied time and their values are those at -// that specific time. Absence of this field will default to the API's -// version of NOW. -func (c *OrganizationsSourcesFindingsListCall) ReadTime(readTime string) *OrganizationsSourcesFindingsListCall { - c.urlParams_.Set("readTime", readTime) - 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 *OrganizationsSourcesFindingsListCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsListCall { +func (c *OrganizationsSourcesListCall) Fields(s ...googleapi.Field) *OrganizationsSourcesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -14933,7 +14866,7 @@ func (c *OrganizationsSourcesFindingsListCall) Fields(s ...googleapi.Field) *Org // 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 *OrganizationsSourcesFindingsListCall) IfNoneMatch(entityTag string) *OrganizationsSourcesFindingsListCall { +func (c *OrganizationsSourcesListCall) IfNoneMatch(entityTag string) *OrganizationsSourcesListCall { c.ifNoneMatch_ = entityTag return c } @@ -14941,21 +14874,21 @@ func (c *OrganizationsSourcesFindingsListCall) IfNoneMatch(entityTag string) *Or // 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 *OrganizationsSourcesFindingsListCall) Context(ctx context.Context) *OrganizationsSourcesFindingsListCall { +func (c *OrganizationsSourcesListCall) Context(ctx context.Context) *OrganizationsSourcesListCall { 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 *OrganizationsSourcesFindingsListCall) Header() http.Header { +func (c *OrganizationsSourcesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSourcesFindingsListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSourcesListCall) 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_ { @@ -14968,7 +14901,7 @@ func (c *OrganizationsSourcesFindingsListCall) 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, "v1/{+parent}/findings") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/sources") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -14981,14 +14914,14 @@ func (c *OrganizationsSourcesFindingsListCall) doRequest(alt string) (*http.Resp return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.sources.findings.list" call. -// Exactly one of *ListFindingsResponse or error will be non-nil. Any +// Do executes the "securitycenter.organizations.sources.list" call. +// Exactly one of *ListSourcesResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either -// *ListFindingsResponse.ServerResponse.Header or (if a response was +// *ListSourcesResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *OrganizationsSourcesFindingsListCall) Do(opts ...googleapi.CallOption) (*ListFindingsResponse, error) { +func (c *OrganizationsSourcesListCall) Do(opts ...googleapi.CallOption) (*ListSourcesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15007,7 +14940,7 @@ func (c *OrganizationsSourcesFindingsListCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &ListFindingsResponse{ + ret := &ListSourcesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -15019,36 +14952,14 @@ func (c *OrganizationsSourcesFindingsListCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Lists an organization or source's findings. To list across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings", - // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings", + // "description": "Lists all sources belonging to an organization.", + // "flatPath": "v1/organizations/{organizationsId}/sources", // "httpMethod": "GET", - // "id": "securitycenter.organizations.sources.findings.list", + // "id": "securitycenter.organizations.sources.list", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "compareDuration": { - // "description": "When compare_duration is set, the ListFindingsResult's \"state_change\" attribute is updated to indicate whether the finding had its state changed, the finding's state remained unchanged, or if the finding was added in any state during the compare_duration period of time that precedes the read_time. This is the time between (read_time - compare_duration) and read_time. The state_change value is derived based on the presence and state of the finding at the two points in time. Intermediate state changes between the two times don't affect the result. For example, the results aren't affected if the finding is made inactive and then active again. Possible \"state_change\" values when compare_duration is specified: * \"CHANGED\": indicates that the finding was present and matched the given filter at the start of compare_duration, but changed its state at read_time. * \"UNCHANGED\": indicates that the finding was present and matched the given filter at the start of compare_duration and did not change state at read_time. * \"ADDED\": indicates that the finding did not match the given filter or was not present at the start of compare_duration, but was present at read_time. * \"REMOVED\": indicates that the finding was present and matched the filter at the start of compare_duration, but did not match the filter at read_time. If compare_duration is not specified, then the only possible state_change is \"UNUSED\", which will be the state_change set for all findings present at read_time.", - // "format": "google-duration", - // "location": "query", - // "type": "string" - // }, - // "fieldMask": { - // "description": "A field mask to specify the Finding fields to be listed in the response. An empty field mask will list all fields.", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" - // }, - // "filter": { - // "description": "Expression that defines the filter to apply across findings. The expression is a list of one or more restrictions combined via logical operators `AND` and `OR`. Parentheses are supported, and `OR` has higher precedence than `AND`. Restrictions have the form ` ` and may have a `-` character in front of them to indicate negation. Examples include: * name * source_properties.a_property * security_marks.marks.marka The supported operators are: * `=` for all value types. * `\u003e`, `\u003c`, `\u003e=`, `\u003c=` for integer values. * `:`, meaning substring matching, for strings. The supported value types are: * string literals in quotes. * integer literals without quotes. * boolean literals `true` and `false` without quotes. The following field and operator combinations are supported: * name: `=` * parent: `=`, `:` * resource_name: `=`, `:` * state: `=`, `:` * category: `=`, `:` * external_uri: `=`, `:` * event_time: `=`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: `event_time = \"2019-06-10T16:07:18-07:00\"` `event_time = 1560208038000` * severity: `=`, `:` * workflow_state: `=`, `:` * security_marks.marks: `=`, `:` * source_properties: `=`, `:`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` For example, `source_properties.size = 100` is a valid filter string. Use a partial match on the empty string to filter based on a property existing: `source_properties.my_property : \"\"` Use a negated partial match on the empty string to filter based on a property not existing: `-source_properties.my_property : \"\"` * resource: * resource.name: `=`, `:` * resource.parent_name: `=`, `:` * resource.parent_display_name: `=`, `:` * resource.project_name: `=`, `:` * resource.project_display_name: `=`, `:` * resource.type: `=`, `:` * resource.folders.resource_folder: `=`, `:` * resource.display_name: `=`, `:`", - // "location": "query", - // "type": "string" - // }, - // "orderBy": { - // "description": "Expression that defines what fields and order to use for sorting. The string value should follow SQL syntax: comma separated list of fields. For example: \"name,resource_properties.a_property\". The default sorting order is ascending. To specify descending order for a field, a suffix \" desc\" should be appended to the field name. For example: \"name desc,source_properties.a_property\". Redundant space characters in the syntax are insignificant. \"name desc,source_properties.a_property\" and \" name desc , source_properties.a_property \" are equivalent. The following fields are supported: name parent state category resource_name event_time source_properties security_marks.marks", - // "location": "query", - // "type": "string" - // }, // "pageSize": { // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", // "format": "int32", @@ -15056,27 +14967,21 @@ func (c *OrganizationsSourcesFindingsListCall) Do(opts ...googleapi.CallOption) // "type": "integer" // }, // "pageToken": { - // "description": "The value returned by the last `ListFindingsResponse`; indicates that this is a continuation of a prior `ListFindings` call, and that the system should return the next page of data.", + // "description": "The value returned by the last `ListSourcesResponse`; indicates that this is a continuation of a prior `ListSources` call, and that the system should return the next page of data.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. Name of the source the findings belong to. Its format is \"organizations/[organization_id]/sources/[source_id], folders/[folder_id]/sources/[source_id], or projects/[project_id]/sources/[source_id]\". To list across all sources provide a source_id of `-`. For example: organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or projects/{projects_id}/sources/-", + // "description": "Required. Resource name of the parent of sources to list. Its format should be \"organizations/[organization_id], folders/[folder_id], or projects/[project_id]\".", // "location": "path", - // "pattern": "^organizations/[^/]+/sources/[^/]+$", + // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" - // }, - // "readTime": { - // "description": "Time used as a reference point when filtering findings. The filter is limited to findings existing at the supplied time and their values are those at that specific time. Absence of this field will default to the API's version of NOW.", - // "format": "google-datetime", - // "location": "query", - // "type": "string" // } // }, - // "path": "v1/{+parent}/findings", + // "path": "v1/{+parent}/sources", // "response": { - // "$ref": "ListFindingsResponse" + // "$ref": "ListSourcesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -15088,7 +14993,7 @@ func (c *OrganizationsSourcesFindingsListCall) 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 *OrganizationsSourcesFindingsListCall) Pages(ctx context.Context, f func(*ListFindingsResponse) error) error { +func (c *OrganizationsSourcesListCall) Pages(ctx context.Context, f func(*ListSourcesResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -15106,39 +15011,33 @@ func (c *OrganizationsSourcesFindingsListCall) Pages(ctx context.Context, f func } } -// method id "securitycenter.organizations.sources.findings.patch": +// method id "securitycenter.organizations.sources.patch": -type OrganizationsSourcesFindingsPatchCall struct { +type OrganizationsSourcesPatchCall struct { s *Service name string - finding *Finding + source *Source urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Patch: Creates or updates a finding. The corresponding source must -// exist for a finding creation to succeed. +// Patch: Updates a source. // -// - name: The relative resource name of this finding. See: +// - name: The relative resource name of this source. See: // https://cloud.google.com/apis/design/resource_names#relative_resource_name -// Example: -// "organizations/{organization_id}/sources/{source_id}/findings/{findi -// ng_id}". -func (r *OrganizationsSourcesFindingsService) Patch(name string, finding *Finding) *OrganizationsSourcesFindingsPatchCall { - c := &OrganizationsSourcesFindingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// Example: "organizations/{organization_id}/sources/{source_id}". +func (r *OrganizationsSourcesService) Patch(name string, source *Source) *OrganizationsSourcesPatchCall { + c := &OrganizationsSourcesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.finding = finding + c.source = source return c } // UpdateMask sets the optional parameter "updateMask": The FieldMask to -// use when updating the finding resource. This field should not be -// specified when creating a finding. When updating a finding, an empty -// mask is treated as updating all mutable fields and replacing -// source_properties. Individual source_properties can be added/updated -// by using "source_properties." in the field mask. -func (c *OrganizationsSourcesFindingsPatchCall) UpdateMask(updateMask string) *OrganizationsSourcesFindingsPatchCall { +// use when updating the source resource. If empty all mutable fields +// will be updated. +func (c *OrganizationsSourcesPatchCall) UpdateMask(updateMask string) *OrganizationsSourcesPatchCall { c.urlParams_.Set("updateMask", updateMask) return c } @@ -15146,7 +15045,7 @@ func (c *OrganizationsSourcesFindingsPatchCall) UpdateMask(updateMask string) *O // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSourcesFindingsPatchCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsPatchCall { +func (c *OrganizationsSourcesPatchCall) Fields(s ...googleapi.Field) *OrganizationsSourcesPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -15154,21 +15053,21 @@ func (c *OrganizationsSourcesFindingsPatchCall) Fields(s ...googleapi.Field) *Or // 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 *OrganizationsSourcesFindingsPatchCall) Context(ctx context.Context) *OrganizationsSourcesFindingsPatchCall { +func (c *OrganizationsSourcesPatchCall) Context(ctx context.Context) *OrganizationsSourcesPatchCall { 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 *OrganizationsSourcesFindingsPatchCall) Header() http.Header { +func (c *OrganizationsSourcesPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSourcesFindingsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSourcesPatchCall) 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_ { @@ -15176,7 +15075,7 @@ func (c *OrganizationsSourcesFindingsPatchCall) doRequest(alt string) (*http.Res } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.finding) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.source) if err != nil { return nil, err } @@ -15196,14 +15095,14 @@ func (c *OrganizationsSourcesFindingsPatchCall) doRequest(alt string) (*http.Res return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.sources.findings.patch" call. -// Exactly one of *Finding or error will be non-nil. Any non-2xx status +// Do executes the "securitycenter.organizations.sources.patch" call. +// Exactly one of *Source or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *Finding.ServerResponse.Header or (if a response was returned at all) +// *Source.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. -func (c *OrganizationsSourcesFindingsPatchCall) Do(opts ...googleapi.CallOption) (*Finding, error) { +func (c *OrganizationsSourcesPatchCall) Do(opts ...googleapi.CallOption) (*Source, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15222,7 +15121,7 @@ func (c *OrganizationsSourcesFindingsPatchCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &Finding{ + ret := &Source{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -15234,23 +15133,23 @@ func (c *OrganizationsSourcesFindingsPatchCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Creates or updates a finding. The corresponding source must exist for a finding creation to succeed.", - // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings/{findingsId}", + // "description": "Updates a source.", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}", // "httpMethod": "PATCH", - // "id": "securitycenter.organizations.sources.findings.patch", + // "id": "securitycenter.organizations.sources.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "The relative resource name of this finding. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}\"", + // "description": "The relative resource name of this source. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/sources/{source_id}\"", // "location": "path", - // "pattern": "^organizations/[^/]+/sources/[^/]+/findings/[^/]+$", + // "pattern": "^organizations/[^/]+/sources/[^/]+$", // "required": true, // "type": "string" // }, // "updateMask": { - // "description": "The FieldMask to use when updating the finding resource. This field should not be specified when creating a finding. When updating a finding, an empty mask is treated as updating all mutable fields and replacing source_properties. Individual source_properties can be added/updated by using \"source_properties.\" in the field mask.", + // "description": "The FieldMask to use when updating the source resource. If empty all mutable fields will be updated.", // "format": "google-fieldmask", // "location": "query", // "type": "string" @@ -15258,10 +15157,10 @@ func (c *OrganizationsSourcesFindingsPatchCall) Do(opts ...googleapi.CallOption) // }, // "path": "v1/{+name}", // "request": { - // "$ref": "Finding" + // "$ref": "Source" // }, // "response": { - // "$ref": "Finding" + // "$ref": "Source" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -15270,37 +15169,34 @@ func (c *OrganizationsSourcesFindingsPatchCall) Do(opts ...googleapi.CallOption) } -// method id "securitycenter.organizations.sources.findings.setMute": +// method id "securitycenter.organizations.sources.setIamPolicy": -type OrganizationsSourcesFindingsSetMuteCall struct { - s *Service - name string - setmuterequest *SetMuteRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsSourcesSetIamPolicyCall struct { + s *Service + resource string + setiampolicyrequest *SetIamPolicyRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// SetMute: Updates the mute state of a finding. +// SetIamPolicy: Sets the access control policy on the specified Source. // -// - name: The relative resource name of the finding. See: -// https://cloud.google.com/apis/design/resource_names#relative_resource_name -// Example: -// "organizations/{organization_id}/sources/{source_id}/finding/{findin -// g_id}", -// "folders/{folder_id}/sources/{source_id}/finding/{finding_id}", -// "projects/{project_id}/sources/{source_id}/finding/{finding_id}". -func (r *OrganizationsSourcesFindingsService) SetMute(name string, setmuterequest *SetMuteRequest) *OrganizationsSourcesFindingsSetMuteCall { - c := &OrganizationsSourcesFindingsSetMuteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.setmuterequest = setmuterequest +// - 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 *OrganizationsSourcesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *OrganizationsSourcesSetIamPolicyCall { + c := &OrganizationsSourcesSetIamPolicyCall{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 *OrganizationsSourcesFindingsSetMuteCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsSetMuteCall { +func (c *OrganizationsSourcesSetIamPolicyCall) Fields(s ...googleapi.Field) *OrganizationsSourcesSetIamPolicyCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -15308,21 +15204,21 @@ func (c *OrganizationsSourcesFindingsSetMuteCall) 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 *OrganizationsSourcesFindingsSetMuteCall) Context(ctx context.Context) *OrganizationsSourcesFindingsSetMuteCall { +func (c *OrganizationsSourcesSetIamPolicyCall) Context(ctx context.Context) *OrganizationsSourcesSetIamPolicyCall { 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 *OrganizationsSourcesFindingsSetMuteCall) Header() http.Header { +func (c *OrganizationsSourcesSetIamPolicyCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSourcesFindingsSetMuteCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSourcesSetIamPolicyCall) 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_ { @@ -15330,14 +15226,14 @@ func (c *OrganizationsSourcesFindingsSetMuteCall) doRequest(alt string) (*http.R } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmuterequest) + 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/{+name}:setMute") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -15345,19 +15241,19 @@ func (c *OrganizationsSourcesFindingsSetMuteCall) doRequest(alt string) (*http.R } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "resource": c.resource, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.sources.findings.setMute" call. -// Exactly one of *Finding or error will be non-nil. Any non-2xx status +// Do executes the "securitycenter.organizations.sources.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 -// *Finding.ServerResponse.Header or (if a response was returned at all) +// *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 *OrganizationsSourcesFindingsSetMuteCall) Do(opts ...googleapi.CallOption) (*Finding, error) { +func (c *OrganizationsSourcesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15376,7 +15272,7 @@ func (c *OrganizationsSourcesFindingsSetMuteCall) Do(opts ...googleapi.CallOptio if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &Finding{ + ret := &Policy{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -15388,28 +15284,2107 @@ func (c *OrganizationsSourcesFindingsSetMuteCall) Do(opts ...googleapi.CallOptio } return ret, nil // { - // "description": "Updates the mute state of a finding.", - // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings/{findingsId}:setMute", + // "description": "Sets the access control policy on the specified Source.", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}:setIamPolicy", // "httpMethod": "POST", - // "id": "securitycenter.organizations.sources.findings.setMute", + // "id": "securitycenter.organizations.sources.setIamPolicy", // "parameterOrder": [ - // "name" + // "resource" // ], // "parameters": { - // "name": { - // "description": "Required. The relative resource name of the finding. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/sources/{source_id}/finding/{finding_id}\", \"folders/{folder_id}/sources/{source_id}/finding/{finding_id}\", \"projects/{project_id}/sources/{source_id}/finding/{finding_id}\".", + // "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": "^organizations/[^/]+/sources/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+resource}:setIamPolicy", + // "request": { + // "$ref": "SetIamPolicyRequest" + // }, + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "securitycenter.organizations.sources.testIamPermissions": + +type OrganizationsSourcesTestIamPermissionsCall struct { + s *Service + resource string + testiampermissionsrequest *TestIamPermissionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// TestIamPermissions: Returns the permissions that a caller has on the +// specified source. +// +// - 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 *OrganizationsSourcesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *OrganizationsSourcesTestIamPermissionsCall { + c := &OrganizationsSourcesTestIamPermissionsCall{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 *OrganizationsSourcesTestIamPermissionsCall) Fields(s ...googleapi.Field) *OrganizationsSourcesTestIamPermissionsCall { + 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 *OrganizationsSourcesTestIamPermissionsCall) Context(ctx context.Context) *OrganizationsSourcesTestIamPermissionsCall { + 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 *OrganizationsSourcesTestIamPermissionsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsSourcesTestIamPermissionsCall) 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 "securitycenter.organizations.sources.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 *OrganizationsSourcesTestIamPermissionsCall) 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, &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, 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 the permissions that a caller has on the specified source.", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}:testIamPermissions", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.sources.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": "^organizations/[^/]+/sources/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+resource}:testIamPermissions", + // "request": { + // "$ref": "TestIamPermissionsRequest" + // }, + // "response": { + // "$ref": "TestIamPermissionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "securitycenter.organizations.sources.findings.create": + +type OrganizationsSourcesFindingsCreateCall struct { + s *Service + parent string + finding *Finding + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a finding. The corresponding source must exist for +// finding creation to succeed. +// +// - parent: Resource name of the new finding's parent. Its format +// should be "organizations/[organization_id]/sources/[source_id]". +func (r *OrganizationsSourcesFindingsService) Create(parent string, finding *Finding) *OrganizationsSourcesFindingsCreateCall { + c := &OrganizationsSourcesFindingsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.finding = finding + return c +} + +// FindingId sets the optional parameter "findingId": Required. Unique +// identifier provided by the client within the parent scope. It must be +// alphanumeric and less than or equal to 32 characters and greater than +// 0 characters in length. +func (c *OrganizationsSourcesFindingsCreateCall) FindingId(findingId string) *OrganizationsSourcesFindingsCreateCall { + c.urlParams_.Set("findingId", findingId) + 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 *OrganizationsSourcesFindingsCreateCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsCreateCall { + 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 *OrganizationsSourcesFindingsCreateCall) Context(ctx context.Context) *OrganizationsSourcesFindingsCreateCall { + 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 *OrganizationsSourcesFindingsCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsSourcesFindingsCreateCall) 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.finding) + 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/{+parent}/findings") + 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 "securitycenter.organizations.sources.findings.create" call. +// Exactly one of *Finding or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Finding.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrganizationsSourcesFindingsCreateCall) Do(opts ...googleapi.CallOption) (*Finding, 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, &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, err + } + ret := &Finding{ + 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 finding. The corresponding source must exist for finding creation to succeed.", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.sources.findings.create", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "findingId": { + // "description": "Required. Unique identifier provided by the client within the parent scope. It must be alphanumeric and less than or equal to 32 characters and greater than 0 characters in length.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. Resource name of the new finding's parent. Its format should be \"organizations/[organization_id]/sources/[source_id]\".", + // "location": "path", + // "pattern": "^organizations/[^/]+/sources/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+parent}/findings", + // "request": { + // "$ref": "Finding" + // }, + // "response": { + // "$ref": "Finding" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "securitycenter.organizations.sources.findings.group": + +type OrganizationsSourcesFindingsGroupCall struct { + s *Service + parent string + groupfindingsrequest *GroupFindingsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Group: Filters an organization or source's findings and groups them +// by their specified properties. To group across all sources provide a +// `-` as the source id. Example: +// /v1/organizations/{organization_id}/sources/-/findings, +// /v1/folders/{folder_id}/sources/-/findings, +// /v1/projects/{project_id}/sources/-/findings +// +// - parent: Name of the source to groupBy. Its format is +// "organizations/[organization_id]/sources/[source_id]", +// folders/[folder_id]/sources/[source_id], or +// projects/[project_id]/sources/[source_id]. To groupBy across all +// sources provide a source_id of `-`. For example: +// organizations/{organization_id}/sources/-, +// folders/{folder_id}/sources/-, or projects/{project_id}/sources/-. +func (r *OrganizationsSourcesFindingsService) Group(parent string, groupfindingsrequest *GroupFindingsRequest) *OrganizationsSourcesFindingsGroupCall { + c := &OrganizationsSourcesFindingsGroupCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.groupfindingsrequest = groupfindingsrequest + 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 *OrganizationsSourcesFindingsGroupCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsGroupCall { + 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 *OrganizationsSourcesFindingsGroupCall) Context(ctx context.Context) *OrganizationsSourcesFindingsGroupCall { + 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 *OrganizationsSourcesFindingsGroupCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsSourcesFindingsGroupCall) 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.groupfindingsrequest) + 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/{+parent}/findings:group") + 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 "securitycenter.organizations.sources.findings.group" call. +// Exactly one of *GroupFindingsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GroupFindingsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsSourcesFindingsGroupCall) Do(opts ...googleapi.CallOption) (*GroupFindingsResponse, 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, &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, err + } + ret := &GroupFindingsResponse{ + 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": "Filters an organization or source's findings and groups them by their specified properties. To group across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings, /v1/folders/{folder_id}/sources/-/findings, /v1/projects/{project_id}/sources/-/findings", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings:group", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.sources.findings.group", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. Name of the source to groupBy. Its format is \"organizations/[organization_id]/sources/[source_id]\", folders/[folder_id]/sources/[source_id], or projects/[project_id]/sources/[source_id]. To groupBy across all sources provide a source_id of `-`. For example: organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, or projects/{project_id}/sources/-", + // "location": "path", + // "pattern": "^organizations/[^/]+/sources/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+parent}/findings:group", + // "request": { + // "$ref": "GroupFindingsRequest" + // }, + // "response": { + // "$ref": "GroupFindingsResponse" + // }, + // "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 *OrganizationsSourcesFindingsGroupCall) Pages(ctx context.Context, f func(*GroupFindingsResponse) error) error { + c.ctx_ = ctx + defer func(pt string) { c.groupfindingsrequest.PageToken = pt }(c.groupfindingsrequest.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.groupfindingsrequest.PageToken = x.NextPageToken + } +} + +// method id "securitycenter.organizations.sources.findings.list": + +type OrganizationsSourcesFindingsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists an organization or source's findings. To list across all +// sources provide a `-` as the source id. Example: +// /v1/organizations/{organization_id}/sources/-/findings +// +// - parent: Name of the source the findings belong to. Its format is +// "organizations/[organization_id]/sources/[source_id], +// folders/[folder_id]/sources/[source_id], or +// projects/[project_id]/sources/[source_id]". To list across all +// sources provide a source_id of `-`. For example: +// organizations/{organization_id}/sources/-, +// folders/{folder_id}/sources/- or projects/{projects_id}/sources/-. +func (r *OrganizationsSourcesFindingsService) List(parent string) *OrganizationsSourcesFindingsListCall { + c := &OrganizationsSourcesFindingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// CompareDuration sets the optional parameter "compareDuration": When +// compare_duration is set, the ListFindingsResult's "state_change" +// attribute is updated to indicate whether the finding had its state +// changed, the finding's state remained unchanged, or if the finding +// was added in any state during the compare_duration period of time +// that precedes the read_time. This is the time between (read_time - +// compare_duration) and read_time. The state_change value is derived +// based on the presence and state of the finding at the two points in +// time. Intermediate state changes between the two times don't affect +// the result. For example, the results aren't affected if the finding +// is made inactive and then active again. Possible "state_change" +// values when compare_duration is specified: * "CHANGED": indicates +// that the finding was present and matched the given filter at the +// start of compare_duration, but changed its state at read_time. * +// "UNCHANGED": indicates that the finding was present and matched the +// given filter at the start of compare_duration and did not change +// state at read_time. * "ADDED": indicates that the finding did not +// match the given filter or was not present at the start of +// compare_duration, but was present at read_time. * "REMOVED": +// indicates that the finding was present and matched the filter at the +// start of compare_duration, but did not match the filter at read_time. +// If compare_duration is not specified, then the only possible +// state_change is "UNUSED", which will be the state_change set for all +// findings present at read_time. +func (c *OrganizationsSourcesFindingsListCall) CompareDuration(compareDuration string) *OrganizationsSourcesFindingsListCall { + c.urlParams_.Set("compareDuration", compareDuration) + return c +} + +// FieldMask sets the optional parameter "fieldMask": A field mask to +// specify the Finding fields to be listed in the response. An empty +// field mask will list all fields. +func (c *OrganizationsSourcesFindingsListCall) FieldMask(fieldMask string) *OrganizationsSourcesFindingsListCall { + c.urlParams_.Set("fieldMask", fieldMask) + return c +} + +// Filter sets the optional parameter "filter": Expression that defines +// the filter to apply across findings. The expression is a list of one +// or more restrictions combined via logical operators `AND` and `OR`. +// Parentheses are supported, and `OR` has higher precedence than `AND`. +// Restrictions have the form ` ` and may have a `-` character in front +// of them to indicate negation. Examples include: * name * +// source_properties.a_property * security_marks.marks.marka The +// supported operators are: * `=` for all value types. * `>`, `<`, `>=`, +// `<=` for integer values. * `:`, meaning substring matching, for +// strings. The supported value types are: * string literals in quotes. +// * integer literals without quotes. * boolean literals `true` and +// `false` without quotes. The following field and operator combinations +// are supported: * name: `=` * parent: `=`, `:` * resource_name: `=`, +// `:` * state: `=`, `:` * category: `=`, `:` * external_uri: `=`, `:` * +// event_time: `=`, `>`, `<`, `>=`, `<=` Usage: This should be +// milliseconds since epoch or an RFC3339 string. Examples: `event_time +// = "2019-06-10T16:07:18-07:00" `event_time = 1560208038000` * +// severity: `=`, `:` * workflow_state: `=`, `:` * security_marks.marks: +// `=`, `:` * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` For +// example, `source_properties.size = 100` is a valid filter string. Use +// a partial match on the empty string to filter based on a property +// existing: `source_properties.my_property : "" Use a negated partial +// match on the empty string to filter based on a property not existing: +// `-source_properties.my_property : "" * resource: * resource.name: +// `=`, `:` * resource.parent_name: `=`, `:` * +// resource.parent_display_name: `=`, `:` * resource.project_name: `=`, +// `:` * resource.project_display_name: `=`, `:` * resource.type: `=`, +// `:` * resource.folders.resource_folder: `=`, `:` * +// resource.display_name: `=`, `:` +func (c *OrganizationsSourcesFindingsListCall) Filter(filter string) *OrganizationsSourcesFindingsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// OrderBy sets the optional parameter "orderBy": Expression that +// defines what fields and order to use for sorting. The string value +// should follow SQL syntax: comma separated list of fields. For +// example: "name,resource_properties.a_property". The default sorting +// order is ascending. To specify descending order for a field, a suffix +// " desc" should be appended to the field name. For example: "name +// desc,source_properties.a_property". Redundant space characters in the +// syntax are insignificant. "name desc,source_properties.a_property" +// and " name desc , source_properties.a_property " are equivalent. The +// following fields are supported: name parent state category +// resource_name event_time source_properties security_marks.marks +func (c *OrganizationsSourcesFindingsListCall) OrderBy(orderBy string) *OrganizationsSourcesFindingsListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return in a single response. Default is 10, minimum is +// 1, maximum is 1000. +func (c *OrganizationsSourcesFindingsListCall) PageSize(pageSize int64) *OrganizationsSourcesFindingsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last `ListFindingsResponse`; indicates that this is a +// continuation of a prior `ListFindings` call, and that the system +// should return the next page of data. +func (c *OrganizationsSourcesFindingsListCall) PageToken(pageToken string) *OrganizationsSourcesFindingsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReadTime sets the optional parameter "readTime": Time used as a +// reference point when filtering findings. The filter is limited to +// findings existing at the supplied time and their values are those at +// that specific time. Absence of this field will default to the API's +// version of NOW. +func (c *OrganizationsSourcesFindingsListCall) ReadTime(readTime string) *OrganizationsSourcesFindingsListCall { + c.urlParams_.Set("readTime", readTime) + 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 *OrganizationsSourcesFindingsListCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsListCall { + 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 *OrganizationsSourcesFindingsListCall) IfNoneMatch(entityTag string) *OrganizationsSourcesFindingsListCall { + 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 *OrganizationsSourcesFindingsListCall) Context(ctx context.Context) *OrganizationsSourcesFindingsListCall { + 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 *OrganizationsSourcesFindingsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsSourcesFindingsListCall) 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}/findings") + 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 "securitycenter.organizations.sources.findings.list" call. +// Exactly one of *ListFindingsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListFindingsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsSourcesFindingsListCall) Do(opts ...googleapi.CallOption) (*ListFindingsResponse, 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, &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, err + } + ret := &ListFindingsResponse{ + 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 an organization or source's findings. To list across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.sources.findings.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "compareDuration": { + // "description": "When compare_duration is set, the ListFindingsResult's \"state_change\" attribute is updated to indicate whether the finding had its state changed, the finding's state remained unchanged, or if the finding was added in any state during the compare_duration period of time that precedes the read_time. This is the time between (read_time - compare_duration) and read_time. The state_change value is derived based on the presence and state of the finding at the two points in time. Intermediate state changes between the two times don't affect the result. For example, the results aren't affected if the finding is made inactive and then active again. Possible \"state_change\" values when compare_duration is specified: * \"CHANGED\": indicates that the finding was present and matched the given filter at the start of compare_duration, but changed its state at read_time. * \"UNCHANGED\": indicates that the finding was present and matched the given filter at the start of compare_duration and did not change state at read_time. * \"ADDED\": indicates that the finding did not match the given filter or was not present at the start of compare_duration, but was present at read_time. * \"REMOVED\": indicates that the finding was present and matched the filter at the start of compare_duration, but did not match the filter at read_time. If compare_duration is not specified, then the only possible state_change is \"UNUSED\", which will be the state_change set for all findings present at read_time.", + // "format": "google-duration", + // "location": "query", + // "type": "string" + // }, + // "fieldMask": { + // "description": "A field mask to specify the Finding fields to be listed in the response. An empty field mask will list all fields.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // }, + // "filter": { + // "description": "Expression that defines the filter to apply across findings. The expression is a list of one or more restrictions combined via logical operators `AND` and `OR`. Parentheses are supported, and `OR` has higher precedence than `AND`. Restrictions have the form ` ` and may have a `-` character in front of them to indicate negation. Examples include: * name * source_properties.a_property * security_marks.marks.marka The supported operators are: * `=` for all value types. * `\u003e`, `\u003c`, `\u003e=`, `\u003c=` for integer values. * `:`, meaning substring matching, for strings. The supported value types are: * string literals in quotes. * integer literals without quotes. * boolean literals `true` and `false` without quotes. The following field and operator combinations are supported: * name: `=` * parent: `=`, `:` * resource_name: `=`, `:` * state: `=`, `:` * category: `=`, `:` * external_uri: `=`, `:` * event_time: `=`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: `event_time = \"2019-06-10T16:07:18-07:00\"` `event_time = 1560208038000` * severity: `=`, `:` * workflow_state: `=`, `:` * security_marks.marks: `=`, `:` * source_properties: `=`, `:`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` For example, `source_properties.size = 100` is a valid filter string. Use a partial match on the empty string to filter based on a property existing: `source_properties.my_property : \"\"` Use a negated partial match on the empty string to filter based on a property not existing: `-source_properties.my_property : \"\"` * resource: * resource.name: `=`, `:` * resource.parent_name: `=`, `:` * resource.parent_display_name: `=`, `:` * resource.project_name: `=`, `:` * resource.project_display_name: `=`, `:` * resource.type: `=`, `:` * resource.folders.resource_folder: `=`, `:` * resource.display_name: `=`, `:`", + // "location": "query", + // "type": "string" + // }, + // "orderBy": { + // "description": "Expression that defines what fields and order to use for sorting. The string value should follow SQL syntax: comma separated list of fields. For example: \"name,resource_properties.a_property\". The default sorting order is ascending. To specify descending order for a field, a suffix \" desc\" should be appended to the field name. For example: \"name desc,source_properties.a_property\". Redundant space characters in the syntax are insignificant. \"name desc,source_properties.a_property\" and \" name desc , source_properties.a_property \" are equivalent. The following fields are supported: name parent state category resource_name event_time source_properties security_marks.marks", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value returned by the last `ListFindingsResponse`; indicates that this is a continuation of a prior `ListFindings` call, and that the system should return the next page of data.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. Name of the source the findings belong to. Its format is \"organizations/[organization_id]/sources/[source_id], folders/[folder_id]/sources/[source_id], or projects/[project_id]/sources/[source_id]\". To list across all sources provide a source_id of `-`. For example: organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or projects/{projects_id}/sources/-", + // "location": "path", + // "pattern": "^organizations/[^/]+/sources/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "readTime": { + // "description": "Time used as a reference point when filtering findings. The filter is limited to findings existing at the supplied time and their values are those at that specific time. Absence of this field will default to the API's version of NOW.", + // "format": "google-datetime", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/{+parent}/findings", + // "response": { + // "$ref": "ListFindingsResponse" + // }, + // "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 *OrganizationsSourcesFindingsListCall) Pages(ctx context.Context, f func(*ListFindingsResponse) 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 "securitycenter.organizations.sources.findings.patch": + +type OrganizationsSourcesFindingsPatchCall struct { + s *Service + name string + finding *Finding + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Creates or updates a finding. The corresponding source must +// exist for a finding creation to succeed. +// +// - name: The relative resource name of this finding. See: +// https://cloud.google.com/apis/design/resource_names#relative_resource_name +// Example: +// "organizations/{organization_id}/sources/{source_id}/findings/{findi +// ng_id}". +func (r *OrganizationsSourcesFindingsService) Patch(name string, finding *Finding) *OrganizationsSourcesFindingsPatchCall { + c := &OrganizationsSourcesFindingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.finding = finding + return c +} + +// UpdateMask sets the optional parameter "updateMask": The FieldMask to +// use when updating the finding resource. This field should not be +// specified when creating a finding. When updating a finding, an empty +// mask is treated as updating all mutable fields and replacing +// source_properties. Individual source_properties can be added/updated +// by using "source_properties." in the field mask. +func (c *OrganizationsSourcesFindingsPatchCall) UpdateMask(updateMask string) *OrganizationsSourcesFindingsPatchCall { + 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 *OrganizationsSourcesFindingsPatchCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsPatchCall { + 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 *OrganizationsSourcesFindingsPatchCall) Context(ctx context.Context) *OrganizationsSourcesFindingsPatchCall { + 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 *OrganizationsSourcesFindingsPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsSourcesFindingsPatchCall) 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.finding) + 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 "securitycenter.organizations.sources.findings.patch" call. +// Exactly one of *Finding or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Finding.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrganizationsSourcesFindingsPatchCall) Do(opts ...googleapi.CallOption) (*Finding, 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, &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, err + } + ret := &Finding{ + 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 or updates a finding. The corresponding source must exist for a finding creation to succeed.", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings/{findingsId}", + // "httpMethod": "PATCH", + // "id": "securitycenter.organizations.sources.findings.patch", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The relative resource name of this finding. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}\"", + // "location": "path", + // "pattern": "^organizations/[^/]+/sources/[^/]+/findings/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "updateMask": { + // "description": "The FieldMask to use when updating the finding resource. This field should not be specified when creating a finding. When updating a finding, an empty mask is treated as updating all mutable fields and replacing source_properties. Individual source_properties can be added/updated by using \"source_properties.\" in the field mask.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "request": { + // "$ref": "Finding" + // }, + // "response": { + // "$ref": "Finding" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "securitycenter.organizations.sources.findings.setMute": + +type OrganizationsSourcesFindingsSetMuteCall struct { + s *Service + name string + setmuterequest *SetMuteRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// SetMute: Updates the mute state of a finding. +// +// - name: The relative resource name of the finding. See: +// https://cloud.google.com/apis/design/resource_names#relative_resource_name +// Example: +// "organizations/{organization_id}/sources/{source_id}/finding/{findin +// g_id}", +// "folders/{folder_id}/sources/{source_id}/finding/{finding_id}", +// "projects/{project_id}/sources/{source_id}/finding/{finding_id}". +func (r *OrganizationsSourcesFindingsService) SetMute(name string, setmuterequest *SetMuteRequest) *OrganizationsSourcesFindingsSetMuteCall { + c := &OrganizationsSourcesFindingsSetMuteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.setmuterequest = setmuterequest + 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 *OrganizationsSourcesFindingsSetMuteCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsSetMuteCall { + 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 *OrganizationsSourcesFindingsSetMuteCall) Context(ctx context.Context) *OrganizationsSourcesFindingsSetMuteCall { + 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 *OrganizationsSourcesFindingsSetMuteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsSourcesFindingsSetMuteCall) 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.setmuterequest) + 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}:setMute") + 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 "securitycenter.organizations.sources.findings.setMute" call. +// Exactly one of *Finding or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Finding.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrganizationsSourcesFindingsSetMuteCall) Do(opts ...googleapi.CallOption) (*Finding, 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, &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, err + } + ret := &Finding{ + 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 mute state of a finding.", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings/{findingsId}:setMute", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.sources.findings.setMute", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The relative resource name of the finding. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/sources/{source_id}/finding/{finding_id}\", \"folders/{folder_id}/sources/{source_id}/finding/{finding_id}\", \"projects/{project_id}/sources/{source_id}/finding/{finding_id}\".", + // "location": "path", + // "pattern": "^organizations/[^/]+/sources/[^/]+/findings/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}:setMute", + // "request": { + // "$ref": "SetMuteRequest" + // }, + // "response": { + // "$ref": "Finding" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "securitycenter.organizations.sources.findings.setState": + +type OrganizationsSourcesFindingsSetStateCall struct { + s *Service + name string + setfindingstaterequest *SetFindingStateRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// SetState: Updates the state of a finding. +// +// - name: The relative resource name of the finding. See: +// https://cloud.google.com/apis/design/resource_names#relative_resource_name +// Example: +// "organizations/{organization_id}/sources/{source_id}/finding/{findin +// g_id}". +func (r *OrganizationsSourcesFindingsService) SetState(name string, setfindingstaterequest *SetFindingStateRequest) *OrganizationsSourcesFindingsSetStateCall { + c := &OrganizationsSourcesFindingsSetStateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.setfindingstaterequest = setfindingstaterequest + 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 *OrganizationsSourcesFindingsSetStateCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsSetStateCall { + 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 *OrganizationsSourcesFindingsSetStateCall) Context(ctx context.Context) *OrganizationsSourcesFindingsSetStateCall { + 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 *OrganizationsSourcesFindingsSetStateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsSourcesFindingsSetStateCall) 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.setfindingstaterequest) + 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}:setState") + 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 "securitycenter.organizations.sources.findings.setState" call. +// Exactly one of *Finding or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Finding.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrganizationsSourcesFindingsSetStateCall) Do(opts ...googleapi.CallOption) (*Finding, 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, &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, err + } + ret := &Finding{ + 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 state of a finding.", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings/{findingsId}:setState", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.sources.findings.setState", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The relative resource name of the finding. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/sources/{source_id}/finding/{finding_id}\".", + // "location": "path", + // "pattern": "^organizations/[^/]+/sources/[^/]+/findings/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}:setState", + // "request": { + // "$ref": "SetFindingStateRequest" + // }, + // "response": { + // "$ref": "Finding" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "securitycenter.organizations.sources.findings.updateSecurityMarks": + +type OrganizationsSourcesFindingsUpdateSecurityMarksCall struct { + s *Service + name string + securitymarks *SecurityMarks + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// UpdateSecurityMarks: Updates security marks. +// +// - name: The relative resource name of the SecurityMarks. See: +// https://cloud.google.com/apis/design/resource_names#relative_resource_name +// Examples: +// "organizations/{organization_id}/assets/{asset_id}/securityMarks" +// "organizations/{organization_id}/sources/{source_id}/findings/{findi +// ng_id}/securityMarks". +func (r *OrganizationsSourcesFindingsService) UpdateSecurityMarks(name string, securitymarks *SecurityMarks) *OrganizationsSourcesFindingsUpdateSecurityMarksCall { + c := &OrganizationsSourcesFindingsUpdateSecurityMarksCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.securitymarks = securitymarks + return c +} + +// StartTime sets the optional parameter "startTime": The time at which +// the updated SecurityMarks take effect. If not set uses current server +// time. Updates will be applied to the SecurityMarks that are active +// immediately preceding this time. Must be earlier or equal to the +// server time. +func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) StartTime(startTime string) *OrganizationsSourcesFindingsUpdateSecurityMarksCall { + c.urlParams_.Set("startTime", startTime) + return c +} + +// UpdateMask sets the optional parameter "updateMask": The FieldMask to +// use when updating the security marks resource. The field mask must +// not contain duplicate fields. If empty or set to "marks", all marks +// will be replaced. Individual marks can be updated using "marks.". +func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) UpdateMask(updateMask string) *OrganizationsSourcesFindingsUpdateSecurityMarksCall { + 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 *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsUpdateSecurityMarksCall { + 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 *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Context(ctx context.Context) *OrganizationsSourcesFindingsUpdateSecurityMarksCall { + 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 *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) 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.securitymarks) + 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 "securitycenter.organizations.sources.findings.updateSecurityMarks" call. +// Exactly one of *SecurityMarks or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SecurityMarks.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOption) (*SecurityMarks, 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, &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, err + } + ret := &SecurityMarks{ + 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 security marks.", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings/{findingsId}/securityMarks", + // "httpMethod": "PATCH", + // "id": "securitycenter.organizations.sources.findings.updateSecurityMarks", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The relative resource name of the SecurityMarks. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Examples: \"organizations/{organization_id}/assets/{asset_id}/securityMarks\" \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks\".", + // "location": "path", + // "pattern": "^organizations/[^/]+/sources/[^/]+/findings/[^/]+/securityMarks$", + // "required": true, + // "type": "string" + // }, + // "startTime": { + // "description": "The time at which the updated SecurityMarks take effect. If not set uses current server time. Updates will be applied to the SecurityMarks that are active immediately preceding this time. Must be earlier or equal to the server time.", + // "format": "google-datetime", + // "location": "query", + // "type": "string" + // }, + // "updateMask": { + // "description": "The FieldMask to use when updating the security marks resource. The field mask must not contain duplicate fields. If empty or set to \"marks\", all marks will be replaced. Individual marks can be updated using \"marks.\".", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "request": { + // "$ref": "SecurityMarks" + // }, + // "response": { + // "$ref": "SecurityMarks" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "securitycenter.organizations.sources.findings.externalSystems.patch": + +type OrganizationsSourcesFindingsExternalSystemsPatchCall struct { + s *Service + name string + googlecloudsecuritycenterv1externalsystem *GoogleCloudSecuritycenterV1ExternalSystem + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates external system. This is for a given finding. +// +// - name: External System Name e.g. jira, demisto, etc. e.g.: +// `organizations/1234/sources/5678/findings/123456/externalSystems/jir +// a` `folders/1234/sources/5678/findings/123456/externalSystems/jira` +// `projects/1234/sources/5678/findings/123456/externalSystems/jira`. +func (r *OrganizationsSourcesFindingsExternalSystemsService) Patch(name string, googlecloudsecuritycenterv1externalsystem *GoogleCloudSecuritycenterV1ExternalSystem) *OrganizationsSourcesFindingsExternalSystemsPatchCall { + c := &OrganizationsSourcesFindingsExternalSystemsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googlecloudsecuritycenterv1externalsystem = googlecloudsecuritycenterv1externalsystem + return c +} + +// UpdateMask sets the optional parameter "updateMask": The FieldMask to +// use when updating the external system resource. If empty all mutable +// fields will be updated. +func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) UpdateMask(updateMask string) *OrganizationsSourcesFindingsExternalSystemsPatchCall { + 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 *OrganizationsSourcesFindingsExternalSystemsPatchCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsExternalSystemsPatchCall { + 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 *OrganizationsSourcesFindingsExternalSystemsPatchCall) Context(ctx context.Context) *OrganizationsSourcesFindingsExternalSystemsPatchCall { + 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 *OrganizationsSourcesFindingsExternalSystemsPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) 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.googlecloudsecuritycenterv1externalsystem) + 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 "securitycenter.organizations.sources.findings.externalSystems.patch" call. +// Exactly one of *GoogleCloudSecuritycenterV1ExternalSystem or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudSecuritycenterV1ExternalSystem.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1ExternalSystem, 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, &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, err + } + ret := &GoogleCloudSecuritycenterV1ExternalSystem{ + 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 external system. This is for a given finding.", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings/{findingsId}/externalSystems/{externalSystemsId}", + // "httpMethod": "PATCH", + // "id": "securitycenter.organizations.sources.findings.externalSystems.patch", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "External System Name e.g. jira, demisto, etc. e.g.: `organizations/1234/sources/5678/findings/123456/externalSystems/jira` `folders/1234/sources/5678/findings/123456/externalSystems/jira` `projects/1234/sources/5678/findings/123456/externalSystems/jira`", + // "location": "path", + // "pattern": "^organizations/[^/]+/sources/[^/]+/findings/[^/]+/externalSystems/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "updateMask": { + // "description": "The FieldMask to use when updating the external system resource. If empty all mutable fields will be updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "request": { + // "$ref": "GoogleCloudSecuritycenterV1ExternalSystem" + // }, + // "response": { + // "$ref": "GoogleCloudSecuritycenterV1ExternalSystem" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "securitycenter.projects.assets.group": + +type ProjectsAssetsGroupCall struct { + s *Service + parent string + groupassetsrequest *GroupAssetsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Group: Filters an organization's assets and groups them by their +// specified properties. +// +// - parent: Name of the organization to groupBy. Its format is +// "organizations/[organization_id], folders/[folder_id], or +// projects/[project_id]". +func (r *ProjectsAssetsService) Group(parent string, groupassetsrequest *GroupAssetsRequest) *ProjectsAssetsGroupCall { + c := &ProjectsAssetsGroupCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.groupassetsrequest = groupassetsrequest + 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 *ProjectsAssetsGroupCall) Fields(s ...googleapi.Field) *ProjectsAssetsGroupCall { + 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 *ProjectsAssetsGroupCall) Context(ctx context.Context) *ProjectsAssetsGroupCall { + 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 *ProjectsAssetsGroupCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsAssetsGroupCall) 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.groupassetsrequest) + 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/{+parent}/assets:group") + 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 "securitycenter.projects.assets.group" call. +// Exactly one of *GroupAssetsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GroupAssetsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsAssetsGroupCall) Do(opts ...googleapi.CallOption) (*GroupAssetsResponse, 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, &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, err + } + ret := &GroupAssetsResponse{ + 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": "Filters an organization's assets and groups them by their specified properties.", + // "flatPath": "v1/projects/{projectsId}/assets:group", + // "httpMethod": "POST", + // "id": "securitycenter.projects.assets.group", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. Name of the organization to groupBy. Its format is \"organizations/[organization_id], folders/[folder_id], or projects/[project_id]\".", + // "location": "path", + // "pattern": "^projects/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+parent}/assets:group", + // "request": { + // "$ref": "GroupAssetsRequest" + // }, + // "response": { + // "$ref": "GroupAssetsResponse" + // }, + // "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 *ProjectsAssetsGroupCall) Pages(ctx context.Context, f func(*GroupAssetsResponse) error) error { + c.ctx_ = ctx + defer func(pt string) { c.groupassetsrequest.PageToken = pt }(c.groupassetsrequest.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.groupassetsrequest.PageToken = x.NextPageToken + } +} + +// method id "securitycenter.projects.assets.list": + +type ProjectsAssetsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists an organization's assets. +// +// - parent: Name of the organization assets should belong to. Its +// format is "organizations/[organization_id], folders/[folder_id], or +// projects/[project_id]". +func (r *ProjectsAssetsService) List(parent string) *ProjectsAssetsListCall { + c := &ProjectsAssetsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// CompareDuration sets the optional parameter "compareDuration": When +// compare_duration is set, the ListAssetsResult's "state_change" +// attribute is updated to indicate whether the asset was added, +// removed, or remained present during the compare_duration period of +// time that precedes the read_time. This is the time between (read_time +// - compare_duration) and read_time. The state_change value is derived +// based on the presence of the asset at the two points in time. +// Intermediate state changes between the two times don't affect the +// result. For example, the results aren't affected if the asset is +// removed and re-created again. Possible "state_change" values when +// compare_duration is specified: * "ADDED": indicates that the asset +// was not present at the start of compare_duration, but present at +// read_time. * "REMOVED": indicates that the asset was present at the +// start of compare_duration, but not present at read_time. * "ACTIVE": +// indicates that the asset was present at both the start and the end of +// the time period defined by compare_duration and read_time. If +// compare_duration is not specified, then the only possible +// state_change is "UNUSED", which will be the state_change set for all +// assets present at read_time. +func (c *ProjectsAssetsListCall) CompareDuration(compareDuration string) *ProjectsAssetsListCall { + c.urlParams_.Set("compareDuration", compareDuration) + return c +} + +// FieldMask sets the optional parameter "fieldMask": A field mask to +// specify the ListAssetsResult fields to be listed in the response. An +// empty field mask will list all fields. +func (c *ProjectsAssetsListCall) FieldMask(fieldMask string) *ProjectsAssetsListCall { + c.urlParams_.Set("fieldMask", fieldMask) + return c +} + +// Filter sets the optional parameter "filter": Expression that defines +// the filter to apply across assets. The expression is a list of zero +// or more restrictions combined via logical operators `AND` and `OR`. +// Parentheses are supported, and `OR` has higher precedence than `AND`. +// Restrictions have the form ` ` and may have a `-` character in front +// of them to indicate negation. The fields map to those defined in the +// Asset resource. Examples include: * name * +// security_center_properties.resource_name * +// resource_properties.a_property * security_marks.marks.marka The +// supported operators are: * `=` for all value types. * `>`, `<`, `>=`, +// `<=` for integer values. * `:`, meaning substring matching, for +// strings. The supported value types are: * string literals in quotes. +// * integer literals without quotes. * boolean literals `true` and +// `false` without quotes. The following are the allowed field and +// operator combinations: * name: `=` * update_time: `=`, `>`, `<`, +// `>=`, `<=` Usage: This should be milliseconds since epoch or an +// RFC3339 string. Examples: `update_time = "2019-06-10T16:07:18-07:00" +// `update_time = 1560208038000` * create_time: `=`, `>`, `<`, `>=`, +// `<=` Usage: This should be milliseconds since epoch or an RFC3339 +// string. Examples: `create_time = "2019-06-10T16:07:18-07:00" +// `create_time = 1560208038000` * iam_policy.policy_blob: `=`, `:` * +// resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * +// security_marks.marks: `=`, `:` * +// security_center_properties.resource_name: `=`, `:` * +// security_center_properties.resource_display_name: `=`, `:` * +// security_center_properties.resource_type: `=`, `:` * +// security_center_properties.resource_parent: `=`, `:` * +// security_center_properties.resource_parent_display_name: `=`, `:` * +// security_center_properties.resource_project: `=`, `:` * +// security_center_properties.resource_project_display_name: `=`, `:` * +// security_center_properties.resource_owners: `=`, `:` For example, +// `resource_properties.size = 100` is a valid filter string. Use a +// partial match on the empty string to filter based on a property +// existing: `resource_properties.my_property : "" Use a negated +// partial match on the empty string to filter based on a property not +// existing: `-resource_properties.my_property : "" +func (c *ProjectsAssetsListCall) Filter(filter string) *ProjectsAssetsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// OrderBy sets the optional parameter "orderBy": Expression that +// defines what fields and order to use for sorting. The string value +// should follow SQL syntax: comma separated list of fields. For +// example: "name,resource_properties.a_property". The default sorting +// order is ascending. To specify descending order for a field, a suffix +// " desc" should be appended to the field name. For example: "name +// desc,resource_properties.a_property". Redundant space characters in +// the syntax are insignificant. "name +// desc,resource_properties.a_property" and " name desc , +// resource_properties.a_property " are equivalent. The following fields +// are supported: name update_time resource_properties +// security_marks.marks security_center_properties.resource_name +// security_center_properties.resource_display_name +// security_center_properties.resource_parent +// security_center_properties.resource_parent_display_name +// security_center_properties.resource_project +// security_center_properties.resource_project_display_name +// security_center_properties.resource_type +func (c *ProjectsAssetsListCall) OrderBy(orderBy string) *ProjectsAssetsListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return in a single response. Default is 10, minimum is +// 1, maximum is 1000. +func (c *ProjectsAssetsListCall) PageSize(pageSize int64) *ProjectsAssetsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last `ListAssetsResponse`; indicates that this is a +// continuation of a prior `ListAssets` call, and that the system should +// return the next page of data. +func (c *ProjectsAssetsListCall) PageToken(pageToken string) *ProjectsAssetsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReadTime sets the optional parameter "readTime": Time used as a +// reference point when filtering assets. The filter is limited to +// assets existing at the supplied time and their values are those at +// that specific time. Absence of this field will default to the API's +// version of NOW. +func (c *ProjectsAssetsListCall) ReadTime(readTime string) *ProjectsAssetsListCall { + c.urlParams_.Set("readTime", readTime) + 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 *ProjectsAssetsListCall) Fields(s ...googleapi.Field) *ProjectsAssetsListCall { + 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 *ProjectsAssetsListCall) IfNoneMatch(entityTag string) *ProjectsAssetsListCall { + 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 *ProjectsAssetsListCall) Context(ctx context.Context) *ProjectsAssetsListCall { + 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 *ProjectsAssetsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsAssetsListCall) 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}/assets") + 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 "securitycenter.projects.assets.list" call. +// Exactly one of *ListAssetsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListAssetsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAssetsResponse, 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, &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, err + } + ret := &ListAssetsResponse{ + 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 an organization's assets.", + // "flatPath": "v1/projects/{projectsId}/assets", + // "httpMethod": "GET", + // "id": "securitycenter.projects.assets.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "compareDuration": { + // "description": "When compare_duration is set, the ListAssetsResult's \"state_change\" attribute is updated to indicate whether the asset was added, removed, or remained present during the compare_duration period of time that precedes the read_time. This is the time between (read_time - compare_duration) and read_time. The state_change value is derived based on the presence of the asset at the two points in time. Intermediate state changes between the two times don't affect the result. For example, the results aren't affected if the asset is removed and re-created again. Possible \"state_change\" values when compare_duration is specified: * \"ADDED\": indicates that the asset was not present at the start of compare_duration, but present at read_time. * \"REMOVED\": indicates that the asset was present at the start of compare_duration, but not present at read_time. * \"ACTIVE\": indicates that the asset was present at both the start and the end of the time period defined by compare_duration and read_time. If compare_duration is not specified, then the only possible state_change is \"UNUSED\", which will be the state_change set for all assets present at read_time.", + // "format": "google-duration", + // "location": "query", + // "type": "string" + // }, + // "fieldMask": { + // "description": "A field mask to specify the ListAssetsResult fields to be listed in the response. An empty field mask will list all fields.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // }, + // "filter": { + // "description": "Expression that defines the filter to apply across assets. The expression is a list of zero or more restrictions combined via logical operators `AND` and `OR`. Parentheses are supported, and `OR` has higher precedence than `AND`. Restrictions have the form ` ` and may have a `-` character in front of them to indicate negation. The fields map to those defined in the Asset resource. Examples include: * name * security_center_properties.resource_name * resource_properties.a_property * security_marks.marks.marka The supported operators are: * `=` for all value types. * `\u003e`, `\u003c`, `\u003e=`, `\u003c=` for integer values. * `:`, meaning substring matching, for strings. The supported value types are: * string literals in quotes. * integer literals without quotes. * boolean literals `true` and `false` without quotes. The following are the allowed field and operator combinations: * name: `=` * update_time: `=`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: `update_time = \"2019-06-10T16:07:18-07:00\"` `update_time = 1560208038000` * create_time: `=`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: `create_time = \"2019-06-10T16:07:18-07:00\"` `create_time = 1560208038000` * iam_policy.policy_blob: `=`, `:` * resource_properties: `=`, `:`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` * security_marks.marks: `=`, `:` * security_center_properties.resource_name: `=`, `:` * security_center_properties.resource_display_name: `=`, `:` * security_center_properties.resource_type: `=`, `:` * security_center_properties.resource_parent: `=`, `:` * security_center_properties.resource_parent_display_name: `=`, `:` * security_center_properties.resource_project: `=`, `:` * security_center_properties.resource_project_display_name: `=`, `:` * security_center_properties.resource_owners: `=`, `:` For example, `resource_properties.size = 100` is a valid filter string. Use a partial match on the empty string to filter based on a property existing: `resource_properties.my_property : \"\"` Use a negated partial match on the empty string to filter based on a property not existing: `-resource_properties.my_property : \"\"`", + // "location": "query", + // "type": "string" + // }, + // "orderBy": { + // "description": "Expression that defines what fields and order to use for sorting. The string value should follow SQL syntax: comma separated list of fields. For example: \"name,resource_properties.a_property\". The default sorting order is ascending. To specify descending order for a field, a suffix \" desc\" should be appended to the field name. For example: \"name desc,resource_properties.a_property\". Redundant space characters in the syntax are insignificant. \"name desc,resource_properties.a_property\" and \" name desc , resource_properties.a_property \" are equivalent. The following fields are supported: name update_time resource_properties security_marks.marks security_center_properties.resource_name security_center_properties.resource_display_name security_center_properties.resource_parent security_center_properties.resource_parent_display_name security_center_properties.resource_project security_center_properties.resource_project_display_name security_center_properties.resource_type", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value returned by the last `ListAssetsResponse`; indicates that this is a continuation of a prior `ListAssets` call, and that the system should return the next page of data.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. Name of the organization assets should belong to. Its format is \"organizations/[organization_id], folders/[folder_id], or projects/[project_id]\".", // "location": "path", - // "pattern": "^organizations/[^/]+/sources/[^/]+/findings/[^/]+$", + // "pattern": "^projects/[^/]+$", // "required": true, // "type": "string" + // }, + // "readTime": { + // "description": "Time used as a reference point when filtering assets. The filter is limited to assets existing at the supplied time and their values are those at that specific time. Absence of this field will default to the API's version of NOW.", + // "format": "google-datetime", + // "location": "query", + // "type": "string" // } // }, - // "path": "v1/{+name}:setMute", - // "request": { - // "$ref": "SetMuteRequest" - // }, + // "path": "v1/{+parent}/assets", // "response": { - // "$ref": "Finding" + // "$ref": "ListAssetsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -15418,35 +17393,76 @@ func (c *OrganizationsSourcesFindingsSetMuteCall) Do(opts ...googleapi.CallOptio } -// method id "securitycenter.organizations.sources.findings.setState": +// 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 *ProjectsAssetsListCall) Pages(ctx context.Context, f func(*ListAssetsResponse) 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 OrganizationsSourcesFindingsSetStateCall struct { - s *Service - name string - setfindingstaterequest *SetFindingStateRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "securitycenter.projects.assets.updateSecurityMarks": + +type ProjectsAssetsUpdateSecurityMarksCall struct { + s *Service + name string + securitymarks *SecurityMarks + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// SetState: Updates the state of a finding. +// UpdateSecurityMarks: Updates security marks. // -// - name: The relative resource name of the finding. See: +// - name: The relative resource name of the SecurityMarks. See: // https://cloud.google.com/apis/design/resource_names#relative_resource_name -// Example: -// "organizations/{organization_id}/sources/{source_id}/finding/{findin -// g_id}". -func (r *OrganizationsSourcesFindingsService) SetState(name string, setfindingstaterequest *SetFindingStateRequest) *OrganizationsSourcesFindingsSetStateCall { - c := &OrganizationsSourcesFindingsSetStateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// Examples: +// "organizations/{organization_id}/assets/{asset_id}/securityMarks" +// "organizations/{organization_id}/sources/{source_id}/findings/{findi +// ng_id}/securityMarks". +func (r *ProjectsAssetsService) UpdateSecurityMarks(name string, securitymarks *SecurityMarks) *ProjectsAssetsUpdateSecurityMarksCall { + c := &ProjectsAssetsUpdateSecurityMarksCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.setfindingstaterequest = setfindingstaterequest + c.securitymarks = securitymarks + return c +} + +// StartTime sets the optional parameter "startTime": The time at which +// the updated SecurityMarks take effect. If not set uses current server +// time. Updates will be applied to the SecurityMarks that are active +// immediately preceding this time. Must be earlier or equal to the +// server time. +func (c *ProjectsAssetsUpdateSecurityMarksCall) StartTime(startTime string) *ProjectsAssetsUpdateSecurityMarksCall { + c.urlParams_.Set("startTime", startTime) + return c +} + +// UpdateMask sets the optional parameter "updateMask": The FieldMask to +// use when updating the security marks resource. The field mask must +// not contain duplicate fields. If empty or set to "marks", all marks +// will be replaced. Individual marks can be updated using "marks.". +func (c *ProjectsAssetsUpdateSecurityMarksCall) UpdateMask(updateMask string) *ProjectsAssetsUpdateSecurityMarksCall { + 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 *OrganizationsSourcesFindingsSetStateCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsSetStateCall { +func (c *ProjectsAssetsUpdateSecurityMarksCall) Fields(s ...googleapi.Field) *ProjectsAssetsUpdateSecurityMarksCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -15454,21 +17470,21 @@ func (c *OrganizationsSourcesFindingsSetStateCall) 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 *OrganizationsSourcesFindingsSetStateCall) Context(ctx context.Context) *OrganizationsSourcesFindingsSetStateCall { +func (c *ProjectsAssetsUpdateSecurityMarksCall) Context(ctx context.Context) *ProjectsAssetsUpdateSecurityMarksCall { 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 *OrganizationsSourcesFindingsSetStateCall) Header() http.Header { +func (c *ProjectsAssetsUpdateSecurityMarksCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSourcesFindingsSetStateCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsAssetsUpdateSecurityMarksCall) 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_ { @@ -15476,16 +17492,16 @@ func (c *OrganizationsSourcesFindingsSetStateCall) doRequest(alt string) (*http. } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setfindingstaterequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitymarks) 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}:setState") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+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 } @@ -15496,14 +17512,14 @@ func (c *OrganizationsSourcesFindingsSetStateCall) doRequest(alt string) (*http. return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.sources.findings.setState" call. -// Exactly one of *Finding or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Finding.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *OrganizationsSourcesFindingsSetStateCall) Do(opts ...googleapi.CallOption) (*Finding, error) { +// Do executes the "securitycenter.projects.assets.updateSecurityMarks" call. +// Exactly one of *SecurityMarks or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SecurityMarks.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsAssetsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOption) (*SecurityMarks, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15522,7 +17538,7 @@ func (c *OrganizationsSourcesFindingsSetStateCall) Do(opts ...googleapi.CallOpti if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &Finding{ + ret := &SecurityMarks{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -15534,28 +17550,40 @@ func (c *OrganizationsSourcesFindingsSetStateCall) Do(opts ...googleapi.CallOpti } return ret, nil // { - // "description": "Updates the state of a finding.", - // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings/{findingsId}:setState", - // "httpMethod": "POST", - // "id": "securitycenter.organizations.sources.findings.setState", + // "description": "Updates security marks.", + // "flatPath": "v1/projects/{projectsId}/assets/{assetsId}/securityMarks", + // "httpMethod": "PATCH", + // "id": "securitycenter.projects.assets.updateSecurityMarks", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The relative resource name of the finding. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/sources/{source_id}/finding/{finding_id}\".", + // "description": "The relative resource name of the SecurityMarks. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Examples: \"organizations/{organization_id}/assets/{asset_id}/securityMarks\" \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks\".", // "location": "path", - // "pattern": "^organizations/[^/]+/sources/[^/]+/findings/[^/]+$", + // "pattern": "^projects/[^/]+/assets/[^/]+/securityMarks$", // "required": true, // "type": "string" + // }, + // "startTime": { + // "description": "The time at which the updated SecurityMarks take effect. If not set uses current server time. Updates will be applied to the SecurityMarks that are active immediately preceding this time. Must be earlier or equal to the server time.", + // "format": "google-datetime", + // "location": "query", + // "type": "string" + // }, + // "updateMask": { + // "description": "The FieldMask to use when updating the security marks resource. The field mask must not contain duplicate fields. If empty or set to \"marks\", all marks will be replaced. Individual marks can be updated using \"marks.\".", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v1/{+name}:setState", + // "path": "v1/{+name}", // "request": { - // "$ref": "SetFindingStateRequest" + // "$ref": "SecurityMarks" // }, // "response": { - // "$ref": "Finding" + // "$ref": "SecurityMarks" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -15564,55 +17592,43 @@ func (c *OrganizationsSourcesFindingsSetStateCall) Do(opts ...googleapi.CallOpti } -// method id "securitycenter.organizations.sources.findings.updateSecurityMarks": +// method id "securitycenter.projects.bigQueryExports.create": -type OrganizationsSourcesFindingsUpdateSecurityMarksCall struct { - s *Service - name string - securitymarks *SecurityMarks - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsBigQueryExportsCreateCall struct { + s *Service + parent string + googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// UpdateSecurityMarks: Updates security marks. +// Create: Creates a big query export. // -// - name: The relative resource name of the SecurityMarks. See: -// https://cloud.google.com/apis/design/resource_names#relative_resource_name -// Examples: -// "organizations/{organization_id}/assets/{asset_id}/securityMarks" -// "organizations/{organization_id}/sources/{source_id}/findings/{findi -// ng_id}/securityMarks". -func (r *OrganizationsSourcesFindingsService) UpdateSecurityMarks(name string, securitymarks *SecurityMarks) *OrganizationsSourcesFindingsUpdateSecurityMarksCall { - c := &OrganizationsSourcesFindingsUpdateSecurityMarksCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.securitymarks = securitymarks - return c -} - -// StartTime sets the optional parameter "startTime": The time at which -// the updated SecurityMarks take effect. If not set uses current server -// time. Updates will be applied to the SecurityMarks that are active -// immediately preceding this time. Must be earlier or equal to the -// server time. -func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) StartTime(startTime string) *OrganizationsSourcesFindingsUpdateSecurityMarksCall { - c.urlParams_.Set("startTime", startTime) +// - parent: Resource name of the new big query export's parent. Its +// format is "organizations/[organization_id]", "folders/[folder_id]", +// or "projects/[project_id]". +func (r *ProjectsBigQueryExportsService) Create(parent string, googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport) *ProjectsBigQueryExportsCreateCall { + c := &ProjectsBigQueryExportsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googlecloudsecuritycenterv1bigqueryexport = googlecloudsecuritycenterv1bigqueryexport return c } -// UpdateMask sets the optional parameter "updateMask": The FieldMask to -// use when updating the security marks resource. The field mask must -// not contain duplicate fields. If empty or set to "marks", all marks -// will be replaced. Individual marks can be updated using "marks.". -func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) UpdateMask(updateMask string) *OrganizationsSourcesFindingsUpdateSecurityMarksCall { - c.urlParams_.Set("updateMask", updateMask) +// BigQueryExportId sets the optional parameter "bigQueryExportId": +// Required. Unique identifier provided by the client within the parent +// scope. It must consist of lower case letters, numbers, and hyphen, +// with the first character a letter, the last a letter or a number, and +// a 63 character maximum. +func (c *ProjectsBigQueryExportsCreateCall) BigQueryExportId(bigQueryExportId string) *ProjectsBigQueryExportsCreateCall { + c.urlParams_.Set("bigQueryExportId", bigQueryExportId) 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 *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsUpdateSecurityMarksCall { +func (c *ProjectsBigQueryExportsCreateCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -15620,21 +17636,21 @@ func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Fields(s ...google // 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 *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Context(ctx context.Context) *OrganizationsSourcesFindingsUpdateSecurityMarksCall { +func (c *ProjectsBigQueryExportsCreateCall) Context(ctx context.Context) *ProjectsBigQueryExportsCreateCall { 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 *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Header() http.Header { +func (c *ProjectsBigQueryExportsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsBigQueryExportsCreateCall) 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_ { @@ -15642,34 +17658,36 @@ func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) doRequest(alt stri } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitymarks) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1bigqueryexport) 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 := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/bigQueryExports") 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 "securitycenter.organizations.sources.findings.updateSecurityMarks" call. -// Exactly one of *SecurityMarks or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *SecurityMarks.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOption) (*SecurityMarks, error) { +// Do executes the "securitycenter.projects.bigQueryExports.create" call. +// Exactly one of *GoogleCloudSecuritycenterV1BigQueryExport or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudSecuritycenterV1BigQueryExport.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsBigQueryExportsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1BigQueryExport, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15688,7 +17706,7 @@ func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Do(opts ...googlea if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &SecurityMarks{ + ret := &GoogleCloudSecuritycenterV1BigQueryExport{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -15700,40 +17718,33 @@ func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Do(opts ...googlea } return ret, nil // { - // "description": "Updates security marks.", - // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings/{findingsId}/securityMarks", - // "httpMethod": "PATCH", - // "id": "securitycenter.organizations.sources.findings.updateSecurityMarks", + // "description": "Creates a big query export.", + // "flatPath": "v1/projects/{projectsId}/bigQueryExports", + // "httpMethod": "POST", + // "id": "securitycenter.projects.bigQueryExports.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "The relative resource name of the SecurityMarks. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Examples: \"organizations/{organization_id}/assets/{asset_id}/securityMarks\" \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks\".", - // "location": "path", - // "pattern": "^organizations/[^/]+/sources/[^/]+/findings/[^/]+/securityMarks$", - // "required": true, - // "type": "string" - // }, - // "startTime": { - // "description": "The time at which the updated SecurityMarks take effect. If not set uses current server time. Updates will be applied to the SecurityMarks that are active immediately preceding this time. Must be earlier or equal to the server time.", - // "format": "google-datetime", + // "bigQueryExportId": { + // "description": "Required. Unique identifier provided by the client within the parent scope. It must consist of lower case letters, numbers, and hyphen, with the first character a letter, the last a letter or a number, and a 63 character maximum.", // "location": "query", // "type": "string" // }, - // "updateMask": { - // "description": "The FieldMask to use when updating the security marks resource. The field mask must not contain duplicate fields. If empty or set to \"marks\", all marks will be replaced. Individual marks can be updated using \"marks.\".", - // "format": "google-fieldmask", - // "location": "query", + // "parent": { + // "description": "Required. Resource name of the new big query export's parent. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "location": "path", + // "pattern": "^projects/[^/]+$", + // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/bigQueryExports", // "request": { - // "$ref": "SecurityMarks" + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" // }, // "response": { - // "$ref": "SecurityMarks" + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -15742,42 +17753,32 @@ func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Do(opts ...googlea } -// method id "securitycenter.organizations.sources.findings.externalSystems.patch": +// method id "securitycenter.projects.bigQueryExports.delete": -type OrganizationsSourcesFindingsExternalSystemsPatchCall struct { - s *Service - name string - googlecloudsecuritycenterv1externalsystem *GoogleCloudSecuritycenterV1ExternalSystem - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsBigQueryExportsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates external system. This is for a given finding. +// Delete: Deletes an existing big query export. // -// - name: External System Name e.g. jira, demisto, etc. e.g.: -// `organizations/1234/sources/5678/findings/123456/externalSystems/jir -// a` `folders/1234/sources/5678/findings/123456/externalSystems/jira` -// `projects/1234/sources/5678/findings/123456/externalSystems/jira`. -func (r *OrganizationsSourcesFindingsExternalSystemsService) Patch(name string, googlecloudsecuritycenterv1externalsystem *GoogleCloudSecuritycenterV1ExternalSystem) *OrganizationsSourcesFindingsExternalSystemsPatchCall { - c := &OrganizationsSourcesFindingsExternalSystemsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Name of the big query export to delete. Its format is +// organizations/{organization}/bigQueryExports/{export_id}, +// folders/{folder}/bigQueryExports/{export_id}, or +// projects/{project}/bigQueryExports/{export_id}. +func (r *ProjectsBigQueryExportsService) Delete(name string) *ProjectsBigQueryExportsDeleteCall { + c := &ProjectsBigQueryExportsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.googlecloudsecuritycenterv1externalsystem = googlecloudsecuritycenterv1externalsystem - return c -} - -// UpdateMask sets the optional parameter "updateMask": The FieldMask to -// use when updating the external system resource. If empty all mutable -// fields will be updated. -func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) UpdateMask(updateMask string) *OrganizationsSourcesFindingsExternalSystemsPatchCall { - 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 *OrganizationsSourcesFindingsExternalSystemsPatchCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsExternalSystemsPatchCall { +func (c *ProjectsBigQueryExportsDeleteCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -15785,21 +17786,21 @@ func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) Fields(s ...googl // 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 *OrganizationsSourcesFindingsExternalSystemsPatchCall) Context(ctx context.Context) *OrganizationsSourcesFindingsExternalSystemsPatchCall { +func (c *ProjectsBigQueryExportsDeleteCall) Context(ctx context.Context) *ProjectsBigQueryExportsDeleteCall { 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 *OrganizationsSourcesFindingsExternalSystemsPatchCall) Header() http.Header { +func (c *ProjectsBigQueryExportsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsBigQueryExportsDeleteCall) 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_ { @@ -15807,16 +17808,11 @@ func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) doRequest(alt str } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1externalsystem) - 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) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -15827,16 +17823,14 @@ func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) doRequest(alt str return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.sources.findings.externalSystems.patch" call. -// Exactly one of *GoogleCloudSecuritycenterV1ExternalSystem or error -// will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudSecuritycenterV1ExternalSystem.ServerResponse.Header or -// (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1ExternalSystem, error) { +// Do executes the "securitycenter.projects.bigQueryExports.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 *ProjectsBigQueryExportsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15855,7 +17849,7 @@ func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) Do(opts ...google if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleCloudSecuritycenterV1ExternalSystem{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -15867,34 +17861,25 @@ func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) Do(opts ...google } return ret, nil // { - // "description": "Updates external system. This is for a given finding.", - // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings/{findingsId}/externalSystems/{externalSystemsId}", - // "httpMethod": "PATCH", - // "id": "securitycenter.organizations.sources.findings.externalSystems.patch", + // "description": "Deletes an existing big query export.", + // "flatPath": "v1/projects/{projectsId}/bigQueryExports/{bigQueryExportsId}", + // "httpMethod": "DELETE", + // "id": "securitycenter.projects.bigQueryExports.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "External System Name e.g. jira, demisto, etc. e.g.: `organizations/1234/sources/5678/findings/123456/externalSystems/jira` `folders/1234/sources/5678/findings/123456/externalSystems/jira` `projects/1234/sources/5678/findings/123456/externalSystems/jira`", + // "description": "Required. Name of the big query export to delete. Its format is organizations/{organization}/bigQueryExports/{export_id}, folders/{folder}/bigQueryExports/{export_id}, or projects/{project}/bigQueryExports/{export_id}", // "location": "path", - // "pattern": "^organizations/[^/]+/sources/[^/]+/findings/[^/]+/externalSystems/[^/]+$", + // "pattern": "^projects/[^/]+/bigQueryExports/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "The FieldMask to use when updating the external system resource. If empty all mutable fields will be updated.", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, // "path": "v1/{+name}", - // "request": { - // "$ref": "GoogleCloudSecuritycenterV1ExternalSystem" - // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1ExternalSystem" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -15903,91 +17888,100 @@ func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) Do(opts ...google } -// method id "securitycenter.projects.assets.group": +// method id "securitycenter.projects.bigQueryExports.get": -type ProjectsAssetsGroupCall struct { - s *Service - parent string - groupassetsrequest *GroupAssetsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsBigQueryExportsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Group: Filters an organization's assets and groups them by their -// specified properties. +// Get: Gets a big query export. // -// - parent: Name of the organization to groupBy. Its format is -// "organizations/[organization_id], folders/[folder_id], or -// projects/[project_id]". -func (r *ProjectsAssetsService) Group(parent string, groupassetsrequest *GroupAssetsRequest) *ProjectsAssetsGroupCall { - c := &ProjectsAssetsGroupCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.groupassetsrequest = groupassetsrequest +// - name: Name of the big query export to retrieve. Its format is +// organizations/{organization}/bigQueryExports/{export_id}, +// folders/{folder}/bigQueryExports/{export_id}, or +// projects/{project}/bigQueryExports/{export_id}. +func (r *ProjectsBigQueryExportsService) Get(name string) *ProjectsBigQueryExportsGetCall { + c := &ProjectsBigQueryExportsGetCall{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 *ProjectsAssetsGroupCall) Fields(s ...googleapi.Field) *ProjectsAssetsGroupCall { +func (c *ProjectsBigQueryExportsGetCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsGetCall { 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 *ProjectsBigQueryExportsGetCall) IfNoneMatch(entityTag string) *ProjectsBigQueryExportsGetCall { + 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 *ProjectsAssetsGroupCall) Context(ctx context.Context) *ProjectsAssetsGroupCall { +func (c *ProjectsBigQueryExportsGetCall) Context(ctx context.Context) *ProjectsBigQueryExportsGetCall { 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 *ProjectsAssetsGroupCall) Header() http.Header { +func (c *ProjectsBigQueryExportsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsAssetsGroupCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsBigQueryExportsGetCall) 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.groupassetsrequest) - 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, "v1/{+parent}/assets:group") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+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 "securitycenter.projects.assets.group" call. -// Exactly one of *GroupAssetsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *GroupAssetsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsAssetsGroupCall) Do(opts ...googleapi.CallOption) (*GroupAssetsResponse, error) { +// Do executes the "securitycenter.projects.bigQueryExports.get" call. +// Exactly one of *GoogleCloudSecuritycenterV1BigQueryExport or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudSecuritycenterV1BigQueryExport.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsBigQueryExportsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1BigQueryExport, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -16006,7 +18000,7 @@ func (c *ProjectsAssetsGroupCall) Do(opts ...googleapi.CallOption) (*GroupAssets if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GroupAssetsResponse{ + ret := &GoogleCloudSecuritycenterV1BigQueryExport{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -16018,60 +18012,36 @@ func (c *ProjectsAssetsGroupCall) Do(opts ...googleapi.CallOption) (*GroupAssets } return ret, nil // { - // "description": "Filters an organization's assets and groups them by their specified properties.", - // "flatPath": "v1/projects/{projectsId}/assets:group", - // "httpMethod": "POST", - // "id": "securitycenter.projects.assets.group", + // "description": "Gets a big query export.", + // "flatPath": "v1/projects/{projectsId}/bigQueryExports/{bigQueryExportsId}", + // "httpMethod": "GET", + // "id": "securitycenter.projects.bigQueryExports.get", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. Name of the organization to groupBy. Its format is \"organizations/[organization_id], folders/[folder_id], or projects/[project_id]\".", + // "name": { + // "description": "Required. Name of the big query export to retrieve. Its format is organizations/{organization}/bigQueryExports/{export_id}, folders/{folder}/bigQueryExports/{export_id}, or projects/{project}/bigQueryExports/{export_id}", // "location": "path", - // "pattern": "^projects/[^/]+$", + // "pattern": "^projects/[^/]+/bigQueryExports/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/assets:group", - // "request": { - // "$ref": "GroupAssetsRequest" - // }, + // "path": "v1/{+name}", // "response": { - // "$ref": "GroupAssetsResponse" + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" // }, // "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 *ProjectsAssetsGroupCall) Pages(ctx context.Context, f func(*GroupAssetsResponse) error) error { - c.ctx_ = ctx - defer func(pt string) { c.groupassetsrequest.PageToken = pt }(c.groupassetsrequest.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.groupassetsrequest.PageToken = x.NextPageToken - } + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + } -// method id "securitycenter.projects.assets.list": +// method id "securitycenter.projects.bigQueryExports.list": -type ProjectsAssetsListCall struct { +type ProjectsBigQueryExportsListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -16080,144 +18050,44 @@ type ProjectsAssetsListCall struct { header_ http.Header } -// List: Lists an organization's assets. +// List: Lists BigQuery exports. Note that when requesting BigQuery +// exports at a given level all exports under that level are also +// returned e.g. if requesting BigQuery exports under a folder, then all +// BigQuery exports immediately under the folder plus the ones created +// under the projects within the folder are returned. // -// - parent: Name of the organization assets should belong to. Its -// format is "organizations/[organization_id], folders/[folder_id], or -// projects/[project_id]". -func (r *ProjectsAssetsService) List(parent string) *ProjectsAssetsListCall { - c := &ProjectsAssetsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The parent, which owns the collection of BigQuery exports. +// Its format is "organizations/[organization_id]", +// "folders/[folder_id]", "projects/[project_id]". +func (r *ProjectsBigQueryExportsService) List(parent string) *ProjectsBigQueryExportsListCall { + c := &ProjectsBigQueryExportsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } -// CompareDuration sets the optional parameter "compareDuration": When -// compare_duration is set, the ListAssetsResult's "state_change" -// attribute is updated to indicate whether the asset was added, -// removed, or remained present during the compare_duration period of -// time that precedes the read_time. This is the time between (read_time -// - compare_duration) and read_time. The state_change value is derived -// based on the presence of the asset at the two points in time. -// Intermediate state changes between the two times don't affect the -// result. For example, the results aren't affected if the asset is -// removed and re-created again. Possible "state_change" values when -// compare_duration is specified: * "ADDED": indicates that the asset -// was not present at the start of compare_duration, but present at -// read_time. * "REMOVED": indicates that the asset was present at the -// start of compare_duration, but not present at read_time. * "ACTIVE": -// indicates that the asset was present at both the start and the end of -// the time period defined by compare_duration and read_time. If -// compare_duration is not specified, then the only possible -// state_change is "UNUSED", which will be the state_change set for all -// assets present at read_time. -func (c *ProjectsAssetsListCall) CompareDuration(compareDuration string) *ProjectsAssetsListCall { - c.urlParams_.Set("compareDuration", compareDuration) - return c -} - -// FieldMask sets the optional parameter "fieldMask": A field mask to -// specify the ListAssetsResult fields to be listed in the response. An -// empty field mask will list all fields. -func (c *ProjectsAssetsListCall) FieldMask(fieldMask string) *ProjectsAssetsListCall { - c.urlParams_.Set("fieldMask", fieldMask) - return c -} - -// Filter sets the optional parameter "filter": Expression that defines -// the filter to apply across assets. The expression is a list of zero -// or more restrictions combined via logical operators `AND` and `OR`. -// Parentheses are supported, and `OR` has higher precedence than `AND`. -// Restrictions have the form ` ` and may have a `-` character in front -// of them to indicate negation. The fields map to those defined in the -// Asset resource. Examples include: * name * -// security_center_properties.resource_name * -// resource_properties.a_property * security_marks.marks.marka The -// supported operators are: * `=` for all value types. * `>`, `<`, `>=`, -// `<=` for integer values. * `:`, meaning substring matching, for -// strings. The supported value types are: * string literals in quotes. -// * integer literals without quotes. * boolean literals `true` and -// `false` without quotes. The following are the allowed field and -// operator combinations: * name: `=` * update_time: `=`, `>`, `<`, -// `>=`, `<=` Usage: This should be milliseconds since epoch or an -// RFC3339 string. Examples: `update_time = "2019-06-10T16:07:18-07:00" -// `update_time = 1560208038000` * create_time: `=`, `>`, `<`, `>=`, -// `<=` Usage: This should be milliseconds since epoch or an RFC3339 -// string. Examples: `create_time = "2019-06-10T16:07:18-07:00" -// `create_time = 1560208038000` * iam_policy.policy_blob: `=`, `:` * -// resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * -// security_marks.marks: `=`, `:` * -// security_center_properties.resource_name: `=`, `:` * -// security_center_properties.resource_display_name: `=`, `:` * -// security_center_properties.resource_type: `=`, `:` * -// security_center_properties.resource_parent: `=`, `:` * -// security_center_properties.resource_parent_display_name: `=`, `:` * -// security_center_properties.resource_project: `=`, `:` * -// security_center_properties.resource_project_display_name: `=`, `:` * -// security_center_properties.resource_owners: `=`, `:` For example, -// `resource_properties.size = 100` is a valid filter string. Use a -// partial match on the empty string to filter based on a property -// existing: `resource_properties.my_property : "" Use a negated -// partial match on the empty string to filter based on a property not -// existing: `-resource_properties.my_property : "" -func (c *ProjectsAssetsListCall) Filter(filter string) *ProjectsAssetsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// OrderBy sets the optional parameter "orderBy": Expression that -// defines what fields and order to use for sorting. The string value -// should follow SQL syntax: comma separated list of fields. For -// example: "name,resource_properties.a_property". The default sorting -// order is ascending. To specify descending order for a field, a suffix -// " desc" should be appended to the field name. For example: "name -// desc,resource_properties.a_property". Redundant space characters in -// the syntax are insignificant. "name -// desc,resource_properties.a_property" and " name desc , -// resource_properties.a_property " are equivalent. The following fields -// are supported: name update_time resource_properties -// security_marks.marks security_center_properties.resource_name -// security_center_properties.resource_display_name -// security_center_properties.resource_parent -// security_center_properties.resource_parent_display_name -// security_center_properties.resource_project -// security_center_properties.resource_project_display_name -// security_center_properties.resource_type -func (c *ProjectsAssetsListCall) OrderBy(orderBy string) *ProjectsAssetsListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - // PageSize sets the optional parameter "pageSize": The maximum number -// of results to return in a single response. Default is 10, minimum is -// 1, maximum is 1000. -func (c *ProjectsAssetsListCall) PageSize(pageSize int64) *ProjectsAssetsListCall { +// of configs to return. The service may return fewer than this value. +// If unspecified, at most 10 configs will be returned. The maximum +// value is 1000; values above 1000 will be coerced to 1000. +func (c *ProjectsBigQueryExportsListCall) PageSize(pageSize int64) *ProjectsBigQueryExportsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } -// PageToken sets the optional parameter "pageToken": The value returned -// by the last `ListAssetsResponse`; indicates that this is a -// continuation of a prior `ListAssets` call, and that the system should -// return the next page of data. -func (c *ProjectsAssetsListCall) PageToken(pageToken string) *ProjectsAssetsListCall { +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous `ListBigQueryExports` call. Provide this to +// retrieve the subsequent page. When paginating, all other parameters +// provided to `ListBigQueryExports` must match the call that provided +// the page token. +func (c *ProjectsBigQueryExportsListCall) PageToken(pageToken string) *ProjectsBigQueryExportsListCall { c.urlParams_.Set("pageToken", pageToken) return c } -// ReadTime sets the optional parameter "readTime": Time used as a -// reference point when filtering assets. The filter is limited to -// assets existing at the supplied time and their values are those at -// that specific time. Absence of this field will default to the API's -// version of NOW. -func (c *ProjectsAssetsListCall) ReadTime(readTime string) *ProjectsAssetsListCall { - c.urlParams_.Set("readTime", readTime) - 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 *ProjectsAssetsListCall) Fields(s ...googleapi.Field) *ProjectsAssetsListCall { +func (c *ProjectsBigQueryExportsListCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -16227,7 +18097,7 @@ func (c *ProjectsAssetsListCall) Fields(s ...googleapi.Field) *ProjectsAssetsLis // 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 *ProjectsAssetsListCall) IfNoneMatch(entityTag string) *ProjectsAssetsListCall { +func (c *ProjectsBigQueryExportsListCall) IfNoneMatch(entityTag string) *ProjectsBigQueryExportsListCall { c.ifNoneMatch_ = entityTag return c } @@ -16235,21 +18105,21 @@ func (c *ProjectsAssetsListCall) IfNoneMatch(entityTag string) *ProjectsAssetsLi // 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 *ProjectsAssetsListCall) Context(ctx context.Context) *ProjectsAssetsListCall { +func (c *ProjectsBigQueryExportsListCall) Context(ctx context.Context) *ProjectsBigQueryExportsListCall { 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 *ProjectsAssetsListCall) Header() http.Header { +func (c *ProjectsBigQueryExportsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsAssetsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsBigQueryExportsListCall) 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_ { @@ -16262,7 +18132,7 @@ func (c *ProjectsAssetsListCall) 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, "v1/{+parent}/assets") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/bigQueryExports") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -16275,14 +18145,14 @@ func (c *ProjectsAssetsListCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.projects.assets.list" call. -// Exactly one of *ListAssetsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListAssetsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use +// Do executes the "securitycenter.projects.bigQueryExports.list" call. +// Exactly one of *ListBigQueryExportsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ListBigQueryExportsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAssetsResponse, error) { +func (c *ProjectsBigQueryExportsListCall) Do(opts ...googleapi.CallOption) (*ListBigQueryExportsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -16301,7 +18171,7 @@ func (c *ProjectsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAssetsRe if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &ListAssetsResponse{ + ret := &ListBigQueryExportsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -16313,64 +18183,36 @@ func (c *ProjectsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAssetsRe } return ret, nil // { - // "description": "Lists an organization's assets.", - // "flatPath": "v1/projects/{projectsId}/assets", + // "description": "Lists BigQuery exports. Note that when requesting BigQuery exports at a given level all exports under that level are also returned e.g. if requesting BigQuery exports under a folder, then all BigQuery exports immediately under the folder plus the ones created under the projects within the folder are returned.", + // "flatPath": "v1/projects/{projectsId}/bigQueryExports", // "httpMethod": "GET", - // "id": "securitycenter.projects.assets.list", + // "id": "securitycenter.projects.bigQueryExports.list", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "compareDuration": { - // "description": "When compare_duration is set, the ListAssetsResult's \"state_change\" attribute is updated to indicate whether the asset was added, removed, or remained present during the compare_duration period of time that precedes the read_time. This is the time between (read_time - compare_duration) and read_time. The state_change value is derived based on the presence of the asset at the two points in time. Intermediate state changes between the two times don't affect the result. For example, the results aren't affected if the asset is removed and re-created again. Possible \"state_change\" values when compare_duration is specified: * \"ADDED\": indicates that the asset was not present at the start of compare_duration, but present at read_time. * \"REMOVED\": indicates that the asset was present at the start of compare_duration, but not present at read_time. * \"ACTIVE\": indicates that the asset was present at both the start and the end of the time period defined by compare_duration and read_time. If compare_duration is not specified, then the only possible state_change is \"UNUSED\", which will be the state_change set for all assets present at read_time.", - // "format": "google-duration", - // "location": "query", - // "type": "string" - // }, - // "fieldMask": { - // "description": "A field mask to specify the ListAssetsResult fields to be listed in the response. An empty field mask will list all fields.", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" - // }, - // "filter": { - // "description": "Expression that defines the filter to apply across assets. The expression is a list of zero or more restrictions combined via logical operators `AND` and `OR`. Parentheses are supported, and `OR` has higher precedence than `AND`. Restrictions have the form ` ` and may have a `-` character in front of them to indicate negation. The fields map to those defined in the Asset resource. Examples include: * name * security_center_properties.resource_name * resource_properties.a_property * security_marks.marks.marka The supported operators are: * `=` for all value types. * `\u003e`, `\u003c`, `\u003e=`, `\u003c=` for integer values. * `:`, meaning substring matching, for strings. The supported value types are: * string literals in quotes. * integer literals without quotes. * boolean literals `true` and `false` without quotes. The following are the allowed field and operator combinations: * name: `=` * update_time: `=`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: `update_time = \"2019-06-10T16:07:18-07:00\"` `update_time = 1560208038000` * create_time: `=`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: `create_time = \"2019-06-10T16:07:18-07:00\"` `create_time = 1560208038000` * iam_policy.policy_blob: `=`, `:` * resource_properties: `=`, `:`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` * security_marks.marks: `=`, `:` * security_center_properties.resource_name: `=`, `:` * security_center_properties.resource_display_name: `=`, `:` * security_center_properties.resource_type: `=`, `:` * security_center_properties.resource_parent: `=`, `:` * security_center_properties.resource_parent_display_name: `=`, `:` * security_center_properties.resource_project: `=`, `:` * security_center_properties.resource_project_display_name: `=`, `:` * security_center_properties.resource_owners: `=`, `:` For example, `resource_properties.size = 100` is a valid filter string. Use a partial match on the empty string to filter based on a property existing: `resource_properties.my_property : \"\"` Use a negated partial match on the empty string to filter based on a property not existing: `-resource_properties.my_property : \"\"`", - // "location": "query", - // "type": "string" - // }, - // "orderBy": { - // "description": "Expression that defines what fields and order to use for sorting. The string value should follow SQL syntax: comma separated list of fields. For example: \"name,resource_properties.a_property\". The default sorting order is ascending. To specify descending order for a field, a suffix \" desc\" should be appended to the field name. For example: \"name desc,resource_properties.a_property\". Redundant space characters in the syntax are insignificant. \"name desc,resource_properties.a_property\" and \" name desc , resource_properties.a_property \" are equivalent. The following fields are supported: name update_time resource_properties security_marks.marks security_center_properties.resource_name security_center_properties.resource_display_name security_center_properties.resource_parent security_center_properties.resource_parent_display_name security_center_properties.resource_project security_center_properties.resource_project_display_name security_center_properties.resource_type", - // "location": "query", - // "type": "string" - // }, // "pageSize": { - // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", + // "description": "The maximum number of configs to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "The value returned by the last `ListAssetsResponse`; indicates that this is a continuation of a prior `ListAssets` call, and that the system should return the next page of data.", + // "description": "A page token, received from a previous `ListBigQueryExports` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListBigQueryExports` must match the call that provided the page token.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. Name of the organization assets should belong to. Its format is \"organizations/[organization_id], folders/[folder_id], or projects/[project_id]\".", + // "description": "Required. The parent, which owns the collection of BigQuery exports. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", \"projects/[project_id]\".", // "location": "path", // "pattern": "^projects/[^/]+$", // "required": true, // "type": "string" - // }, - // "readTime": { - // "description": "Time used as a reference point when filtering assets. The filter is limited to assets existing at the supplied time and their values are those at that specific time. Absence of this field will default to the API's version of NOW.", - // "format": "google-datetime", - // "location": "query", - // "type": "string" // } // }, - // "path": "v1/{+parent}/assets", + // "path": "v1/{+parent}/bigQueryExports", // "response": { - // "$ref": "ListAssetsResponse" + // "$ref": "ListBigQueryExportsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -16382,7 +18224,7 @@ func (c *ProjectsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAssetsRe // 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 *ProjectsAssetsListCall) Pages(ctx context.Context, f func(*ListAssetsResponse) error) error { +func (c *ProjectsBigQueryExportsListCall) Pages(ctx context.Context, f func(*ListBigQueryExportsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -16400,47 +18242,37 @@ func (c *ProjectsAssetsListCall) Pages(ctx context.Context, f func(*ListAssetsRe } } -// method id "securitycenter.projects.assets.updateSecurityMarks": +// method id "securitycenter.projects.bigQueryExports.patch": -type ProjectsAssetsUpdateSecurityMarksCall struct { - s *Service - name string - securitymarks *SecurityMarks - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsBigQueryExportsPatchCall struct { + s *Service + name string + googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// UpdateSecurityMarks: Updates security marks. +// Patch: Updates a BigQuery export. // -// - name: The relative resource name of the SecurityMarks. See: -// https://cloud.google.com/apis/design/resource_names#relative_resource_name -// Examples: -// "organizations/{organization_id}/assets/{asset_id}/securityMarks" -// "organizations/{organization_id}/sources/{source_id}/findings/{findi -// ng_id}/securityMarks". -func (r *ProjectsAssetsService) UpdateSecurityMarks(name string, securitymarks *SecurityMarks) *ProjectsAssetsUpdateSecurityMarksCall { - c := &ProjectsAssetsUpdateSecurityMarksCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The relative resource name of this export. See: +// https://cloud.google.com/apis/design/resource_names#relative_resource_name. +// Example format: +// "organizations/{organization_id}/bigQueryExports/{export_id}" +// Example format: "folders/{folder_id}/bigQueryExports/{export_id}" +// Example format: "projects/{project_id}/bigQueryExports/{export_id}" +// This field is provided in responses, and is ignored when provided +// in create requests. +func (r *ProjectsBigQueryExportsService) Patch(name string, googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport) *ProjectsBigQueryExportsPatchCall { + c := &ProjectsBigQueryExportsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.securitymarks = securitymarks - return c -} - -// StartTime sets the optional parameter "startTime": The time at which -// the updated SecurityMarks take effect. If not set uses current server -// time. Updates will be applied to the SecurityMarks that are active -// immediately preceding this time. Must be earlier or equal to the -// server time. -func (c *ProjectsAssetsUpdateSecurityMarksCall) StartTime(startTime string) *ProjectsAssetsUpdateSecurityMarksCall { - c.urlParams_.Set("startTime", startTime) + c.googlecloudsecuritycenterv1bigqueryexport = googlecloudsecuritycenterv1bigqueryexport return c } -// UpdateMask sets the optional parameter "updateMask": The FieldMask to -// use when updating the security marks resource. The field mask must -// not contain duplicate fields. If empty or set to "marks", all marks -// will be replaced. Individual marks can be updated using "marks.". -func (c *ProjectsAssetsUpdateSecurityMarksCall) UpdateMask(updateMask string) *ProjectsAssetsUpdateSecurityMarksCall { +// UpdateMask sets the optional parameter "updateMask": The list of +// fields to be updated. If empty all mutable fields will be updated. +func (c *ProjectsBigQueryExportsPatchCall) UpdateMask(updateMask string) *ProjectsBigQueryExportsPatchCall { c.urlParams_.Set("updateMask", updateMask) return c } @@ -16448,7 +18280,7 @@ func (c *ProjectsAssetsUpdateSecurityMarksCall) UpdateMask(updateMask string) *P // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsAssetsUpdateSecurityMarksCall) Fields(s ...googleapi.Field) *ProjectsAssetsUpdateSecurityMarksCall { +func (c *ProjectsBigQueryExportsPatchCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -16456,21 +18288,21 @@ func (c *ProjectsAssetsUpdateSecurityMarksCall) Fields(s ...googleapi.Field) *Pr // 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 *ProjectsAssetsUpdateSecurityMarksCall) Context(ctx context.Context) *ProjectsAssetsUpdateSecurityMarksCall { +func (c *ProjectsBigQueryExportsPatchCall) Context(ctx context.Context) *ProjectsBigQueryExportsPatchCall { 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 *ProjectsAssetsUpdateSecurityMarksCall) Header() http.Header { +func (c *ProjectsBigQueryExportsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsAssetsUpdateSecurityMarksCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsBigQueryExportsPatchCall) 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_ { @@ -16478,7 +18310,7 @@ func (c *ProjectsAssetsUpdateSecurityMarksCall) doRequest(alt string) (*http.Res } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitymarks) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1bigqueryexport) if err != nil { return nil, err } @@ -16498,14 +18330,16 @@ func (c *ProjectsAssetsUpdateSecurityMarksCall) doRequest(alt string) (*http.Res return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.projects.assets.updateSecurityMarks" call. -// Exactly one of *SecurityMarks or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *SecurityMarks.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsAssetsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOption) (*SecurityMarks, error) { +// Do executes the "securitycenter.projects.bigQueryExports.patch" call. +// Exactly one of *GoogleCloudSecuritycenterV1BigQueryExport or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudSecuritycenterV1BigQueryExport.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsBigQueryExportsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1BigQueryExport, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -16524,7 +18358,7 @@ func (c *ProjectsAssetsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &SecurityMarks{ + ret := &GoogleCloudSecuritycenterV1BigQueryExport{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -16536,29 +18370,23 @@ func (c *ProjectsAssetsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Updates security marks.", - // "flatPath": "v1/projects/{projectsId}/assets/{assetsId}/securityMarks", + // "description": "Updates a BigQuery export.", + // "flatPath": "v1/projects/{projectsId}/bigQueryExports/{bigQueryExportsId}", // "httpMethod": "PATCH", - // "id": "securitycenter.projects.assets.updateSecurityMarks", + // "id": "securitycenter.projects.bigQueryExports.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "The relative resource name of the SecurityMarks. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Examples: \"organizations/{organization_id}/assets/{asset_id}/securityMarks\" \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks\".", + // "description": "The relative resource name of this export. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name. Example format: \"organizations/{organization_id}/bigQueryExports/{export_id}\" Example format: \"folders/{folder_id}/bigQueryExports/{export_id}\" Example format: \"projects/{project_id}/bigQueryExports/{export_id}\" This field is provided in responses, and is ignored when provided in create requests.", // "location": "path", - // "pattern": "^projects/[^/]+/assets/[^/]+/securityMarks$", + // "pattern": "^projects/[^/]+/bigQueryExports/[^/]+$", // "required": true, // "type": "string" // }, - // "startTime": { - // "description": "The time at which the updated SecurityMarks take effect. If not set uses current server time. Updates will be applied to the SecurityMarks that are active immediately preceding this time. Must be earlier or equal to the server time.", - // "format": "google-datetime", - // "location": "query", - // "type": "string" - // }, // "updateMask": { - // "description": "The FieldMask to use when updating the security marks resource. The field mask must not contain duplicate fields. If empty or set to \"marks\", all marks will be replaced. Individual marks can be updated using \"marks.\".", + // "description": "The list of fields to be updated. If empty all mutable fields will be updated.", // "format": "google-fieldmask", // "location": "query", // "type": "string" @@ -16566,10 +18394,10 @@ func (c *ProjectsAssetsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOption) // }, // "path": "v1/{+name}", // "request": { - // "$ref": "SecurityMarks" + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" // }, // "response": { - // "$ref": "SecurityMarks" + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -16578,43 +18406,36 @@ func (c *ProjectsAssetsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOption) } -// method id "securitycenter.projects.bigQueryExports.create": +// method id "securitycenter.projects.findings.bulkMute": -type ProjectsBigQueryExportsCreateCall struct { - s *Service - parent string - googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsFindingsBulkMuteCall struct { + s *Service + parent string + bulkmutefindingsrequest *BulkMuteFindingsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates a big query export. +// BulkMute: Kicks off an LRO to bulk mute findings for a parent based +// on a filter. The parent can be either an organization, folder or +// project. The findings matched by the filter will be muted after the +// LRO is done. // -// - parent: Resource name of the new big query export's parent. Its +// - parent: The parent, at which bulk action needs to be applied. Its // format is "organizations/[organization_id]", "folders/[folder_id]", -// or "projects/[project_id]". -func (r *ProjectsBigQueryExportsService) Create(parent string, googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport) *ProjectsBigQueryExportsCreateCall { - c := &ProjectsBigQueryExportsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// "projects/[project_id]". +func (r *ProjectsFindingsService) BulkMute(parent string, bulkmutefindingsrequest *BulkMuteFindingsRequest) *ProjectsFindingsBulkMuteCall { + c := &ProjectsFindingsBulkMuteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.googlecloudsecuritycenterv1bigqueryexport = googlecloudsecuritycenterv1bigqueryexport - return c -} - -// BigQueryExportId sets the optional parameter "bigQueryExportId": -// Required. Unique identifier provided by the client within the parent -// scope. It must consist of lower case letters, numbers, and hyphen, -// with the first character a letter, the last a letter or a number, and -// a 63 character maximum. -func (c *ProjectsBigQueryExportsCreateCall) BigQueryExportId(bigQueryExportId string) *ProjectsBigQueryExportsCreateCall { - c.urlParams_.Set("bigQueryExportId", bigQueryExportId) + c.bulkmutefindingsrequest = bulkmutefindingsrequest 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 *ProjectsBigQueryExportsCreateCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsCreateCall { +func (c *ProjectsFindingsBulkMuteCall) Fields(s ...googleapi.Field) *ProjectsFindingsBulkMuteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -16622,21 +18443,21 @@ func (c *ProjectsBigQueryExportsCreateCall) 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 *ProjectsBigQueryExportsCreateCall) Context(ctx context.Context) *ProjectsBigQueryExportsCreateCall { +func (c *ProjectsFindingsBulkMuteCall) Context(ctx context.Context) *ProjectsFindingsBulkMuteCall { 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 *ProjectsBigQueryExportsCreateCall) Header() http.Header { +func (c *ProjectsFindingsBulkMuteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsBigQueryExportsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsFindingsBulkMuteCall) 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_ { @@ -16644,14 +18465,14 @@ func (c *ProjectsBigQueryExportsCreateCall) doRequest(alt string) (*http.Respons } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1bigqueryexport) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkmutefindingsrequest) 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/{+parent}/bigQueryExports") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findings:bulkMute") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -16664,16 +18485,14 @@ func (c *ProjectsBigQueryExportsCreateCall) doRequest(alt string) (*http.Respons return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.projects.bigQueryExports.create" call. -// Exactly one of *GoogleCloudSecuritycenterV1BigQueryExport or error -// will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudSecuritycenterV1BigQueryExport.ServerResponse.Header or -// (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *ProjectsBigQueryExportsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1BigQueryExport, error) { +// Do executes the "securitycenter.projects.findings.bulkMute" 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 *ProjectsFindingsBulkMuteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -16692,7 +18511,7 @@ func (c *ProjectsBigQueryExportsCreateCall) Do(opts ...googleapi.CallOption) (*G if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleCloudSecuritycenterV1BigQueryExport{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -16704,33 +18523,28 @@ func (c *ProjectsBigQueryExportsCreateCall) Do(opts ...googleapi.CallOption) (*G } return ret, nil // { - // "description": "Creates a big query export.", - // "flatPath": "v1/projects/{projectsId}/bigQueryExports", + // "description": "Kicks off an LRO to bulk mute findings for a parent based on a filter. The parent can be either an organization, folder or project. The findings matched by the filter will be muted after the LRO is done.", + // "flatPath": "v1/projects/{projectsId}/findings:bulkMute", // "httpMethod": "POST", - // "id": "securitycenter.projects.bigQueryExports.create", + // "id": "securitycenter.projects.findings.bulkMute", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "bigQueryExportId": { - // "description": "Required. Unique identifier provided by the client within the parent scope. It must consist of lower case letters, numbers, and hyphen, with the first character a letter, the last a letter or a number, and a 63 character maximum.", - // "location": "query", - // "type": "string" - // }, // "parent": { - // "description": "Required. Resource name of the new big query export's parent. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "description": "Required. The parent, at which bulk action needs to be applied. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", \"projects/[project_id]\".", // "location": "path", // "pattern": "^projects/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/bigQueryExports", + // "path": "v1/{+parent}/findings:bulkMute", // "request": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // "$ref": "BulkMuteFindingsRequest" // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -16739,32 +18553,43 @@ func (c *ProjectsBigQueryExportsCreateCall) Do(opts ...googleapi.CallOption) (*G } -// method id "securitycenter.projects.bigQueryExports.delete": +// method id "securitycenter.projects.muteConfigs.create": -type ProjectsBigQueryExportsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsMuteConfigsCreateCall struct { + s *Service + parent string + googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes an existing big query export. +// Create: Creates a mute config. // -// - name: Name of the big query export to delete. Its format is -// organizations/{organization}/bigQueryExports/{export_id}, -// folders/{folder}/bigQueryExports/{export_id}, or -// projects/{project}/bigQueryExports/{export_id}. -func (r *ProjectsBigQueryExportsService) Delete(name string) *ProjectsBigQueryExportsDeleteCall { - c := &ProjectsBigQueryExportsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: Resource name of the new mute configs's parent. Its format +// is "organizations/[organization_id]", "folders/[folder_id]", or +// "projects/[project_id]". +func (r *ProjectsMuteConfigsService) Create(parent string, googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig) *ProjectsMuteConfigsCreateCall { + c := &ProjectsMuteConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googlecloudsecuritycenterv1muteconfig = googlecloudsecuritycenterv1muteconfig + return c +} + +// MuteConfigId sets the optional parameter "muteConfigId": Required. +// Unique identifier provided by the client within the parent scope. It +// must consist of lower case letters, numbers, and hyphen, with the +// first character a letter, the last a letter or a number, and a 63 +// character maximum. +func (c *ProjectsMuteConfigsCreateCall) MuteConfigId(muteConfigId string) *ProjectsMuteConfigsCreateCall { + c.urlParams_.Set("muteConfigId", muteConfigId) 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 *ProjectsBigQueryExportsDeleteCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsDeleteCall { +func (c *ProjectsMuteConfigsCreateCall) Fields(s ...googleapi.Field) *ProjectsMuteConfigsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -16772,21 +18597,21 @@ func (c *ProjectsBigQueryExportsDeleteCall) 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 *ProjectsBigQueryExportsDeleteCall) Context(ctx context.Context) *ProjectsBigQueryExportsDeleteCall { +func (c *ProjectsMuteConfigsCreateCall) Context(ctx context.Context) *ProjectsMuteConfigsCreateCall { 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 *ProjectsBigQueryExportsDeleteCall) Header() http.Header { +func (c *ProjectsMuteConfigsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsBigQueryExportsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsMuteConfigsCreateCall) 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_ { @@ -16794,29 +18619,35 @@ func (c *ProjectsBigQueryExportsDeleteCall) doRequest(alt string) (*http.Respons } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1muteconfig) + 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 := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/muteConfigs") 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 "securitycenter.projects.bigQueryExports.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 *ProjectsBigQueryExportsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "securitycenter.projects.muteConfigs.create" call. +// Exactly one of *GoogleCloudSecuritycenterV1MuteConfig or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudSecuritycenterV1MuteConfig.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsMuteConfigsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -16835,7 +18666,7 @@ func (c *ProjectsBigQueryExportsDeleteCall) Do(opts ...googleapi.CallOption) (*E if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &Empty{ + ret := &GoogleCloudSecuritycenterV1MuteConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -16847,25 +18678,33 @@ func (c *ProjectsBigQueryExportsDeleteCall) Do(opts ...googleapi.CallOption) (*E } return ret, nil // { - // "description": "Deletes an existing big query export.", - // "flatPath": "v1/projects/{projectsId}/bigQueryExports/{bigQueryExportsId}", - // "httpMethod": "DELETE", - // "id": "securitycenter.projects.bigQueryExports.delete", + // "description": "Creates a mute config.", + // "flatPath": "v1/projects/{projectsId}/muteConfigs", + // "httpMethod": "POST", + // "id": "securitycenter.projects.muteConfigs.create", // "parameterOrder": [ - // "name" + // "parent" // ], - // "parameters": { - // "name": { - // "description": "Required. Name of the big query export to delete. Its format is organizations/{organization}/bigQueryExports/{export_id}, folders/{folder}/bigQueryExports/{export_id}, or projects/{project}/bigQueryExports/{export_id}", + // "parameters": { + // "muteConfigId": { + // "description": "Required. Unique identifier provided by the client within the parent scope. It must consist of lower case letters, numbers, and hyphen, with the first character a letter, the last a letter or a number, and a 63 character maximum.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. Resource name of the new mute configs's parent. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", // "location": "path", - // "pattern": "^projects/[^/]+/bigQueryExports/[^/]+$", + // "pattern": "^projects/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/muteConfigs", + // "request": { + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // }, // "response": { - // "$ref": "Empty" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -16874,25 +18713,24 @@ func (c *ProjectsBigQueryExportsDeleteCall) Do(opts ...googleapi.CallOption) (*E } -// method id "securitycenter.projects.bigQueryExports.get": +// method id "securitycenter.projects.muteConfigs.delete": -type ProjectsBigQueryExportsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsMuteConfigsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a big query export. +// Delete: Deletes an existing mute config. // -// - name: Name of the big query export to retrieve. Its format is -// organizations/{organization}/bigQueryExports/{export_id}, -// folders/{folder}/bigQueryExports/{export_id}, or -// projects/{project}/bigQueryExports/{export_id}. -func (r *ProjectsBigQueryExportsService) Get(name string) *ProjectsBigQueryExportsGetCall { - c := &ProjectsBigQueryExportsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Name of the mute config to delete. Its format is +// organizations/{organization}/muteConfigs/{config_id}, +// folders/{folder}/muteConfigs/{config_id}, or +// projects/{project}/muteConfigs/{config_id}. +func (r *ProjectsMuteConfigsService) Delete(name string) *ProjectsMuteConfigsDeleteCall { + c := &ProjectsMuteConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -16900,54 +18738,41 @@ func (r *ProjectsBigQueryExportsService) Get(name string) *ProjectsBigQueryExpor // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsBigQueryExportsGetCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsGetCall { +func (c *ProjectsMuteConfigsDeleteCall) Fields(s ...googleapi.Field) *ProjectsMuteConfigsDeleteCall { 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 *ProjectsBigQueryExportsGetCall) IfNoneMatch(entityTag string) *ProjectsBigQueryExportsGetCall { - 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 *ProjectsBigQueryExportsGetCall) Context(ctx context.Context) *ProjectsBigQueryExportsGetCall { +func (c *ProjectsMuteConfigsDeleteCall) Context(ctx context.Context) *ProjectsMuteConfigsDeleteCall { 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 *ProjectsBigQueryExportsGetCall) Header() http.Header { +func (c *ProjectsMuteConfigsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsBigQueryExportsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsMuteConfigsDeleteCall) 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) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -16958,16 +18783,14 @@ func (c *ProjectsBigQueryExportsGetCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.projects.bigQueryExports.get" call. -// Exactly one of *GoogleCloudSecuritycenterV1BigQueryExport or error -// will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudSecuritycenterV1BigQueryExport.ServerResponse.Header or -// (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *ProjectsBigQueryExportsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1BigQueryExport, error) { +// Do executes the "securitycenter.projects.muteConfigs.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 *ProjectsMuteConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -16986,7 +18809,7 @@ func (c *ProjectsBigQueryExportsGetCall) Do(opts ...googleapi.CallOption) (*Goog if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleCloudSecuritycenterV1BigQueryExport{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -16998,25 +18821,25 @@ func (c *ProjectsBigQueryExportsGetCall) Do(opts ...googleapi.CallOption) (*Goog } return ret, nil // { - // "description": "Gets a big query export.", - // "flatPath": "v1/projects/{projectsId}/bigQueryExports/{bigQueryExportsId}", - // "httpMethod": "GET", - // "id": "securitycenter.projects.bigQueryExports.get", + // "description": "Deletes an existing mute config.", + // "flatPath": "v1/projects/{projectsId}/muteConfigs/{muteConfigsId}", + // "httpMethod": "DELETE", + // "id": "securitycenter.projects.muteConfigs.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the big query export to retrieve. Its format is organizations/{organization}/bigQueryExports/{export_id}, folders/{folder}/bigQueryExports/{export_id}, or projects/{project}/bigQueryExports/{export_id}", + // "description": "Required. Name of the mute config to delete. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, or projects/{project}/muteConfigs/{config_id}", // "location": "path", - // "pattern": "^projects/[^/]+/bigQueryExports/[^/]+$", + // "pattern": "^projects/[^/]+/muteConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1/{+name}", // "response": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -17025,55 +18848,33 @@ func (c *ProjectsBigQueryExportsGetCall) Do(opts ...googleapi.CallOption) (*Goog } -// method id "securitycenter.projects.bigQueryExports.list": +// method id "securitycenter.projects.muteConfigs.get": -type ProjectsBigQueryExportsListCall struct { +type ProjectsMuteConfigsGetCall struct { s *Service - parent string + name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists BigQuery exports. Note that when requesting BigQuery -// exports at a given level all exports under that level are also -// returned e.g. if requesting BigQuery exports under a folder, then all -// BigQuery exports immediately under the folder plus the ones created -// under the projects within the folder are returned. +// Get: Gets a mute config. // -// - parent: The parent, which owns the collection of BigQuery exports. -// Its format is "organizations/[organization_id]", -// "folders/[folder_id]", "projects/[project_id]". -func (r *ProjectsBigQueryExportsService) List(parent string) *ProjectsBigQueryExportsListCall { - c := &ProjectsBigQueryExportsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of configs to return. The service may return fewer than this value. -// If unspecified, at most 10 configs will be returned. The maximum -// value is 1000; values above 1000 will be coerced to 1000. -func (c *ProjectsBigQueryExportsListCall) PageSize(pageSize int64) *ProjectsBigQueryExportsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": A page token, -// received from a previous `ListBigQueryExports` call. Provide this to -// retrieve the subsequent page. When paginating, all other parameters -// provided to `ListBigQueryExports` must match the call that provided -// the page token. -func (c *ProjectsBigQueryExportsListCall) PageToken(pageToken string) *ProjectsBigQueryExportsListCall { - c.urlParams_.Set("pageToken", pageToken) +// - name: Name of the mute config to retrieve. Its format is +// organizations/{organization}/muteConfigs/{config_id}, +// folders/{folder}/muteConfigs/{config_id}, or +// projects/{project}/muteConfigs/{config_id}. +func (r *ProjectsMuteConfigsService) Get(name string) *ProjectsMuteConfigsGetCall { + c := &ProjectsMuteConfigsGetCall{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 *ProjectsBigQueryExportsListCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsListCall { +func (c *ProjectsMuteConfigsGetCall) Fields(s ...googleapi.Field) *ProjectsMuteConfigsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -17083,7 +18884,7 @@ func (c *ProjectsBigQueryExportsListCall) Fields(s ...googleapi.Field) *Projects // 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 *ProjectsBigQueryExportsListCall) IfNoneMatch(entityTag string) *ProjectsBigQueryExportsListCall { +func (c *ProjectsMuteConfigsGetCall) IfNoneMatch(entityTag string) *ProjectsMuteConfigsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -17091,21 +18892,21 @@ func (c *ProjectsBigQueryExportsListCall) IfNoneMatch(entityTag string) *Project // 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 *ProjectsBigQueryExportsListCall) Context(ctx context.Context) *ProjectsBigQueryExportsListCall { +func (c *ProjectsMuteConfigsGetCall) Context(ctx context.Context) *ProjectsMuteConfigsGetCall { 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 *ProjectsBigQueryExportsListCall) Header() http.Header { +func (c *ProjectsMuteConfigsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsBigQueryExportsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsMuteConfigsGetCall) 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_ { @@ -17118,7 +18919,7 @@ func (c *ProjectsBigQueryExportsListCall) 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, "v1/{+parent}/bigQueryExports") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -17126,19 +18927,20 @@ func (c *ProjectsBigQueryExportsListCall) 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 "securitycenter.projects.bigQueryExports.list" call. -// Exactly one of *ListBigQueryExportsResponse or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *ListBigQueryExportsResponse.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use +// Do executes the "securitycenter.projects.muteConfigs.get" call. +// Exactly one of *GoogleCloudSecuritycenterV1MuteConfig or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudSecuritycenterV1MuteConfig.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsBigQueryExportsListCall) Do(opts ...googleapi.CallOption) (*ListBigQueryExportsResponse, error) { +func (c *ProjectsMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -17157,7 +18959,7 @@ func (c *ProjectsBigQueryExportsListCall) Do(opts ...googleapi.CallOption) (*Lis if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &ListBigQueryExportsResponse{ + ret := &GoogleCloudSecuritycenterV1MuteConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -17169,36 +18971,25 @@ func (c *ProjectsBigQueryExportsListCall) Do(opts ...googleapi.CallOption) (*Lis } return ret, nil // { - // "description": "Lists BigQuery exports. Note that when requesting BigQuery exports at a given level all exports under that level are also returned e.g. if requesting BigQuery exports under a folder, then all BigQuery exports immediately under the folder plus the ones created under the projects within the folder are returned.", - // "flatPath": "v1/projects/{projectsId}/bigQueryExports", + // "description": "Gets a mute config.", + // "flatPath": "v1/projects/{projectsId}/muteConfigs/{muteConfigsId}", // "httpMethod": "GET", - // "id": "securitycenter.projects.bigQueryExports.list", + // "id": "securitycenter.projects.muteConfigs.get", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "pageSize": { - // "description": "The maximum number of configs to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "A page token, received from a previous `ListBigQueryExports` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListBigQueryExports` must match the call that provided the page token.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The parent, which owns the collection of BigQuery exports. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", \"projects/[project_id]\".", + // "name": { + // "description": "Required. Name of the mute config to retrieve. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, or projects/{project}/muteConfigs/{config_id}", // "location": "path", - // "pattern": "^projects/[^/]+$", + // "pattern": "^projects/[^/]+/muteConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/bigQueryExports", + // "path": "v1/{+name}", // "response": { - // "$ref": "ListBigQueryExportsResponse" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -17207,125 +18998,116 @@ func (c *ProjectsBigQueryExportsListCall) 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 *ProjectsBigQueryExportsListCall) Pages(ctx context.Context, f func(*ListBigQueryExportsResponse) 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 "securitycenter.projects.bigQueryExports.patch": +// method id "securitycenter.projects.muteConfigs.list": -type ProjectsBigQueryExportsPatchCall struct { - s *Service - name string - googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsMuteConfigsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Patch: Updates a BigQuery export. +// List: Lists mute configs. // -// - name: The relative resource name of this export. See: -// https://cloud.google.com/apis/design/resource_names#relative_resource_name. -// Example format: -// "organizations/{organization_id}/bigQueryExports/{export_id}" -// Example format: "folders/{folder_id}/bigQueryExports/{export_id}" -// Example format: "projects/{project_id}/bigQueryExports/{export_id}" -// This field is provided in responses, and is ignored when provided -// in create requests. -func (r *ProjectsBigQueryExportsService) Patch(name string, googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport) *ProjectsBigQueryExportsPatchCall { - c := &ProjectsBigQueryExportsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.googlecloudsecuritycenterv1bigqueryexport = googlecloudsecuritycenterv1bigqueryexport +// - parent: The parent, which owns the collection of mute configs. Its +// format is "organizations/[organization_id]", "folders/[folder_id]", +// "projects/[project_id]". +func (r *ProjectsMuteConfigsService) List(parent string) *ProjectsMuteConfigsListCall { + c := &ProjectsMuteConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent return c } -// UpdateMask sets the optional parameter "updateMask": The list of -// fields to be updated. If empty all mutable fields will be updated. -func (c *ProjectsBigQueryExportsPatchCall) UpdateMask(updateMask string) *ProjectsBigQueryExportsPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// PageSize sets the optional parameter "pageSize": The maximum number +// of configs to return. The service may return fewer than this value. +// If unspecified, at most 10 configs will be returned. The maximum +// value is 1000; values above 1000 will be coerced to 1000. +func (c *ProjectsMuteConfigsListCall) PageSize(pageSize int64) *ProjectsMuteConfigsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous `ListMuteConfigs` call. Provide this to +// retrieve the subsequent page. When paginating, all other parameters +// provided to `ListMuteConfigs` must match the call that provided the +// page token. +func (c *ProjectsMuteConfigsListCall) PageToken(pageToken string) *ProjectsMuteConfigsListCall { + 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 *ProjectsBigQueryExportsPatchCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsPatchCall { +func (c *ProjectsMuteConfigsListCall) Fields(s ...googleapi.Field) *ProjectsMuteConfigsListCall { 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 *ProjectsMuteConfigsListCall) IfNoneMatch(entityTag string) *ProjectsMuteConfigsListCall { + 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 *ProjectsBigQueryExportsPatchCall) Context(ctx context.Context) *ProjectsBigQueryExportsPatchCall { +func (c *ProjectsMuteConfigsListCall) Context(ctx context.Context) *ProjectsMuteConfigsListCall { 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 *ProjectsBigQueryExportsPatchCall) Header() http.Header { +func (c *ProjectsMuteConfigsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsBigQueryExportsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsMuteConfigsListCall) 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.googlecloudsecuritycenterv1bigqueryexport) - 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, "v1/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/muteConfigs") 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 "securitycenter.projects.bigQueryExports.patch" call. -// Exactly one of *GoogleCloudSecuritycenterV1BigQueryExport or error -// will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudSecuritycenterV1BigQueryExport.ServerResponse.Header or -// (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *ProjectsBigQueryExportsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1BigQueryExport, error) { +// Do executes the "securitycenter.projects.muteConfigs.list" call. +// Exactly one of *ListMuteConfigsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListMuteConfigsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsMuteConfigsListCall) Do(opts ...googleapi.CallOption) (*ListMuteConfigsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -17344,7 +19126,7 @@ func (c *ProjectsBigQueryExportsPatchCall) Do(opts ...googleapi.CallOption) (*Go if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleCloudSecuritycenterV1BigQueryExport{ + ret := &ListMuteConfigsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -17356,34 +19138,36 @@ func (c *ProjectsBigQueryExportsPatchCall) Do(opts ...googleapi.CallOption) (*Go } return ret, nil // { - // "description": "Updates a BigQuery export.", - // "flatPath": "v1/projects/{projectsId}/bigQueryExports/{bigQueryExportsId}", - // "httpMethod": "PATCH", - // "id": "securitycenter.projects.bigQueryExports.patch", + // "description": "Lists mute configs.", + // "flatPath": "v1/projects/{projectsId}/muteConfigs", + // "httpMethod": "GET", + // "id": "securitycenter.projects.muteConfigs.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "The relative resource name of this export. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name. Example format: \"organizations/{organization_id}/bigQueryExports/{export_id}\" Example format: \"folders/{folder_id}/bigQueryExports/{export_id}\" Example format: \"projects/{project_id}/bigQueryExports/{export_id}\" This field is provided in responses, and is ignored when provided in create requests.", - // "location": "path", - // "pattern": "^projects/[^/]+/bigQueryExports/[^/]+$", - // "required": true, - // "type": "string" + // "pageSize": { + // "description": "The maximum number of configs to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" // }, - // "updateMask": { - // "description": "The list of fields to be updated. If empty all mutable fields will be updated.", - // "format": "google-fieldmask", + // "pageToken": { + // "description": "A page token, received from a previous `ListMuteConfigs` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListMuteConfigs` must match the call that provided the page token.", // "location": "query", // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent, which owns the collection of mute configs. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", \"projects/[project_id]\".", + // "location": "path", + // "pattern": "^projects/[^/]+$", + // "required": true, + // "type": "string" // } // }, - // "path": "v1/{+name}", - // "request": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" - // }, + // "path": "v1/{+parent}/muteConfigs", // "response": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // "$ref": "ListMuteConfigsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -17392,36 +19176,62 @@ func (c *ProjectsBigQueryExportsPatchCall) Do(opts ...googleapi.CallOption) (*Go } -// method id "securitycenter.projects.findings.bulkMute": +// 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 *ProjectsMuteConfigsListCall) Pages(ctx context.Context, f func(*ListMuteConfigsResponse) 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 ProjectsFindingsBulkMuteCall struct { - s *Service - parent string - bulkmutefindingsrequest *BulkMuteFindingsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "securitycenter.projects.muteConfigs.patch": + +type ProjectsMuteConfigsPatchCall struct { + s *Service + name string + googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// BulkMute: Kicks off an LRO to bulk mute findings for a parent based -// on a filter. The parent can be either an organization, folder or -// project. The findings matched by the filter will be muted after the -// LRO is done. +// Patch: Updates a mute config. // -// - parent: The parent, at which bulk action needs to be applied. Its -// format is "organizations/[organization_id]", "folders/[folder_id]", -// "projects/[project_id]". -func (r *ProjectsFindingsService) BulkMute(parent string, bulkmutefindingsrequest *BulkMuteFindingsRequest) *ProjectsFindingsBulkMuteCall { - c := &ProjectsFindingsBulkMuteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.bulkmutefindingsrequest = bulkmutefindingsrequest +// - name: This field will be ignored if provided on config creation. +// Format "organizations/{organization}/muteConfigs/{mute_config}" +// "folders/{folder}/muteConfigs/{mute_config}" +// "projects/{project}/muteConfigs/{mute_config}". +func (r *ProjectsMuteConfigsService) Patch(name string, googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig) *ProjectsMuteConfigsPatchCall { + c := &ProjectsMuteConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googlecloudsecuritycenterv1muteconfig = googlecloudsecuritycenterv1muteconfig + return c +} + +// UpdateMask sets the optional parameter "updateMask": The list of +// fields to be updated. If empty all mutable fields will be updated. +func (c *ProjectsMuteConfigsPatchCall) UpdateMask(updateMask string) *ProjectsMuteConfigsPatchCall { + 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 *ProjectsFindingsBulkMuteCall) Fields(s ...googleapi.Field) *ProjectsFindingsBulkMuteCall { +func (c *ProjectsMuteConfigsPatchCall) Fields(s ...googleapi.Field) *ProjectsMuteConfigsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -17429,21 +19239,21 @@ func (c *ProjectsFindingsBulkMuteCall) Fields(s ...googleapi.Field) *ProjectsFin // 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 *ProjectsFindingsBulkMuteCall) Context(ctx context.Context) *ProjectsFindingsBulkMuteCall { +func (c *ProjectsMuteConfigsPatchCall) Context(ctx context.Context) *ProjectsMuteConfigsPatchCall { 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 *ProjectsFindingsBulkMuteCall) Header() http.Header { +func (c *ProjectsMuteConfigsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsFindingsBulkMuteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsMuteConfigsPatchCall) 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_ { @@ -17451,34 +19261,35 @@ func (c *ProjectsFindingsBulkMuteCall) doRequest(alt string) (*http.Response, er } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkmutefindingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1muteconfig) 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/{+parent}/findings:bulkMute") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+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 "securitycenter.projects.findings.bulkMute" 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 *ProjectsFindingsBulkMuteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// Do executes the "securitycenter.projects.muteConfigs.patch" call. +// Exactly one of *GoogleCloudSecuritycenterV1MuteConfig or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudSecuritycenterV1MuteConfig.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -17497,7 +19308,7 @@ func (c *ProjectsFindingsBulkMuteCall) Do(opts ...googleapi.CallOption) (*Operat if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &Operation{ + ret := &GoogleCloudSecuritycenterV1MuteConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -17509,28 +19320,34 @@ func (c *ProjectsFindingsBulkMuteCall) Do(opts ...googleapi.CallOption) (*Operat } return ret, nil // { - // "description": "Kicks off an LRO to bulk mute findings for a parent based on a filter. The parent can be either an organization, folder or project. The findings matched by the filter will be muted after the LRO is done.", - // "flatPath": "v1/projects/{projectsId}/findings:bulkMute", - // "httpMethod": "POST", - // "id": "securitycenter.projects.findings.bulkMute", + // "description": "Updates a mute config.", + // "flatPath": "v1/projects/{projectsId}/muteConfigs/{muteConfigsId}", + // "httpMethod": "PATCH", + // "id": "securitycenter.projects.muteConfigs.patch", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. The parent, at which bulk action needs to be applied. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", \"projects/[project_id]\".", + // "name": { + // "description": "This field will be ignored if provided on config creation. Format \"organizations/{organization}/muteConfigs/{mute_config}\" \"folders/{folder}/muteConfigs/{mute_config}\" \"projects/{project}/muteConfigs/{mute_config}\"", // "location": "path", - // "pattern": "^projects/[^/]+$", + // "pattern": "^projects/[^/]+/muteConfigs/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "The list of fields to be updated. If empty all mutable fields will be updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v1/{+parent}/findings:bulkMute", + // "path": "v1/{+name}", // "request": { - // "$ref": "BulkMuteFindingsRequest" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "response": { - // "$ref": "Operation" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -17539,43 +19356,42 @@ func (c *ProjectsFindingsBulkMuteCall) Do(opts ...googleapi.CallOption) (*Operat } -// method id "securitycenter.projects.muteConfigs.create": +// method id "securitycenter.projects.notificationConfigs.create": -type ProjectsMuteConfigsCreateCall struct { - s *Service - parent string - googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsNotificationConfigsCreateCall struct { + s *Service + parent string + notificationconfig *NotificationConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates a mute config. +// Create: Creates a notification config. // -// - parent: Resource name of the new mute configs's parent. Its format -// is "organizations/[organization_id]", "folders/[folder_id]", or -// "projects/[project_id]". -func (r *ProjectsMuteConfigsService) Create(parent string, googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig) *ProjectsMuteConfigsCreateCall { - c := &ProjectsMuteConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: Resource name of the new notification config's parent. Its +// format is "organizations/[organization_id]", "folders/[folder_id]", +// or "projects/[project_id]". +func (r *ProjectsNotificationConfigsService) Create(parent string, notificationconfig *NotificationConfig) *ProjectsNotificationConfigsCreateCall { + c := &ProjectsNotificationConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.googlecloudsecuritycenterv1muteconfig = googlecloudsecuritycenterv1muteconfig + c.notificationconfig = notificationconfig return c } -// MuteConfigId sets the optional parameter "muteConfigId": Required. -// Unique identifier provided by the client within the parent scope. It -// must consist of lower case letters, numbers, and hyphen, with the -// first character a letter, the last a letter or a number, and a 63 -// character maximum. -func (c *ProjectsMuteConfigsCreateCall) MuteConfigId(muteConfigId string) *ProjectsMuteConfigsCreateCall { - c.urlParams_.Set("muteConfigId", muteConfigId) +// ConfigId sets the optional parameter "configId": Required. Unique +// identifier provided by the client within the parent scope. It must be +// between 1 and 128 characters, and contains alphanumeric characters, +// underscores or hyphens only. +func (c *ProjectsNotificationConfigsCreateCall) ConfigId(configId string) *ProjectsNotificationConfigsCreateCall { + c.urlParams_.Set("configId", configId) 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 *ProjectsMuteConfigsCreateCall) Fields(s ...googleapi.Field) *ProjectsMuteConfigsCreateCall { +func (c *ProjectsNotificationConfigsCreateCall) Fields(s ...googleapi.Field) *ProjectsNotificationConfigsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -17583,21 +19399,21 @@ func (c *ProjectsMuteConfigsCreateCall) Fields(s ...googleapi.Field) *ProjectsMu // 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 *ProjectsMuteConfigsCreateCall) Context(ctx context.Context) *ProjectsMuteConfigsCreateCall { +func (c *ProjectsNotificationConfigsCreateCall) Context(ctx context.Context) *ProjectsNotificationConfigsCreateCall { 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 *ProjectsMuteConfigsCreateCall) Header() http.Header { +func (c *ProjectsNotificationConfigsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsMuteConfigsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsNotificationConfigsCreateCall) 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_ { @@ -17605,14 +19421,14 @@ func (c *ProjectsMuteConfigsCreateCall) doRequest(alt string) (*http.Response, e } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1muteconfig) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationconfig) 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/{+parent}/muteConfigs") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/notificationConfigs") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -17625,15 +19441,14 @@ func (c *ProjectsMuteConfigsCreateCall) doRequest(alt string) (*http.Response, e return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.projects.muteConfigs.create" call. -// Exactly one of *GoogleCloudSecuritycenterV1MuteConfig or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleCloudSecuritycenterV1MuteConfig.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use +// Do executes the "securitycenter.projects.notificationConfigs.create" call. +// Exactly one of *NotificationConfig or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *NotificationConfig.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsMuteConfigsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { +func (c *ProjectsNotificationConfigsCreateCall) Do(opts ...googleapi.CallOption) (*NotificationConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -17652,7 +19467,7 @@ func (c *ProjectsMuteConfigsCreateCall) Do(opts ...googleapi.CallOption) (*Googl if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleCloudSecuritycenterV1MuteConfig{ + ret := &NotificationConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -17664,33 +19479,33 @@ func (c *ProjectsMuteConfigsCreateCall) Do(opts ...googleapi.CallOption) (*Googl } return ret, nil // { - // "description": "Creates a mute config.", - // "flatPath": "v1/projects/{projectsId}/muteConfigs", + // "description": "Creates a notification config.", + // "flatPath": "v1/projects/{projectsId}/notificationConfigs", // "httpMethod": "POST", - // "id": "securitycenter.projects.muteConfigs.create", + // "id": "securitycenter.projects.notificationConfigs.create", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "muteConfigId": { - // "description": "Required. Unique identifier provided by the client within the parent scope. It must consist of lower case letters, numbers, and hyphen, with the first character a letter, the last a letter or a number, and a 63 character maximum.", + // "configId": { + // "description": "Required. Unique identifier provided by the client within the parent scope. It must be between 1 and 128 characters, and contains alphanumeric characters, underscores or hyphens only.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. Resource name of the new mute configs's parent. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "description": "Required. Resource name of the new notification config's parent. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", // "location": "path", // "pattern": "^projects/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/muteConfigs", + // "path": "v1/{+parent}/notificationConfigs", // "request": { - // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // "$ref": "NotificationConfig" // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // "$ref": "NotificationConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -17699,9 +19514,9 @@ func (c *ProjectsMuteConfigsCreateCall) Do(opts ...googleapi.CallOption) (*Googl } -// method id "securitycenter.projects.muteConfigs.delete": +// method id "securitycenter.projects.notificationConfigs.delete": -type ProjectsMuteConfigsDeleteCall struct { +type ProjectsNotificationConfigsDeleteCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -17709,14 +19524,12 @@ type ProjectsMuteConfigsDeleteCall struct { header_ http.Header } -// Delete: Deletes an existing mute config. +// Delete: Deletes a notification config. // -// - name: Name of the mute config to delete. Its format is -// organizations/{organization}/muteConfigs/{config_id}, -// folders/{folder}/muteConfigs/{config_id}, or -// projects/{project}/muteConfigs/{config_id}. -func (r *ProjectsMuteConfigsService) Delete(name string) *ProjectsMuteConfigsDeleteCall { - c := &ProjectsMuteConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Name of the notification config to delete. Its format is +// "organizations/[organization_id]/notificationConfigs/[config_id]". +func (r *ProjectsNotificationConfigsService) Delete(name string) *ProjectsNotificationConfigsDeleteCall { + c := &ProjectsNotificationConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -17724,7 +19537,7 @@ func (r *ProjectsMuteConfigsService) Delete(name string) *ProjectsMuteConfigsDel // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsMuteConfigsDeleteCall) Fields(s ...googleapi.Field) *ProjectsMuteConfigsDeleteCall { +func (c *ProjectsNotificationConfigsDeleteCall) Fields(s ...googleapi.Field) *ProjectsNotificationConfigsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -17732,21 +19545,21 @@ func (c *ProjectsMuteConfigsDeleteCall) Fields(s ...googleapi.Field) *ProjectsMu // 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 *ProjectsMuteConfigsDeleteCall) Context(ctx context.Context) *ProjectsMuteConfigsDeleteCall { +func (c *ProjectsNotificationConfigsDeleteCall) Context(ctx context.Context) *ProjectsNotificationConfigsDeleteCall { 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 *ProjectsMuteConfigsDeleteCall) Header() http.Header { +func (c *ProjectsNotificationConfigsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsMuteConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsNotificationConfigsDeleteCall) 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_ { @@ -17769,14 +19582,14 @@ func (c *ProjectsMuteConfigsDeleteCall) doRequest(alt string) (*http.Response, e return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.projects.muteConfigs.delete" call. +// Do executes the "securitycenter.projects.notificationConfigs.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 *ProjectsMuteConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +func (c *ProjectsNotificationConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -17807,18 +19620,18 @@ func (c *ProjectsMuteConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty } return ret, nil // { - // "description": "Deletes an existing mute config.", - // "flatPath": "v1/projects/{projectsId}/muteConfigs/{muteConfigsId}", + // "description": "Deletes a notification config.", + // "flatPath": "v1/projects/{projectsId}/notificationConfigs/{notificationConfigsId}", // "httpMethod": "DELETE", - // "id": "securitycenter.projects.muteConfigs.delete", + // "id": "securitycenter.projects.notificationConfigs.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the mute config to delete. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, or projects/{project}/muteConfigs/{config_id}", + // "description": "Required. Name of the notification config to delete. Its format is \"organizations/[organization_id]/notificationConfigs/[config_id]\".", // "location": "path", - // "pattern": "^projects/[^/]+/muteConfigs/[^/]+$", + // "pattern": "^projects/[^/]+/notificationConfigs/[^/]+$", // "required": true, // "type": "string" // } @@ -17834,9 +19647,9 @@ func (c *ProjectsMuteConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty } -// method id "securitycenter.projects.muteConfigs.get": +// method id "securitycenter.projects.notificationConfigs.get": -type ProjectsMuteConfigsGetCall struct { +type ProjectsNotificationConfigsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -17845,14 +19658,12 @@ type ProjectsMuteConfigsGetCall struct { header_ http.Header } -// Get: Gets a mute config. +// Get: Gets a notification config. // -// - name: Name of the mute config to retrieve. Its format is -// organizations/{organization}/muteConfigs/{config_id}, -// folders/{folder}/muteConfigs/{config_id}, or -// projects/{project}/muteConfigs/{config_id}. -func (r *ProjectsMuteConfigsService) Get(name string) *ProjectsMuteConfigsGetCall { - c := &ProjectsMuteConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Name of the notification config to get. Its format is +// "organizations/[organization_id]/notificationConfigs/[config_id]". +func (r *ProjectsNotificationConfigsService) Get(name string) *ProjectsNotificationConfigsGetCall { + c := &ProjectsNotificationConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -17860,7 +19671,7 @@ func (r *ProjectsMuteConfigsService) Get(name string) *ProjectsMuteConfigsGetCal // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsMuteConfigsGetCall) Fields(s ...googleapi.Field) *ProjectsMuteConfigsGetCall { +func (c *ProjectsNotificationConfigsGetCall) Fields(s ...googleapi.Field) *ProjectsNotificationConfigsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -17870,7 +19681,7 @@ func (c *ProjectsMuteConfigsGetCall) Fields(s ...googleapi.Field) *ProjectsMuteC // 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 *ProjectsMuteConfigsGetCall) IfNoneMatch(entityTag string) *ProjectsMuteConfigsGetCall { +func (c *ProjectsNotificationConfigsGetCall) IfNoneMatch(entityTag string) *ProjectsNotificationConfigsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -17878,21 +19689,21 @@ func (c *ProjectsMuteConfigsGetCall) IfNoneMatch(entityTag string) *ProjectsMute // 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 *ProjectsMuteConfigsGetCall) Context(ctx context.Context) *ProjectsMuteConfigsGetCall { +func (c *ProjectsNotificationConfigsGetCall) Context(ctx context.Context) *ProjectsNotificationConfigsGetCall { 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 *ProjectsMuteConfigsGetCall) Header() http.Header { +func (c *ProjectsNotificationConfigsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsMuteConfigsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsNotificationConfigsGetCall) 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_ { @@ -17918,15 +19729,14 @@ func (c *ProjectsMuteConfigsGetCall) doRequest(alt string) (*http.Response, erro return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.projects.muteConfigs.get" call. -// Exactly one of *GoogleCloudSecuritycenterV1MuteConfig or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleCloudSecuritycenterV1MuteConfig.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use +// Do executes the "securitycenter.projects.notificationConfigs.get" call. +// Exactly one of *NotificationConfig or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *NotificationConfig.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { +func (c *ProjectsNotificationConfigsGetCall) Do(opts ...googleapi.CallOption) (*NotificationConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -17945,7 +19755,7 @@ func (c *ProjectsMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCl if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleCloudSecuritycenterV1MuteConfig{ + ret := &NotificationConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -17957,25 +19767,25 @@ func (c *ProjectsMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCl } return ret, nil // { - // "description": "Gets a mute config.", - // "flatPath": "v1/projects/{projectsId}/muteConfigs/{muteConfigsId}", + // "description": "Gets a notification config.", + // "flatPath": "v1/projects/{projectsId}/notificationConfigs/{notificationConfigsId}", // "httpMethod": "GET", - // "id": "securitycenter.projects.muteConfigs.get", + // "id": "securitycenter.projects.notificationConfigs.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the mute config to retrieve. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, or projects/{project}/muteConfigs/{config_id}", + // "description": "Required. Name of the notification config to get. Its format is \"organizations/[organization_id]/notificationConfigs/[config_id]\".", // "location": "path", - // "pattern": "^projects/[^/]+/muteConfigs/[^/]+$", + // "pattern": "^projects/[^/]+/notificationConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1/{+name}", // "response": { - // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // "$ref": "NotificationConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -17984,9 +19794,9 @@ func (c *ProjectsMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCl } -// method id "securitycenter.projects.muteConfigs.list": +// method id "securitycenter.projects.notificationConfigs.list": -type ProjectsMuteConfigsListCall struct { +type ProjectsNotificationConfigsListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -17995,32 +19805,30 @@ type ProjectsMuteConfigsListCall struct { header_ http.Header } -// List: Lists mute configs. +// List: Lists notification configs. // -// - parent: The parent, which owns the collection of mute configs. Its +// - parent: Name of the organization to list notification configs. Its // format is "organizations/[organization_id]", "folders/[folder_id]", -// "projects/[project_id]". -func (r *ProjectsMuteConfigsService) List(parent string) *ProjectsMuteConfigsListCall { - c := &ProjectsMuteConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// or "projects/[project_id]". +func (r *ProjectsNotificationConfigsService) List(parent string) *ProjectsNotificationConfigsListCall { + c := &ProjectsNotificationConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } // PageSize sets the optional parameter "pageSize": The maximum number -// of configs to return. The service may return fewer than this value. -// If unspecified, at most 10 configs will be returned. The maximum -// value is 1000; values above 1000 will be coerced to 1000. -func (c *ProjectsMuteConfigsListCall) PageSize(pageSize int64) *ProjectsMuteConfigsListCall { +// of results to return in a single response. Default is 10, minimum is +// 1, maximum is 1000. +func (c *ProjectsNotificationConfigsListCall) PageSize(pageSize int64) *ProjectsNotificationConfigsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } -// PageToken sets the optional parameter "pageToken": A page token, -// received from a previous `ListMuteConfigs` call. Provide this to -// retrieve the subsequent page. When paginating, all other parameters -// provided to `ListMuteConfigs` must match the call that provided the -// page token. -func (c *ProjectsMuteConfigsListCall) PageToken(pageToken string) *ProjectsMuteConfigsListCall { +// PageToken sets the optional parameter "pageToken": The value returned +// by the last `ListNotificationConfigsResponse`; indicates that this is +// a continuation of a prior `ListNotificationConfigs` call, and that +// the system should return the next page of data. +func (c *ProjectsNotificationConfigsListCall) PageToken(pageToken string) *ProjectsNotificationConfigsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -18028,7 +19836,7 @@ func (c *ProjectsMuteConfigsListCall) PageToken(pageToken string) *ProjectsMuteC // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsMuteConfigsListCall) Fields(s ...googleapi.Field) *ProjectsMuteConfigsListCall { +func (c *ProjectsNotificationConfigsListCall) Fields(s ...googleapi.Field) *ProjectsNotificationConfigsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -18038,7 +19846,7 @@ func (c *ProjectsMuteConfigsListCall) Fields(s ...googleapi.Field) *ProjectsMute // 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 *ProjectsMuteConfigsListCall) IfNoneMatch(entityTag string) *ProjectsMuteConfigsListCall { +func (c *ProjectsNotificationConfigsListCall) IfNoneMatch(entityTag string) *ProjectsNotificationConfigsListCall { c.ifNoneMatch_ = entityTag return c } @@ -18046,21 +19854,21 @@ func (c *ProjectsMuteConfigsListCall) IfNoneMatch(entityTag string) *ProjectsMut // 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 *ProjectsMuteConfigsListCall) Context(ctx context.Context) *ProjectsMuteConfigsListCall { +func (c *ProjectsNotificationConfigsListCall) Context(ctx context.Context) *ProjectsNotificationConfigsListCall { 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 *ProjectsMuteConfigsListCall) Header() http.Header { +func (c *ProjectsNotificationConfigsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsMuteConfigsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsNotificationConfigsListCall) 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_ { @@ -18073,7 +19881,7 @@ func (c *ProjectsMuteConfigsListCall) 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, "v1/{+parent}/muteConfigs") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/notificationConfigs") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -18086,14 +19894,14 @@ func (c *ProjectsMuteConfigsListCall) doRequest(alt string) (*http.Response, err return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.projects.muteConfigs.list" call. -// Exactly one of *ListMuteConfigsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListMuteConfigsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was +// Do executes the "securitycenter.projects.notificationConfigs.list" call. +// Exactly one of *ListNotificationConfigsResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ListNotificationConfigsResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsMuteConfigsListCall) Do(opts ...googleapi.CallOption) (*ListMuteConfigsResponse, error) { +func (c *ProjectsNotificationConfigsListCall) Do(opts ...googleapi.CallOption) (*ListNotificationConfigsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18112,7 +19920,7 @@ func (c *ProjectsMuteConfigsListCall) Do(opts ...googleapi.CallOption) (*ListMut if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &ListMuteConfigsResponse{ + ret := &ListNotificationConfigsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -18124,36 +19932,36 @@ func (c *ProjectsMuteConfigsListCall) Do(opts ...googleapi.CallOption) (*ListMut } return ret, nil // { - // "description": "Lists mute configs.", - // "flatPath": "v1/projects/{projectsId}/muteConfigs", + // "description": "Lists notification configs.", + // "flatPath": "v1/projects/{projectsId}/notificationConfigs", // "httpMethod": "GET", - // "id": "securitycenter.projects.muteConfigs.list", + // "id": "securitycenter.projects.notificationConfigs.list", // "parameterOrder": [ // "parent" // ], // "parameters": { // "pageSize": { - // "description": "The maximum number of configs to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "A page token, received from a previous `ListMuteConfigs` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListMuteConfigs` must match the call that provided the page token.", + // "description": "The value returned by the last `ListNotificationConfigsResponse`; indicates that this is a continuation of a prior `ListNotificationConfigs` call, and that the system should return the next page of data.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. The parent, which owns the collection of mute configs. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", \"projects/[project_id]\".", + // "description": "Required. Name of the organization to list notification configs. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", // "location": "path", // "pattern": "^projects/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/muteConfigs", + // "path": "v1/{+parent}/notificationConfigs", // "response": { - // "$ref": "ListMuteConfigsResponse" + // "$ref": "ListNotificationConfigsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -18165,7 +19973,7 @@ func (c *ProjectsMuteConfigsListCall) Do(opts ...googleapi.CallOption) (*ListMut // 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 *ProjectsMuteConfigsListCall) Pages(ctx context.Context, f func(*ListMuteConfigsResponse) error) error { +func (c *ProjectsNotificationConfigsListCall) Pages(ctx context.Context, f func(*ListNotificationConfigsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -18183,33 +19991,36 @@ func (c *ProjectsMuteConfigsListCall) Pages(ctx context.Context, f func(*ListMut } } -// method id "securitycenter.projects.muteConfigs.patch": +// method id "securitycenter.projects.notificationConfigs.patch": -type ProjectsMuteConfigsPatchCall struct { - s *Service - name string - googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsNotificationConfigsPatchCall struct { + s *Service + name string + notificationconfig *NotificationConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates a mute config. +// Patch: Updates a notification config. The following update fields +// are allowed: description, pubsub_topic, streaming_config.filter // -// - name: This field will be ignored if provided on config creation. -// Format "organizations/{organization}/muteConfigs/{mute_config}" -// "folders/{folder}/muteConfigs/{mute_config}" -// "projects/{project}/muteConfigs/{mute_config}". -func (r *ProjectsMuteConfigsService) Patch(name string, googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig) *ProjectsMuteConfigsPatchCall { - c := &ProjectsMuteConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The relative resource name of this notification config. See: +// https://cloud.google.com/apis/design/resource_names#relative_resource_name +// Example: +// "organizations/{organization_id}/notificationConfigs/notify_public_b +// ucket". +func (r *ProjectsNotificationConfigsService) Patch(name string, notificationconfig *NotificationConfig) *ProjectsNotificationConfigsPatchCall { + c := &ProjectsNotificationConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.googlecloudsecuritycenterv1muteconfig = googlecloudsecuritycenterv1muteconfig + c.notificationconfig = notificationconfig return c } -// UpdateMask sets the optional parameter "updateMask": The list of -// fields to be updated. If empty all mutable fields will be updated. -func (c *ProjectsMuteConfigsPatchCall) UpdateMask(updateMask string) *ProjectsMuteConfigsPatchCall { +// UpdateMask sets the optional parameter "updateMask": The FieldMask to +// use when updating the notification config. If empty all mutable +// fields will be updated. +func (c *ProjectsNotificationConfigsPatchCall) UpdateMask(updateMask string) *ProjectsNotificationConfigsPatchCall { c.urlParams_.Set("updateMask", updateMask) return c } @@ -18217,7 +20028,7 @@ func (c *ProjectsMuteConfigsPatchCall) UpdateMask(updateMask string) *ProjectsMu // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsMuteConfigsPatchCall) Fields(s ...googleapi.Field) *ProjectsMuteConfigsPatchCall { +func (c *ProjectsNotificationConfigsPatchCall) Fields(s ...googleapi.Field) *ProjectsNotificationConfigsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -18225,21 +20036,21 @@ func (c *ProjectsMuteConfigsPatchCall) Fields(s ...googleapi.Field) *ProjectsMut // 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 *ProjectsMuteConfigsPatchCall) Context(ctx context.Context) *ProjectsMuteConfigsPatchCall { +func (c *ProjectsNotificationConfigsPatchCall) Context(ctx context.Context) *ProjectsNotificationConfigsPatchCall { 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 *ProjectsMuteConfigsPatchCall) Header() http.Header { +func (c *ProjectsNotificationConfigsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsMuteConfigsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsNotificationConfigsPatchCall) 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_ { @@ -18247,7 +20058,7 @@ func (c *ProjectsMuteConfigsPatchCall) doRequest(alt string) (*http.Response, er } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1muteconfig) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationconfig) if err != nil { return nil, err } @@ -18267,15 +20078,14 @@ func (c *ProjectsMuteConfigsPatchCall) doRequest(alt string) (*http.Response, er return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.projects.muteConfigs.patch" call. -// Exactly one of *GoogleCloudSecuritycenterV1MuteConfig or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleCloudSecuritycenterV1MuteConfig.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use +// Do executes the "securitycenter.projects.notificationConfigs.patch" call. +// Exactly one of *NotificationConfig or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *NotificationConfig.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { +func (c *ProjectsNotificationConfigsPatchCall) Do(opts ...googleapi.CallOption) (*NotificationConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18294,7 +20104,7 @@ func (c *ProjectsMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*Google if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleCloudSecuritycenterV1MuteConfig{ + ret := &NotificationConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -18306,23 +20116,23 @@ func (c *ProjectsMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*Google } return ret, nil // { - // "description": "Updates a mute config.", - // "flatPath": "v1/projects/{projectsId}/muteConfigs/{muteConfigsId}", + // "description": " Updates a notification config. The following update fields are allowed: description, pubsub_topic, streaming_config.filter", + // "flatPath": "v1/projects/{projectsId}/notificationConfigs/{notificationConfigsId}", // "httpMethod": "PATCH", - // "id": "securitycenter.projects.muteConfigs.patch", + // "id": "securitycenter.projects.notificationConfigs.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "This field will be ignored if provided on config creation. Format \"organizations/{organization}/muteConfigs/{mute_config}\" \"folders/{folder}/muteConfigs/{mute_config}\" \"projects/{project}/muteConfigs/{mute_config}\"", + // "description": "The relative resource name of this notification config. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/notificationConfigs/notify_public_bucket\".", // "location": "path", - // "pattern": "^projects/[^/]+/muteConfigs/[^/]+$", + // "pattern": "^projects/[^/]+/notificationConfigs/[^/]+$", // "required": true, // "type": "string" // }, // "updateMask": { - // "description": "The list of fields to be updated. If empty all mutable fields will be updated.", + // "description": "The FieldMask to use when updating the notification config. If empty all mutable fields will be updated.", // "format": "google-fieldmask", // "location": "query", // "type": "string" @@ -18330,10 +20140,10 @@ func (c *ProjectsMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*Google // }, // "path": "v1/{+name}", // "request": { - // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // "$ref": "NotificationConfig" // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // "$ref": "NotificationConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" diff --git a/securitycenter/v1beta1/securitycenter-api.json b/securitycenter/v1beta1/securitycenter-api.json index 5c5f0c72a27..1aba10dc6af 100644 --- a/securitycenter/v1beta1/securitycenter-api.json +++ b/securitycenter/v1beta1/securitycenter-api.json @@ -896,7 +896,7 @@ } } }, - "revision": "20220921", + "revision": "20221014", "rootUrl": "https://securitycenter.googleapis.com/", "schemas": { "Access": { @@ -942,7 +942,7 @@ "description": "What kind of user agent is associated, e.g. operating system shells, embedded or stand-alone applications, etc.", "type": "string" }, - "username": { + "userName": { "description": "A string representing a username. This is likely not an IAM principal. For instance, this may be the system user name if the finding is VM-related, or this may be some type of application login user name, depending on the type of finding.", "type": "string" } @@ -1048,6 +1048,21 @@ }, "type": "object" }, + "AssociatedFinding": { + "description": "A finding that is associated with this node in the exposure path.", + "id": "AssociatedFinding", + "properties": { + "canonicalFindingName": { + "description": "Canonical name of the associated findings. Example: organizations/123/sources/456/findings/789", + "type": "string" + }, + "findingCategory": { + "description": "The additional taxonomy group within findings from a given source.", + "type": "string" + } + }, + "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", @@ -1450,6 +1465,21 @@ }, "type": "object" }, + "Edge": { + "description": "Represents a connection between a source node and a destination node in this exposure path.", + "id": "Edge", + "properties": { + "destination": { + "description": "This is the resource name of the destination node.", + "type": "string" + }, + "source": { + "description": "This is the resource name of the source node.", + "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", @@ -1918,13 +1948,76 @@ "GoogleCloudSecuritycenterV1ExposedResource": { "description": "A resource that is exposed as a result of a finding.", "id": "GoogleCloudSecuritycenterV1ExposedResource", - "properties": {}, + "properties": { + "displayName": { + "description": "Human readable name of the resource that is exposed.", + "type": "string" + }, + "methods": { + "description": "The ways in which this resource is exposed. Examples: Read, Write", + "items": { + "type": "string" + }, + "type": "array" + }, + "name": { + "description": "Exposed Resource Name e.g.: `organizations/123/attackExposureResults/456/exposedResources/789`", + "type": "string" + }, + "resource": { + "description": "The name of the resource that is exposed. See: https://cloud.google.com/apis/design/resource_names#full_resource_name", + "type": "string" + }, + "resourceType": { + "description": "The resource type of the exposed resource. See: https://cloud.google.com/asset-inventory/docs/supported-asset-types", + "type": "string" + }, + "resourceValue": { + "description": "How valuable this resource is.", + "enum": [ + "RESOURCE_VALUE_UNSPECIFIED", + "RESOURCE_VALUE_LOW", + "RESOURCE_VALUE_MEDIUM", + "RESOURCE_VALUE_HIGH" + ], + "enumDescriptions": [ + "The resource value isn't specified.", + "This is a low value resource.", + "This is a medium value resource.", + "This is a high value resource." + ], + "type": "string" + } + }, "type": "object" }, "GoogleCloudSecuritycenterV1ExposurePath": { "description": "A path that an attacker could take to reach an exposed resource.", "id": "GoogleCloudSecuritycenterV1ExposurePath", - "properties": {}, + "properties": { + "edges": { + "description": "A list of the edges between nodes in this exposure path.", + "items": { + "$ref": "Edge" + }, + "type": "array" + }, + "exposedResource": { + "$ref": "GoogleCloudSecuritycenterV1ExposedResource", + "description": "The leaf node of this exposure path." + }, + "name": { + "description": "Exposure Path Name e.g.: `organizations/123/attackExposureResults/456/exposurePaths/789`", + "type": "string" + }, + "pathNodes": { + "description": "A list of nodes that exist in this exposure path.", + "items": { + "$ref": "PathNode" + }, + "type": "array" + } + }, "type": "object" }, "GoogleCloudSecuritycenterV1ExternalSystem": { @@ -3167,6 +3260,32 @@ }, "type": "object" }, + "PathNode": { + "description": "Represents one point that an attacker passes through in this exposure path.", + "id": "PathNode", + "properties": { + "associatedFindings": { + "description": "The findings associated with this node in the exposure path.", + "items": { + "$ref": "AssociatedFinding" + }, + "type": "array" + }, + "displayName": { + "description": "Human readable name of this resource.", + "type": "string" + }, + "resource": { + "description": "The name of the resource at this point in the exposure path. The format of the name is: https://cloud.google.com/apis/design/resource_names#full_resource_name", + "type": "string" + }, + "resourceType": { + "description": "The resource type of this resource. See: https://cloud.google.com/asset-inventory/docs/supported-asset-types", + "type": "string" + } + }, + "type": "object" + }, "Pod": { "description": "Kubernetes Pod.", "id": "Pod", diff --git a/securitycenter/v1beta1/securitycenter-gen.go b/securitycenter/v1beta1/securitycenter-gen.go index f176aa6a60e..90e2694eaa5 100644 --- a/securitycenter/v1beta1/securitycenter-gen.go +++ b/securitycenter/v1beta1/securitycenter-gen.go @@ -250,11 +250,11 @@ type Access struct { // operating system shells, embedded or stand-alone applications, etc. UserAgentFamily string `json:"userAgentFamily,omitempty"` - // Username: A string representing a username. This is likely not an IAM + // UserName: A string representing a username. This is likely not an IAM // principal. For instance, this may be the system user name if the // finding is VM-related, or this may be some type of application login // user name, depending on the type of finding. - Username string `json:"username,omitempty"` + UserName string `json:"userName,omitempty"` // ForceSendFields is a list of field names (e.g. "CallerIp") to // unconditionally include in API requests. By default, fields with @@ -429,6 +429,42 @@ func (s *AssetDiscoveryConfig) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// AssociatedFinding: A finding that is associated with this node in the +// exposure path. +type AssociatedFinding struct { + // CanonicalFindingName: Canonical name of the associated findings. + // Example: organizations/123/sources/456/findings/789 + CanonicalFindingName string `json:"canonicalFindingName,omitempty"` + + // FindingCategory: The additional taxonomy group within findings from a + // given source. + FindingCategory string `json:"findingCategory,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "CanonicalFindingName") 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. "CanonicalFindingName") 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 *AssociatedFinding) MarshalJSON() ([]byte, error) { + type NoMethod AssociatedFinding + raw := NoMethod(*s) + 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 @@ -1089,6 +1125,38 @@ func (s *Detection) UnmarshalJSON(data []byte) error { return nil } +// Edge: Represents a connection between a source node and a destination +// node in this exposure path. +type Edge struct { + // Destination: This is the resource name of the destination node. + Destination string `json:"destination,omitempty"` + + // Source: This is the resource name of the source node. + Source string `json:"source,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Destination") 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. "Destination") 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 *Edge) MarshalJSON() ([]byte, error) { + type NoMethod Edge + 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 @@ -1831,11 +1899,94 @@ type GoogleCloudSecuritycenterV1BulkMuteFindingsResponse struct { // GoogleCloudSecuritycenterV1ExposedResource: A resource that is // exposed as a result of a finding. type GoogleCloudSecuritycenterV1ExposedResource struct { + // DisplayName: Human readable name of the resource that is exposed. + DisplayName string `json:"displayName,omitempty"` + + // Methods: The ways in which this resource is exposed. Examples: Read, + // Write + Methods []string `json:"methods,omitempty"` + + // Name: Exposed Resource Name e.g.: + // `organizations/123/attackExposureResults/456/exposedResources/789` + Name string `json:"name,omitempty"` + + // Resource: The name of the resource that is exposed. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + Resource string `json:"resource,omitempty"` + + // ResourceType: The resource type of the exposed resource. See: + // https://cloud.google.com/asset-inventory/docs/supported-asset-types + ResourceType string `json:"resourceType,omitempty"` + + // ResourceValue: How valuable this resource is. + // + // Possible values: + // "RESOURCE_VALUE_UNSPECIFIED" - The resource value isn't specified. + // "RESOURCE_VALUE_LOW" - This is a low value resource. + // "RESOURCE_VALUE_MEDIUM" - This is a medium value resource. + // "RESOURCE_VALUE_HIGH" - This is a high value resource. + ResourceValue string `json:"resourceValue,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DisplayName") 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. "DisplayName") 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 *GoogleCloudSecuritycenterV1ExposedResource) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudSecuritycenterV1ExposedResource + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // GoogleCloudSecuritycenterV1ExposurePath: A path that an attacker // could take to reach an exposed resource. type GoogleCloudSecuritycenterV1ExposurePath struct { + // Edges: A list of the edges between nodes in this exposure path. + Edges []*Edge `json:"edges,omitempty"` + + // ExposedResource: The leaf node of this exposure path. + ExposedResource *GoogleCloudSecuritycenterV1ExposedResource `json:"exposedResource,omitempty"` + + // Name: Exposure Path Name e.g.: + // `organizations/123/attackExposureResults/456/exposurePaths/789` + Name string `json:"name,omitempty"` + + // PathNodes: A list of nodes that exist in this exposure path. + PathNodes []*PathNode `json:"pathNodes,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Edges") 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. "Edges") 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 *GoogleCloudSecuritycenterV1ExposurePath) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudSecuritycenterV1ExposurePath + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // GoogleCloudSecuritycenterV1ExternalSystem: Representation of third @@ -3647,6 +3798,49 @@ func (s *OrganizationSettings) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// PathNode: Represents one point that an attacker passes through in +// this exposure path. +type PathNode struct { + // AssociatedFindings: The findings associated with this node in the + // exposure path. + AssociatedFindings []*AssociatedFinding `json:"associatedFindings,omitempty"` + + // DisplayName: Human readable name of this resource. + DisplayName string `json:"displayName,omitempty"` + + // Resource: The name of the resource at this point in the exposure + // path. The format of the name is: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + Resource string `json:"resource,omitempty"` + + // ResourceType: The resource type of this resource. See: + // https://cloud.google.com/asset-inventory/docs/supported-asset-types + ResourceType string `json:"resourceType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AssociatedFindings") + // 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. "AssociatedFindings") 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 *PathNode) MarshalJSON() ([]byte, error) { + type NoMethod PathNode + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // Pod: Kubernetes Pod. type Pod struct { // Containers: Pod containers associated with this finding, if any. diff --git a/securitycenter/v1beta2/securitycenter-api.json b/securitycenter/v1beta2/securitycenter-api.json index b7575e09673..e24d729f892 100644 --- a/securitycenter/v1beta2/securitycenter-api.json +++ b/securitycenter/v1beta2/securitycenter-api.json @@ -1981,7 +1981,7 @@ } } }, - "revision": "20220921", + "revision": "20221014", "rootUrl": "https://securitycenter.googleapis.com/", "schemas": { "Access": { @@ -2027,7 +2027,7 @@ "description": "What kind of user agent is associated, e.g. operating system shells, embedded or stand-alone applications, etc.", "type": "string" }, - "username": { + "userName": { "description": "A string representing a username. This is likely not an IAM principal. For instance, this may be the system user name if the finding is VM-related, or this may be some type of application login user name, depending on the type of finding.", "type": "string" } @@ -2069,6 +2069,21 @@ }, "type": "object" }, + "AssociatedFinding": { + "description": "A finding that is associated with this node in the exposure path.", + "id": "AssociatedFinding", + "properties": { + "canonicalFindingName": { + "description": "Canonical name of the associated findings. Example: organizations/123/sources/456/findings/789", + "type": "string" + }, + "findingCategory": { + "description": "The additional taxonomy group within findings from a given source.", + "type": "string" + } + }, + "type": "object" + }, "Compliance": { "description": "Contains compliance information about a security standard indicating unmet recommendations.", "id": "Compliance", @@ -2506,6 +2521,21 @@ }, "type": "object" }, + "Edge": { + "description": "Represents a connection between a source node and a destination node in this exposure path.", + "id": "Edge", + "properties": { + "destination": { + "description": "This is the resource name of the destination node.", + "type": "string" + }, + "source": { + "description": "This is the resource name of the source node.", + "type": "string" + } + }, + "type": "object" + }, "EnvironmentVariable": { "description": "EnvironmentVariable is a name-value pair to store environment variables for Process.", "id": "EnvironmentVariable", @@ -2962,13 +2992,76 @@ "GoogleCloudSecuritycenterV1ExposedResource": { "description": "A resource that is exposed as a result of a finding.", "id": "GoogleCloudSecuritycenterV1ExposedResource", - "properties": {}, + "properties": { + "displayName": { + "description": "Human readable name of the resource that is exposed.", + "type": "string" + }, + "methods": { + "description": "The ways in which this resource is exposed. Examples: Read, Write", + "items": { + "type": "string" + }, + "type": "array" + }, + "name": { + "description": "Exposed Resource Name e.g.: `organizations/123/attackExposureResults/456/exposedResources/789`", + "type": "string" + }, + "resource": { + "description": "The name of the resource that is exposed. See: https://cloud.google.com/apis/design/resource_names#full_resource_name", + "type": "string" + }, + "resourceType": { + "description": "The resource type of the exposed resource. See: https://cloud.google.com/asset-inventory/docs/supported-asset-types", + "type": "string" + }, + "resourceValue": { + "description": "How valuable this resource is.", + "enum": [ + "RESOURCE_VALUE_UNSPECIFIED", + "RESOURCE_VALUE_LOW", + "RESOURCE_VALUE_MEDIUM", + "RESOURCE_VALUE_HIGH" + ], + "enumDescriptions": [ + "The resource value isn't specified.", + "This is a low value resource.", + "This is a medium value resource.", + "This is a high value resource." + ], + "type": "string" + } + }, "type": "object" }, "GoogleCloudSecuritycenterV1ExposurePath": { "description": "A path that an attacker could take to reach an exposed resource.", "id": "GoogleCloudSecuritycenterV1ExposurePath", - "properties": {}, + "properties": { + "edges": { + "description": "A list of the edges between nodes in this exposure path.", + "items": { + "$ref": "Edge" + }, + "type": "array" + }, + "exposedResource": { + "$ref": "GoogleCloudSecuritycenterV1ExposedResource", + "description": "The leaf node of this exposure path." + }, + "name": { + "description": "Exposure Path Name e.g.: `organizations/123/attackExposureResults/456/exposurePaths/789`", + "type": "string" + }, + "pathNodes": { + "description": "A list of nodes that exist in this exposure path.", + "items": { + "$ref": "PathNode" + }, + "type": "array" + } + }, "type": "object" }, "GoogleCloudSecuritycenterV1ExternalSystem": { @@ -3852,6 +3945,32 @@ }, "type": "object" }, + "PathNode": { + "description": "Represents one point that an attacker passes through in this exposure path.", + "id": "PathNode", + "properties": { + "associatedFindings": { + "description": "The findings associated with this node in the exposure path.", + "items": { + "$ref": "AssociatedFinding" + }, + "type": "array" + }, + "displayName": { + "description": "Human readable name of this resource.", + "type": "string" + }, + "resource": { + "description": "The name of the resource at this point in the exposure path. The format of the name is: https://cloud.google.com/apis/design/resource_names#full_resource_name", + "type": "string" + }, + "resourceType": { + "description": "The resource type of this resource. See: https://cloud.google.com/asset-inventory/docs/supported-asset-types", + "type": "string" + } + }, + "type": "object" + }, "Pod": { "description": "Kubernetes Pod.", "id": "Pod", diff --git a/securitycenter/v1beta2/securitycenter-gen.go b/securitycenter/v1beta2/securitycenter-gen.go index b81e561856f..83c4364126f 100644 --- a/securitycenter/v1beta2/securitycenter-gen.go +++ b/securitycenter/v1beta2/securitycenter-gen.go @@ -478,11 +478,11 @@ type Access struct { // operating system shells, embedded or stand-alone applications, etc. UserAgentFamily string `json:"userAgentFamily,omitempty"` - // Username: A string representing a username. This is likely not an IAM + // UserName: A string representing a username. This is likely not an IAM // principal. For instance, this may be the system user name if the // finding is VM-related, or this may be some type of application login // user name, depending on the type of finding. - Username string `json:"username,omitempty"` + UserName string `json:"userName,omitempty"` // ForceSendFields is a list of field names (e.g. "CallerIp") to // unconditionally include in API requests. By default, fields with @@ -559,6 +559,42 @@ func (s *AccessReview) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// AssociatedFinding: A finding that is associated with this node in the +// exposure path. +type AssociatedFinding struct { + // CanonicalFindingName: Canonical name of the associated findings. + // Example: organizations/123/sources/456/findings/789 + CanonicalFindingName string `json:"canonicalFindingName,omitempty"` + + // FindingCategory: The additional taxonomy group within findings from a + // given source. + FindingCategory string `json:"findingCategory,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "CanonicalFindingName") 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. "CanonicalFindingName") 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 *AssociatedFinding) MarshalJSON() ([]byte, error) { + type NoMethod AssociatedFinding + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // Compliance: Contains compliance information about a security standard // indicating unmet recommendations. type Compliance struct { @@ -1187,6 +1223,38 @@ func (s *Detection) UnmarshalJSON(data []byte) error { return nil } +// Edge: Represents a connection between a source node and a destination +// node in this exposure path. +type Edge struct { + // Destination: This is the resource name of the destination node. + Destination string `json:"destination,omitempty"` + + // Source: This is the resource name of the source node. + Source string `json:"source,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Destination") 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. "Destination") 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 *Edge) MarshalJSON() ([]byte, error) { + type NoMethod Edge + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // EnvironmentVariable: EnvironmentVariable is a name-value pair to // store environment variables for Process. type EnvironmentVariable struct { @@ -1844,11 +1912,94 @@ type GoogleCloudSecuritycenterV1BulkMuteFindingsResponse struct { // GoogleCloudSecuritycenterV1ExposedResource: A resource that is // exposed as a result of a finding. type GoogleCloudSecuritycenterV1ExposedResource struct { + // DisplayName: Human readable name of the resource that is exposed. + DisplayName string `json:"displayName,omitempty"` + + // Methods: The ways in which this resource is exposed. Examples: Read, + // Write + Methods []string `json:"methods,omitempty"` + + // Name: Exposed Resource Name e.g.: + // `organizations/123/attackExposureResults/456/exposedResources/789` + Name string `json:"name,omitempty"` + + // Resource: The name of the resource that is exposed. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + Resource string `json:"resource,omitempty"` + + // ResourceType: The resource type of the exposed resource. See: + // https://cloud.google.com/asset-inventory/docs/supported-asset-types + ResourceType string `json:"resourceType,omitempty"` + + // ResourceValue: How valuable this resource is. + // + // Possible values: + // "RESOURCE_VALUE_UNSPECIFIED" - The resource value isn't specified. + // "RESOURCE_VALUE_LOW" - This is a low value resource. + // "RESOURCE_VALUE_MEDIUM" - This is a medium value resource. + // "RESOURCE_VALUE_HIGH" - This is a high value resource. + ResourceValue string `json:"resourceValue,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DisplayName") 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. "DisplayName") 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 *GoogleCloudSecuritycenterV1ExposedResource) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudSecuritycenterV1ExposedResource + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // GoogleCloudSecuritycenterV1ExposurePath: A path that an attacker // could take to reach an exposed resource. type GoogleCloudSecuritycenterV1ExposurePath struct { + // Edges: A list of the edges between nodes in this exposure path. + Edges []*Edge `json:"edges,omitempty"` + + // ExposedResource: The leaf node of this exposure path. + ExposedResource *GoogleCloudSecuritycenterV1ExposedResource `json:"exposedResource,omitempty"` + + // Name: Exposure Path Name e.g.: + // `organizations/123/attackExposureResults/456/exposurePaths/789` + Name string `json:"name,omitempty"` + + // PathNodes: A list of nodes that exist in this exposure path. + PathNodes []*PathNode `json:"pathNodes,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Edges") 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. "Edges") 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 *GoogleCloudSecuritycenterV1ExposurePath) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudSecuritycenterV1ExposurePath + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // GoogleCloudSecuritycenterV1ExternalSystem: Representation of third @@ -2988,6 +3139,49 @@ func (s *OnboardingState) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// PathNode: Represents one point that an attacker passes through in +// this exposure path. +type PathNode struct { + // AssociatedFindings: The findings associated with this node in the + // exposure path. + AssociatedFindings []*AssociatedFinding `json:"associatedFindings,omitempty"` + + // DisplayName: Human readable name of this resource. + DisplayName string `json:"displayName,omitempty"` + + // Resource: The name of the resource at this point in the exposure + // path. The format of the name is: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + Resource string `json:"resource,omitempty"` + + // ResourceType: The resource type of this resource. See: + // https://cloud.google.com/asset-inventory/docs/supported-asset-types + ResourceType string `json:"resourceType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AssociatedFindings") + // 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. "AssociatedFindings") 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 *PathNode) MarshalJSON() ([]byte, error) { + type NoMethod PathNode + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // Pod: Kubernetes Pod. type Pod struct { // Containers: Pod containers associated with this finding, if any. diff --git a/servicecontrol/v1/servicecontrol-api.json b/servicecontrol/v1/servicecontrol-api.json index 84cf8d6b70b..ed7c37f6304 100644 --- a/servicecontrol/v1/servicecontrol-api.json +++ b/servicecontrol/v1/servicecontrol-api.json @@ -197,7 +197,7 @@ } } }, - "revision": "20220915", + "revision": "20220923", "rootUrl": "https://servicecontrol.googleapis.com/", "schemas": { "AllocateInfo": { @@ -1690,6 +1690,10 @@ "description": "Describes a resource associated with this operation.", "id": "ResourceInfo", "properties": { + "permission": { + "description": "The resource permission required for this request.", + "type": "string" + }, "resourceContainer": { "description": "The identifier of the parent of this resource instance. Must be in one of the following formats: - `projects/` - `folders/` - `organizations/`", "type": "string" diff --git a/servicecontrol/v1/servicecontrol-gen.go b/servicecontrol/v1/servicecontrol-gen.go index 7ed5d5ae05e..24401f77efa 100644 --- a/servicecontrol/v1/servicecontrol-gen.go +++ b/servicecontrol/v1/servicecontrol-gen.go @@ -2575,6 +2575,9 @@ func (s *Resource) MarshalJSON() ([]byte, error) { // ResourceInfo: Describes a resource associated with this operation. type ResourceInfo struct { + // Permission: The resource permission required for this request. + Permission string `json:"permission,omitempty"` + // ResourceContainer: The identifier of the parent of this resource // instance. Must be in one of the following formats: - `projects/` - // `folders/` - `organizations/` @@ -2590,21 +2593,20 @@ type ResourceInfo struct { // purposes. ResourceName string `json:"resourceName,omitempty"` - // ForceSendFields is a list of field names (e.g. "ResourceContainer") - // to unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "Permission") 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. "ResourceContainer") 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. "Permission") 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:"-"` } diff --git a/webrisk/v1/webrisk-api.json b/webrisk/v1/webrisk-api.json index 862c5e45a0d..3b23765721d 100644 --- a/webrisk/v1/webrisk-api.json +++ b/webrisk/v1/webrisk-api.json @@ -134,7 +134,7 @@ "Malware targeting any platform.", "Social engineering targeting any platform.", "Unwanted software targeting any platform.", - "Extended Coverage Social Engineering list targeting any platform." + "A list of extended coverage social engineering URIs targeting any platform." ], "location": "query", "repeated": true, @@ -384,7 +384,7 @@ "Malware targeting any platform.", "Social engineering targeting any platform.", "Unwanted software targeting any platform.", - "Extended Coverage Social Engineering list targeting any platform." + "A list of extended coverage social engineering URIs targeting any platform." ], "location": "query", "type": "string" @@ -429,7 +429,7 @@ "Malware targeting any platform.", "Social engineering targeting any platform.", "Unwanted software targeting any platform.", - "Extended Coverage Social Engineering list targeting any platform." + "A list of extended coverage social engineering URIs targeting any platform." ], "location": "query", "repeated": true, @@ -452,7 +452,7 @@ } } }, - "revision": "20220819", + "revision": "20221016", "rootUrl": "https://webrisk.googleapis.com/", "schemas": { "GoogleCloudWebriskV1ComputeThreatListDiffResponse": { @@ -615,7 +615,7 @@ "Malware targeting any platform.", "Social engineering targeting any platform.", "Unwanted software targeting any platform.", - "Extended Coverage Social Engineering list targeting any platform." + "A list of extended coverage social engineering URIs targeting any platform." ], "type": "string" }, @@ -629,7 +629,7 @@ "properties": { "threat": { "$ref": "GoogleCloudWebriskV1SearchUrisResponseThreatUri", - "description": "The threat list matches. This may be empty if the URI is on no list." + "description": "The threat list matches. This might be empty if the URI is on no list." } }, "type": "object" @@ -658,7 +658,7 @@ "Malware targeting any platform.", "Social engineering targeting any platform.", "Unwanted software targeting any platform.", - "Extended Coverage Social Engineering list targeting any platform." + "A list of extended coverage social engineering URIs targeting any platform." ], "type": "string" }, @@ -672,7 +672,7 @@ "id": "GoogleCloudWebriskV1Submission", "properties": { "threatTypes": { - "description": "ThreatTypes found to be associated with the submitted URI after reviewing it. This may be empty if the URI was not added to any list.", + "description": "ThreatTypes found to be associated with the submitted URI after reviewing it. This might be empty if the URI was not added to any list.", "items": { "enum": [ "THREAT_TYPE_UNSPECIFIED", @@ -686,7 +686,7 @@ "Malware targeting any platform.", "Social engineering targeting any platform.", "Unwanted software targeting any platform.", - "Extended Coverage Social Engineering list targeting any platform." + "A list of extended coverage social engineering URIs targeting any platform." ], "type": "string" }, @@ -821,11 +821,11 @@ "description": "Properties of the object. Contains field @type with type URL.", "type": "any" }, - "description": "This field will contain a `SubmitUriMetadata` object.", + "description": "Contains a `SubmitUriMetadata` object.", "type": "object" }, "name": { - "description": "This will match the pattern `/v1/{project-name}/operations/{operation-id}`.", + "description": "Matches the `/v1/{project-name}/operations/{operation-id}` pattern.", "type": "string" }, "response": { diff --git a/webrisk/v1/webrisk-gen.go b/webrisk/v1/webrisk-gen.go index cf626aff1a6..6e7aeb943a7 100644 --- a/webrisk/v1/webrisk-gen.go +++ b/webrisk/v1/webrisk-gen.go @@ -489,8 +489,8 @@ type GoogleCloudWebriskV1SearchHashesResponseThreatHash struct { // "MALWARE" - Malware targeting any platform. // "SOCIAL_ENGINEERING" - Social engineering targeting any platform. // "UNWANTED_SOFTWARE" - Unwanted software targeting any platform. - // "SOCIAL_ENGINEERING_EXTENDED_COVERAGE" - Extended Coverage Social - // Engineering list targeting any platform. + // "SOCIAL_ENGINEERING_EXTENDED_COVERAGE" - A list of extended + // coverage social engineering URIs targeting any platform. ThreatTypes []string `json:"threatTypes,omitempty"` // ForceSendFields is a list of field names (e.g. "ExpireTime") to @@ -517,7 +517,7 @@ func (s *GoogleCloudWebriskV1SearchHashesResponseThreatHash) MarshalJSON() ([]by } type GoogleCloudWebriskV1SearchUrisResponse struct { - // Threat: The threat list matches. This may be empty if the URI is on + // Threat: The threat list matches. This might be empty if the URI is on // no list. Threat *GoogleCloudWebriskV1SearchUrisResponseThreatUri `json:"threat,omitempty"` @@ -563,8 +563,8 @@ type GoogleCloudWebriskV1SearchUrisResponseThreatUri struct { // "MALWARE" - Malware targeting any platform. // "SOCIAL_ENGINEERING" - Social engineering targeting any platform. // "UNWANTED_SOFTWARE" - Unwanted software targeting any platform. - // "SOCIAL_ENGINEERING_EXTENDED_COVERAGE" - Extended Coverage Social - // Engineering list targeting any platform. + // "SOCIAL_ENGINEERING_EXTENDED_COVERAGE" - A list of extended + // coverage social engineering URIs targeting any platform. ThreatTypes []string `json:"threatTypes,omitempty"` // ForceSendFields is a list of field names (e.g. "ExpireTime") to @@ -594,8 +594,8 @@ func (s *GoogleCloudWebriskV1SearchUrisResponseThreatUri) MarshalJSON() ([]byte, // malicious content. type GoogleCloudWebriskV1Submission struct { // ThreatTypes: ThreatTypes found to be associated with the submitted - // URI after reviewing it. This may be empty if the URI was not added to - // any list. + // URI after reviewing it. This might be empty if the URI was not added + // to any list. // // Possible values: // "THREAT_TYPE_UNSPECIFIED" - No entries should match this threat @@ -603,8 +603,8 @@ type GoogleCloudWebriskV1Submission struct { // "MALWARE" - Malware targeting any platform. // "SOCIAL_ENGINEERING" - Social engineering targeting any platform. // "UNWANTED_SOFTWARE" - Unwanted software targeting any platform. - // "SOCIAL_ENGINEERING_EXTENDED_COVERAGE" - Extended Coverage Social - // Engineering list targeting any platform. + // "SOCIAL_ENGINEERING_EXTENDED_COVERAGE" - A list of extended + // coverage social engineering URIs targeting any platform. ThreatTypes []string `json:"threatTypes,omitempty"` // Uri: Required. The URI that is being reported for malicious content @@ -837,11 +837,11 @@ type GoogleLongrunningOperation struct { // cancellation. Error *GoogleRpcStatus `json:"error,omitempty"` - // Metadata: This field will contain a `SubmitUriMetadata` object. + // Metadata: Contains a `SubmitUriMetadata` object. Metadata googleapi.RawMessage `json:"metadata,omitempty"` - // Name: This will match the pattern - // `/v1/{project-name}/operations/{operation-id}`. + // Name: Matches the `/v1/{project-name}/operations/{operation-id}` + // pattern. Name string `json:"name,omitempty"` // Response: The normal response of the operation in case of success. If @@ -978,9 +978,9 @@ func (c *HashesSearchCall) HashPrefix(hashPrefix string) *HashesSearchCall { // "MALWARE" - Malware targeting any platform. // "SOCIAL_ENGINEERING" - Social engineering targeting any platform. // "UNWANTED_SOFTWARE" - Unwanted software targeting any platform. -// "SOCIAL_ENGINEERING_EXTENDED_COVERAGE" - Extended Coverage Social +// "SOCIAL_ENGINEERING_EXTENDED_COVERAGE" - A list of extended // -// Engineering list targeting any platform. +// coverage social engineering URIs targeting any platform. func (c *HashesSearchCall) ThreatTypes(threatTypes ...string) *HashesSearchCall { c.urlParams_.SetMulti("threatTypes", append([]string{}, threatTypes...)) return c @@ -1110,7 +1110,7 @@ func (c *HashesSearchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudWebrisk // "Malware targeting any platform.", // "Social engineering targeting any platform.", // "Unwanted software targeting any platform.", - // "Extended Coverage Social Engineering list targeting any platform." + // "A list of extended coverage social engineering URIs targeting any platform." // ], // "location": "query", // "repeated": true, @@ -2140,9 +2140,9 @@ func (c *ThreatListsComputeDiffCall) ConstraintsSupportedCompressions(constraint // "MALWARE" - Malware targeting any platform. // "SOCIAL_ENGINEERING" - Social engineering targeting any platform. // "UNWANTED_SOFTWARE" - Unwanted software targeting any platform. -// "SOCIAL_ENGINEERING_EXTENDED_COVERAGE" - Extended Coverage Social +// "SOCIAL_ENGINEERING_EXTENDED_COVERAGE" - A list of extended // -// Engineering list targeting any platform. +// coverage social engineering URIs targeting any platform. func (c *ThreatListsComputeDiffCall) ThreatType(threatType string) *ThreatListsComputeDiffCall { c.urlParams_.Set("threatType", threatType) return c @@ -2305,7 +2305,7 @@ func (c *ThreatListsComputeDiffCall) Do(opts ...googleapi.CallOption) (*GoogleCl // "Malware targeting any platform.", // "Social engineering targeting any platform.", // "Unwanted software targeting any platform.", - // "Extended Coverage Social Engineering list targeting any platform." + // "A list of extended coverage social engineering URIs targeting any platform." // ], // "location": "query", // "type": "string" @@ -2360,9 +2360,9 @@ func (r *UrisService) Search() *UrisSearchCall { // "MALWARE" - Malware targeting any platform. // "SOCIAL_ENGINEERING" - Social engineering targeting any platform. // "UNWANTED_SOFTWARE" - Unwanted software targeting any platform. -// "SOCIAL_ENGINEERING_EXTENDED_COVERAGE" - Extended Coverage Social +// "SOCIAL_ENGINEERING_EXTENDED_COVERAGE" - A list of extended // -// Engineering list targeting any platform. +// coverage social engineering URIs targeting any platform. func (c *UrisSearchCall) ThreatTypes(threatTypes ...string) *UrisSearchCall { c.urlParams_.SetMulti("threatTypes", append([]string{}, threatTypes...)) return c @@ -2492,7 +2492,7 @@ func (c *UrisSearchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudWebriskV1 // "Malware targeting any platform.", // "Social engineering targeting any platform.", // "Unwanted software targeting any platform.", - // "Extended Coverage Social Engineering list targeting any platform." + // "A list of extended coverage social engineering URIs targeting any platform." // ], // "location": "query", // "repeated": true,