From 7900dd9f999d20ea9c94b8ef978aaa85fdb23483 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 2 Aug 2023 07:12:10 +0000 Subject: [PATCH] feat(all): auto-regenerate discovery clients --- .../v1/advisorynotifications-api.json | 10 +- .../v1/advisorynotifications-gen.go | 2 + androidpublisher/v3/androidpublisher-api.json | 6 +- androidpublisher/v3/androidpublisher-gen.go | 9 +- chat/v1/chat-api.json | 16 +- chat/v1/chat-gen.go | 94 +- securitycenter/v1/securitycenter-api.json | 1573 +- securitycenter/v1/securitycenter-gen.go | 14061 ++++++++-------- .../v1beta1/securitycenter-api.json | 123 +- securitycenter/v1beta1/securitycenter-gen.go | 158 + .../v1beta2/securitycenter-api.json | 123 +- securitycenter/v1beta2/securitycenter-gen.go | 158 + servicecontrol/v2/servicecontrol-api.json | 47 +- servicecontrol/v2/servicecontrol-gen.go | 92 + verifiedaccess/v2/verifiedaccess-api.json | 6 +- verifiedaccess/v2/verifiedaccess-gen.go | 3 + 16 files changed, 9268 insertions(+), 7213 deletions(-) diff --git a/advisorynotifications/v1/advisorynotifications-api.json b/advisorynotifications/v1/advisorynotifications-api.json index 8e5f72dc67a..3d9ad9c230e 100644 --- a/advisorynotifications/v1/advisorynotifications-api.json +++ b/advisorynotifications/v1/advisorynotifications-api.json @@ -204,7 +204,7 @@ } } }, - "revision": "20230402", + "revision": "20230729", "rootUrl": "https://advisorynotifications.googleapis.com/", "schemas": { "GoogleCloudAdvisorynotificationsV1Attachment": { @@ -345,12 +345,16 @@ "enum": [ "NOTIFICATION_TYPE_UNSPECIFIED", "NOTIFICATION_TYPE_SECURITY_PRIVACY_ADVISORY", - "NOTIFICATION_TYPE_SENSITIVE_ACTIONS" + "NOTIFICATION_TYPE_SENSITIVE_ACTIONS", + "NOTIFICATION_TYPE_SECURITY_MSA", + "NOTIFICATION_TYPE_THREAT_HORIZONS" ], "enumDescriptions": [ "Default type", "Security and privacy advisory notifications", - "Sensitive action notifications" + "Sensitive action notifications", + "General security MSA", + "Threat horizons MSA" ], "type": "string" }, diff --git a/advisorynotifications/v1/advisorynotifications-gen.go b/advisorynotifications/v1/advisorynotifications-gen.go index c56ed1fa086..02ed22c87ed 100644 --- a/advisorynotifications/v1/advisorynotifications-gen.go +++ b/advisorynotifications/v1/advisorynotifications-gen.go @@ -396,6 +396,8 @@ type GoogleCloudAdvisorynotificationsV1Notification struct { // privacy advisory notifications // "NOTIFICATION_TYPE_SENSITIVE_ACTIONS" - Sensitive action // notifications + // "NOTIFICATION_TYPE_SECURITY_MSA" - General security MSA + // "NOTIFICATION_TYPE_THREAT_HORIZONS" - Threat horizons MSA NotificationType string `json:"notificationType,omitempty"` // Subject: The subject line of the notification. diff --git a/androidpublisher/v3/androidpublisher-api.json b/androidpublisher/v3/androidpublisher-api.json index e59a1087a7a..99c3f012909 100644 --- a/androidpublisher/v3/androidpublisher-api.json +++ b/androidpublisher/v3/androidpublisher-api.json @@ -3064,7 +3064,7 @@ ], "parameters": { "basePlanId": { - "description": "Required. The parent base plan (ID) for which the offers should be read. May be specified as '-' to read all offers under a subscription.", + "description": "Required. The parent base plan (ID) for which the offers should be read. May be specified as '-' to read all offers under a subscription or an app. Must be specified as '-' if product_id is specified as '-'.", "location": "path", "required": true, "type": "string" @@ -3087,7 +3087,7 @@ "type": "string" }, "productId": { - "description": "Required. The parent subscription (ID) for which the offers should be read.", + "description": "Required. The parent subscription (ID) for which the offers should be read. May be specified as '-' to read all offers under an app.", "location": "path", "required": true, "type": "string" @@ -4047,7 +4047,7 @@ } } }, - "revision": "20230720", + "revision": "20230801", "rootUrl": "https://androidpublisher.googleapis.com/", "schemas": { "Abi": { diff --git a/androidpublisher/v3/androidpublisher-gen.go b/androidpublisher/v3/androidpublisher-gen.go index 950ba15b7df..7cb1ff01bd1 100644 --- a/androidpublisher/v3/androidpublisher-gen.go +++ b/androidpublisher/v3/androidpublisher-gen.go @@ -19358,11 +19358,12 @@ type MonetizationSubscriptionsBasePlansOffersListCall struct { // // - basePlanId: The parent base plan (ID) for which the offers should // be read. May be specified as '-' to read all offers under a -// subscription. +// subscription or an app. Must be specified as '-' if product_id is +// specified as '-'. // - packageName: The parent app (package name) for which the // subscriptions should be read. // - productId: The parent subscription (ID) for which the offers should -// be read. +// be read. May be specified as '-' to read all offers under an app. func (r *MonetizationSubscriptionsBasePlansOffersService) List(packageName string, productId string, basePlanId string) *MonetizationSubscriptionsBasePlansOffersListCall { c := &MonetizationSubscriptionsBasePlansOffersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName @@ -19502,7 +19503,7 @@ func (c *MonetizationSubscriptionsBasePlansOffersListCall) Do(opts ...googleapi. // ], // "parameters": { // "basePlanId": { - // "description": "Required. The parent base plan (ID) for which the offers should be read. May be specified as '-' to read all offers under a subscription.", + // "description": "Required. The parent base plan (ID) for which the offers should be read. May be specified as '-' to read all offers under a subscription or an app. Must be specified as '-' if product_id is specified as '-'.", // "location": "path", // "required": true, // "type": "string" @@ -19525,7 +19526,7 @@ func (c *MonetizationSubscriptionsBasePlansOffersListCall) Do(opts ...googleapi. // "type": "string" // }, // "productId": { - // "description": "Required. The parent subscription (ID) for which the offers should be read.", + // "description": "Required. The parent subscription (ID) for which the offers should be read. May be specified as '-' to read all offers under an app.", // "location": "path", // "required": true, // "type": "string" diff --git a/chat/v1/chat-api.json b/chat/v1/chat-api.json index 10f09e13e89..7052cad321d 100644 --- a/chat/v1/chat-api.json +++ b/chat/v1/chat-api.json @@ -288,7 +288,7 @@ "parameterOrder": [], "parameters": { "name": { - "description": "Required. Resource name of the user to find direct message with. Format: `users/{user}`, where `{user}` is either the `{person_id}` for the [person](https://developers.google.com/people/api/rest/v1/people) from the People API, or the `id` for the [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Directory API. For example, if the People API `Person.resourceName` is `people/123456789`, you can find a direct message with that person by using `users/123456789` as the `name`.", + "description": "Required. Resource name of the user to find direct message with. Format: `users/{user}`, where `{user}` is either the `{person_id}` for the [person](https://developers.google.com/people/api/rest/v1/people) from the People API, or the `id` for the [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Directory API. For example, if the People API `Person.resourceName` is `people/123456789`, you can find a direct message with that person by using `users/123456789` as the `name`. When [authenticated as a user](https://developers.google.com/chat/api/guides/auth/users), you can use the email as an alias for `{user}`. For example, `users/example@gmail.com` where `example@gmail.com` is the email of the Google Chat user.", "location": "query", "type": "string" } @@ -400,7 +400,7 @@ ] }, "setup": { - "description": "Creates a space and adds specified users to it. The calling user is automatically added to the space, and shouldn't be specified as a membership in the request. For an example, see [Set up a space](https://developers.google.com/chat/api/guides/v1/spaces/set-up). To specify the human members to add, add memberships with the appropriate `member.name` in the `SetUpSpaceRequest`. To add a human user, use `users/{user}`, where `{user}` is either the `{person_id}` for the [person](https://developers.google.com/people/api/rest/v1/people) from the People API, or the `id` for the [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Admin SDK Directory API. For example, if the People API `Person` `resourceName` is `people/123456789`, you can add the user to the space by including a membership with `users/123456789` as the `member.name`. For a space or group chat, if the caller blocks or is blocked by some members, then those members aren't added to the created space. To create a direct message (DM) between the calling user and another human user, specify exactly one membership to represent the human user. If one user blocks the other, the request fails and the DM isn't created. To create a DM between the calling user and the calling app, set `Space.singleUserBotDm` to `true` and don't specify any memberships. You can only use this method to set up a DM with the calling app. To add the calling app as a member of a space or an existing DM between two human users, see [create a membership](https://developers.google.com/chat/api/guides/v1/members/create). If a DM already exists between two users, even when one user blocks the other at the time a request is made, then the existing DM is returned. Spaces with threaded replies or guest access aren't supported. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users) and the `chat.spaces.create` or `chat.spaces` scope.", + "description": "Creates a space and adds specified users to it. The calling user is automatically added to the space, and shouldn't be specified as a membership in the request. For an example, see [Set up a space](https://developers.google.com/chat/api/guides/v1/spaces/set-up). To specify the human members to add, add memberships with the appropriate `member.name` in the `SetUpSpaceRequest`. To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace organization `{user}` can also be the `{person_id}` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person `resourceName` for `user@example.com` is `people/123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user@example.com` or `users/123456789`. For a space or group chat, if the caller blocks or is blocked by some members, then those members aren't added to the created space. To create a direct message (DM) between the calling user and another human user, specify exactly one membership to represent the human user. If one user blocks the other, the request fails and the DM isn't created. To create a DM between the calling user and the calling app, set `Space.singleUserBotDm` to `true` and don't specify any memberships. You can only use this method to set up a DM with the calling app. To add the calling app as a member of a space or an existing DM between two human users, see [create a membership](https://developers.google.com/chat/api/guides/v1/members/create). If a DM already exists between two users, even when one user blocks the other at the time a request is made, then the existing DM is returned. Spaces with threaded replies or guest access aren't supported. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users) and the `chat.spaces.create` or `chat.spaces` scope.", "flatPath": "v1/spaces:setup", "httpMethod": "POST", "id": "chat.spaces.setup", @@ -423,7 +423,7 @@ "members": { "methods": { "create": { - "description": "Creates a human membership or app membership for the calling app. Creating memberships for other apps isn't supported. For an example, see [ Create a membership](https://developers.google.com/chat/api/guides/v1/members/create). When creating a membership, if the specified member has their auto-accept policy turned off, then they're invited, and must accept the space invitation before joining. Otherwise, creating a membership adds the member directly to the specified space. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users) and the `chat.memberships` (for human membership) or `chat.memberships.app` (for app membership) scope. To specify the member to add, set the `membership.member.name` in the `CreateMembershipRequest`: - To add the calling app to a space or a direct message between two human users, use `users/app`. Unable to add other apps to the space. - To add a human user, use `users/{user}`, where `{user}` is either the `{person_id}` for the [person](https://developers.google.com/people/api/rest/v1/people) from the People API, or the `id` for the [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Directory API. For example, if the People API `Person` `resourceName` is `people/123456789`, you can add the user to the space by setting the `membership.member.name` to `users/123456789`.", + "description": "Creates a human membership or app membership for the calling app. Creating memberships for other apps isn't supported. For an example, see [ Create a membership](https://developers.google.com/chat/api/guides/v1/members/create). When creating a membership, if the specified member has their auto-accept policy turned off, then they're invited, and must accept the space invitation before joining. Otherwise, creating a membership adds the member directly to the specified space. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users) and the `chat.memberships` (for human membership) or `chat.memberships.app` (for app membership) scope. To specify the member to add, set the `membership.member.name` in the `CreateMembershipRequest`: - To add the calling app to a space or a direct message between two human users, use `users/app`. Unable to add other apps to the space. - To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace organization `{user}` can also be the `{person_id}` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person `resourceName` for `user@example.com` is `people/123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user@example.com` or `users/123456789`.", "flatPath": "v1/spaces/{spacesId}/members", "httpMethod": "POST", "id": "chat.spaces.members.create", @@ -461,7 +461,7 @@ ], "parameters": { "name": { - "description": "Required. Resource name of the membership to delete. Chat apps can delete human users' or their own memberships. Chat apps can't delete other apps' memberships. When deleting a human membership, requires the `chat.memberships` scope and `spaces/{space}/members/{member}` format. When deleting an app membership, requires the `chat.memberships.app` scope and `spaces/{space}/members/app` format. Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`", + "description": "Required. Resource name of the membership to delete. Chat apps can delete human users' or their own memberships. Chat apps can't delete other apps' memberships. When deleting a human membership, requires the `chat.memberships` scope and `spaces/{space}/members/{member}` format. You can use the email as an alias for `{member}`. For example, `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the email of the Google Chat user. When deleting an app membership, requires the `chat.memberships.app` scope and `spaces/{space}/members/app` format. Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`.", "location": "path", "pattern": "^spaces/[^/]+/members/[^/]+$", "required": true, @@ -487,7 +487,7 @@ ], "parameters": { "name": { - "description": "Required. Resource name of the membership to retrieve. To get the app's own membership, you can optionally use `spaces/{space}/members/app`. Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`", + "description": "Required. Resource name of the membership to retrieve. To get the app's own membership, you can optionally use `spaces/{space}/members/app`. Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app` When [authenticated as a user](https://developers.google.com/chat/api/guides/auth/users), you can use the user's email as an alias for `{member}`. For example, `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the email of the Google Chat user.", "location": "path", "pattern": "^spaces/[^/]+/members/[^/]+$", "required": true, @@ -954,7 +954,7 @@ } } }, - "revision": "20230727", + "revision": "20230729", "rootUrl": "https://chat.googleapis.com/", "schemas": { "ActionParameter": { @@ -3299,7 +3299,7 @@ "id": "SetUpSpaceRequest", "properties": { "memberships": { - "description": "Optional. The initial set of in-domain users invited to join the space. The calling user is automatically added to the space, and shouldn't be specified as a membership. The set currently allows up to 20 memberships (in addition to the caller). The `Membership.member` field must contain a user with `name` populated and `User.Type.HUMAN`. All other fields are ignored. Optional when setting `Space.spaceType` to `SPACE`. Required when setting `Space.spaceType` to `GROUP_CHAT`, along with at least two memberships. Required when setting `Space.spaceType` to `DIRECT_MESSAGE` with a human user, along with exactly one membership. Must be empty when creating a 1:1 conversation between a human and the calling Chat app (when setting `Space.spaceType` to `DIRECT_MESSAGE` and `Space.singleUserBotDm` to `true`). Not supported: Inviting guest users, or adding other Chat apps.", + "description": "Optional. The Google Chat users to invite to join the space. Omit the calling user, as they are added automatically. The set currently allows up to 20 memberships (in addition to the caller). The `Membership.member` field must contain a `user` with `name` populated (format: `users/{user}`) and `type` set to `User.Type.HUMAN`. You can only add human users when setting up a space (adding Chat apps is only supported for direct message setup with the calling app). You can also add members using the user's email as an alias for {user}. For example, the `user.name` can be `users/example@gmail.com`.\" To invite Gmail users or users from external Google Workspace domains, user's email must be used for `{user}`. Optional when setting `Space.spaceType` to `SPACE`. Required when setting `Space.spaceType` to `GROUP_CHAT`, along with at least two memberships. Required when setting `Space.spaceType` to `DIRECT_MESSAGE` with a human user, along with exactly one membership. Must be empty when creating a 1:1 conversation between a human and the calling Chat app (when setting `Space.spaceType` to `DIRECT_MESSAGE` and `Space.singleUserBotDm` to `true`).", "items": { "$ref": "Membership" }, @@ -3628,7 +3628,7 @@ "type": "object" }, "User": { - "description": "A user in Google Chat. When returned as an output from a request, if your Chat app [authenticates as a user](https://developers.google.com/chat/api/guides/auth/users), the output for a User resource only populates the user's `name` and `type`.", + "description": "A user in Google Chat. When returned as an output from a request, if your Chat app [authenticates as a user](https://developers.google.com/chat/api/guides/auth/users), the output for a `User` resource only populates the user's `name` and `type`.", "id": "User", "properties": { "displayName": { diff --git a/chat/v1/chat-gen.go b/chat/v1/chat-gen.go index 5685232768d..f0c5b87fdbe 100644 --- a/chat/v1/chat-gen.go +++ b/chat/v1/chat-gen.go @@ -4376,20 +4376,24 @@ func (s *Section) MarshalJSON() ([]byte, error) { } type SetUpSpaceRequest struct { - // Memberships: Optional. The initial set of in-domain users invited to - // join the space. The calling user is automatically added to the space, - // and shouldn't be specified as a membership. The set currently allows - // up to 20 memberships (in addition to the caller). The - // `Membership.member` field must contain a user with `name` populated - // and `User.Type.HUMAN`. All other fields are ignored. Optional when - // setting `Space.spaceType` to `SPACE`. Required when setting - // `Space.spaceType` to `GROUP_CHAT`, along with at least two - // memberships. Required when setting `Space.spaceType` to + // Memberships: Optional. The Google Chat users to invite to join the + // space. Omit the calling user, as they are added automatically. The + // set currently allows up to 20 memberships (in addition to the + // caller). The `Membership.member` field must contain a `user` with + // `name` populated (format: `users/{user}`) and `type` set to + // `User.Type.HUMAN`. You can only add human users when setting up a + // space (adding Chat apps is only supported for direct message setup + // with the calling app). You can also add members using the user's + // email as an alias for {user}. For example, the `user.name` can be + // `users/example@gmail.com`." To invite Gmail users or users from + // external Google Workspace domains, user's email must be used for + // `{user}`. Optional when setting `Space.spaceType` to `SPACE`. + // Required when setting `Space.spaceType` to `GROUP_CHAT`, along with + // at least two memberships. Required when setting `Space.spaceType` to // `DIRECT_MESSAGE` with a human user, along with exactly one // membership. Must be empty when creating a 1:1 conversation between a // human and the calling Chat app (when setting `Space.spaceType` to - // `DIRECT_MESSAGE` and `Space.singleUserBotDm` to `true`). Not - // supported: Inviting guest users, or adding other Chat apps. + // `DIRECT_MESSAGE` and `Space.singleUserBotDm` to `true`). Memberships []*Membership `json:"memberships,omitempty"` // RequestId: Optional. A unique identifier for this request. A random @@ -5000,7 +5004,7 @@ func (s *UploadAttachmentResponse) MarshalJSON() ([]byte, error) { // User: A user in Google Chat. When returned as an output from a // request, if your Chat app authenticates as a user // (https://developers.google.com/chat/api/guides/auth/users), the -// output for a User resource only populates the user's `name` and +// output for a `User` resource only populates the user's `name` and // `type`. type User struct { // DisplayName: Output only. The user's display name. @@ -5863,6 +5867,11 @@ func (r *SpacesService) FindDirectMessage() *SpacesFindDirectMessageCall { // in the Directory API. For example, if the People API // `Person.resourceName` is `people/123456789`, you can find a direct // message with that person by using `users/123456789` as the `name`. +// When authenticated as a user +// (https://developers.google.com/chat/api/guides/auth/users), you can +// use the email as an alias for `{user}`. For example, +// `users/example@gmail.com` where `example@gmail.com` is the email of +// the Google Chat user. func (c *SpacesFindDirectMessageCall) Name(name string) *SpacesFindDirectMessageCall { c.urlParams_.Set("name", name) return c @@ -5971,7 +5980,7 @@ func (c *SpacesFindDirectMessageCall) Do(opts ...googleapi.CallOption) (*Space, // "parameterOrder": [], // "parameters": { // "name": { - // "description": "Required. Resource name of the user to find direct message with. Format: `users/{user}`, where `{user}` is either the `{person_id}` for the [person](https://developers.google.com/people/api/rest/v1/people) from the People API, or the `id` for the [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Directory API. For example, if the People API `Person.resourceName` is `people/123456789`, you can find a direct message with that person by using `users/123456789` as the `name`.", + // "description": "Required. Resource name of the user to find direct message with. Format: `users/{user}`, where `{user}` is either the `{person_id}` for the [person](https://developers.google.com/people/api/rest/v1/people) from the People API, or the `id` for the [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Directory API. For example, if the People API `Person.resourceName` is `people/123456789`, you can find a direct message with that person by using `users/123456789` as the `name`. When [authenticated as a user](https://developers.google.com/chat/api/guides/auth/users), you can use the email as an alias for `{user}`. For example, `users/example@gmail.com` where `example@gmail.com` is the email of the Google Chat user.", // "location": "query", // "type": "string" // } @@ -6564,16 +6573,15 @@ type SpacesSetupCall struct { // (https://developers.google.com/chat/api/guides/v1/spaces/set-up). To // specify the human members to add, add memberships with the // appropriate `member.name` in the `SetUpSpaceRequest`. To add a human -// user, use `users/{user}`, where `{user}` is either the `{person_id}` -// for the person -// (https://developers.google.com/people/api/rest/v1/people) from the -// People API, or the `id` for the user -// (https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) -// in the Admin SDK Directory API. For example, if the People API -// `Person` `resourceName` is `people/123456789`, you can add the user -// to the space by including a membership with `users/123456789` as the -// `member.name`. For a space or group chat, if the caller blocks or is -// blocked by some members, then those members aren't added to the +// user, use `users/{user}`, where `{user}` can be the email address for +// the user. For users in the same Workspace organization `{user}` can +// also be the `{person_id}` for the person from the People API, or the +// `id` for the user in the Directory API. For example, if the People +// API Person `resourceName` for `user@example.com` is +// `people/123456789`, you can add the user to the space by setting the +// `membership.member.name` to `users/user@example.com` or +// `users/123456789`. For a space or group chat, if the caller blocks or +// is blocked by some members, then those members aren't added to the // created space. To create a direct message (DM) between the calling // user and another human user, specify exactly one membership to // represent the human user. If one user blocks the other, the request @@ -6684,7 +6692,7 @@ func (c *SpacesSetupCall) Do(opts ...googleapi.CallOption) (*Space, error) { } return ret, nil // { - // "description": "Creates a space and adds specified users to it. The calling user is automatically added to the space, and shouldn't be specified as a membership in the request. For an example, see [Set up a space](https://developers.google.com/chat/api/guides/v1/spaces/set-up). To specify the human members to add, add memberships with the appropriate `member.name` in the `SetUpSpaceRequest`. To add a human user, use `users/{user}`, where `{user}` is either the `{person_id}` for the [person](https://developers.google.com/people/api/rest/v1/people) from the People API, or the `id` for the [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Admin SDK Directory API. For example, if the People API `Person` `resourceName` is `people/123456789`, you can add the user to the space by including a membership with `users/123456789` as the `member.name`. For a space or group chat, if the caller blocks or is blocked by some members, then those members aren't added to the created space. To create a direct message (DM) between the calling user and another human user, specify exactly one membership to represent the human user. If one user blocks the other, the request fails and the DM isn't created. To create a DM between the calling user and the calling app, set `Space.singleUserBotDm` to `true` and don't specify any memberships. You can only use this method to set up a DM with the calling app. To add the calling app as a member of a space or an existing DM between two human users, see [create a membership](https://developers.google.com/chat/api/guides/v1/members/create). If a DM already exists between two users, even when one user blocks the other at the time a request is made, then the existing DM is returned. Spaces with threaded replies or guest access aren't supported. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users) and the `chat.spaces.create` or `chat.spaces` scope.", + // "description": "Creates a space and adds specified users to it. The calling user is automatically added to the space, and shouldn't be specified as a membership in the request. For an example, see [Set up a space](https://developers.google.com/chat/api/guides/v1/spaces/set-up). To specify the human members to add, add memberships with the appropriate `member.name` in the `SetUpSpaceRequest`. To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace organization `{user}` can also be the `{person_id}` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person `resourceName` for `user@example.com` is `people/123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user@example.com` or `users/123456789`. For a space or group chat, if the caller blocks or is blocked by some members, then those members aren't added to the created space. To create a direct message (DM) between the calling user and another human user, specify exactly one membership to represent the human user. If one user blocks the other, the request fails and the DM isn't created. To create a DM between the calling user and the calling app, set `Space.singleUserBotDm` to `true` and don't specify any memberships. You can only use this method to set up a DM with the calling app. To add the calling app as a member of a space or an existing DM between two human users, see [create a membership](https://developers.google.com/chat/api/guides/v1/members/create). If a DM already exists between two users, even when one user blocks the other at the time a request is made, then the existing DM is returned. Spaces with threaded replies or guest access aren't supported. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users) and the `chat.spaces.create` or `chat.spaces` scope.", // "flatPath": "v1/spaces:setup", // "httpMethod": "POST", // "id": "chat.spaces.setup", @@ -6731,14 +6739,14 @@ type SpacesMembersCreateCall struct { // `membership.member.name` in the `CreateMembershipRequest`: - To add // the calling app to a space or a direct message between two human // users, use `users/app`. Unable to add other apps to the space. - To -// add a human user, use `users/{user}`, where `{user}` is either the -// `{person_id}` for the person -// (https://developers.google.com/people/api/rest/v1/people) from the -// People API, or the `id` for the user -// (https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) -// in the Directory API. For example, if the People API `Person` -// `resourceName` is `people/123456789`, you can add the user to the -// space by setting the `membership.member.name` to `users/123456789`. +// add a human user, use `users/{user}`, where `{user}` can be the email +// address for the user. For users in the same Workspace organization +// `{user}` can also be the `{person_id}` for the person from the People +// API, or the `id` for the user in the Directory API. For example, if +// the People API Person `resourceName` for `user@example.com` is +// `people/123456789`, you can add the user to the space by setting the +// `membership.member.name` to `users/user@example.com` or +// `users/123456789`. // // - parent: The resource name of the space for which to create the // membership. Format: spaces/{space}. @@ -6840,7 +6848,7 @@ func (c *SpacesMembersCreateCall) Do(opts ...googleapi.CallOption) (*Membership, } return ret, nil // { - // "description": "Creates a human membership or app membership for the calling app. Creating memberships for other apps isn't supported. For an example, see [ Create a membership](https://developers.google.com/chat/api/guides/v1/members/create). When creating a membership, if the specified member has their auto-accept policy turned off, then they're invited, and must accept the space invitation before joining. Otherwise, creating a membership adds the member directly to the specified space. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users) and the `chat.memberships` (for human membership) or `chat.memberships.app` (for app membership) scope. To specify the member to add, set the `membership.member.name` in the `CreateMembershipRequest`: - To add the calling app to a space or a direct message between two human users, use `users/app`. Unable to add other apps to the space. - To add a human user, use `users/{user}`, where `{user}` is either the `{person_id}` for the [person](https://developers.google.com/people/api/rest/v1/people) from the People API, or the `id` for the [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Directory API. For example, if the People API `Person` `resourceName` is `people/123456789`, you can add the user to the space by setting the `membership.member.name` to `users/123456789`.", + // "description": "Creates a human membership or app membership for the calling app. Creating memberships for other apps isn't supported. For an example, see [ Create a membership](https://developers.google.com/chat/api/guides/v1/members/create). When creating a membership, if the specified member has their auto-accept policy turned off, then they're invited, and must accept the space invitation before joining. Otherwise, creating a membership adds the member directly to the specified space. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users) and the `chat.memberships` (for human membership) or `chat.memberships.app` (for app membership) scope. To specify the member to add, set the `membership.member.name` in the `CreateMembershipRequest`: - To add the calling app to a space or a direct message between two human users, use `users/app`. Unable to add other apps to the space. - To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace organization `{user}` can also be the `{person_id}` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person `resourceName` for `user@example.com` is `people/123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user@example.com` or `users/123456789`.", // "flatPath": "v1/spaces/{spacesId}/members", // "httpMethod": "POST", // "id": "chat.spaces.members.create", @@ -6891,9 +6899,12 @@ type SpacesMembersDeleteCall struct { // delete human users' or their own memberships. Chat apps can't // delete other apps' memberships. When deleting a human membership, // requires the `chat.memberships` scope and -// `spaces/{space}/members/{member}` format. When deleting an app -// membership, requires the `chat.memberships.app` scope and -// `spaces/{space}/members/app` format. Format: +// `spaces/{space}/members/{member}` format. You can use the email as +// an alias for `{member}`. For example, +// `spaces/{space}/members/example@gmail.com` where +// `example@gmail.com` is the email of the Google Chat user. When +// deleting an app membership, requires the `chat.memberships.app` +// scope and `spaces/{space}/members/app` format. Format: // `spaces/{space}/members/{member}` or `spaces/{space}/members/app`. func (r *SpacesMembersService) Delete(name string) *SpacesMembersDeleteCall { c := &SpacesMembersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -6996,7 +7007,7 @@ func (c *SpacesMembersDeleteCall) Do(opts ...googleapi.CallOption) (*Membership, // ], // "parameters": { // "name": { - // "description": "Required. Resource name of the membership to delete. Chat apps can delete human users' or their own memberships. Chat apps can't delete other apps' memberships. When deleting a human membership, requires the `chat.memberships` scope and `spaces/{space}/members/{member}` format. When deleting an app membership, requires the `chat.memberships.app` scope and `spaces/{space}/members/app` format. Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`", + // "description": "Required. Resource name of the membership to delete. Chat apps can delete human users' or their own memberships. Chat apps can't delete other apps' memberships. When deleting a human membership, requires the `chat.memberships` scope and `spaces/{space}/members/{member}` format. You can use the email as an alias for `{member}`. For example, `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the email of the Google Chat user. When deleting an app membership, requires the `chat.memberships.app` scope and `spaces/{space}/members/app` format. Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`.", // "location": "path", // "pattern": "^spaces/[^/]+/members/[^/]+$", // "required": true, @@ -7043,7 +7054,12 @@ type SpacesMembersGetCall struct { // - name: Resource name of the membership to retrieve. To get the app's // own membership, you can optionally use // `spaces/{space}/members/app`. Format: -// `spaces/{space}/members/{member}` or `spaces/{space}/members/app`. +// `spaces/{space}/members/{member}` or `spaces/{space}/members/app` +// When authenticated as a user +// (https://developers.google.com/chat/api/guides/auth/users), you can +// use the user's email as an alias for `{member}`. For example, +// `spaces/{space}/members/example@gmail.com` where +// `example@gmail.com` is the email of the Google Chat user. func (r *SpacesMembersService) Get(name string) *SpacesMembersGetCall { c := &SpacesMembersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name @@ -7158,7 +7174,7 @@ func (c *SpacesMembersGetCall) Do(opts ...googleapi.CallOption) (*Membership, er // ], // "parameters": { // "name": { - // "description": "Required. Resource name of the membership to retrieve. To get the app's own membership, you can optionally use `spaces/{space}/members/app`. Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`", + // "description": "Required. Resource name of the membership to retrieve. To get the app's own membership, you can optionally use `spaces/{space}/members/app`. Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app` When [authenticated as a user](https://developers.google.com/chat/api/guides/auth/users), you can use the user's email as an alias for `{member}`. For example, `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the email of the Google Chat user.", // "location": "path", // "pattern": "^spaces/[^/]+/members/[^/]+$", // "required": true, diff --git a/securitycenter/v1/securitycenter-api.json b/securitycenter/v1/securitycenter-api.json index cb375ccc331..a129a81bfc2 100644 --- a/securitycenter/v1/securitycenter-api.json +++ b/securitycenter/v1/securitycenter-api.json @@ -402,192 +402,6 @@ } } }, - "eventThreatDetectionSettings": { - "methods": { - "validateCustomModule": { - "description": "Validates the given Event Threat Detection Custom Module.", - "flatPath": "v1/folders/{foldersId}/eventThreatDetectionSettings:validateCustomModule", - "httpMethod": "POST", - "id": "securitycenter.folders.eventThreatDetectionSettings.validateCustomModule", - "parameterOrder": [ - "parent" - ], - "parameters": { - "parent": { - "description": "Required. Resource name of the parent to validate the Custom Module under. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", - "location": "path", - "pattern": "^folders/[^/]+/eventThreatDetectionSettings$", - "required": true, - "type": "string" - } - }, - "path": "v1/{+parent}:validateCustomModule", - "request": { - "$ref": "ValidateEventThreatDetectionCustomModuleRequest" - }, - "response": { - "$ref": "ValidateEventThreatDetectionCustomModuleResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - } - }, - "resources": { - "customModules": { - "methods": { - "create": { - "description": "Creates an ETD custom module at the given level. Creating a module has a side-effect of creating modules at all descendants.", - "flatPath": "v1/folders/{foldersId}/eventThreatDetectionSettings/customModules", - "httpMethod": "POST", - "id": "securitycenter.folders.eventThreatDetectionSettings.customModules.create", - "parameterOrder": [ - "parent" - ], - "parameters": { - "parent": { - "description": "Required. The new custom module's parent. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", - "location": "path", - "pattern": "^folders/[^/]+/eventThreatDetectionSettings$", - "required": true, - "type": "string" - } - }, - "path": "v1/{+parent}/customModules", - "request": { - "$ref": "EventThreatDetectionCustomModule" - }, - "response": { - "$ref": "EventThreatDetectionCustomModule" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - "delete": { - "description": "Deletes an ETD custom module. Deletion at resident level also deletes modules at all descendants. Deletion at any other level is not supported.", - "flatPath": "v1/folders/{foldersId}/eventThreatDetectionSettings/customModules/{customModulesId}", - "httpMethod": "DELETE", - "id": "securitycenter.folders.eventThreatDetectionSettings.customModules.delete", - "parameterOrder": [ - "name" - ], - "parameters": { - "name": { - "description": "Required. Name of the custom module to delete. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", - "location": "path", - "pattern": "^folders/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", - "required": true, - "type": "string" - } - }, - "path": "v1/{+name}", - "response": { - "$ref": "Empty" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - "get": { - "description": "Gets an ETD custom module. Retrieves the module at the given level.", - "flatPath": "v1/folders/{foldersId}/eventThreatDetectionSettings/customModules/{customModulesId}", - "httpMethod": "GET", - "id": "securitycenter.folders.eventThreatDetectionSettings.customModules.get", - "parameterOrder": [ - "name" - ], - "parameters": { - "name": { - "description": "Required. Name of the custom module to get. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", - "location": "path", - "pattern": "^folders/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", - "required": true, - "type": "string" - } - }, - "path": "v1/{+name}", - "response": { - "$ref": "EventThreatDetectionCustomModule" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - "list": { - "description": "Lists ETD custom modules. Retrieve all resident and inherited modules at the given level (no descendants).", - "flatPath": "v1/folders/{foldersId}/eventThreatDetectionSettings/customModules", - "httpMethod": "GET", - "id": "securitycenter.folders.eventThreatDetectionSettings.customModules.list", - "parameterOrder": [ - "parent" - ], - "parameters": { - "pageSize": { - "description": "The maximum number of modules 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 `ListEventThreatDetectionCustomModules` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListEventThreatDetectionCustomModules` must match the call that provided the page token.", - "location": "query", - "type": "string" - }, - "parent": { - "description": "Required. Name of the parent to list custom modules. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", - "location": "path", - "pattern": "^folders/[^/]+/eventThreatDetectionSettings$", - "required": true, - "type": "string" - } - }, - "path": "v1/{+parent}/customModules", - "response": { - "$ref": "ListEventThreatDetectionCustomModulesResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - "patch": { - "description": "Updates an ETD custom module at the given level. All config fields can be updated when updating the module at resident level. Only enablement state can be updated when updating the module at inherited levels. Updating the module has a side-effect that it updates all descendants that are inherited from this module.", - "flatPath": "v1/folders/{foldersId}/eventThreatDetectionSettings/customModules/{customModulesId}", - "httpMethod": "PATCH", - "id": "securitycenter.folders.eventThreatDetectionSettings.customModules.patch", - "parameterOrder": [ - "name" - ], - "parameters": { - "name": { - "description": "Immutable. The resource name of the Event Threat Detection custom module. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", - "location": "path", - "pattern": "^folders/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", - "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}", - "request": { - "$ref": "EventThreatDetectionCustomModule" - }, - "response": { - "$ref": "EventThreatDetectionCustomModule" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - } - } - } - } - }, "findings": { "methods": { "bulkMute": { @@ -1891,7 +1705,7 @@ "eventThreatDetectionSettings": { "methods": { "validateCustomModule": { - "description": "Validates the given Event Threat Detection Custom Module.", + "description": "Validates the given Event Threat Detection custom module.", "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings:validateCustomModule", "httpMethod": "POST", "id": "securitycenter.organizations.eventThreatDetectionSettings.validateCustomModule", @@ -1900,7 +1714,7 @@ ], "parameters": { "parent": { - "description": "Required. Resource name of the parent to validate the Custom Module under. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", + "description": "Required. Resource name of the parent to validate the Custom Module under. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\".", "location": "path", "pattern": "^organizations/[^/]+/eventThreatDetectionSettings$", "required": true, @@ -1923,7 +1737,7 @@ "customModules": { "methods": { "create": { - "description": "Creates an ETD custom module at the given level. Creating a module has a side-effect of creating modules at all descendants.", + "description": "Creates an Event Threat Detection custom module.", "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules", "httpMethod": "POST", "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.create", @@ -1932,7 +1746,7 @@ ], "parameters": { "parent": { - "description": "Required. The new custom module's parent. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", + "description": "Required. The new custom module's parent. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\".", "location": "path", "pattern": "^organizations/[^/]+/eventThreatDetectionSettings$", "required": true, @@ -1951,7 +1765,7 @@ ] }, "delete": { - "description": "Deletes an ETD custom module. Deletion at resident level also deletes modules at all descendants. Deletion at any other level is not supported.", + "description": "Deletes an Event Threat Detection custom module.", "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules/{customModulesId}", "httpMethod": "DELETE", "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.delete", @@ -1960,7 +1774,7 @@ ], "parameters": { "name": { - "description": "Required. Name of the custom module to delete. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", + "description": "Required. Name of the custom module to delete. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\".", "location": "path", "pattern": "^organizations/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", "required": true, @@ -1976,7 +1790,7 @@ ] }, "get": { - "description": "Gets an ETD custom module. Retrieves the module at the given level.", + "description": "Gets an Event Threat Detection custom module.", "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules/{customModulesId}", "httpMethod": "GET", "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.get", @@ -1985,7 +1799,7 @@ ], "parameters": { "name": { - "description": "Required. Name of the custom module to get. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", + "description": "Required. Name of the custom module to get. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\".", "location": "path", "pattern": "^organizations/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", "required": true, @@ -2001,7 +1815,7 @@ ] }, "list": { - "description": "Lists ETD custom modules. Retrieve all resident and inherited modules at the given level (no descendants).", + "description": "Lists Event Threat Detection custom modules.", "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules", "httpMethod": "GET", "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.list", @@ -2021,7 +1835,7 @@ "type": "string" }, "parent": { - "description": "Required. Name of the parent to list custom modules. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", + "description": "Required. Name of the parent to list custom modules under. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\".", "location": "path", "pattern": "^organizations/[^/]+/eventThreatDetectionSettings$", "required": true, @@ -2037,7 +1851,7 @@ ] }, "patch": { - "description": "Updates an ETD custom module at the given level. All config fields can be updated when updating the module at resident level. Only enablement state can be updated when updating the module at inherited levels. Updating the module has a side-effect that it updates all descendants that are inherited from this module.", + "description": "Updates an Event Threat Detection custom module.", "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules/{customModulesId}", "httpMethod": "PATCH", "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.patch", @@ -2540,105 +2354,257 @@ } } }, - "securityHealthAnalyticsSettings": { - "resources": { - "customModules": { - "methods": { - "create": { - "description": "Creates a resident SecurityHealthAnalyticsCustomModule at the scope of the given CRM parent, and also creates inherited SecurityHealthAnalyticsCustomModules for all CRM descendants of the given parent. These modules are enabled by default.", - "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules", - "httpMethod": "POST", - "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.create", - "parameterOrder": [ - "parent" - ], - "parameters": { - "parent": { - "description": "Required. Resource name of the new custom module's parent. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", - "location": "path", - "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings$", - "required": true, - "type": "string" - } - }, - "path": "v1/{+parent}/customModules", - "request": { - "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" - }, - "response": { - "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - "delete": { - "description": "Deletes the specified SecurityHealthAnalyticsCustomModule and all of its descendants in the CRM hierarchy. This method is only supported for resident custom modules.", - "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules/{customModulesId}", - "httpMethod": "DELETE", - "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.delete", - "parameterOrder": [ - "name" - ], - "parameters": { - "name": { - "description": "Required. Name of the custom module to delete. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}\", \"folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}\"", - "location": "path", - "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+$", - "required": true, - "type": "string" - } - }, - "path": "v1/{+name}", - "response": { - "$ref": "Empty" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - "get": { - "description": "Retrieves a SecurityHealthAnalyticsCustomModule.", - "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules/{customModulesId}", - "httpMethod": "GET", - "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.get", - "parameterOrder": [ - "name" - ], - "parameters": { - "name": { - "description": "Required. Name of the custom module to get. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}\", \"folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}\"", - "location": "path", - "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+$", - "required": true, - "type": "string" - } - }, - "path": "v1/{+name}", - "response": { - "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - "list": { - "description": "Returns a list of all SecurityHealthAnalyticsCustomModules for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from CRM ancestors.", - "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules", - "httpMethod": "GET", - "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.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 call indicating a continuation", + "resourceValueConfigs": { + "methods": { + "batchCreate": { + "description": "Creates a ResourceValueConfig for an organization. Maps user's tags to difference resource values for use by the attack path simulation.", + "flatPath": "v1/organizations/{organizationsId}/resourceValueConfigs:batchCreate", + "httpMethod": "POST", + "id": "securitycenter.organizations.resourceValueConfigs.batchCreate", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. Resource name of the new ResourceValueConfig's parent. The parent field in the CreateResourceValueConfigRequest messages must either be empty or match this field.", + "location": "path", + "pattern": "^organizations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/resourceValueConfigs:batchCreate", + "request": { + "$ref": "BatchCreateResourceValueConfigsRequest" + }, + "response": { + "$ref": "BatchCreateResourceValueConfigsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "description": "Deletes a ResourceValueConfig.", + "flatPath": "v1/organizations/{organizationsId}/resourceValueConfigs/{resourceValueConfigsId}", + "httpMethod": "DELETE", + "id": "securitycenter.organizations.resourceValueConfigs.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Name of the ResourceValueConfig to delete", + "location": "path", + "pattern": "^organizations/[^/]+/resourceValueConfigs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Gets a ResourceValueConfig.", + "flatPath": "v1/organizations/{organizationsId}/resourceValueConfigs/{resourceValueConfigsId}", + "httpMethod": "GET", + "id": "securitycenter.organizations.resourceValueConfigs.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Name of the resource value config to retrieve. Its format is organizations/{organization}/resourceValueConfigs/{config_id}.", + "location": "path", + "pattern": "^organizations/[^/]+/resourceValueConfigs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "GoogleCloudSecuritycenterV1ResourceValueConfig" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Lists all ResourceValueConfigs.", + "flatPath": "v1/organizations/{organizationsId}/resourceValueConfigs", + "httpMethod": "GET", + "id": "securitycenter.organizations.resourceValueConfigs.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "The number of results 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 `ListResourceValueConfigs` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListResourceValueConfigs` must match the call that provided the page token. page_size can be specified, and the new page_size will be used.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The parent, which owns the collection of resource value configs. Its format is \"organizations/[organization_id]\"", + "location": "path", + "pattern": "^organizations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/resourceValueConfigs", + "response": { + "$ref": "ListResourceValueConfigsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "patch": { + "description": "Updates an existing ResourceValueConfigs with new rules.", + "flatPath": "v1/organizations/{organizationsId}/resourceValueConfigs/{resourceValueConfigsId}", + "httpMethod": "PATCH", + "id": "securitycenter.organizations.resourceValueConfigs.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Name for the resource value config", + "location": "path", + "pattern": "^organizations/[^/]+/resourceValueConfigs/[^/]+$", + "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}", + "request": { + "$ref": "GoogleCloudSecuritycenterV1ResourceValueConfig" + }, + "response": { + "$ref": "GoogleCloudSecuritycenterV1ResourceValueConfig" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "securityHealthAnalyticsSettings": { + "resources": { + "customModules": { + "methods": { + "create": { + "description": "Creates a resident SecurityHealthAnalyticsCustomModule at the scope of the given CRM parent, and also creates inherited SecurityHealthAnalyticsCustomModules for all CRM descendants of the given parent. These modules are enabled by default.", + "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules", + "httpMethod": "POST", + "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. Resource name of the new custom module's parent. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", + "location": "path", + "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/customModules", + "request": { + "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" + }, + "response": { + "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "description": "Deletes the specified SecurityHealthAnalyticsCustomModule and all of its descendants in the CRM hierarchy. This method is only supported for resident custom modules.", + "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules/{customModulesId}", + "httpMethod": "DELETE", + "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Name of the custom module to delete. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}\", \"folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}\"", + "location": "path", + "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Retrieves a SecurityHealthAnalyticsCustomModule.", + "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules/{customModulesId}", + "httpMethod": "GET", + "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Name of the custom module to get. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}\", \"folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}\"", + "location": "path", + "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Returns a list of all SecurityHealthAnalyticsCustomModules for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from CRM ancestors.", + "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules", + "httpMethod": "GET", + "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.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 call indicating a continuation", "location": "query", "type": "string" }, @@ -2797,6 +2763,268 @@ } } }, + "simulations": { + "methods": { + "get": { + "description": "Get the simulation by name or the latest simulation for the given organization.", + "flatPath": "v1/organizations/{organizationsId}/simulations/{simulationsId}", + "httpMethod": "GET", + "id": "securitycenter.organizations.simulations.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The organization name or simulation name of this simulation Valid format: \"organizations/{organization}/simulations/latest\" \"organizations/{organization}/simulations/{simulation}\"", + "location": "path", + "pattern": "^organizations/[^/]+/simulations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "Simulation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + }, + "resources": { + "attackExposureResults": { + "resources": { + "attackPaths": { + "methods": { + "list": { + "description": "Lists the attack paths for a set of simulation results or valued resources and filter.", + "flatPath": "v1/organizations/{organizationsId}/simulations/{simulationsId}/attackExposureResults/{attackExposureResultsId}/attackPaths", + "httpMethod": "GET", + "id": "securitycenter.organizations.simulations.attackExposureResults.attackPaths.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "filter": { + "description": "The filter expression that filters the attack path in the response. Supported fields: * `valued_resources` supports =", + "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 `ListAttackPathsResponse`; indicates that this is a continuation of a prior `ListAttackPaths` call, and that the system should return the next page of data.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. Name of parent to list attack paths. Valid formats: \"organizations/{organization}\", \"organizations/{organization}/simulations/{simulation}\" \"organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}\" \"organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}\"", + "location": "path", + "pattern": "^organizations/[^/]+/simulations/[^/]+/attackExposureResults/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/attackPaths", + "response": { + "$ref": "ListAttackPathsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "valuedResources": { + "methods": { + "list": { + "description": "Lists the valued resources for a set of simulation results and filter.", + "flatPath": "v1/organizations/{organizationsId}/simulations/{simulationsId}/attackExposureResults/{attackExposureResultsId}/valuedResources", + "httpMethod": "GET", + "id": "securitycenter.organizations.simulations.attackExposureResults.valuedResources.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "filter": { + "description": "The filter expression that filters the valued resources in the response. Supported fields: * `resource_value` supports = * `resource_type` supports =", + "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 `ListValuedResourcesResponse`; indicates that this is a continuation of a prior `ListValuedResources` call, and that the system should return the next page of data.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. Name of parent to list valued resources. Valid formats: \"organizations/{organization}\", \"organizations/{organization}/simulations/{simulation}\" \"organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}\"", + "location": "path", + "pattern": "^organizations/[^/]+/simulations/[^/]+/attackExposureResults/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/valuedResources", + "response": { + "$ref": "ListValuedResourcesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } + }, + "attackPaths": { + "methods": { + "list": { + "description": "Lists the attack paths for a set of simulation results or valued resources and filter.", + "flatPath": "v1/organizations/{organizationsId}/simulations/{simulationsId}/attackPaths", + "httpMethod": "GET", + "id": "securitycenter.organizations.simulations.attackPaths.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "filter": { + "description": "The filter expression that filters the attack path in the response. Supported fields: * `valued_resources` supports =", + "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 `ListAttackPathsResponse`; indicates that this is a continuation of a prior `ListAttackPaths` call, and that the system should return the next page of data.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. Name of parent to list attack paths. Valid formats: \"organizations/{organization}\", \"organizations/{organization}/simulations/{simulation}\" \"organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}\" \"organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}\"", + "location": "path", + "pattern": "^organizations/[^/]+/simulations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/attackPaths", + "response": { + "$ref": "ListAttackPathsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "valuedResources": { + "methods": { + "list": { + "description": "Lists the valued resources for a set of simulation results and filter.", + "flatPath": "v1/organizations/{organizationsId}/simulations/{simulationsId}/valuedResources", + "httpMethod": "GET", + "id": "securitycenter.organizations.simulations.valuedResources.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "filter": { + "description": "The filter expression that filters the valued resources in the response. Supported fields: * `resource_value` supports = * `resource_type` supports =", + "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 `ListValuedResourcesResponse`; indicates that this is a continuation of a prior `ListValuedResources` call, and that the system should return the next page of data.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. Name of parent to list valued resources. Valid formats: \"organizations/{organization}\", \"organizations/{organization}/simulations/{simulation}\" \"organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}\"", + "location": "path", + "pattern": "^organizations/[^/]+/simulations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/valuedResources", + "response": { + "$ref": "ListValuedResourcesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + }, + "resources": { + "attackPaths": { + "methods": { + "list": { + "description": "Lists the attack paths for a set of simulation results or valued resources and filter.", + "flatPath": "v1/organizations/{organizationsId}/simulations/{simulationsId}/valuedResources/{valuedResourcesId}/attackPaths", + "httpMethod": "GET", + "id": "securitycenter.organizations.simulations.valuedResources.attackPaths.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "filter": { + "description": "The filter expression that filters the attack path in the response. Supported fields: * `valued_resources` supports =", + "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 `ListAttackPathsResponse`; indicates that this is a continuation of a prior `ListAttackPaths` call, and that the system should return the next page of data.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. Name of parent to list attack paths. Valid formats: \"organizations/{organization}\", \"organizations/{organization}/simulations/{simulation}\" \"organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}\" \"organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}\"", + "location": "path", + "pattern": "^organizations/[^/]+/simulations/[^/]+/valuedResources/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/attackPaths", + "response": { + "$ref": "ListAttackPathsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } + } + } + }, "sources": { "methods": { "create": { @@ -3595,203 +3823,17 @@ "type": "string" } }, - "path": "v1/{+name}", - "request": { - "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" - }, - "response": { - "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - } - } - }, - "eventThreatDetectionSettings": { - "methods": { - "validateCustomModule": { - "description": "Validates the given Event Threat Detection Custom Module.", - "flatPath": "v1/projects/{projectsId}/eventThreatDetectionSettings:validateCustomModule", - "httpMethod": "POST", - "id": "securitycenter.projects.eventThreatDetectionSettings.validateCustomModule", - "parameterOrder": [ - "parent" - ], - "parameters": { - "parent": { - "description": "Required. Resource name of the parent to validate the Custom Module under. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", - "location": "path", - "pattern": "^projects/[^/]+/eventThreatDetectionSettings$", - "required": true, - "type": "string" - } - }, - "path": "v1/{+parent}:validateCustomModule", + "path": "v1/{+name}", "request": { - "$ref": "ValidateEventThreatDetectionCustomModuleRequest" + "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" }, "response": { - "$ref": "ValidateEventThreatDetectionCustomModuleResponse" + "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ] } - }, - "resources": { - "customModules": { - "methods": { - "create": { - "description": "Creates an ETD custom module at the given level. Creating a module has a side-effect of creating modules at all descendants.", - "flatPath": "v1/projects/{projectsId}/eventThreatDetectionSettings/customModules", - "httpMethod": "POST", - "id": "securitycenter.projects.eventThreatDetectionSettings.customModules.create", - "parameterOrder": [ - "parent" - ], - "parameters": { - "parent": { - "description": "Required. The new custom module's parent. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", - "location": "path", - "pattern": "^projects/[^/]+/eventThreatDetectionSettings$", - "required": true, - "type": "string" - } - }, - "path": "v1/{+parent}/customModules", - "request": { - "$ref": "EventThreatDetectionCustomModule" - }, - "response": { - "$ref": "EventThreatDetectionCustomModule" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - "delete": { - "description": "Deletes an ETD custom module. Deletion at resident level also deletes modules at all descendants. Deletion at any other level is not supported.", - "flatPath": "v1/projects/{projectsId}/eventThreatDetectionSettings/customModules/{customModulesId}", - "httpMethod": "DELETE", - "id": "securitycenter.projects.eventThreatDetectionSettings.customModules.delete", - "parameterOrder": [ - "name" - ], - "parameters": { - "name": { - "description": "Required. Name of the custom module to delete. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", - "location": "path", - "pattern": "^projects/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", - "required": true, - "type": "string" - } - }, - "path": "v1/{+name}", - "response": { - "$ref": "Empty" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - "get": { - "description": "Gets an ETD custom module. Retrieves the module at the given level.", - "flatPath": "v1/projects/{projectsId}/eventThreatDetectionSettings/customModules/{customModulesId}", - "httpMethod": "GET", - "id": "securitycenter.projects.eventThreatDetectionSettings.customModules.get", - "parameterOrder": [ - "name" - ], - "parameters": { - "name": { - "description": "Required. Name of the custom module to get. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", - "location": "path", - "pattern": "^projects/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", - "required": true, - "type": "string" - } - }, - "path": "v1/{+name}", - "response": { - "$ref": "EventThreatDetectionCustomModule" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - "list": { - "description": "Lists ETD custom modules. Retrieve all resident and inherited modules at the given level (no descendants).", - "flatPath": "v1/projects/{projectsId}/eventThreatDetectionSettings/customModules", - "httpMethod": "GET", - "id": "securitycenter.projects.eventThreatDetectionSettings.customModules.list", - "parameterOrder": [ - "parent" - ], - "parameters": { - "pageSize": { - "description": "The maximum number of modules 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 `ListEventThreatDetectionCustomModules` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListEventThreatDetectionCustomModules` must match the call that provided the page token.", - "location": "query", - "type": "string" - }, - "parent": { - "description": "Required. Name of the parent to list custom modules. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", - "location": "path", - "pattern": "^projects/[^/]+/eventThreatDetectionSettings$", - "required": true, - "type": "string" - } - }, - "path": "v1/{+parent}/customModules", - "response": { - "$ref": "ListEventThreatDetectionCustomModulesResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - "patch": { - "description": "Updates an ETD custom module at the given level. All config fields can be updated when updating the module at resident level. Only enablement state can be updated when updating the module at inherited levels. Updating the module has a side-effect that it updates all descendants that are inherited from this module.", - "flatPath": "v1/projects/{projectsId}/eventThreatDetectionSettings/customModules/{customModulesId}", - "httpMethod": "PATCH", - "id": "securitycenter.projects.eventThreatDetectionSettings.customModules.patch", - "parameterOrder": [ - "name" - ], - "parameters": { - "name": { - "description": "Immutable. The resource name of the Event Threat Detection custom module. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", - "location": "path", - "pattern": "^projects/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", - "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}", - "request": { - "$ref": "EventThreatDetectionCustomModule" - }, - "response": { - "$ref": "EventThreatDetectionCustomModule" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - } - } - } } }, "findings": { @@ -4708,7 +4750,7 @@ } } }, - "revision": "20230721", + "revision": "20230727", "rootUrl": "https://securitycenter.googleapis.com/", "schemas": { "Access": { @@ -4793,88 +4835,259 @@ "description": "A Kubernetes resource API verb, like get, list, watch, create, update, delete, proxy. \"*\" means all.", "type": "string" }, - "version": { - "description": "The API version of the resource. \"*\" means all.", + "version": { + "description": "The API version of the resource. \"*\" means all.", + "type": "string" + } + }, + "type": "object" + }, + "Asset": { + "description": "Security Command Center representation of a Google Cloud resource. The Asset is a Security Command Center resource that captures information about a single Google Cloud resource. All modifications to an Asset are only within the context of Security Command Center and don't affect the referenced Google Cloud resource.", + "id": "Asset", + "properties": { + "canonicalName": { + "description": "The canonical name of the resource. It's either \"organizations/{organization_id}/assets/{asset_id}\", \"folders/{folder_id}/assets/{asset_id}\" or \"projects/{project_number}/assets/{asset_id}\", depending on the closest CRM ancestor of the resource.", + "type": "string" + }, + "createTime": { + "description": "The time at which the asset was created in Security Command Center.", + "format": "google-datetime", + "type": "string" + }, + "iamPolicy": { + "$ref": "IamPolicy", + "description": "Cloud IAM Policy information associated with the Google Cloud resource described by the Security Command Center asset. This information is managed and defined by the Google Cloud resource and cannot be modified by the user." + }, + "name": { + "description": "The relative resource name of this asset. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/assets/{asset_id}\".", + "type": "string" + }, + "resourceProperties": { + "additionalProperties": { + "type": "any" + }, + "description": "Resource managed properties. These properties are managed and defined by the Google Cloud resource and cannot be modified by the user.", + "type": "object" + }, + "securityCenterProperties": { + "$ref": "SecurityCenterProperties", + "description": "Security Command Center managed properties. These properties are managed by Security Command Center and cannot be modified by the user." + }, + "securityMarks": { + "$ref": "SecurityMarks", + "description": "User specified security marks. These marks are entirely managed by the user and come from the SecurityMarks resource that belongs to the asset." + }, + "updateTime": { + "description": "The time at which the asset was last updated or added in Cloud SCC.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, + "AssetDiscoveryConfig": { + "description": "The configuration used for Asset Discovery runs.", + "id": "AssetDiscoveryConfig", + "properties": { + "folderIds": { + "description": "The folder ids to use for filtering asset discovery. It consists of only digits, e.g., 756619654966.", + "items": { + "type": "string" + }, + "type": "array" + }, + "inclusionMode": { + "description": "The mode to use for filtering asset discovery.", + "enum": [ + "INCLUSION_MODE_UNSPECIFIED", + "INCLUDE_ONLY", + "EXCLUDE" + ], + "enumDescriptions": [ + "Unspecified. Setting the mode with this value will disable inclusion/exclusion filtering for Asset Discovery.", + "Asset Discovery will capture only the resources within the projects specified. All other resources will be ignored.", + "Asset Discovery will ignore all resources under the projects specified. All other resources will be retrieved." + ], + "type": "string" + }, + "projectIds": { + "description": "The project ids to use for filtering asset discovery.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "AttackExposure": { + "description": "An attack exposure contains the results of an attack path simulation run.", + "id": "AttackExposure", + "properties": { + "attackExposureResult": { + "description": "The resource name of the attack path simulation result that contains the details regarding this attack exposure score. Example: organizations/123/attackExposureResults/456", + "type": "string" + }, + "exposedHighValueResourcesCount": { + "description": "The number of high value resources that are exposed as a result of this finding.", + "format": "int32", + "type": "integer" + }, + "exposedLowValueResourcesCount": { + "description": "The number of high value resources that are exposed as a result of this finding.", + "format": "int32", + "type": "integer" + }, + "exposedMediumValueResourcesCount": { + "description": "The number of medium value resources that are exposed as a result of this finding.", + "format": "int32", + "type": "integer" + }, + "latestCalculationTime": { + "description": "The most recent time the attack exposure was updated on this finding.", + "format": "google-datetime", + "type": "string" + }, + "score": { + "description": "A number between 0 (inclusive) and infinity that represents how important this finding is to remediate. The higher the score, the more important it is to remediate.", + "format": "double", + "type": "number" + }, + "state": { + "description": "What state this AttackExposure is in. This captures whether or not an attack exposure has been calculated or not.", + "enum": [ + "STATE_UNSPECIFIED", + "CALCULATED", + "NOT_CALCULATED" + ], + "enumDescriptions": [ + "The state is not specified.", + "The attack exposure has been calculated.", + "The attack exposure has not been calculated." + ], + "type": "string" + } + }, + "type": "object" + }, + "AttackPath": { + "description": "A path that an attacker could take to reach an exposed resource.", + "id": "AttackPath", + "properties": { + "edges": { + "description": "A list of the edges between nodes in this attack path.", + "items": { + "$ref": "AttackPathEdge" + }, + "type": "array" + }, + "name": { + "description": "The attack path name, for example, `organizations/12/simulation/34/valuedResources/56/attackPaths/78`", "type": "string" + }, + "pathNodes": { + "description": "A list of nodes that exist in this attack path.", + "items": { + "$ref": "AttackPathNode" + }, + "type": "array" } }, "type": "object" }, - "Asset": { - "description": "Security Command Center representation of a Google Cloud resource. The Asset is a Security Command Center resource that captures information about a single Google Cloud resource. All modifications to an Asset are only within the context of Security Command Center and don't affect the referenced Google Cloud resource.", - "id": "Asset", + "AttackPathEdge": { + "description": "Represents a connection between a source node and a destination node in this attack path.", + "id": "AttackPathEdge", "properties": { - "canonicalName": { - "description": "The canonical name of the resource. It's either \"organizations/{organization_id}/assets/{asset_id}\", \"folders/{folder_id}/assets/{asset_id}\" or \"projects/{project_number}/assets/{asset_id}\", depending on the closest CRM ancestor of the resource.", + "destination": { + "description": "The attack node uuid of the destination node.", "type": "string" }, - "createTime": { - "description": "The time at which the asset was created in Security Command Center.", - "format": "google-datetime", + "source": { + "description": "The attack node uuid of the source node.", "type": "string" + } + }, + "type": "object" + }, + "AttackPathNode": { + "description": "Represents one point that an attacker passes through in this attack path.", + "id": "AttackPathNode", + "properties": { + "associatedFindings": { + "description": "The findings associated with this node in the attack path.", + "items": { + "$ref": "PathNodeAssociatedFinding" + }, + "type": "array" }, - "iamPolicy": { - "$ref": "IamPolicy", - "description": "Cloud IAM Policy information associated with the Google Cloud resource described by the Security Command Center asset. This information is managed and defined by the Google Cloud resource and cannot be modified by the user." + "attackSteps": { + "description": "A list of attack step nodes that exist in this attack path node.", + "items": { + "$ref": "AttackStepNode" + }, + "type": "array" }, - "name": { - "description": "The relative resource name of this asset. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/assets/{asset_id}\".", + "displayName": { + "description": "Human-readable name of this resource.", "type": "string" }, - "resourceProperties": { - "additionalProperties": { - "type": "any" - }, - "description": "Resource managed properties. These properties are managed and defined by the Google Cloud resource and cannot be modified by the user.", - "type": "object" - }, - "securityCenterProperties": { - "$ref": "SecurityCenterProperties", - "description": "Security Command Center managed properties. These properties are managed by Security Command Center and cannot be modified by the user." + "resource": { + "description": "The name of the resource at this point in the attack path. The format of the name follows the Cloud Asset Inventory [resource name format](\"https://cloud.google.com/asset-inventory/docs/resource-name-format\")", + "type": "string" }, - "securityMarks": { - "$ref": "SecurityMarks", - "description": "User specified security marks. These marks are entirely managed by the user and come from the SecurityMarks resource that belongs to the asset." + "resourceType": { + "description": "The [supported resource type](http://cloud/asset-inventory/docs/supported-asset-types\")", + "type": "string" }, - "updateTime": { - "description": "The time at which the asset was last updated or added in Cloud SCC.", - "format": "google-datetime", + "uuid": { + "description": "Unique id of the attack path node.", "type": "string" } }, "type": "object" }, - "AssetDiscoveryConfig": { - "description": "The configuration used for Asset Discovery runs.", - "id": "AssetDiscoveryConfig", + "AttackStepNode": { + "description": "Detailed steps the attack can take between path nodes.", + "id": "AttackStepNode", "properties": { - "folderIds": { - "description": "The folder ids to use for filtering asset discovery. It consists of only digits, e.g., 756619654966.", - "items": { + "description": { + "description": "Attack step description", + "type": "string" + }, + "displayName": { + "description": "User friendly name of the attack step", + "type": "string" + }, + "labels": { + "additionalProperties": { "type": "string" }, - "type": "array" + "description": "Attack step labels for metadata", + "type": "object" }, - "inclusionMode": { - "description": "The mode to use for filtering asset discovery.", + "type": { + "description": "Attack step type. Can be either AND, OR or DEFENSE", "enum": [ - "INCLUSION_MODE_UNSPECIFIED", - "INCLUDE_ONLY", - "EXCLUDE" + "NODE_TYPE_UNSPECIFIED", + "NODE_TYPE_AND", + "NODE_TYPE_OR", + "NODE_TYPE_DEFENSE", + "NODE_TYPE_ATTACKER" ], "enumDescriptions": [ - "Unspecified. Setting the mode with this value will disable inclusion/exclusion filtering for Asset Discovery.", - "Asset Discovery will capture only the resources within the projects specified. All other resources will be ignored.", - "Asset Discovery will ignore all resources under the projects specified. All other resources will be retrieved." + "Type not specified", + "Incoming edge joined with AND", + "Incoming edge joined with OR", + "Incoming edge is defense", + "Incoming edge is attacker" ], "type": "string" }, - "projectIds": { - "description": "The project ids to use for filtering asset discovery.", - "items": { - "type": "string" - }, - "type": "array" + "uuid": { + "description": "Unique ID for one Node", + "type": "string" } }, "type": "object" @@ -4927,6 +5140,34 @@ }, "type": "object" }, + "BatchCreateResourceValueConfigsRequest": { + "description": "Request message to create multiple resource value configs", + "id": "BatchCreateResourceValueConfigsRequest", + "properties": { + "requests": { + "description": "Required. The resource value configs to be created.", + "items": { + "$ref": "CreateResourceValueConfigRequest" + }, + "type": "array" + } + }, + "type": "object" + }, + "BatchCreateResourceValueConfigsResponse": { + "description": "Response message for BatchCreateResourceValueConfigs", + "id": "BatchCreateResourceValueConfigsResponse", + "properties": { + "resourceValueConfigs": { + "description": "The resource value configs created", + "items": { + "$ref": "GoogleCloudSecuritycenterV1ResourceValueConfig" + }, + "type": "array" + } + }, + "type": "object" + }, "Binding": { "description": "Associates `members`, or principals, with a `role`.", "id": "Binding", @@ -5137,6 +5378,21 @@ }, "type": "object" }, + "CreateResourceValueConfigRequest": { + "description": "Request message to create single resource value config", + "id": "CreateResourceValueConfigRequest", + "properties": { + "parent": { + "description": "Required. Resource name of the new ResourceValueConfig's parent.", + "type": "string" + }, + "resourceValueConfig": { + "$ref": "GoogleCloudSecuritycenterV1ResourceValueConfig", + "description": "Required. The resource value config being created." + } + }, + "type": "object" + }, "CustomModuleValidationError": { "description": "An error encountered while validating the uploaded configuration of an Event Threat Detection Custom Module.", "id": "CustomModuleValidationError", @@ -5565,6 +5821,10 @@ "$ref": "Access", "description": "Access details associated with the finding, such as more information on the caller, which method was accessed, and from where." }, + "attackExposure": { + "$ref": "AttackExposure", + "description": "The results of an attack path simulation relevant to this finding." + }, "canonicalName": { "description": "The canonical name of the finding. It's either \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}\", \"folders/{folder_id}/sources/{source_id}/findings/{finding_id}\" or \"projects/{project_number}/sources/{source_id}/findings/{finding_id}\", depending on the closest CRM ancestor of the resource associated with the finding.", "type": "string" @@ -6188,6 +6448,73 @@ }, "type": "object" }, + "GoogleCloudSecuritycenterV1ResourceValueConfig": { + "description": "A resource value config is a mapping configuration of user's tag values to resource values. Used by the attack path simulation.", + "id": "GoogleCloudSecuritycenterV1ResourceValueConfig", + "properties": { + "createTime": { + "description": "Output only. Timestamp this resource value config was created.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "description": { + "description": "Description of the resource value config.", + "type": "string" + }, + "name": { + "description": "Name for the resource value config", + "type": "string" + }, + "resourceLabelsSelector": { + "additionalProperties": { + "type": "string" + }, + "description": "List of resource labels to search for, evaluated with AND. E.g. \"resource_labels_selector\": {\"key\": \"value\", \"env\": \"prod\"} will match resources with labels \"key\": \"value\" AND \"env\": \"prod\" https://cloud.google.com/resource-manager/docs/creating-managing-labels", + "type": "object" + }, + "resourceType": { + "description": "Apply resource_value only to resources that match resource_type. resource_type will be checked with \"AND\" of other resources. E.g. \"storage.googleapis.com/Bucket\" with resource_value \"HIGH\" will apply \"HIGH\" value only to \"storage.googleapis.com/Bucket\" resources.", + "type": "string" + }, + "resourceValue": { + "description": "Required. Resource value level this expression represents", + "enum": [ + "RESOURCE_VALUE_UNSPECIFIED", + "HIGH", + "MEDIUM", + "LOW", + "NONE" + ], + "enumDescriptions": [ + "Unspecific value", + "High resource value", + "Medium resource value", + "Low resource value", + "No resource value, e.g. ignore these resources" + ], + "type": "string" + }, + "scope": { + "description": "Project or folder to scope this config to. For example, \"project/456\" would apply this config only to resources in \"project/456\" scope will be checked with \"AND\" of other resources.", + "type": "string" + }, + "tagValues": { + "description": "Required. Tag values combined with AND to check against. Values in the form \"tagValues/123\" E.g. [ \"tagValues/123\", \"tagValues/456\", \"tagValues/789\" ] https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing", + "items": { + "type": "string" + }, + "type": "array" + }, + "updateTime": { + "description": "Output only. Timestamp this resource value config was last updated.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudSecuritycenterV1RunAssetDiscoveryResponse": { "description": "Response of asset discovery run", "id": "GoogleCloudSecuritycenterV1RunAssetDiscoveryResponse", @@ -6879,6 +7206,24 @@ }, "type": "object" }, + "ListAttackPathsResponse": { + "description": "Response message for listing the attack paths for a given simulation or valued resource.", + "id": "ListAttackPathsResponse", + "properties": { + "attackPaths": { + "description": "The attack paths that the attack path simulation identified.", + "items": { + "$ref": "AttackPath" + }, + "type": "array" + }, + "nextPageToken": { + "description": "Token to retrieve the next page of results, or empty if there are no more results.", + "type": "string" + } + }, + "type": "object" + }, "ListBigQueryExportsResponse": { "description": "Response message for listing BigQuery exports.", "id": "ListBigQueryExportsResponse", @@ -6934,7 +7279,7 @@ "type": "object" }, "ListEventThreatDetectionCustomModulesResponse": { - "description": "Response for listing EventThreatDetectionCustomModules.", + "description": "Response for listing Event Threat Detection custom modules.", "id": "ListEventThreatDetectionCustomModulesResponse", "properties": { "eventThreatDetectionCustomModules": { @@ -7067,6 +7412,24 @@ }, "type": "object" }, + "ListResourceValueConfigsResponse": { + "description": "Response message to list resource value configs", + "id": "ListResourceValueConfigsResponse", + "properties": { + "nextPageToken": { + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is empty, there are no subsequent pages.", + "type": "string" + }, + "resourceValueConfigs": { + "description": "The resource value configs from the specified parent.", + "items": { + "$ref": "GoogleCloudSecuritycenterV1ResourceValueConfig" + }, + "type": "array" + } + }, + "type": "object" + }, "ListSecurityHealthAnalyticsCustomModulesResponse": { "description": "Response message for listing Security Health Analytics custom modules.", "id": "ListSecurityHealthAnalyticsCustomModulesResponse", @@ -7103,6 +7466,29 @@ }, "type": "object" }, + "ListValuedResourcesResponse": { + "description": "Response message for listing the valued resources for a given simulation.", + "id": "ListValuedResourcesResponse", + "properties": { + "nextPageToken": { + "description": "Token to retrieve the next page of results, or empty if there are no more results.", + "type": "string" + }, + "totalSize": { + "description": "The estimated total number of results matching the query.", + "format": "int32", + "type": "integer" + }, + "valuedResources": { + "description": "The valued resources that the attack path simulation identified.", + "items": { + "$ref": "ValuedResource" + }, + "type": "array" + } + }, + "type": "object" + }, "MemoryHashSignature": { "description": "A signature corresponding to memory page hashes.", "id": "MemoryHashSignature", @@ -7492,6 +7878,25 @@ }, "type": "object" }, + "PathNodeAssociatedFinding": { + "description": "A finding that is associated with this node in the attack path.", + "id": "PathNodeAssociatedFinding", + "properties": { + "canonicalFinding": { + "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" + }, + "name": { + "description": "Full resource name of the finding.", + "type": "string" + } + }, + "type": "object" + }, "Pod": { "description": "A Kubernetes Pod.", "id": "Pod", @@ -7697,6 +8102,17 @@ }, "type": "object" }, + "ResourceValueConfigMetadata": { + "description": "Metadata about a ResourceValueConfig. For example, id and name.", + "id": "ResourceValueConfigMetadata", + "properties": { + "name": { + "description": "Resource value config name", + "type": "string" + } + }, + "type": "object" + }, "Role": { "description": "Kubernetes Role or ClusterRole.", "id": "Role", @@ -7883,6 +8299,30 @@ }, "type": "object" }, + "Simulation": { + "description": "Attack path simulation", + "id": "Simulation", + "properties": { + "createTime": { + "description": "Output only. Time simulation was created", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "name": { + "description": "Full resource name of the Simulation: organizations/123/simulations/456", + "type": "string" + }, + "resourceValueConfigsMetadata": { + "description": "Resource value configurations' metadata used in this simulation. Maximum of 100.", + "items": { + "$ref": "ResourceValueConfigMetadata" + }, + "type": "array" + } + }, + "type": "object" + }, "Source": { "description": "Security Command Center finding source. A finding source is an entity or a mechanism that can produce a finding. A source is like a container of findings that come from the same scanner, logger, monitor, and other tools.", "id": "Source", @@ -8004,7 +8444,7 @@ "type": "object" }, "ValidateEventThreatDetectionCustomModuleRequest": { - "description": "Request to validate an EventThreatDetectionCustomModule.", + "description": "Request to validate an Event Threat Detection custom module.", "id": "ValidateEventThreatDetectionCustomModuleRequest", "properties": { "rawText": { @@ -8019,7 +8459,7 @@ "type": "object" }, "ValidateEventThreatDetectionCustomModuleResponse": { - "description": "Response to validating an Event Threat Detection Custom Module.", + "description": "Response to validating an Event Threat Detection custom module.", "id": "ValidateEventThreatDetectionCustomModuleResponse", "properties": { "errors": { @@ -8029,6 +8469,57 @@ }, "type": "object" }, + "ValuedResource": { + "description": "A resource that is determined to have value to a user's system", + "id": "ValuedResource", + "properties": { + "displayName": { + "description": "Human-readable name of the valued resource.", + "type": "string" + }, + "exposedScore": { + "description": "Exposed score for this valued resource. A value of 0 means no exposure was detected exposure.", + "format": "double", + "type": "number" + }, + "name": { + "description": "Valued resource name, for example, e.g.: `organizations/123/simulations/456/valuedResources/789`", + "type": "string" + }, + "resource": { + "description": "The [full resource name](https://cloud.google.com/apis/design/resource_names#full_resource_name) of the valued resource.", + "type": "string" + }, + "resourceType": { + "description": "The [resource type](https://cloud.google.com/asset-inventory/docs/supported-asset-types) of the valued resource.", + "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" + }, + "resourceValueConfigsUsed": { + "description": "List of resource value configurations' metadata used to determine the value of this resource. Maximum of 100.", + "items": { + "$ref": "ResourceValueConfigMetadata" + }, + "type": "array" + } + }, + "type": "object" + }, "Vulnerability": { "description": "Refers to common vulnerability fields e.g. cve, cvss, cwe etc.", "id": "Vulnerability", diff --git a/securitycenter/v1/securitycenter-gen.go b/securitycenter/v1/securitycenter-gen.go index 6d5bce632a4..02eeca32dd4 100644 --- a/securitycenter/v1/securitycenter-gen.go +++ b/securitycenter/v1/securitycenter-gen.go @@ -148,7 +148,6 @@ func NewFoldersService(s *Service) *FoldersService { rs := &FoldersService{s: s} rs.Assets = NewFoldersAssetsService(s) rs.BigQueryExports = NewFoldersBigQueryExportsService(s) - rs.EventThreatDetectionSettings = NewFoldersEventThreatDetectionSettingsService(s) rs.Findings = NewFoldersFindingsService(s) rs.MuteConfigs = NewFoldersMuteConfigsService(s) rs.NotificationConfigs = NewFoldersNotificationConfigsService(s) @@ -164,8 +163,6 @@ type FoldersService struct { BigQueryExports *FoldersBigQueryExportsService - EventThreatDetectionSettings *FoldersEventThreatDetectionSettingsService - Findings *FoldersFindingsService MuteConfigs *FoldersMuteConfigsService @@ -195,27 +192,6 @@ type FoldersBigQueryExportsService struct { s *Service } -func NewFoldersEventThreatDetectionSettingsService(s *Service) *FoldersEventThreatDetectionSettingsService { - rs := &FoldersEventThreatDetectionSettingsService{s: s} - rs.CustomModules = NewFoldersEventThreatDetectionSettingsCustomModulesService(s) - return rs -} - -type FoldersEventThreatDetectionSettingsService struct { - s *Service - - CustomModules *FoldersEventThreatDetectionSettingsCustomModulesService -} - -func NewFoldersEventThreatDetectionSettingsCustomModulesService(s *Service) *FoldersEventThreatDetectionSettingsCustomModulesService { - rs := &FoldersEventThreatDetectionSettingsCustomModulesService{s: s} - return rs -} - -type FoldersEventThreatDetectionSettingsCustomModulesService struct { - s *Service -} - func NewFoldersFindingsService(s *Service) *FoldersFindingsService { rs := &FoldersFindingsService{s: s} return rs @@ -318,7 +294,9 @@ func NewOrganizationsService(s *Service) *OrganizationsService { rs.MuteConfigs = NewOrganizationsMuteConfigsService(s) rs.NotificationConfigs = NewOrganizationsNotificationConfigsService(s) rs.Operations = NewOrganizationsOperationsService(s) + rs.ResourceValueConfigs = NewOrganizationsResourceValueConfigsService(s) rs.SecurityHealthAnalyticsSettings = NewOrganizationsSecurityHealthAnalyticsSettingsService(s) + rs.Simulations = NewOrganizationsSimulationsService(s) rs.Sources = NewOrganizationsSourcesService(s) return rs } @@ -340,8 +318,12 @@ type OrganizationsService struct { Operations *OrganizationsOperationsService + ResourceValueConfigs *OrganizationsResourceValueConfigsService + SecurityHealthAnalyticsSettings *OrganizationsSecurityHealthAnalyticsSettingsService + Simulations *OrganizationsSimulationsService + Sources *OrganizationsSourcesService } @@ -420,6 +402,15 @@ type OrganizationsOperationsService struct { s *Service } +func NewOrganizationsResourceValueConfigsService(s *Service) *OrganizationsResourceValueConfigsService { + rs := &OrganizationsResourceValueConfigsService{s: s} + return rs +} + +type OrganizationsResourceValueConfigsService struct { + s *Service +} + func NewOrganizationsSecurityHealthAnalyticsSettingsService(s *Service) *OrganizationsSecurityHealthAnalyticsSettingsService { rs := &OrganizationsSecurityHealthAnalyticsSettingsService{s: s} rs.CustomModules = NewOrganizationsSecurityHealthAnalyticsSettingsCustomModulesService(s) @@ -453,6 +444,87 @@ type OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesService s s *Service } +func NewOrganizationsSimulationsService(s *Service) *OrganizationsSimulationsService { + rs := &OrganizationsSimulationsService{s: s} + rs.AttackExposureResults = NewOrganizationsSimulationsAttackExposureResultsService(s) + rs.AttackPaths = NewOrganizationsSimulationsAttackPathsService(s) + rs.ValuedResources = NewOrganizationsSimulationsValuedResourcesService(s) + return rs +} + +type OrganizationsSimulationsService struct { + s *Service + + AttackExposureResults *OrganizationsSimulationsAttackExposureResultsService + + AttackPaths *OrganizationsSimulationsAttackPathsService + + ValuedResources *OrganizationsSimulationsValuedResourcesService +} + +func NewOrganizationsSimulationsAttackExposureResultsService(s *Service) *OrganizationsSimulationsAttackExposureResultsService { + rs := &OrganizationsSimulationsAttackExposureResultsService{s: s} + rs.AttackPaths = NewOrganizationsSimulationsAttackExposureResultsAttackPathsService(s) + rs.ValuedResources = NewOrganizationsSimulationsAttackExposureResultsValuedResourcesService(s) + return rs +} + +type OrganizationsSimulationsAttackExposureResultsService struct { + s *Service + + AttackPaths *OrganizationsSimulationsAttackExposureResultsAttackPathsService + + ValuedResources *OrganizationsSimulationsAttackExposureResultsValuedResourcesService +} + +func NewOrganizationsSimulationsAttackExposureResultsAttackPathsService(s *Service) *OrganizationsSimulationsAttackExposureResultsAttackPathsService { + rs := &OrganizationsSimulationsAttackExposureResultsAttackPathsService{s: s} + return rs +} + +type OrganizationsSimulationsAttackExposureResultsAttackPathsService struct { + s *Service +} + +func NewOrganizationsSimulationsAttackExposureResultsValuedResourcesService(s *Service) *OrganizationsSimulationsAttackExposureResultsValuedResourcesService { + rs := &OrganizationsSimulationsAttackExposureResultsValuedResourcesService{s: s} + return rs +} + +type OrganizationsSimulationsAttackExposureResultsValuedResourcesService struct { + s *Service +} + +func NewOrganizationsSimulationsAttackPathsService(s *Service) *OrganizationsSimulationsAttackPathsService { + rs := &OrganizationsSimulationsAttackPathsService{s: s} + return rs +} + +type OrganizationsSimulationsAttackPathsService struct { + s *Service +} + +func NewOrganizationsSimulationsValuedResourcesService(s *Service) *OrganizationsSimulationsValuedResourcesService { + rs := &OrganizationsSimulationsValuedResourcesService{s: s} + rs.AttackPaths = NewOrganizationsSimulationsValuedResourcesAttackPathsService(s) + return rs +} + +type OrganizationsSimulationsValuedResourcesService struct { + s *Service + + AttackPaths *OrganizationsSimulationsValuedResourcesAttackPathsService +} + +func NewOrganizationsSimulationsValuedResourcesAttackPathsService(s *Service) *OrganizationsSimulationsValuedResourcesAttackPathsService { + rs := &OrganizationsSimulationsValuedResourcesAttackPathsService{s: s} + return rs +} + +type OrganizationsSimulationsValuedResourcesAttackPathsService struct { + s *Service +} + func NewOrganizationsSourcesService(s *Service) *OrganizationsSourcesService { rs := &OrganizationsSourcesService{s: s} rs.Findings = NewOrganizationsSourcesFindingsService(s) @@ -490,7 +562,6 @@ func NewProjectsService(s *Service) *ProjectsService { rs := &ProjectsService{s: s} rs.Assets = NewProjectsAssetsService(s) rs.BigQueryExports = NewProjectsBigQueryExportsService(s) - rs.EventThreatDetectionSettings = NewProjectsEventThreatDetectionSettingsService(s) rs.Findings = NewProjectsFindingsService(s) rs.MuteConfigs = NewProjectsMuteConfigsService(s) rs.NotificationConfigs = NewProjectsNotificationConfigsService(s) @@ -506,8 +577,6 @@ type ProjectsService struct { BigQueryExports *ProjectsBigQueryExportsService - EventThreatDetectionSettings *ProjectsEventThreatDetectionSettingsService - Findings *ProjectsFindingsService MuteConfigs *ProjectsMuteConfigsService @@ -537,27 +606,6 @@ type ProjectsBigQueryExportsService struct { s *Service } -func NewProjectsEventThreatDetectionSettingsService(s *Service) *ProjectsEventThreatDetectionSettingsService { - rs := &ProjectsEventThreatDetectionSettingsService{s: s} - rs.CustomModules = NewProjectsEventThreatDetectionSettingsCustomModulesService(s) - return rs -} - -type ProjectsEventThreatDetectionSettingsService struct { - s *Service - - CustomModules *ProjectsEventThreatDetectionSettingsCustomModulesService -} - -func NewProjectsEventThreatDetectionSettingsCustomModulesService(s *Service) *ProjectsEventThreatDetectionSettingsCustomModulesService { - rs := &ProjectsEventThreatDetectionSettingsCustomModulesService{s: s} - return rs -} - -type ProjectsEventThreatDetectionSettingsCustomModulesService struct { - s *Service -} - func NewProjectsFindingsService(s *Service) *ProjectsFindingsService { rs := &ProjectsFindingsService{s: s} return rs @@ -910,6 +958,250 @@ func (s *AssetDiscoveryConfig) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// AttackExposure: An attack exposure contains the results of an attack +// path simulation run. +type AttackExposure struct { + // AttackExposureResult: The resource name of the attack path simulation + // result that contains the details regarding this attack exposure + // score. Example: organizations/123/attackExposureResults/456 + AttackExposureResult string `json:"attackExposureResult,omitempty"` + + // ExposedHighValueResourcesCount: The number of high value resources + // that are exposed as a result of this finding. + ExposedHighValueResourcesCount int64 `json:"exposedHighValueResourcesCount,omitempty"` + + // ExposedLowValueResourcesCount: The number of high value resources + // that are exposed as a result of this finding. + ExposedLowValueResourcesCount int64 `json:"exposedLowValueResourcesCount,omitempty"` + + // ExposedMediumValueResourcesCount: The number of medium value + // resources that are exposed as a result of this finding. + ExposedMediumValueResourcesCount int64 `json:"exposedMediumValueResourcesCount,omitempty"` + + // LatestCalculationTime: The most recent time the attack exposure was + // updated on this finding. + LatestCalculationTime string `json:"latestCalculationTime,omitempty"` + + // Score: A number between 0 (inclusive) and infinity that represents + // how important this finding is to remediate. The higher the score, the + // more important it is to remediate. + Score float64 `json:"score,omitempty"` + + // State: What state this AttackExposure is in. This captures whether or + // not an attack exposure has been calculated or not. + // + // Possible values: + // "STATE_UNSPECIFIED" - The state is not specified. + // "CALCULATED" - The attack exposure has been calculated. + // "NOT_CALCULATED" - The attack exposure has not been calculated. + State string `json:"state,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "AttackExposureResult") 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. "AttackExposureResult") 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 *AttackExposure) MarshalJSON() ([]byte, error) { + type NoMethod AttackExposure + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +func (s *AttackExposure) UnmarshalJSON(data []byte) error { + type NoMethod AttackExposure + var s1 struct { + Score gensupport.JSONFloat64 `json:"score"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Score = float64(s1.Score) + return nil +} + +// AttackPath: A path that an attacker could take to reach an exposed +// resource. +type AttackPath struct { + // Edges: A list of the edges between nodes in this attack path. + Edges []*AttackPathEdge `json:"edges,omitempty"` + + // Name: The attack path name, for example, + // `organizations/12/simulation/34/valuedResources/56/attackPaths/78` + Name string `json:"name,omitempty"` + + // PathNodes: A list of nodes that exist in this attack path. + PathNodes []*AttackPathNode `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 *AttackPath) MarshalJSON() ([]byte, error) { + type NoMethod AttackPath + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// AttackPathEdge: Represents a connection between a source node and a +// destination node in this attack path. +type AttackPathEdge struct { + // Destination: The attack node uuid of the destination node. + Destination string `json:"destination,omitempty"` + + // Source: The attack node uuid 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 *AttackPathEdge) MarshalJSON() ([]byte, error) { + type NoMethod AttackPathEdge + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// AttackPathNode: Represents one point that an attacker passes through +// in this attack path. +type AttackPathNode struct { + // AssociatedFindings: The findings associated with this node in the + // attack path. + AssociatedFindings []*PathNodeAssociatedFinding `json:"associatedFindings,omitempty"` + + // AttackSteps: A list of attack step nodes that exist in this attack + // path node. + AttackSteps []*AttackStepNode `json:"attackSteps,omitempty"` + + // DisplayName: Human-readable name of this resource. + DisplayName string `json:"displayName,omitempty"` + + // Resource: The name of the resource at this point in the attack path. + // The format of the name follows the Cloud Asset Inventory resource + // name format + // ("https://cloud.google.com/asset-inventory/docs/resource-name-format") + Resource string `json:"resource,omitempty"` + + // ResourceType: The supported resource type + // (http://cloud/asset-inventory/docs/supported-asset-types") + ResourceType string `json:"resourceType,omitempty"` + + // Uuid: Unique id of the attack path node. + Uuid string `json:"uuid,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 *AttackPathNode) MarshalJSON() ([]byte, error) { + type NoMethod AttackPathNode + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// AttackStepNode: Detailed steps the attack can take between path +// nodes. +type AttackStepNode struct { + // Description: Attack step description + Description string `json:"description,omitempty"` + + // DisplayName: User friendly name of the attack step + DisplayName string `json:"displayName,omitempty"` + + // Labels: Attack step labels for metadata + Labels map[string]string `json:"labels,omitempty"` + + // Type: Attack step type. Can be either AND, OR or DEFENSE + // + // Possible values: + // "NODE_TYPE_UNSPECIFIED" - Type not specified + // "NODE_TYPE_AND" - Incoming edge joined with AND + // "NODE_TYPE_OR" - Incoming edge joined with OR + // "NODE_TYPE_DEFENSE" - Incoming edge is defense + // "NODE_TYPE_ATTACKER" - Incoming edge is attacker + Type string `json:"type,omitempty"` + + // Uuid: Unique ID for one Node + Uuid string `json:"uuid,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Description") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *AttackStepNode) MarshalJSON() ([]byte, error) { + type NoMethod AttackStepNode + 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 @@ -1007,33 +1299,97 @@ func (s *AuditLogConfig) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// Binding: Associates `members`, or principals, with a `role`. -type Binding struct { - // Condition: The condition that is associated with this binding. If the - // condition evaluates to `true`, then this binding applies to the - // current request. If the condition evaluates to `false`, then this - // binding does not apply to the current request. However, a different - // role binding might grant the same role to one or more of the - // principals in this binding. To learn which resources support - // conditions in their IAM policies, see the IAM documentation - // (https://cloud.google.com/iam/help/conditions/resource-policies). - Condition *Expr `json:"condition,omitempty"` +// BatchCreateResourceValueConfigsRequest: Request message to create +// multiple resource value configs +type BatchCreateResourceValueConfigsRequest struct { + // Requests: Required. The resource value configs to be created. + Requests []*CreateResourceValueConfigRequest `json:"requests,omitempty"` - // Members: Specifies the principals requesting access for a Google - // Cloud resource. `members` can have the following values: * - // `allUsers`: A special identifier that represents anyone who is on the - // internet; with or without a Google account. * - // `allAuthenticatedUsers`: A special identifier that represents anyone - // who is authenticated with a Google account or a service account. Does - // not include identities that come from external identity providers - // (IdPs) through identity federation. * `user:{emailid}`: An email - // address that represents a specific Google account. For example, - // `alice@example.com` . * `serviceAccount:{emailid}`: An email address - // that represents a Google service account. For example, - // `my-other-app@appspot.gserviceaccount.com`. * - // `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: - // An identifier for a Kubernetes service account - // (https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). + // ForceSendFields is a list of field names (e.g. "Requests") 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. "Requests") 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 *BatchCreateResourceValueConfigsRequest) MarshalJSON() ([]byte, error) { + type NoMethod BatchCreateResourceValueConfigsRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// BatchCreateResourceValueConfigsResponse: Response message for +// BatchCreateResourceValueConfigs +type BatchCreateResourceValueConfigsResponse struct { + // ResourceValueConfigs: The resource value configs created + ResourceValueConfigs []*GoogleCloudSecuritycenterV1ResourceValueConfig `json:"resourceValueConfigs,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "ResourceValueConfigs") 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. "ResourceValueConfigs") 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 *BatchCreateResourceValueConfigsResponse) MarshalJSON() ([]byte, error) { + type NoMethod BatchCreateResourceValueConfigsResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// Binding: Associates `members`, or principals, with a `role`. +type Binding struct { + // Condition: The condition that is associated with this binding. If the + // condition evaluates to `true`, then this binding applies to the + // current request. If the condition evaluates to `false`, then this + // binding does not apply to the current request. However, a different + // role binding might grant the same role to one or more of the + // principals in this binding. To learn which resources support + // conditions in their IAM policies, see the IAM documentation + // (https://cloud.google.com/iam/help/conditions/resource-policies). + Condition *Expr `json:"condition,omitempty"` + + // Members: Specifies the principals requesting access for a Google + // Cloud resource. `members` can have the following values: * + // `allUsers`: A special identifier that represents anyone who is on the + // internet; with or without a Google account. * + // `allAuthenticatedUsers`: A special identifier that represents anyone + // who is authenticated with a Google account or a service account. Does + // not include identities that come from external identity providers + // (IdPs) through identity federation. * `user:{emailid}`: An email + // address that represents a specific Google account. For example, + // `alice@example.com` . * `serviceAccount:{emailid}`: An email address + // that represents a Google service account. For example, + // `my-other-app@appspot.gserviceaccount.com`. * + // `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: + // An identifier for a Kubernetes service account + // (https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). // For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. // * `group:{emailid}`: An email address that represents a Google group. // For example, `admins@example.com`. * `domain:{domain}`: The G Suite @@ -1402,6 +1758,40 @@ func (s *Container) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// CreateResourceValueConfigRequest: Request message to create single +// resource value config +type CreateResourceValueConfigRequest struct { + // Parent: Required. Resource name of the new ResourceValueConfig's + // parent. + Parent string `json:"parent,omitempty"` + + // ResourceValueConfig: Required. The resource value config being + // created. + ResourceValueConfig *GoogleCloudSecuritycenterV1ResourceValueConfig `json:"resourceValueConfig,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Parent") 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. "Parent") 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 *CreateResourceValueConfigRequest) MarshalJSON() ([]byte, error) { + type NoMethod CreateResourceValueConfigRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // CustomModuleValidationError: An error encountered while validating // the uploaded configuration of an Event Threat Detection Custom // Module. @@ -2091,6 +2481,10 @@ type Finding struct { // information on the caller, which method was accessed, and from where. Access *Access `json:"access,omitempty"` + // AttackExposure: The results of an attack path simulation relevant to + // this finding. + AttackExposure *AttackExposure `json:"attackExposure,omitempty"` + // CanonicalName: The canonical name of the finding. It's either // "organizations/{organization_id}/sources/{source_id}/findings/{finding // _id}", @@ -3066,6 +3460,87 @@ func (s *GoogleCloudSecuritycenterV1ResourceSelector) MarshalJSON() ([]byte, err return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudSecuritycenterV1ResourceValueConfig: A resource value +// config is a mapping configuration of user's tag values to resource +// values. Used by the attack path simulation. +type GoogleCloudSecuritycenterV1ResourceValueConfig struct { + // CreateTime: Output only. Timestamp this resource value config was + // created. + CreateTime string `json:"createTime,omitempty"` + + // Description: Description of the resource value config. + Description string `json:"description,omitempty"` + + // Name: Name for the resource value config + Name string `json:"name,omitempty"` + + // ResourceLabelsSelector: List of resource labels to search for, + // evaluated with AND. E.g. "resource_labels_selector": {"key": "value", + // "env": "prod"} will match resources with labels "key": "value" AND + // "env": "prod" + // https://cloud.google.com/resource-manager/docs/creating-managing-labels + ResourceLabelsSelector map[string]string `json:"resourceLabelsSelector,omitempty"` + + // ResourceType: Apply resource_value only to resources that match + // resource_type. resource_type will be checked with "AND" of other + // resources. E.g. "storage.googleapis.com/Bucket" with resource_value + // "HIGH" will apply "HIGH" value only to + // "storage.googleapis.com/Bucket" resources. + ResourceType string `json:"resourceType,omitempty"` + + // ResourceValue: Required. Resource value level this expression + // represents + // + // Possible values: + // "RESOURCE_VALUE_UNSPECIFIED" - Unspecific value + // "HIGH" - High resource value + // "MEDIUM" - Medium resource value + // "LOW" - Low resource value + // "NONE" - No resource value, e.g. ignore these resources + ResourceValue string `json:"resourceValue,omitempty"` + + // Scope: Project or folder to scope this config to. For example, + // "project/456" would apply this config only to resources in + // "project/456" scope will be checked with "AND" of other resources. + Scope string `json:"scope,omitempty"` + + // TagValues: Required. Tag values combined with AND to check against. + // Values in the form "tagValues/123" E.g. [ "tagValues/123", + // "tagValues/456", "tagValues/789" ] + // https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing + TagValues []string `json:"tagValues,omitempty"` + + // UpdateTime: Output only. Timestamp this resource value config was + // last updated. + UpdateTime string `json:"updateTime,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudSecuritycenterV1ResourceValueConfig) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudSecuritycenterV1ResourceValueConfig + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudSecuritycenterV1RunAssetDiscoveryResponse: Response of // asset discovery run type GoogleCloudSecuritycenterV1RunAssetDiscoveryResponse struct { @@ -4260,6 +4735,44 @@ func (s *ListAssetsResult) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// ListAttackPathsResponse: Response message for listing the attack +// paths for a given simulation or valued resource. +type ListAttackPathsResponse struct { + // AttackPaths: The attack paths that the attack path simulation + // identified. + AttackPaths []*AttackPath `json:"attackPaths,omitempty"` + + // NextPageToken: Token to retrieve the next page of results, or empty + // if there are no more results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AttackPaths") 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. "AttackPaths") 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 *ListAttackPathsResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListAttackPathsResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // ListBigQueryExportsResponse: Response message for listing BigQuery // exports. type ListBigQueryExportsResponse struct { @@ -4380,7 +4893,7 @@ func (s *ListEffectiveSecurityHealthAnalyticsCustomModulesResponse) MarshalJSON( } // ListEventThreatDetectionCustomModulesResponse: Response for listing -// EventThreatDetectionCustomModules. +// Event Threat Detection custom modules. type ListEventThreatDetectionCustomModulesResponse struct { // EventThreatDetectionCustomModules: Custom modules belonging to the // requested parent. @@ -4621,6 +5134,44 @@ func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// ListResourceValueConfigsResponse: Response message to list resource +// value configs +type ListResourceValueConfigsResponse struct { + // NextPageToken: A token, which can be sent as `page_token` to retrieve + // the next page. If this field is empty, there are no subsequent pages. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ResourceValueConfigs: The resource value configs from the specified + // parent. + ResourceValueConfigs []*GoogleCloudSecuritycenterV1ResourceValueConfig `json:"resourceValueConfigs,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "NextPageToken") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ListResourceValueConfigsResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListResourceValueConfigsResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // ListSecurityHealthAnalyticsCustomModulesResponse: Response message // for listing Security Health Analytics custom modules. type ListSecurityHealthAnalyticsCustomModulesResponse struct { @@ -4695,6 +5246,47 @@ func (s *ListSourcesResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// ListValuedResourcesResponse: Response message for listing the valued +// resources for a given simulation. +type ListValuedResourcesResponse struct { + // NextPageToken: Token to retrieve the next page of results, or empty + // if there are no more results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // TotalSize: The estimated total number of results matching the query. + TotalSize int64 `json:"totalSize,omitempty"` + + // ValuedResources: The valued resources that the attack path simulation + // identified. + ValuedResources []*ValuedResource `json:"valuedResources,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "NextPageToken") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ListValuedResourcesResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListValuedResourcesResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // MemoryHashSignature: A signature corresponding to memory page hashes. type MemoryHashSignature struct { // BinaryFamily: The binary family. @@ -5118,6 +5710,44 @@ func (s *OrganizationSettings) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// PathNodeAssociatedFinding: A finding that is associated with this +// node in the attack path. +type PathNodeAssociatedFinding struct { + // CanonicalFinding: Canonical name of the associated findings. Example: + // organizations/123/sources/456/findings/789 + CanonicalFinding string `json:"canonicalFinding,omitempty"` + + // FindingCategory: The additional taxonomy group within findings from a + // given source. + FindingCategory string `json:"findingCategory,omitempty"` + + // Name: Full resource name of the finding. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CanonicalFinding") 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. "CanonicalFinding") 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 *PathNodeAssociatedFinding) MarshalJSON() ([]byte, error) { + type NoMethod PathNodeAssociatedFinding + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // Pod: A Kubernetes Pod. type Pod struct { // Containers: Pod containers associated with this finding, if any. @@ -5474,12 +6104,41 @@ func (s *Resource) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// Role: Kubernetes Role or ClusterRole. -type Role struct { - // Kind: Role type. - // - // Possible values: - // "KIND_UNSPECIFIED" - Role type is not specified. +// ResourceValueConfigMetadata: Metadata about a ResourceValueConfig. +// For example, id and name. +type ResourceValueConfigMetadata struct { + // Name: Resource value config name + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Name") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ResourceValueConfigMetadata) MarshalJSON() ([]byte, error) { + type NoMethod ResourceValueConfigMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// Role: Kubernetes Role or ClusterRole. +type Role struct { + // Kind: Role type. + // + // Possible values: + // "KIND_UNSPECIFIED" - Role type is not specified. // "ROLE" - Kubernetes Role. // "CLUSTER_ROLE" - Kubernetes ClusterRole. Kind string `json:"kind,omitempty"` @@ -5798,6 +6457,46 @@ func (s *SetMuteRequest) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// Simulation: Attack path simulation +type Simulation struct { + // CreateTime: Output only. Time simulation was created + CreateTime string `json:"createTime,omitempty"` + + // Name: Full resource name of the Simulation: + // organizations/123/simulations/456 + Name string `json:"name,omitempty"` + + // ResourceValueConfigsMetadata: Resource value configurations' metadata + // used in this simulation. Maximum of 100. + ResourceValueConfigsMetadata []*ResourceValueConfigMetadata `json:"resourceValueConfigsMetadata,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *Simulation) MarshalJSON() ([]byte, error) { + type NoMethod Simulation + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // Source: Security Command Center finding source. A finding source is // an entity or a mechanism that can produce a finding. A source is like // a container of findings that come from the same scanner, logger, @@ -6048,7 +6747,7 @@ func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) { } // ValidateEventThreatDetectionCustomModuleRequest: Request to validate -// an EventThreatDetectionCustomModule. +// an Event Threat Detection custom module. type ValidateEventThreatDetectionCustomModuleRequest struct { // RawText: Required. The raw text of the module's contents. Used to // generate error messages. @@ -6081,7 +6780,7 @@ func (s *ValidateEventThreatDetectionCustomModuleRequest) MarshalJSON() ([]byte, } // ValidateEventThreatDetectionCustomModuleResponse: Response to -// validating an Event Threat Detection Custom Module. +// validating an Event Threat Detection custom module. type ValidateEventThreatDetectionCustomModuleResponse struct { // Errors: A list of errors returned by the validator. If the list is // empty, there were no errors. @@ -6114,6 +6813,81 @@ func (s *ValidateEventThreatDetectionCustomModuleResponse) MarshalJSON() ([]byte return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// ValuedResource: A resource that is determined to have value to a +// user's system +type ValuedResource struct { + // DisplayName: Human-readable name of the valued resource. + DisplayName string `json:"displayName,omitempty"` + + // ExposedScore: Exposed score for this valued resource. A value of 0 + // means no exposure was detected exposure. + ExposedScore float64 `json:"exposedScore,omitempty"` + + // Name: Valued resource name, for example, e.g.: + // `organizations/123/simulations/456/valuedResources/789` + Name string `json:"name,omitempty"` + + // Resource: The full resource name + // (https://cloud.google.com/apis/design/resource_names#full_resource_name) + // of the valued resource. + Resource string `json:"resource,omitempty"` + + // ResourceType: The resource type + // (https://cloud.google.com/asset-inventory/docs/supported-asset-types) + // of the valued resource. + 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"` + + // ResourceValueConfigsUsed: List of resource value configurations' + // metadata used to determine the value of this resource. Maximum of + // 100. + ResourceValueConfigsUsed []*ResourceValueConfigMetadata `json:"resourceValueConfigsUsed,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 *ValuedResource) MarshalJSON() ([]byte, error) { + type NoMethod ValuedResource + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +func (s *ValuedResource) UnmarshalJSON(data []byte) error { + type NoMethod ValuedResource + var s1 struct { + ExposedScore gensupport.JSONFloat64 `json:"exposedScore"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.ExposedScore = float64(s1.ExposedScore) + return nil +} + // Vulnerability: Refers to common vulnerability fields e.g. cve, cvss, // cwe etc. type Vulnerability struct { @@ -7665,36 +8439,36 @@ func (c *FoldersBigQueryExportsPatchCall) Do(opts ...googleapi.CallOption) (*Goo } -// method id "securitycenter.folders.eventThreatDetectionSettings.validateCustomModule": +// method id "securitycenter.folders.findings.bulkMute": -type FoldersEventThreatDetectionSettingsValidateCustomModuleCall struct { - s *Service - parent string - validateeventthreatdetectioncustommodulerequest *ValidateEventThreatDetectionCustomModuleRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersFindingsBulkMuteCall struct { + s *Service + parent string + bulkmutefindingsrequest *BulkMuteFindingsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// ValidateCustomModule: Validates the given Event Threat Detection -// Custom Module. +// 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 parent to validate the Custom Module -// under. Its format is: * -// "organizations/{organization}/eventThreatDetectionSettings". * -// "folders/{folder}/eventThreatDetectionSettings". * -// "projects/{project}/eventThreatDetectionSettings". -func (r *FoldersEventThreatDetectionSettingsService) ValidateCustomModule(parent string, validateeventthreatdetectioncustommodulerequest *ValidateEventThreatDetectionCustomModuleRequest) *FoldersEventThreatDetectionSettingsValidateCustomModuleCall { - c := &FoldersEventThreatDetectionSettingsValidateCustomModuleCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - 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 *FoldersFindingsService) BulkMute(parent string, bulkmutefindingsrequest *BulkMuteFindingsRequest) *FoldersFindingsBulkMuteCall { + c := &FoldersFindingsBulkMuteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.validateeventthreatdetectioncustommodulerequest = validateeventthreatdetectioncustommodulerequest + 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 *FoldersEventThreatDetectionSettingsValidateCustomModuleCall) Fields(s ...googleapi.Field) *FoldersEventThreatDetectionSettingsValidateCustomModuleCall { +func (c *FoldersFindingsBulkMuteCall) Fields(s ...googleapi.Field) *FoldersFindingsBulkMuteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -7702,21 +8476,21 @@ func (c *FoldersEventThreatDetectionSettingsValidateCustomModuleCall) Fields(s . // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersEventThreatDetectionSettingsValidateCustomModuleCall) Context(ctx context.Context) *FoldersEventThreatDetectionSettingsValidateCustomModuleCall { +func (c *FoldersFindingsBulkMuteCall) Context(ctx context.Context) *FoldersFindingsBulkMuteCall { 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 *FoldersEventThreatDetectionSettingsValidateCustomModuleCall) Header() http.Header { +func (c *FoldersFindingsBulkMuteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersEventThreatDetectionSettingsValidateCustomModuleCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersFindingsBulkMuteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -7724,14 +8498,14 @@ func (c *FoldersEventThreatDetectionSettingsValidateCustomModuleCall) doRequest( } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.validateeventthreatdetectioncustommodulerequest) + 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}:validateCustomModule") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findings:bulkMute") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -7744,16 +8518,14 @@ func (c *FoldersEventThreatDetectionSettingsValidateCustomModuleCall) doRequest( return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.eventThreatDetectionSettings.validateCustomModule" call. -// Exactly one of *ValidateEventThreatDetectionCustomModuleResponse or -// error will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *ValidateEventThreatDetectionCustomModuleResponse.ServerResponse.Heade -// r or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *FoldersEventThreatDetectionSettingsValidateCustomModuleCall) Do(opts ...googleapi.CallOption) (*ValidateEventThreatDetectionCustomModuleResponse, error) { +// Do executes the "securitycenter.folders.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 *FoldersFindingsBulkMuteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7772,7 +8544,7 @@ func (c *FoldersEventThreatDetectionSettingsValidateCustomModuleCall) Do(opts .. if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ValidateEventThreatDetectionCustomModuleResponse{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7784,28 +8556,28 @@ func (c *FoldersEventThreatDetectionSettingsValidateCustomModuleCall) Do(opts .. } return ret, nil // { - // "description": "Validates the given Event Threat Detection Custom Module.", - // "flatPath": "v1/folders/{foldersId}/eventThreatDetectionSettings:validateCustomModule", + // "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/folders/{foldersId}/findings:bulkMute", // "httpMethod": "POST", - // "id": "securitycenter.folders.eventThreatDetectionSettings.validateCustomModule", + // "id": "securitycenter.folders.findings.bulkMute", // "parameterOrder": [ // "parent" // ], // "parameters": { // "parent": { - // "description": "Required. Resource name of the parent to validate the Custom Module under. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", + // "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": "^folders/[^/]+/eventThreatDetectionSettings$", + // "pattern": "^folders/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}:validateCustomModule", + // "path": "v1/{+parent}/findings:bulkMute", // "request": { - // "$ref": "ValidateEventThreatDetectionCustomModuleRequest" + // "$ref": "BulkMuteFindingsRequest" // }, // "response": { - // "$ref": "ValidateEventThreatDetectionCustomModuleResponse" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -7814,35 +8586,43 @@ func (c *FoldersEventThreatDetectionSettingsValidateCustomModuleCall) Do(opts .. } -// method id "securitycenter.folders.eventThreatDetectionSettings.customModules.create": +// method id "securitycenter.folders.muteConfigs.create": -type FoldersEventThreatDetectionSettingsCustomModulesCreateCall struct { - s *Service - parent string - eventthreatdetectioncustommodule *EventThreatDetectionCustomModule - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersMuteConfigsCreateCall struct { + s *Service + parent string + googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates an ETD custom module at the given level. Creating a -// module has a side-effect of creating modules at all descendants. +// Create: Creates a mute config. // -// - parent: The new custom module's parent. Its format is: * -// "organizations/{organization}/eventThreatDetectionSettings". * -// "folders/{folder}/eventThreatDetectionSettings". * -// "projects/{project}/eventThreatDetectionSettings". -func (r *FoldersEventThreatDetectionSettingsCustomModulesService) Create(parent string, eventthreatdetectioncustommodule *EventThreatDetectionCustomModule) *FoldersEventThreatDetectionSettingsCustomModulesCreateCall { - c := &FoldersEventThreatDetectionSettingsCustomModulesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - 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 *FoldersMuteConfigsService) Create(parent string, googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig) *FoldersMuteConfigsCreateCall { + c := &FoldersMuteConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.eventthreatdetectioncustommodule = eventthreatdetectioncustommodule + 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 only lowercase letters, numbers, and hyphens, must +// start with a letter, must end with either a letter or a number, and +// must be 63 characters or less. +func (c *FoldersMuteConfigsCreateCall) MuteConfigId(muteConfigId string) *FoldersMuteConfigsCreateCall { + 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 *FoldersEventThreatDetectionSettingsCustomModulesCreateCall) Fields(s ...googleapi.Field) *FoldersEventThreatDetectionSettingsCustomModulesCreateCall { +func (c *FoldersMuteConfigsCreateCall) Fields(s ...googleapi.Field) *FoldersMuteConfigsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -7850,21 +8630,21 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesCreateCall) Fields(s .. // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersEventThreatDetectionSettingsCustomModulesCreateCall) Context(ctx context.Context) *FoldersEventThreatDetectionSettingsCustomModulesCreateCall { +func (c *FoldersMuteConfigsCreateCall) Context(ctx context.Context) *FoldersMuteConfigsCreateCall { 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 *FoldersEventThreatDetectionSettingsCustomModulesCreateCall) Header() http.Header { +func (c *FoldersMuteConfigsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersEventThreatDetectionSettingsCustomModulesCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersMuteConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -7872,14 +8652,14 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesCreateCall) doRequest(a } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventthreatdetectioncustommodule) + 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}/customModules") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/muteConfigs") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -7892,14 +8672,15 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesCreateCall) doRequest(a return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.eventThreatDetectionSettings.customModules.create" call. -// Exactly one of *EventThreatDetectionCustomModule or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *EventThreatDetectionCustomModule.ServerResponse.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.folders.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 *FoldersEventThreatDetectionSettingsCustomModulesCreateCall) Do(opts ...googleapi.CallOption) (*EventThreatDetectionCustomModule, error) { +func (c *FoldersMuteConfigsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7918,7 +8699,7 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesCreateCall) Do(opts ... if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &EventThreatDetectionCustomModule{ + ret := &GoogleCloudSecuritycenterV1MuteConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7930,28 +8711,33 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesCreateCall) Do(opts ... } return ret, nil // { - // "description": "Creates an ETD custom module at the given level. Creating a module has a side-effect of creating modules at all descendants.", - // "flatPath": "v1/folders/{foldersId}/eventThreatDetectionSettings/customModules", + // "description": "Creates a mute config.", + // "flatPath": "v1/folders/{foldersId}/muteConfigs", // "httpMethod": "POST", - // "id": "securitycenter.folders.eventThreatDetectionSettings.customModules.create", + // "id": "securitycenter.folders.muteConfigs.create", // "parameterOrder": [ // "parent" // ], // "parameters": { + // "muteConfigId": { + // "description": "Required. Unique identifier provided by the client within the parent scope. It must consist of only lowercase letters, numbers, and hyphens, must start with a letter, must end with either a letter or a number, and must be 63 characters or less.", + // "location": "query", + // "type": "string" + // }, // "parent": { - // "description": "Required. The new custom module's parent. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", + // "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": "^folders/[^/]+/eventThreatDetectionSettings$", + // "pattern": "^folders/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/customModules", + // "path": "v1/{+parent}/muteConfigs", // "request": { - // "$ref": "EventThreatDetectionCustomModule" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "response": { - // "$ref": "EventThreatDetectionCustomModule" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -7960,9 +8746,9 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesCreateCall) Do(opts ... } -// method id "securitycenter.folders.eventThreatDetectionSettings.customModules.delete": +// method id "securitycenter.folders.muteConfigs.delete": -type FoldersEventThreatDetectionSettingsCustomModulesDeleteCall struct { +type FoldersMuteConfigsDeleteCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -7970,19 +8756,14 @@ type FoldersEventThreatDetectionSettingsCustomModulesDeleteCall struct { header_ http.Header } -// Delete: Deletes an ETD custom module. Deletion at resident level also -// deletes modules at all descendants. Deletion at any other level is -// not supported. +// Delete: Deletes an existing mute config. // -// - name: Name of the custom module to delete. Its format is: * -// "organizations/{organization}/eventThreatDetectionSettings/customMod -// ules/{module}". * -// "folders/{folder}/eventThreatDetectionSettings/customModules/{module -// }". * -// "projects/{project}/eventThreatDetectionSettings/customModules/{modu -// le}". -func (r *FoldersEventThreatDetectionSettingsCustomModulesService) Delete(name string) *FoldersEventThreatDetectionSettingsCustomModulesDeleteCall { - c := &FoldersEventThreatDetectionSettingsCustomModulesDeleteCall{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 *FoldersMuteConfigsService) Delete(name string) *FoldersMuteConfigsDeleteCall { + c := &FoldersMuteConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -7990,7 +8771,7 @@ func (r *FoldersEventThreatDetectionSettingsCustomModulesService) Delete(name st // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersEventThreatDetectionSettingsCustomModulesDeleteCall) Fields(s ...googleapi.Field) *FoldersEventThreatDetectionSettingsCustomModulesDeleteCall { +func (c *FoldersMuteConfigsDeleteCall) Fields(s ...googleapi.Field) *FoldersMuteConfigsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -7998,21 +8779,21 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesDeleteCall) Fields(s .. // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersEventThreatDetectionSettingsCustomModulesDeleteCall) Context(ctx context.Context) *FoldersEventThreatDetectionSettingsCustomModulesDeleteCall { +func (c *FoldersMuteConfigsDeleteCall) Context(ctx context.Context) *FoldersMuteConfigsDeleteCall { 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 *FoldersEventThreatDetectionSettingsCustomModulesDeleteCall) Header() http.Header { +func (c *FoldersMuteConfigsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersEventThreatDetectionSettingsCustomModulesDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersMuteConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -8035,14 +8816,14 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesDeleteCall) doRequest(a return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.eventThreatDetectionSettings.customModules.delete" call. +// Do executes the "securitycenter.folders.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 *FoldersEventThreatDetectionSettingsCustomModulesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +func (c *FoldersMuteConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8073,18 +8854,18 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesDeleteCall) Do(opts ... } return ret, nil // { - // "description": "Deletes an ETD custom module. Deletion at resident level also deletes modules at all descendants. Deletion at any other level is not supported.", - // "flatPath": "v1/folders/{foldersId}/eventThreatDetectionSettings/customModules/{customModulesId}", + // "description": "Deletes an existing mute config.", + // "flatPath": "v1/folders/{foldersId}/muteConfigs/{muteConfigsId}", // "httpMethod": "DELETE", - // "id": "securitycenter.folders.eventThreatDetectionSettings.customModules.delete", + // "id": "securitycenter.folders.muteConfigs.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the custom module to delete. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", + // "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": "^folders/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", + // "pattern": "^folders/[^/]+/muteConfigs/[^/]+$", // "required": true, // "type": "string" // } @@ -8100,9 +8881,9 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesDeleteCall) Do(opts ... } -// method id "securitycenter.folders.eventThreatDetectionSettings.customModules.get": +// method id "securitycenter.folders.muteConfigs.get": -type FoldersEventThreatDetectionSettingsCustomModulesGetCall struct { +type FoldersMuteConfigsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -8111,18 +8892,14 @@ type FoldersEventThreatDetectionSettingsCustomModulesGetCall struct { header_ http.Header } -// Get: Gets an ETD custom module. Retrieves the module at the given -// level. +// Get: Gets a mute config. // -// - name: Name of the custom module to get. Its format is: * -// "organizations/{organization}/eventThreatDetectionSettings/customMod -// ules/{module}". * -// "folders/{folder}/eventThreatDetectionSettings/customModules/{module -// }". * -// "projects/{project}/eventThreatDetectionSettings/customModules/{modu -// le}". -func (r *FoldersEventThreatDetectionSettingsCustomModulesService) Get(name string) *FoldersEventThreatDetectionSettingsCustomModulesGetCall { - c := &FoldersEventThreatDetectionSettingsCustomModulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - 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 *FoldersMuteConfigsService) Get(name string) *FoldersMuteConfigsGetCall { + c := &FoldersMuteConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -8130,7 +8907,7 @@ func (r *FoldersEventThreatDetectionSettingsCustomModulesService) Get(name strin // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersEventThreatDetectionSettingsCustomModulesGetCall) Fields(s ...googleapi.Field) *FoldersEventThreatDetectionSettingsCustomModulesGetCall { +func (c *FoldersMuteConfigsGetCall) Fields(s ...googleapi.Field) *FoldersMuteConfigsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -8140,7 +8917,7 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesGetCall) Fields(s ...go // 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 *FoldersEventThreatDetectionSettingsCustomModulesGetCall) IfNoneMatch(entityTag string) *FoldersEventThreatDetectionSettingsCustomModulesGetCall { +func (c *FoldersMuteConfigsGetCall) IfNoneMatch(entityTag string) *FoldersMuteConfigsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -8148,21 +8925,21 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesGetCall) IfNoneMatch(en // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersEventThreatDetectionSettingsCustomModulesGetCall) Context(ctx context.Context) *FoldersEventThreatDetectionSettingsCustomModulesGetCall { +func (c *FoldersMuteConfigsGetCall) Context(ctx context.Context) *FoldersMuteConfigsGetCall { 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 *FoldersEventThreatDetectionSettingsCustomModulesGetCall) Header() http.Header { +func (c *FoldersMuteConfigsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersEventThreatDetectionSettingsCustomModulesGetCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersMuteConfigsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -8188,14 +8965,15 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesGetCall) doRequest(alt return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.eventThreatDetectionSettings.customModules.get" call. -// Exactly one of *EventThreatDetectionCustomModule or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *EventThreatDetectionCustomModule.ServerResponse.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.folders.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 *FoldersEventThreatDetectionSettingsCustomModulesGetCall) Do(opts ...googleapi.CallOption) (*EventThreatDetectionCustomModule, error) { +func (c *FoldersMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8214,7 +8992,7 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesGetCall) Do(opts ...goo if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &EventThreatDetectionCustomModule{ + ret := &GoogleCloudSecuritycenterV1MuteConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8226,25 +9004,25 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesGetCall) Do(opts ...goo } return ret, nil // { - // "description": "Gets an ETD custom module. Retrieves the module at the given level.", - // "flatPath": "v1/folders/{foldersId}/eventThreatDetectionSettings/customModules/{customModulesId}", + // "description": "Gets a mute config.", + // "flatPath": "v1/folders/{foldersId}/muteConfigs/{muteConfigsId}", // "httpMethod": "GET", - // "id": "securitycenter.folders.eventThreatDetectionSettings.customModules.get", + // "id": "securitycenter.folders.muteConfigs.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the custom module to get. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", + // "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": "^folders/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", + // "pattern": "^folders/[^/]+/muteConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1/{+name}", // "response": { - // "$ref": "EventThreatDetectionCustomModule" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -8253,9 +9031,9 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesGetCall) Do(opts ...goo } -// method id "securitycenter.folders.eventThreatDetectionSettings.customModules.list": +// method id "securitycenter.folders.muteConfigs.list": -type FoldersEventThreatDetectionSettingsCustomModulesListCall struct { +type FoldersMuteConfigsListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -8264,35 +9042,32 @@ type FoldersEventThreatDetectionSettingsCustomModulesListCall struct { header_ http.Header } -// List: Lists ETD custom modules. Retrieve all resident and inherited -// modules at the given level (no descendants). +// List: Lists mute configs. // -// - parent: Name of the parent to list custom modules. Its format is: * -// "organizations/{organization}/eventThreatDetectionSettings". * -// "folders/{folder}/eventThreatDetectionSettings". * -// "projects/{project}/eventThreatDetectionSettings". -func (r *FoldersEventThreatDetectionSettingsCustomModulesService) List(parent string) *FoldersEventThreatDetectionSettingsCustomModulesListCall { - c := &FoldersEventThreatDetectionSettingsCustomModulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The parent, which owns the collection of mute configs. Its +// format is "organizations/[organization_id]", "folders/[folder_id]", +// "projects/[project_id]". +func (r *FoldersMuteConfigsService) List(parent string) *FoldersMuteConfigsListCall { + c := &FoldersMuteConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } // PageSize sets the optional parameter "pageSize": The maximum number -// of modules to return. The service may return fewer than this value. +// 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 *FoldersEventThreatDetectionSettingsCustomModulesListCall) PageSize(pageSize int64) *FoldersEventThreatDetectionSettingsCustomModulesListCall { +func (c *FoldersMuteConfigsListCall) PageSize(pageSize int64) *FoldersMuteConfigsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } // PageToken sets the optional parameter "pageToken": A page token, -// received from a previous `ListEventThreatDetectionCustomModules` -// call. Provide this to retrieve the subsequent page. When paginating, -// all other parameters provided to -// `ListEventThreatDetectionCustomModules` must match the call that -// provided the page token. -func (c *FoldersEventThreatDetectionSettingsCustomModulesListCall) PageToken(pageToken string) *FoldersEventThreatDetectionSettingsCustomModulesListCall { +// 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 *FoldersMuteConfigsListCall) PageToken(pageToken string) *FoldersMuteConfigsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -8300,7 +9075,7 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesListCall) PageToken(pag // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersEventThreatDetectionSettingsCustomModulesListCall) Fields(s ...googleapi.Field) *FoldersEventThreatDetectionSettingsCustomModulesListCall { +func (c *FoldersMuteConfigsListCall) Fields(s ...googleapi.Field) *FoldersMuteConfigsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -8310,7 +9085,7 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesListCall) Fields(s ...g // 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 *FoldersEventThreatDetectionSettingsCustomModulesListCall) IfNoneMatch(entityTag string) *FoldersEventThreatDetectionSettingsCustomModulesListCall { +func (c *FoldersMuteConfigsListCall) IfNoneMatch(entityTag string) *FoldersMuteConfigsListCall { c.ifNoneMatch_ = entityTag return c } @@ -8318,21 +9093,21 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesListCall) IfNoneMatch(e // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersEventThreatDetectionSettingsCustomModulesListCall) Context(ctx context.Context) *FoldersEventThreatDetectionSettingsCustomModulesListCall { +func (c *FoldersMuteConfigsListCall) Context(ctx context.Context) *FoldersMuteConfigsListCall { 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 *FoldersEventThreatDetectionSettingsCustomModulesListCall) Header() http.Header { +func (c *FoldersMuteConfigsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersEventThreatDetectionSettingsCustomModulesListCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersMuteConfigsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -8345,7 +9120,7 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesListCall) doRequest(alt var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/muteConfigs") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -8358,16 +9133,14 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesListCall) doRequest(alt return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.eventThreatDetectionSettings.customModules.list" call. -// Exactly one of *ListEventThreatDetectionCustomModulesResponse or -// error will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *ListEventThreatDetectionCustomModulesResponse.ServerResponse.Header -// or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *FoldersEventThreatDetectionSettingsCustomModulesListCall) Do(opts ...googleapi.CallOption) (*ListEventThreatDetectionCustomModulesResponse, error) { +// Do executes the "securitycenter.folders.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 *FoldersMuteConfigsListCall) Do(opts ...googleapi.CallOption) (*ListMuteConfigsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8386,7 +9159,7 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesListCall) Do(opts ...go if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListEventThreatDetectionCustomModulesResponse{ + ret := &ListMuteConfigsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8398,36 +9171,36 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesListCall) Do(opts ...go } return ret, nil // { - // "description": "Lists ETD custom modules. Retrieve all resident and inherited modules at the given level (no descendants).", - // "flatPath": "v1/folders/{foldersId}/eventThreatDetectionSettings/customModules", + // "description": "Lists mute configs.", + // "flatPath": "v1/folders/{foldersId}/muteConfigs", // "httpMethod": "GET", - // "id": "securitycenter.folders.eventThreatDetectionSettings.customModules.list", + // "id": "securitycenter.folders.muteConfigs.list", // "parameterOrder": [ // "parent" // ], // "parameters": { // "pageSize": { - // "description": "The maximum number of modules 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 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 `ListEventThreatDetectionCustomModules` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListEventThreatDetectionCustomModules` must match the call that provided the page token.", + // "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. Name of the parent to list custom modules. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", + // "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": "^folders/[^/]+/eventThreatDetectionSettings$", + // "pattern": "^folders/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/customModules", + // "path": "v1/{+parent}/muteConfigs", // "response": { - // "$ref": "ListEventThreatDetectionCustomModulesResponse" + // "$ref": "ListMuteConfigsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -8439,7 +9212,7 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesListCall) Do(opts ...go // 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 *FoldersEventThreatDetectionSettingsCustomModulesListCall) Pages(ctx context.Context, f func(*ListEventThreatDetectionCustomModulesResponse) error) error { +func (c *FoldersMuteConfigsListCall) 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 { @@ -8457,41 +9230,33 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesListCall) Pages(ctx con } } -// method id "securitycenter.folders.eventThreatDetectionSettings.customModules.patch": +// method id "securitycenter.folders.muteConfigs.patch": -type FoldersEventThreatDetectionSettingsCustomModulesPatchCall struct { - s *Service - name string - eventthreatdetectioncustommodule *EventThreatDetectionCustomModule - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersMuteConfigsPatchCall struct { + s *Service + name string + googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates an ETD custom module at the given level. All config -// fields can be updated when updating the module at resident level. -// Only enablement state can be updated when updating the module at -// inherited levels. Updating the module has a side-effect that it -// updates all descendants that are inherited from this module. +// Patch: Updates a mute config. // -// - name: Immutable. The resource name of the Event Threat Detection -// custom module. Its format is: * -// "organizations/{organization}/eventThreatDetectionSettings/customMod -// ules/{module}". * -// "folders/{folder}/eventThreatDetectionSettings/customModules/{module -// }". * -// "projects/{project}/eventThreatDetectionSettings/customModules/{modu -// le}". -func (r *FoldersEventThreatDetectionSettingsCustomModulesService) Patch(name string, eventthreatdetectioncustommodule *EventThreatDetectionCustomModule) *FoldersEventThreatDetectionSettingsCustomModulesPatchCall { - c := &FoldersEventThreatDetectionSettingsCustomModulesPatchCall{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 *FoldersMuteConfigsService) Patch(name string, googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig) *FoldersMuteConfigsPatchCall { + c := &FoldersMuteConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.eventthreatdetectioncustommodule = eventthreatdetectioncustommodule + 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 *FoldersEventThreatDetectionSettingsCustomModulesPatchCall) UpdateMask(updateMask string) *FoldersEventThreatDetectionSettingsCustomModulesPatchCall { +func (c *FoldersMuteConfigsPatchCall) UpdateMask(updateMask string) *FoldersMuteConfigsPatchCall { c.urlParams_.Set("updateMask", updateMask) return c } @@ -8499,7 +9264,7 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesPatchCall) UpdateMask(u // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersEventThreatDetectionSettingsCustomModulesPatchCall) Fields(s ...googleapi.Field) *FoldersEventThreatDetectionSettingsCustomModulesPatchCall { +func (c *FoldersMuteConfigsPatchCall) Fields(s ...googleapi.Field) *FoldersMuteConfigsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -8507,21 +9272,21 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesPatchCall) Fields(s ... // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersEventThreatDetectionSettingsCustomModulesPatchCall) Context(ctx context.Context) *FoldersEventThreatDetectionSettingsCustomModulesPatchCall { +func (c *FoldersMuteConfigsPatchCall) Context(ctx context.Context) *FoldersMuteConfigsPatchCall { 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 *FoldersEventThreatDetectionSettingsCustomModulesPatchCall) Header() http.Header { +func (c *FoldersMuteConfigsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersEventThreatDetectionSettingsCustomModulesPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersMuteConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -8529,7 +9294,7 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesPatchCall) doRequest(al } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventthreatdetectioncustommodule) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1muteconfig) if err != nil { return nil, err } @@ -8549,14 +9314,15 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesPatchCall) doRequest(al return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.eventThreatDetectionSettings.customModules.patch" call. -// Exactly one of *EventThreatDetectionCustomModule or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *EventThreatDetectionCustomModule.ServerResponse.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.folders.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 *FoldersEventThreatDetectionSettingsCustomModulesPatchCall) Do(opts ...googleapi.CallOption) (*EventThreatDetectionCustomModule, error) { +func (c *FoldersMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8575,7 +9341,7 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesPatchCall) Do(opts ...g if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &EventThreatDetectionCustomModule{ + ret := &GoogleCloudSecuritycenterV1MuteConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8587,18 +9353,18 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesPatchCall) Do(opts ...g } return ret, nil // { - // "description": "Updates an ETD custom module at the given level. All config fields can be updated when updating the module at resident level. Only enablement state can be updated when updating the module at inherited levels. Updating the module has a side-effect that it updates all descendants that are inherited from this module.", - // "flatPath": "v1/folders/{foldersId}/eventThreatDetectionSettings/customModules/{customModulesId}", + // "description": "Updates a mute config.", + // "flatPath": "v1/folders/{foldersId}/muteConfigs/{muteConfigsId}", // "httpMethod": "PATCH", - // "id": "securitycenter.folders.eventThreatDetectionSettings.customModules.patch", + // "id": "securitycenter.folders.muteConfigs.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Immutable. The resource name of the Event Threat Detection custom module. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", + // "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": "^folders/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", + // "pattern": "^folders/[^/]+/muteConfigs/[^/]+$", // "required": true, // "type": "string" // }, @@ -8611,10 +9377,10 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesPatchCall) Do(opts ...g // }, // "path": "v1/{+name}", // "request": { - // "$ref": "EventThreatDetectionCustomModule" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "response": { - // "$ref": "EventThreatDetectionCustomModule" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -8623,36 +9389,42 @@ func (c *FoldersEventThreatDetectionSettingsCustomModulesPatchCall) Do(opts ...g } -// method id "securitycenter.folders.findings.bulkMute": +// method id "securitycenter.folders.notificationConfigs.create": -type FoldersFindingsBulkMuteCall struct { - s *Service - parent string - bulkmutefindingsrequest *BulkMuteFindingsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersNotificationConfigsCreateCall struct { + s *Service + parent string + notificationconfig *NotificationConfig + 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 notification config. // -// - parent: The parent, at which bulk action needs to be applied. Its +// - parent: Resource name of the new notification config's parent. Its // format is "organizations/[organization_id]", "folders/[folder_id]", -// "projects/[project_id]". -func (r *FoldersFindingsService) BulkMute(parent string, bulkmutefindingsrequest *BulkMuteFindingsRequest) *FoldersFindingsBulkMuteCall { - c := &FoldersFindingsBulkMuteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// 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.bulkmutefindingsrequest = bulkmutefindingsrequest + 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 contain 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 *FoldersFindingsBulkMuteCall) Fields(s ...googleapi.Field) *FoldersFindingsBulkMuteCall { +func (c *FoldersNotificationConfigsCreateCall) Fields(s ...googleapi.Field) *FoldersNotificationConfigsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -8660,21 +9432,21 @@ func (c *FoldersFindingsBulkMuteCall) Fields(s ...googleapi.Field) *FoldersFindi // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersFindingsBulkMuteCall) Context(ctx context.Context) *FoldersFindingsBulkMuteCall { +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 *FoldersFindingsBulkMuteCall) Header() http.Header { +func (c *FoldersNotificationConfigsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersFindingsBulkMuteCall) 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_ { @@ -8682,14 +9454,14 @@ func (c *FoldersFindingsBulkMuteCall) doRequest(alt string) (*http.Response, err } 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.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}/findings:bulkMute") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/notificationConfigs") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -8702,14 +9474,14 @@ func (c *FoldersFindingsBulkMuteCall) doRequest(alt string) (*http.Response, err return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.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 *FoldersFindingsBulkMuteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// 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 +// *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 *FoldersNotificationConfigsCreateCall) Do(opts ...googleapi.CallOption) (*NotificationConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8728,7 +9500,7 @@ func (c *FoldersFindingsBulkMuteCall) Do(opts ...googleapi.CallOption) (*Operati if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &NotificationConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8740,28 +9512,33 @@ func (c *FoldersFindingsBulkMuteCall) Do(opts ...googleapi.CallOption) (*Operati } 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/folders/{foldersId}/findings:bulkMute", + // "description": "Creates a notification config.", + // "flatPath": "v1/folders/{foldersId}/notificationConfigs", // "httpMethod": "POST", - // "id": "securitycenter.folders.findings.bulkMute", + // "id": "securitycenter.folders.notificationConfigs.create", // "parameterOrder": [ // "parent" // ], // "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]\".", - // "location": "path", + // "configId": { + // "description": "Required. Unique identifier provided by the client within the parent scope. It must be between 1 and 128 characters and contain 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}/findings:bulkMute", + // "path": "v1/{+parent}/notificationConfigs", // "request": { - // "$ref": "BulkMuteFindingsRequest" + // "$ref": "NotificationConfig" // }, // "response": { - // "$ref": "Operation" + // "$ref": "NotificationConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -8770,43 +9547,32 @@ func (c *FoldersFindingsBulkMuteCall) Do(opts ...googleapi.CallOption) (*Operati } -// method id "securitycenter.folders.muteConfigs.create": +// method id "securitycenter.folders.notificationConfigs.delete": -type FoldersMuteConfigsCreateCall struct { - s *Service - parent string - googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig - 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 } -// Create: Creates a mute config. +// Delete: Deletes 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 *FoldersMuteConfigsService) Create(parent string, googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig) *FoldersMuteConfigsCreateCall { - c := &FoldersMuteConfigsCreateCall{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 only lowercase letters, numbers, and hyphens, must -// start with a letter, must end with either a letter or a number, and -// must be 63 characters or less. -func (c *FoldersMuteConfigsCreateCall) MuteConfigId(muteConfigId string) *FoldersMuteConfigsCreateCall { - c.urlParams_.Set("muteConfigId", muteConfigId) +// - name: Name of the notification config to delete. Its format is +// "organizations/[organization_id]/notificationConfigs/[config_id]", +// "folders/[folder_id]/notificationConfigs/[config_id]", or +// "projects/[project_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 *FoldersMuteConfigsCreateCall) Fields(s ...googleapi.Field) *FoldersMuteConfigsCreateCall { +func (c *FoldersNotificationConfigsDeleteCall) Fields(s ...googleapi.Field) *FoldersNotificationConfigsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -8814,21 +9580,21 @@ func (c *FoldersMuteConfigsCreateCall) Fields(s ...googleapi.Field) *FoldersMute // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersMuteConfigsCreateCall) Context(ctx context.Context) *FoldersMuteConfigsCreateCall { +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 *FoldersMuteConfigsCreateCall) Header() http.Header { +func (c *FoldersNotificationConfigsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersMuteConfigsCreateCall) 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_ { @@ -8836,35 +9602,29 @@ func (c *FoldersMuteConfigsCreateCall) 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) - 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.folders.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 *FoldersMuteConfigsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, 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 { @@ -8883,7 +9643,7 @@ func (c *FoldersMuteConfigsCreateCall) Do(opts ...googleapi.CallOption) (*Google if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1MuteConfig{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8895,33 +9655,25 @@ func (c *FoldersMuteConfigsCreateCall) Do(opts ...googleapi.CallOption) (*Google } return ret, nil // { - // "description": "Creates a mute config.", - // "flatPath": "v1/folders/{foldersId}/muteConfigs", - // "httpMethod": "POST", - // "id": "securitycenter.folders.muteConfigs.create", + // "description": "Deletes a notification config.", + // "flatPath": "v1/folders/{foldersId}/notificationConfigs/{notificationConfigsId}", + // "httpMethod": "DELETE", + // "id": "securitycenter.folders.notificationConfigs.delete", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "muteConfigId": { - // "description": "Required. Unique identifier provided by the client within the parent scope. It must consist of only lowercase letters, numbers, and hyphens, must start with a letter, must end with either a letter or a number, and must be 63 characters or less.", - // "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 notification config to delete. Its format is \"organizations/[organization_id]/notificationConfigs/[config_id]\", \"folders/[folder_id]/notificationConfigs/[config_id]\", or \"projects/[project_id]/notificationConfigs/[config_id]\".", // "location": "path", - // "pattern": "^folders/[^/]+$", + // "pattern": "^folders/[^/]+/notificationConfigs/[^/]+$", // "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" @@ -8930,24 +9682,25 @@ func (c *FoldersMuteConfigsCreateCall) Do(opts ...googleapi.CallOption) (*Google } -// method id "securitycenter.folders.muteConfigs.delete": +// method id "securitycenter.folders.notificationConfigs.get": -type FoldersMuteConfigsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersNotificationConfigsGetCall 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 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 *FoldersMuteConfigsService) Delete(name string) *FoldersMuteConfigsDeleteCall { - c := &FoldersMuteConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Name of the notification config to get. Its format is +// "organizations/[organization_id]/notificationConfigs/[config_id]", +// "folders/[folder_id]/notificationConfigs/[config_id]", or +// "projects/[project_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 } @@ -8955,41 +9708,54 @@ func (r *FoldersMuteConfigsService) Delete(name string) *FoldersMuteConfigsDelet // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersMuteConfigsDeleteCall) Fields(s ...googleapi.Field) *FoldersMuteConfigsDeleteCall { +func (c *FoldersNotificationConfigsGetCall) Fields(s ...googleapi.Field) *FoldersNotificationConfigsGetCall { 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 *FoldersNotificationConfigsGetCall) IfNoneMatch(entityTag string) *FoldersNotificationConfigsGetCall { + 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 *FoldersMuteConfigsDeleteCall) Context(ctx context.Context) *FoldersMuteConfigsDeleteCall { +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 *FoldersMuteConfigsDeleteCall) Header() http.Header { +func (c *FoldersNotificationConfigsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersMuteConfigsDeleteCall) 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_ { 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("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -9000,14 +9766,14 @@ func (c *FoldersMuteConfigsDeleteCall) doRequest(alt string) (*http.Response, er return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.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 *FoldersMuteConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// 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 +// *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 *FoldersNotificationConfigsGetCall) Do(opts ...googleapi.CallOption) (*NotificationConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9026,7 +9792,7 @@ func (c *FoldersMuteConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &NotificationConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9038,25 +9804,25 @@ func (c *FoldersMuteConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, } return ret, nil // { - // "description": "Deletes an existing mute config.", - // "flatPath": "v1/folders/{foldersId}/muteConfigs/{muteConfigsId}", - // "httpMethod": "DELETE", - // "id": "securitycenter.folders.muteConfigs.delete", + // "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 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 get. Its format is \"organizations/[organization_id]/notificationConfigs/[config_id]\", \"folders/[folder_id]/notificationConfigs/[config_id]\", or \"projects/[project_id]/notificationConfigs/[config_id]\".", // "location": "path", - // "pattern": "^folders/[^/]+/muteConfigs/[^/]+$", + // "pattern": "^folders/[^/]+/notificationConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1/{+name}", // "response": { - // "$ref": "Empty" + // "$ref": "NotificationConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -9065,33 +9831,49 @@ func (c *FoldersMuteConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, } -// method id "securitycenter.folders.muteConfigs.get": +// method id "securitycenter.folders.notificationConfigs.list": -type FoldersMuteConfigsGetCall struct { +type FoldersNotificationConfigsListCall struct { s *Service - name string + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Gets a mute config. +// List: Lists notification configs. // -// - 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 *FoldersMuteConfigsService) Get(name string) *FoldersMuteConfigsGetCall { - c := &FoldersMuteConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: The name of the parent in which to list the notification +// configurations. 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 +} + +// 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 *FoldersMuteConfigsGetCall) Fields(s ...googleapi.Field) *FoldersMuteConfigsGetCall { +func (c *FoldersNotificationConfigsListCall) Fields(s ...googleapi.Field) *FoldersNotificationConfigsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -9101,7 +9883,7 @@ func (c *FoldersMuteConfigsGetCall) Fields(s ...googleapi.Field) *FoldersMuteCon // 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 *FoldersMuteConfigsGetCall) IfNoneMatch(entityTag string) *FoldersMuteConfigsGetCall { +func (c *FoldersNotificationConfigsListCall) IfNoneMatch(entityTag string) *FoldersNotificationConfigsListCall { c.ifNoneMatch_ = entityTag return c } @@ -9109,21 +9891,21 @@ func (c *FoldersMuteConfigsGetCall) IfNoneMatch(entityTag string) *FoldersMuteCo // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersMuteConfigsGetCall) Context(ctx context.Context) *FoldersMuteConfigsGetCall { +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 *FoldersMuteConfigsGetCall) Header() http.Header { +func (c *FoldersNotificationConfigsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersMuteConfigsGetCall) 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_ { @@ -9136,7 +9918,7 @@ func (c *FoldersMuteConfigsGetCall) 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/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/notificationConfigs") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -9144,20 +9926,19 @@ func (c *FoldersMuteConfigsGetCall) doRequest(alt string) (*http.Response, error } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.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 +// 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 *FoldersMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { +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 { @@ -9176,7 +9957,7 @@ func (c *FoldersMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleClo if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1MuteConfig{ + ret := &ListNotificationConfigsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9188,25 +9969,36 @@ func (c *FoldersMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleClo } return ret, nil // { - // "description": "Gets a mute config.", - // "flatPath": "v1/folders/{foldersId}/muteConfigs/{muteConfigsId}", + // "description": "Lists notification configs.", + // "flatPath": "v1/folders/{foldersId}/notificationConfigs", // "httpMethod": "GET", - // "id": "securitycenter.folders.muteConfigs.get", + // "id": "securitycenter.folders.notificationConfigs.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "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}", + // "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. The name of the parent in which to list the notification configurations. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", // "location": "path", - // "pattern": "^folders/[^/]+/muteConfigs/[^/]+$", + // "pattern": "^folders/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/notificationConfigs", // "response": { - // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // "$ref": "ListNotificationConfigsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -9215,116 +10007,124 @@ func (c *FoldersMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleClo } -// method id "securitycenter.folders.muteConfigs.list": - -type FoldersMuteConfigsListCall 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 *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) + } } -// List: Lists mute configs. -// -// - parent: The parent, which owns the collection of mute configs. Its -// format is "organizations/[organization_id]", "folders/[folder_id]", -// "projects/[project_id]". -func (r *FoldersMuteConfigsService) List(parent string) *FoldersMuteConfigsListCall { - c := &FoldersMuteConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c +// method id "securitycenter.folders.notificationConfigs.patch": + +type FoldersNotificationConfigsPatchCall struct { + s *Service + name string + notificationconfig *NotificationConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// 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 *FoldersMuteConfigsListCall) PageSize(pageSize int64) *FoldersMuteConfigsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) +// Patch: Updates a notification config. The following update fields +// are allowed: description, pubsub_topic, streaming_config.filter +// +// - 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", +// "folders/{folder_id}/notificationConfigs/notify_public_bucket", or +// "projects/{project_id}/notificationConfigs/notify_public_bucket". +func (r *FoldersNotificationConfigsService) Patch(name string, notificationconfig *NotificationConfig) *FoldersNotificationConfigsPatchCall { + c := &FoldersNotificationConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.notificationconfig = notificationconfig 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 *FoldersMuteConfigsListCall) PageToken(pageToken string) *FoldersMuteConfigsListCall { - c.urlParams_.Set("pageToken", pageToken) +// 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 *FoldersMuteConfigsListCall) Fields(s ...googleapi.Field) *FoldersMuteConfigsListCall { +func (c *FoldersNotificationConfigsPatchCall) Fields(s ...googleapi.Field) *FoldersNotificationConfigsPatchCall { 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 *FoldersMuteConfigsListCall) IfNoneMatch(entityTag string) *FoldersMuteConfigsListCall { - 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 *FoldersMuteConfigsListCall) Context(ctx context.Context) *FoldersMuteConfigsListCall { +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 *FoldersMuteConfigsListCall) Header() http.Header { +func (c *FoldersNotificationConfigsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersMuteConfigsListCall) 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_ { 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}/muteConfigs") + 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.folders.muteConfigs.list" call. -// Exactly one of *ListMuteConfigsResponse or error will be non-nil. Any +// 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 -// *ListMuteConfigsResponse.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 *FoldersMuteConfigsListCall) Do(opts ...googleapi.CallOption) (*ListMuteConfigsResponse, error) { +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 { @@ -9343,7 +10143,7 @@ func (c *FoldersMuteConfigsListCall) Do(opts ...googleapi.CallOption) (*ListMute if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListMuteConfigsResponse{ + ret := &NotificationConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9355,36 +10155,34 @@ func (c *FoldersMuteConfigsListCall) Do(opts ...googleapi.CallOption) (*ListMute } return ret, nil // { - // "description": "Lists mute configs.", - // "flatPath": "v1/folders/{foldersId}/muteConfigs", - // "httpMethod": "GET", - // "id": "securitycenter.folders.muteConfigs.list", + // "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": [ - // "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 `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]\".", + // "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\", \"folders/{folder_id}/notificationConfigs/notify_public_bucket\", or \"projects/{project_id}/notificationConfigs/notify_public_bucket\".", // "location": "path", - // "pattern": "^folders/[^/]+$", + // "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/{+parent}/muteConfigs", + // "path": "v1/{+name}", + // "request": { + // "$ref": "NotificationConfig" + // }, // "response": { - // "$ref": "ListMuteConfigsResponse" + // "$ref": "NotificationConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -9393,62 +10191,37 @@ func (c *FoldersMuteConfigsListCall) Do(opts ...googleapi.CallOption) (*ListMute } -// 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 *FoldersMuteConfigsListCall) 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) - } -} - -// method id "securitycenter.folders.muteConfigs.patch": +// method id "securitycenter.folders.securityHealthAnalyticsSettings.customModules.create": -type FoldersMuteConfigsPatchCall struct { - s *Service - name string - googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall struct { + s *Service + parent string + googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates a mute config. +// Create: Creates a resident SecurityHealthAnalyticsCustomModule at the +// scope of the given CRM parent, and also creates inherited +// SecurityHealthAnalyticsCustomModules for all CRM descendants of the +// given parent. These modules are enabled by default. // -// - 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 *FoldersMuteConfigsService) Patch(name string, googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig) *FoldersMuteConfigsPatchCall { - c := &FoldersMuteConfigsPatchCall{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 *FoldersMuteConfigsPatchCall) UpdateMask(updateMask string) *FoldersMuteConfigsPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// - parent: Resource name of the new custom module's parent. Its format +// is "organizations/{organization}/securityHealthAnalyticsSettings", +// "folders/{folder}/securityHealthAnalyticsSettings", or +// "projects/{project}/securityHealthAnalyticsSettings". +func (r *FoldersSecurityHealthAnalyticsSettingsCustomModulesService) Create(parent string, googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule) *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall { + c := &FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule = googlecloudsecuritycenterv1securityhealthanalyticscustommodule 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 *FoldersMuteConfigsPatchCall) Fields(s ...googleapi.Field) *FoldersMuteConfigsPatchCall { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -9456,21 +10229,21 @@ func (c *FoldersMuteConfigsPatchCall) Fields(s ...googleapi.Field) *FoldersMuteC // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersMuteConfigsPatchCall) Context(ctx context.Context) *FoldersMuteConfigsPatchCall { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall { 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 *FoldersMuteConfigsPatchCall) Header() http.Header { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersMuteConfigsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -9478,35 +10251,37 @@ func (c *FoldersMuteConfigsPatchCall) doRequest(alt string) (*http.Response, err } 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.googlecloudsecuritycenterv1securityhealthanalyticscustommodule) 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}/customModules") 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.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 *FoldersMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { +// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.customModules.create" call. +// Exactly one of +// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule.Server +// Response.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9525,7 +10300,7 @@ func (c *FoldersMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleC if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1MuteConfig{ + ret := &GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9537,34 +10312,28 @@ func (c *FoldersMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleC } return ret, nil // { - // "description": "Updates a mute config.", - // "flatPath": "v1/folders/{foldersId}/muteConfigs/{muteConfigsId}", - // "httpMethod": "PATCH", - // "id": "securitycenter.folders.muteConfigs.patch", + // "description": "Creates a resident SecurityHealthAnalyticsCustomModule at the scope of the given CRM parent, and also creates inherited SecurityHealthAnalyticsCustomModules for all CRM descendants of the given parent. These modules are enabled by default.", + // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/customModules", + // "httpMethod": "POST", + // "id": "securitycenter.folders.securityHealthAnalyticsSettings.customModules.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "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}\"", + // "parent": { + // "description": "Required. Resource name of the new custom module's parent. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", // "location": "path", - // "pattern": "^folders/[^/]+/muteConfigs/[^/]+$", + // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings$", // "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}", + // "path": "v1/{+parent}/customModules", // "request": { - // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -9573,42 +10342,37 @@ func (c *FoldersMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleC } -// method id "securitycenter.folders.notificationConfigs.create": +// method id "securitycenter.folders.securityHealthAnalyticsSettings.customModules.delete": -type FoldersNotificationConfigsCreateCall struct { - s *Service - parent string - notificationconfig *NotificationConfig - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates a notification config. +// Delete: Deletes the specified SecurityHealthAnalyticsCustomModule and +// all of its descendants in the CRM hierarchy. This method is only +// supported for resident custom modules. // -// - 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 -} - -// 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 contain alphanumeric characters, -// underscores, or hyphens only. -func (c *FoldersNotificationConfigsCreateCall) ConfigId(configId string) *FoldersNotificationConfigsCreateCall { - c.urlParams_.Set("configId", configId) +// - name: Name of the custom module to delete. Its format is +// "organizations/{organization}/securityHealthAnalyticsSettings/custom +// Modules/{customModule}", +// "folders/{folder}/securityHealthAnalyticsSettings/customModules/{cus +// tomModule}", or +// "projects/{project}/securityHealthAnalyticsSettings/customModules/{c +// ustomModule}". +func (r *FoldersSecurityHealthAnalyticsSettingsCustomModulesService) Delete(name string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall { + c := &FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall{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 *FoldersNotificationConfigsCreateCall) Fields(s ...googleapi.Field) *FoldersNotificationConfigsCreateCall { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -9616,21 +10380,21 @@ func (c *FoldersNotificationConfigsCreateCall) Fields(s ...googleapi.Field) *Fol // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersNotificationConfigsCreateCall) Context(ctx context.Context) *FoldersNotificationConfigsCreateCall { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall { 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 *FoldersNotificationConfigsCreateCall) Header() http.Header { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersNotificationConfigsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -9638,34 +10402,29 @@ func (c *FoldersNotificationConfigsCreateCall) doRequest(alt string) (*http.Resp } 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/{+parent}/notificationConfigs") + 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.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 *FoldersNotificationConfigsCreateCall) Do(opts ...googleapi.CallOption) (*NotificationConfig, error) { +// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.customModules.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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9684,7 +10443,7 @@ func (c *FoldersNotificationConfigsCreateCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &NotificationConfig{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9696,33 +10455,25 @@ func (c *FoldersNotificationConfigsCreateCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Creates a notification config.", - // "flatPath": "v1/folders/{foldersId}/notificationConfigs", - // "httpMethod": "POST", - // "id": "securitycenter.folders.notificationConfigs.create", + // "description": "Deletes the specified SecurityHealthAnalyticsCustomModule and all of its descendants in the CRM hierarchy. This method is only supported for resident custom modules.", + // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/customModules/{customModulesId}", + // "httpMethod": "DELETE", + // "id": "securitycenter.folders.securityHealthAnalyticsSettings.customModules.delete", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "configId": { - // "description": "Required. Unique identifier provided by the client within the parent scope. It must be between 1 and 128 characters and contain 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]\".", + // "name": { + // "description": "Required. Name of the custom module to delete. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}\", \"folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}\"", // "location": "path", - // "pattern": "^folders/[^/]+$", + // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/notificationConfigs", - // "request": { - // "$ref": "NotificationConfig" - // }, + // "path": "v1/{+name}", // "response": { - // "$ref": "NotificationConfig" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -9731,24 +10482,28 @@ func (c *FoldersNotificationConfigsCreateCall) Do(opts ...googleapi.CallOption) } -// method id "securitycenter.folders.notificationConfigs.delete": +// method id "securitycenter.folders.securityHealthAnalyticsSettings.customModules.get": -type FoldersNotificationConfigsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a notification config. +// Get: Retrieves a SecurityHealthAnalyticsCustomModule. // -// - name: Name of the notification config to delete. Its format is -// "organizations/[organization_id]/notificationConfigs/[config_id]", -// "folders/[folder_id]/notificationConfigs/[config_id]", or -// "projects/[project_id]/notificationConfigs/[config_id]". -func (r *FoldersNotificationConfigsService) Delete(name string) *FoldersNotificationConfigsDeleteCall { - c := &FoldersNotificationConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Name of the custom module to get. Its format is +// "organizations/{organization}/securityHealthAnalyticsSettings/custom +// Modules/{customModule}", +// "folders/{folder}/securityHealthAnalyticsSettings/customModules/{cus +// tomModule}", or +// "projects/{project}/securityHealthAnalyticsSettings/customModules/{c +// ustomModule}". +func (r *FoldersSecurityHealthAnalyticsSettingsCustomModulesService) Get(name string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall { + c := &FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -9756,41 +10511,54 @@ func (r *FoldersNotificationConfigsService) Delete(name string) *FoldersNotifica // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersNotificationConfigsDeleteCall) Fields(s ...googleapi.Field) *FoldersNotificationConfigsDeleteCall { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall { 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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) IfNoneMatch(entityTag string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall { + 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 *FoldersNotificationConfigsDeleteCall) Context(ctx context.Context) *FoldersNotificationConfigsDeleteCall { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall { 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 *FoldersNotificationConfigsDeleteCall) Header() http.Header { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersNotificationConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) doRequest(alt string) (*http.Response, 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("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -9801,15 +10569,18 @@ func (c *FoldersNotificationConfigsDeleteCall) doRequest(alt string) (*http.Resp return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// 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...) +// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.customModules.get" call. +// Exactly one of +// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule.Server +// Response.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule, error) { + gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { @@ -9827,7 +10598,7 @@ func (c *FoldersNotificationConfigsDeleteCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9839,25 +10610,25 @@ func (c *FoldersNotificationConfigsDeleteCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Deletes a notification config.", - // "flatPath": "v1/folders/{foldersId}/notificationConfigs/{notificationConfigsId}", - // "httpMethod": "DELETE", - // "id": "securitycenter.folders.notificationConfigs.delete", + // "description": "Retrieves a SecurityHealthAnalyticsCustomModule.", + // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/customModules/{customModulesId}", + // "httpMethod": "GET", + // "id": "securitycenter.folders.securityHealthAnalyticsSettings.customModules.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the notification config to delete. Its format is \"organizations/[organization_id]/notificationConfigs/[config_id]\", \"folders/[folder_id]/notificationConfigs/[config_id]\", or \"projects/[project_id]/notificationConfigs/[config_id]\".", + // "description": "Required. Name of the custom module to get. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}\", \"folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}\"", // "location": "path", - // "pattern": "^folders/[^/]+/notificationConfigs/[^/]+$", + // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1/{+name}", // "response": { - // "$ref": "Empty" + // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -9866,33 +10637,50 @@ func (c *FoldersNotificationConfigsDeleteCall) Do(opts ...googleapi.CallOption) } -// method id "securitycenter.folders.notificationConfigs.get": +// method id "securitycenter.folders.securityHealthAnalyticsSettings.customModules.list": -type FoldersNotificationConfigsGetCall struct { +type FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall struct { s *Service - name string + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Gets a notification config. +// List: Returns a list of all SecurityHealthAnalyticsCustomModules for +// the given parent. This includes resident modules defined at the scope +// of the parent, and inherited modules, inherited from CRM ancestors. // -// - name: Name of the notification config to get. Its format is -// "organizations/[organization_id]/notificationConfigs/[config_id]", -// "folders/[folder_id]/notificationConfigs/[config_id]", or -// "projects/[project_id]/notificationConfigs/[config_id]". -func (r *FoldersNotificationConfigsService) Get(name string) *FoldersNotificationConfigsGetCall { - c := &FoldersNotificationConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: Name of parent to list custom modules. Its format is +// "organizations/{organization}/securityHealthAnalyticsSettings", +// "folders/{folder}/securityHealthAnalyticsSettings", or +// "projects/{project}/securityHealthAnalyticsSettings". +func (r *FoldersSecurityHealthAnalyticsSettingsCustomModulesService) List(parent string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall { + c := &FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall{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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) PageSize(pageSize int64) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last call indicating a continuation +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) PageToken(pageToken string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall { + 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 *FoldersNotificationConfigsGetCall) Fields(s ...googleapi.Field) *FoldersNotificationConfigsGetCall { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -9902,7 +10690,7 @@ func (c *FoldersNotificationConfigsGetCall) Fields(s ...googleapi.Field) *Folder // 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 *FoldersNotificationConfigsGetCall) IfNoneMatch(entityTag string) *FoldersNotificationConfigsGetCall { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) IfNoneMatch(entityTag string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall { c.ifNoneMatch_ = entityTag return c } @@ -9910,21 +10698,21 @@ func (c *FoldersNotificationConfigsGetCall) IfNoneMatch(entityTag string) *Folde // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersNotificationConfigsGetCall) Context(ctx context.Context) *FoldersNotificationConfigsGetCall { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall { 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 *FoldersNotificationConfigsGetCall) Header() http.Header { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersNotificationConfigsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -9937,7 +10725,7 @@ func (c *FoldersNotificationConfigsGetCall) doRequest(alt string) (*http.Respons 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}/customModules") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -9945,19 +10733,21 @@ func (c *FoldersNotificationConfigsGetCall) doRequest(alt string) (*http.Respons } 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.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 *FoldersNotificationConfigsGetCall) Do(opts ...googleapi.CallOption) (*NotificationConfig, error) { +// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.customModules.list" call. +// Exactly one of *ListSecurityHealthAnalyticsCustomModulesResponse or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *ListSecurityHealthAnalyticsCustomModulesResponse.ServerResponse.Heade +// r or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) Do(opts ...googleapi.CallOption) (*ListSecurityHealthAnalyticsCustomModulesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9976,7 +10766,7 @@ func (c *FoldersNotificationConfigsGetCall) Do(opts ...googleapi.CallOption) (*N if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &NotificationConfig{ + ret := &ListSecurityHealthAnalyticsCustomModulesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9988,25 +10778,36 @@ func (c *FoldersNotificationConfigsGetCall) Do(opts ...googleapi.CallOption) (*N } return ret, nil // { - // "description": "Gets a notification config.", - // "flatPath": "v1/folders/{foldersId}/notificationConfigs/{notificationConfigsId}", + // "description": "Returns a list of all SecurityHealthAnalyticsCustomModules for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from CRM ancestors.", + // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/customModules", // "httpMethod": "GET", - // "id": "securitycenter.folders.notificationConfigs.get", + // "id": "securitycenter.folders.securityHealthAnalyticsSettings.customModules.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. Name of the notification config to get. Its format is \"organizations/[organization_id]/notificationConfigs/[config_id]\", \"folders/[folder_id]/notificationConfigs/[config_id]\", or \"projects/[project_id]/notificationConfigs/[config_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 call indicating a continuation", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. Name of parent to list custom modules. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", // "location": "path", - // "pattern": "^folders/[^/]+/notificationConfigs/[^/]+$", + // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/customModules", // "response": { - // "$ref": "NotificationConfig" + // "$ref": "ListSecurityHealthAnalyticsCustomModulesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -10015,9 +10816,30 @@ func (c *FoldersNotificationConfigsGetCall) Do(opts ...googleapi.CallOption) (*N } -// method id "securitycenter.folders.notificationConfigs.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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) Pages(ctx context.Context, f func(*ListSecurityHealthAnalyticsCustomModulesResponse) 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 FoldersNotificationConfigsListCall struct { +// method id "securitycenter.folders.securityHealthAnalyticsSettings.customModules.listDescendant": + +type FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -10026,13 +10848,17 @@ type FoldersNotificationConfigsListCall struct { header_ http.Header } -// List: Lists notification configs. +// ListDescendant: Returns a list of all resident +// SecurityHealthAnalyticsCustomModules under the given CRM parent and +// all of the parent’s CRM descendants. // -// - parent: The name of the parent in which to list the notification -// configurations. 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)} +// - parent: Name of parent to list descendant custom modules. Its +// format is +// "organizations/{organization}/securityHealthAnalyticsSettings", +// "folders/{folder}/securityHealthAnalyticsSettings", or +// "projects/{project}/securityHealthAnalyticsSettings". +func (r *FoldersSecurityHealthAnalyticsSettingsCustomModulesService) ListDescendant(parent string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { + c := &FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } @@ -10040,16 +10866,14 @@ func (r *FoldersNotificationConfigsService) List(parent string) *FoldersNotifica // 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 { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) PageSize(pageSize int64) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { 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 { +// by the last call indicating a continuation +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) PageToken(pageToken string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -10057,7 +10881,7 @@ func (c *FoldersNotificationConfigsListCall) PageToken(pageToken string) *Folder // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersNotificationConfigsListCall) Fields(s ...googleapi.Field) *FoldersNotificationConfigsListCall { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -10067,7 +10891,7 @@ func (c *FoldersNotificationConfigsListCall) Fields(s ...googleapi.Field) *Folde // 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 { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) IfNoneMatch(entityTag string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { c.ifNoneMatch_ = entityTag return c } @@ -10075,21 +10899,21 @@ func (c *FoldersNotificationConfigsListCall) IfNoneMatch(entityTag string) *Fold // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersNotificationConfigsListCall) Context(ctx context.Context) *FoldersNotificationConfigsListCall { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { 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 *FoldersNotificationConfigsListCall) Header() http.Header { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersNotificationConfigsListCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -10102,7 +10926,7 @@ func (c *FoldersNotificationConfigsListCall) doRequest(alt string) (*http.Respon 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/{+parent}/customModules:listDescendant") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -10115,14 +10939,17 @@ func (c *FoldersNotificationConfigsListCall) doRequest(alt string) (*http.Respon return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// 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) { +// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.customModules.listDescendant" call. +// Exactly one of +// *ListDescendantSecurityHealthAnalyticsCustomModulesResponse or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *ListDescendantSecurityHealthAnalyticsCustomModulesResponse.ServerResp +// onse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Do(opts ...googleapi.CallOption) (*ListDescendantSecurityHealthAnalyticsCustomModulesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10141,7 +10968,7 @@ func (c *FoldersNotificationConfigsListCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListNotificationConfigsResponse{ + ret := &ListDescendantSecurityHealthAnalyticsCustomModulesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10153,10 +10980,10 @@ func (c *FoldersNotificationConfigsListCall) Do(opts ...googleapi.CallOption) (* } return ret, nil // { - // "description": "Lists notification configs.", - // "flatPath": "v1/folders/{foldersId}/notificationConfigs", + // "description": "Returns a list of all resident SecurityHealthAnalyticsCustomModules under the given CRM parent and all of the parent’s CRM descendants.", + // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/customModules:listDescendant", // "httpMethod": "GET", - // "id": "securitycenter.folders.notificationConfigs.list", + // "id": "securitycenter.folders.securityHealthAnalyticsSettings.customModules.listDescendant", // "parameterOrder": [ // "parent" // ], @@ -10168,21 +10995,21 @@ func (c *FoldersNotificationConfigsListCall) Do(opts ...googleapi.CallOption) (* // "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.", + // "description": "The value returned by the last call indicating a continuation", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. The name of the parent in which to list the notification configurations. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "description": "Required. Name of parent to list descendant custom modules. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", // "location": "path", - // "pattern": "^folders/[^/]+$", + // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/notificationConfigs", + // "path": "v1/{+parent}/customModules:listDescendant", // "response": { - // "$ref": "ListNotificationConfigsResponse" + // "$ref": "ListDescendantSecurityHealthAnalyticsCustomModulesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -10194,7 +11021,7 @@ func (c *FoldersNotificationConfigsListCall) 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 *FoldersNotificationConfigsListCall) Pages(ctx context.Context, f func(*ListNotificationConfigsResponse) error) error { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Pages(ctx context.Context, f func(*ListDescendantSecurityHealthAnalyticsCustomModulesResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -10212,38 +11039,43 @@ func (c *FoldersNotificationConfigsListCall) Pages(ctx context.Context, f func(* } } -// method id "securitycenter.folders.notificationConfigs.patch": +// method id "securitycenter.folders.securityHealthAnalyticsSettings.customModules.patch": -type FoldersNotificationConfigsPatchCall struct { - s *Service - name string - notificationconfig *NotificationConfig - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall struct { + s *Service + name string + googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates a notification config. The following update fields -// are allowed: description, pubsub_topic, streaming_config.filter +// Patch: Updates the SecurityHealthAnalyticsCustomModule under the +// given name based on the given update mask. Updating the enablement +// state is supported on both resident and inherited modules (though +// resident modules cannot have an enablement state of "inherited"). +// Updating the display name and custom config of a module is supported +// on resident modules only. // -// - 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", -// "folders/{folder_id}/notificationConfigs/notify_public_bucket", or -// "projects/{project_id}/notificationConfigs/notify_public_bucket". -func (r *FoldersNotificationConfigsService) Patch(name string, notificationconfig *NotificationConfig) *FoldersNotificationConfigsPatchCall { - c := &FoldersNotificationConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Immutable. The resource name of the custom module. Its format +// is +// "organizations/{organization}/securityHealthAnalyticsSettings/custom +// Modules/{customModule}", or +// "folders/{folder}/securityHealthAnalyticsSettings/customModules/{cus +// tomModule}", or +// "projects/{project}/securityHealthAnalyticsSettings/customModules/{c +// ustomModule}" The id {customModule} is server-generated and is not +// user settable. It will be a numeric id containing 1-20 digits. +func (r *FoldersSecurityHealthAnalyticsSettingsCustomModulesService) Patch(name string, googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule) *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall { + c := &FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.notificationconfig = notificationconfig + c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule = googlecloudsecuritycenterv1securityhealthanalyticscustommodule 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 { +// UpdateMask sets the optional parameter "updateMask": The list of +// fields to update. +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) UpdateMask(updateMask string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall { c.urlParams_.Set("updateMask", updateMask) return c } @@ -10251,7 +11083,7 @@ func (c *FoldersNotificationConfigsPatchCall) UpdateMask(updateMask string) *Fol // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersNotificationConfigsPatchCall) Fields(s ...googleapi.Field) *FoldersNotificationConfigsPatchCall { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -10259,21 +11091,21 @@ func (c *FoldersNotificationConfigsPatchCall) Fields(s ...googleapi.Field) *Fold // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersNotificationConfigsPatchCall) Context(ctx context.Context) *FoldersNotificationConfigsPatchCall { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall { 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 *FoldersNotificationConfigsPatchCall) Header() http.Header { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersNotificationConfigsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -10281,7 +11113,7 @@ func (c *FoldersNotificationConfigsPatchCall) doRequest(alt string) (*http.Respo } 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.googlecloudsecuritycenterv1securityhealthanalyticscustommodule) if err != nil { return nil, err } @@ -10301,14 +11133,17 @@ func (c *FoldersNotificationConfigsPatchCall) doRequest(alt string) (*http.Respo return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// 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) { +// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.customModules.patch" call. +// Exactly one of +// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule.Server +// Response.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10327,7 +11162,7 @@ func (c *FoldersNotificationConfigsPatchCall) Do(opts ...googleapi.CallOption) ( if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &NotificationConfig{ + ret := &GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10339,23 +11174,23 @@ func (c *FoldersNotificationConfigsPatchCall) Do(opts ...googleapi.CallOption) ( } return ret, nil // { - // "description": " Updates a notification config. The following update fields are allowed: description, pubsub_topic, streaming_config.filter", - // "flatPath": "v1/folders/{foldersId}/notificationConfigs/{notificationConfigsId}", + // "description": "Updates the SecurityHealthAnalyticsCustomModule under the given name based on the given update mask. Updating the enablement state is supported on both resident and inherited modules (though resident modules cannot have an enablement state of \"inherited\"). Updating the display name and custom config of a module is supported on resident modules only.", + // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/customModules/{customModulesId}", // "httpMethod": "PATCH", - // "id": "securitycenter.folders.notificationConfigs.patch", + // "id": "securitycenter.folders.securityHealthAnalyticsSettings.customModules.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\", \"folders/{folder_id}/notificationConfigs/notify_public_bucket\", or \"projects/{project_id}/notificationConfigs/notify_public_bucket\".", + // "description": "Immutable. The resource name of the custom module. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}\" The id {customModule} is server-generated and is not user settable. It will be a numeric id containing 1-20 digits.", // "location": "path", - // "pattern": "^folders/[^/]+/notificationConfigs/[^/]+$", + // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+$", // "required": true, // "type": "string" // }, // "updateMask": { - // "description": "The FieldMask to use when updating the notification config. If empty all mutable fields will be updated.", + // "description": "The list of fields to update.", // "format": "google-fieldmask", // "location": "query", // "type": "string" @@ -10363,10 +11198,10 @@ func (c *FoldersNotificationConfigsPatchCall) Do(opts ...googleapi.CallOption) ( // }, // "path": "v1/{+name}", // "request": { - // "$ref": "NotificationConfig" + // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" // }, // "response": { - // "$ref": "NotificationConfig" + // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -10375,97 +11210,104 @@ func (c *FoldersNotificationConfigsPatchCall) Do(opts ...googleapi.CallOption) ( } -// method id "securitycenter.folders.securityHealthAnalyticsSettings.customModules.create": +// method id "securitycenter.folders.securityHealthAnalyticsSettings.effectiveCustomModules.get": -type FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall struct { - s *Service - parent string - googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Create: Creates a resident SecurityHealthAnalyticsCustomModule at the -// scope of the given CRM parent, and also creates inherited -// SecurityHealthAnalyticsCustomModules for all CRM descendants of the -// given parent. These modules are enabled by default. +// Get: Retrieves an EffectiveSecurityHealthAnalyticsCustomModule. // -// - parent: Resource name of the new custom module's parent. Its format -// is "organizations/{organization}/securityHealthAnalyticsSettings", -// "folders/{folder}/securityHealthAnalyticsSettings", or -// "projects/{project}/securityHealthAnalyticsSettings". -func (r *FoldersSecurityHealthAnalyticsSettingsCustomModulesService) Create(parent string, googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule) *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall { - c := &FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule = googlecloudsecuritycenterv1securityhealthanalyticscustommodule +// - name: Name of the effective custom module to get. Its format is +// "organizations/{organization}/securityHealthAnalyticsSettings/effect +// iveCustomModules/{customModule}", +// "folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomMod +// ules/{customModule}", or +// "projects/{project}/securityHealthAnalyticsSettings/effectiveCustomM +// odules/{customModule}". +func (r *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesService) Get(name string) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { + c := &FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall{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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall { +func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { 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 *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) IfNoneMatch(entityTag string) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { + 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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall { +func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { 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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Header() http.Header { +func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) doRequest(alt string) (*http.Response, 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.googlecloudsecuritycenterv1securityhealthanalyticscustommodule) - 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}/customModules") + 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.folders.securityHealthAnalyticsSettings.customModules.create" call. +// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.effectiveCustomModules.get" call. // Exactly one of -// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule or -// error will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule.Server -// Response.Header or (if a response was returned at all) in +// *GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModu +// le or error will be non-nil. Any non-2xx status code is an error. +// Response headers are in either +// *GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModu +// le.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was // returned. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule, error) { +func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModule, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10484,7 +11326,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Do(opts if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule{ + ret := &GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10496,28 +11338,25 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Do(opts } return ret, nil // { - // "description": "Creates a resident SecurityHealthAnalyticsCustomModule at the scope of the given CRM parent, and also creates inherited SecurityHealthAnalyticsCustomModules for all CRM descendants of the given parent. These modules are enabled by default.", - // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/customModules", - // "httpMethod": "POST", - // "id": "securitycenter.folders.securityHealthAnalyticsSettings.customModules.create", + // "description": "Retrieves an EffectiveSecurityHealthAnalyticsCustomModule.", + // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/effectiveCustomModules/{effectiveCustomModulesId}", + // "httpMethod": "GET", + // "id": "securitycenter.folders.securityHealthAnalyticsSettings.effectiveCustomModules.get", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. Resource name of the new custom module's parent. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", + // "name": { + // "description": "Required. Name of the effective custom module to get. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}\", \"folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}\"", // "location": "path", - // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings$", + // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings/effectiveCustomModules/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/customModules", - // "request": { - // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" - // }, + // "path": "v1/{+name}", // "response": { - // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" + // "$ref": "GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -10526,89 +11365,119 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Do(opts } -// method id "securitycenter.folders.securityHealthAnalyticsSettings.customModules.delete": +// method id "securitycenter.folders.securityHealthAnalyticsSettings.effectiveCustomModules.list": -type FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes the specified SecurityHealthAnalyticsCustomModule and -// all of its descendants in the CRM hierarchy. This method is only -// supported for resident custom modules. +// List: Returns a list of all +// EffectiveSecurityHealthAnalyticsCustomModules for the given parent. +// This includes resident modules defined at the scope of the parent, +// and inherited modules, inherited from CRM ancestors. // -// - name: Name of the custom module to delete. Its format is -// "organizations/{organization}/securityHealthAnalyticsSettings/custom -// Modules/{customModule}", -// "folders/{folder}/securityHealthAnalyticsSettings/customModules/{cus -// tomModule}", or -// "projects/{project}/securityHealthAnalyticsSettings/customModules/{c -// ustomModule}". -func (r *FoldersSecurityHealthAnalyticsSettingsCustomModulesService) Delete(name string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall { - c := &FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: Name of parent to list effective custom modules. Its format +// is "organizations/{organization}/securityHealthAnalyticsSettings", +// "folders/{folder}/securityHealthAnalyticsSettings", or +// "projects/{project}/securityHealthAnalyticsSettings". +func (r *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesService) List(parent string) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { + c := &FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall{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 *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) PageSize(pageSize int64) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last call indicating a continuation +func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) PageToken(pageToken string) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { + 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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall { +func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { 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 *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) IfNoneMatch(entityTag string) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { + 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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall { +func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { 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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Header() http.Header { +func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) doRequest(alt string) (*http.Response, 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 := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/effectiveCustomModules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.customModules.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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.effectiveCustomModules.list" call. +// Exactly one of +// *ListEffectiveSecurityHealthAnalyticsCustomModulesResponse or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.ServerRespo +// nse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Do(opts ...googleapi.CallOption) (*ListEffectiveSecurityHealthAnalyticsCustomModulesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10627,7 +11496,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Do(opts if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &ListEffectiveSecurityHealthAnalyticsCustomModulesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10639,25 +11508,36 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Do(opts } return ret, nil // { - // "description": "Deletes the specified SecurityHealthAnalyticsCustomModule and all of its descendants in the CRM hierarchy. This method is only supported for resident custom modules.", - // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/customModules/{customModulesId}", - // "httpMethod": "DELETE", - // "id": "securitycenter.folders.securityHealthAnalyticsSettings.customModules.delete", + // "description": "Returns a list of all EffectiveSecurityHealthAnalyticsCustomModules for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from CRM ancestors.", + // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/effectiveCustomModules", + // "httpMethod": "GET", + // "id": "securitycenter.folders.securityHealthAnalyticsSettings.effectiveCustomModules.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. Name of the custom module to delete. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}\", \"folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}\"", + // "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 call indicating a continuation", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. Name of parent to list effective custom modules. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", // "location": "path", - // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+$", + // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/effectiveCustomModules", // "response": { - // "$ref": "Empty" + // "$ref": "ListEffectiveSecurityHealthAnalyticsCustomModulesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -10666,36 +11546,70 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Do(opts } -// method id "securitycenter.folders.securityHealthAnalyticsSettings.customModules.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 *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Pages(ctx context.Context, f func(*ListEffectiveSecurityHealthAnalyticsCustomModulesResponse) 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 FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall struct { +// method id "securitycenter.folders.sources.list": + +type FoldersSourcesListCall struct { s *Service - name string + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Retrieves a SecurityHealthAnalyticsCustomModule. +// List: Lists all sources belonging to an organization. // -// - name: Name of the custom module to get. Its format is -// "organizations/{organization}/securityHealthAnalyticsSettings/custom -// Modules/{customModule}", -// "folders/{folder}/securityHealthAnalyticsSettings/customModules/{cus -// tomModule}", or -// "projects/{project}/securityHealthAnalyticsSettings/customModules/{c -// ustomModule}". -func (r *FoldersSecurityHealthAnalyticsSettingsCustomModulesService) Get(name string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall { - c := &FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - 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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall { +func (c *FoldersSourcesListCall) Fields(s ...googleapi.Field) *FoldersSourcesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -10705,7 +11619,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) Fields(s .. // 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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) IfNoneMatch(entityTag string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall { +func (c *FoldersSourcesListCall) IfNoneMatch(entityTag string) *FoldersSourcesListCall { c.ifNoneMatch_ = entityTag return c } @@ -10713,21 +11627,21 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) IfNoneMatch // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall { +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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) Header() http.Header { +func (c *FoldersSourcesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) 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_ { @@ -10740,7 +11654,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) doRequest(a 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}/sources") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -10748,22 +11662,19 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) doRequest(a } 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.securityHealthAnalyticsSettings.customModules.get" call. -// Exactly one of -// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule or -// error will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule.Server -// Response.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule, 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 { @@ -10782,7 +11693,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) Do(opts ... if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule{ + ret := &ListSourcesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10794,25 +11705,36 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) Do(opts ... } return ret, nil // { - // "description": "Retrieves a SecurityHealthAnalyticsCustomModule.", - // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/customModules/{customModulesId}", + // "description": "Lists all sources belonging to an organization.", + // "flatPath": "v1/folders/{foldersId}/sources", // "httpMethod": "GET", - // "id": "securitycenter.folders.securityHealthAnalyticsSettings.customModules.get", + // "id": "securitycenter.folders.sources.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. Name of the custom module to get. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}\", \"folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}\"", + // "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/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+$", + // "pattern": "^folders/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/sources", // "response": { - // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" + // "$ref": "ListSourcesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -10821,97 +11743,102 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) Do(opts ... } -// method id "securitycenter.folders.securityHealthAnalyticsSettings.customModules.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 *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) + } +} -type FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// method id "securitycenter.folders.sources.findings.group": + +type FoldersSourcesFindingsGroupCall struct { + s *Service + parent string + groupfindingsrequest *GroupFindingsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Returns a list of all SecurityHealthAnalyticsCustomModules for -// the given parent. This includes resident modules defined at the scope -// of the parent, and inherited modules, inherited from CRM ancestors. +// 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 parent to list custom modules. Its format is -// "organizations/{organization}/securityHealthAnalyticsSettings", -// "folders/{folder}/securityHealthAnalyticsSettings", or -// "projects/{project}/securityHealthAnalyticsSettings". -func (r *FoldersSecurityHealthAnalyticsSettingsCustomModulesService) List(parent string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall { - c := &FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - 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 - 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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) PageSize(pageSize int64) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The value returned -// by the last call indicating a continuation -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) PageToken(pageToken string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall { - c.urlParams_.Set("pageToken", pageToken) + 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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall { +func (c *FoldersSourcesFindingsGroupCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsGroupCall { 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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) IfNoneMatch(entityTag string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall { - 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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall { +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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) Header() http.Header { +func (c *FoldersSourcesFindingsGroupCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) 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_ { 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.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}/customModules") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findings:group") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -10922,16 +11849,14 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) doRequest( return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.customModules.list" call. -// Exactly one of *ListSecurityHealthAnalyticsCustomModulesResponse or -// error will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *ListSecurityHealthAnalyticsCustomModulesResponse.ServerResponse.Heade -// r or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) Do(opts ...googleapi.CallOption) (*ListSecurityHealthAnalyticsCustomModulesResponse, error) { +// 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) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10950,7 +11875,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) Do(opts .. if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListSecurityHealthAnalyticsCustomModulesResponse{ + ret := &GroupFindingsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10962,36 +11887,28 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) Do(opts .. } return ret, nil // { - // "description": "Returns a list of all SecurityHealthAnalyticsCustomModules for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from CRM ancestors.", - // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/customModules", - // "httpMethod": "GET", - // "id": "securitycenter.folders.securityHealthAnalyticsSettings.customModules.list", + // "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": [ // "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 call indicating a continuation", - // "location": "query", - // "type": "string" - // }, // "parent": { - // "description": "Required. Name of parent to list custom modules. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", + // "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/[^/]+/securityHealthAnalyticsSettings$", + // "pattern": "^folders/[^/]+/sources/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/customModules", + // "path": "v1/{+parent}/findings:group", + // "request": { + // "$ref": "GroupFindingsRequest" + // }, // "response": { - // "$ref": "ListSecurityHealthAnalyticsCustomModulesResponse" + // "$ref": "GroupFindingsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -11003,9 +11920,9 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) Do(opts .. // 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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) Pages(ctx context.Context, f func(*ListSecurityHealthAnalyticsCustomModulesResponse) error) error { +func (c *FoldersSourcesFindingsGroupCall) Pages(ctx context.Context, f func(*GroupFindingsResponse) error) error { c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + defer func(pt string) { c.groupfindingsrequest.PageToken = pt }(c.groupfindingsrequest.PageToken) // reset paging to original point for { x, err := c.Do() if err != nil { @@ -11017,13 +11934,13 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) Pages(ctx if x.NextPageToken == "" { return nil } - c.PageToken(x.NextPageToken) + c.groupfindingsrequest.PageToken = x.NextPageToken } } -// method id "securitycenter.folders.securityHealthAnalyticsSettings.customModules.listDescendant": +// method id "securitycenter.folders.sources.findings.list": -type FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall struct { +type FoldersSourcesFindingsListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -11032,40 +11949,141 @@ type FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall struc header_ http.Header } -// ListDescendant: Returns a list of all resident -// SecurityHealthAnalyticsCustomModules under the given CRM parent and -// all of the parent’s CRM descendants. +// 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 parent to list descendant custom modules. Its -// format is -// "organizations/{organization}/securityHealthAnalyticsSettings", -// "folders/{folder}/securityHealthAnalyticsSettings", or -// "projects/{project}/securityHealthAnalyticsSettings". -func (r *FoldersSecurityHealthAnalyticsSettingsCustomModulesService) ListDescendant(parent string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { - c := &FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - 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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) PageSize(pageSize int64) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { +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 call indicating a continuation -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) PageToken(pageToken string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { +// 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) + 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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { +func (c *FoldersSourcesFindingsListCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -11075,7 +12093,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) // 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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) IfNoneMatch(entityTag string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { +func (c *FoldersSourcesFindingsListCall) IfNoneMatch(entityTag string) *FoldersSourcesFindingsListCall { c.ifNoneMatch_ = entityTag return c } @@ -11083,21 +12101,21 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { +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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Header() http.Header { +func (c *FoldersSourcesFindingsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) 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_ { @@ -11110,7 +12128,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules:listDescendant") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findings") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -11123,17 +12141,14 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.customModules.listDescendant" call. -// Exactly one of -// *ListDescendantSecurityHealthAnalyticsCustomModulesResponse or error -// will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *ListDescendantSecurityHealthAnalyticsCustomModulesResponse.ServerResp -// onse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Do(opts ...googleapi.CallOption) (*ListDescendantSecurityHealthAnalyticsCustomModulesResponse, error) { +// 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 +// *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 *FoldersSourcesFindingsListCall) Do(opts ...googleapi.CallOption) (*ListFindingsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -11152,7 +12167,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListDescendantSecurityHealthAnalyticsCustomModulesResponse{ + ret := &ListFindingsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11164,14 +12179,36 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) } return ret, nil // { - // "description": "Returns a list of all resident SecurityHealthAnalyticsCustomModules under the given CRM parent and all of the parent’s CRM descendants.", - // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/customModules:listDescendant", + // "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.folders.securityHealthAnalyticsSettings.customModules.listDescendant", + // "id": "securitycenter.folders.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", @@ -11179,21 +12216,27 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) // "type": "integer" // }, // "pageToken": { - // "description": "The value returned by the last call indicating a continuation", + // "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 parent to list descendant custom modules. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", + // "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": "^folders/[^/]+/securityHealthAnalyticsSettings$", + // "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/{+parent}/customModules:listDescendant", + // "path": "v1/{+parent}/findings", // "response": { - // "$ref": "ListDescendantSecurityHealthAnalyticsCustomModulesResponse" + // "$ref": "ListFindingsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -11205,7 +12248,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) // 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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Pages(ctx context.Context, f func(*ListDescendantSecurityHealthAnalyticsCustomModulesResponse) error) error { +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 { @@ -11223,43 +12266,41 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) } } -// method id "securitycenter.folders.securityHealthAnalyticsSettings.customModules.patch": +// method id "securitycenter.folders.sources.findings.patch": -type FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall struct { - s *Service - name string - googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersSourcesFindingsPatchCall struct { + s *Service + name string + finding *Finding + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates the SecurityHealthAnalyticsCustomModule under the -// given name based on the given update mask. Updating the enablement -// state is supported on both resident and inherited modules (though -// resident modules cannot have an enablement state of "inherited"). -// Updating the display name and custom config of a module is supported -// on resident modules only. +// Patch: Creates or updates a finding. The corresponding source must +// exist for a finding creation to succeed. // -// - name: Immutable. The resource name of the custom module. Its format -// is -// "organizations/{organization}/securityHealthAnalyticsSettings/custom -// Modules/{customModule}", or -// "folders/{folder}/securityHealthAnalyticsSettings/customModules/{cus -// tomModule}", or -// "projects/{project}/securityHealthAnalyticsSettings/customModules/{c -// ustomModule}" The id {customModule} is server-generated and is not -// user settable. It will be a numeric id containing 1-20 digits. -func (r *FoldersSecurityHealthAnalyticsSettingsCustomModulesService) Patch(name string, googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule) *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall { - c := &FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The relative resource name +// (https://cloud.google.com/apis/design/resource_names#relative_resource_name) +// of the finding. Example: +// "organizations/{organization_id}/sources/{source_id}/findings/{findi +// ng_id}", +// "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", +// "projects/{project_id}/sources/{source_id}/findings/{finding_id}". +func (r *FoldersSourcesFindingsService) Patch(name string, finding *Finding) *FoldersSourcesFindingsPatchCall { + c := &FoldersSourcesFindingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule = googlecloudsecuritycenterv1securityhealthanalyticscustommodule + c.finding = finding return c } -// UpdateMask sets the optional parameter "updateMask": The list of -// fields to update. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) UpdateMask(updateMask string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall { +// 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) return c } @@ -11267,7 +12308,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) UpdateMas // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall { +func (c *FoldersSourcesFindingsPatchCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -11275,21 +12316,21 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Fields(s // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall { +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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Header() http.Header { +func (c *FoldersSourcesFindingsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) 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_ { @@ -11297,7 +12338,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) doRequest } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.finding) if err != nil { return nil, err } @@ -11317,17 +12358,14 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) doRequest return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.customModules.patch" call. -// Exactly one of -// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule or -// error will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule.Server -// Response.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule, 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 { @@ -11346,7 +12384,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Do(opts . if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule{ + ret := &Finding{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11358,23 +12396,23 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Do(opts . } return ret, nil // { - // "description": "Updates the SecurityHealthAnalyticsCustomModule under the given name based on the given update mask. Updating the enablement state is supported on both resident and inherited modules (though resident modules cannot have an enablement state of \"inherited\"). Updating the display name and custom config of a module is supported on resident modules only.", - // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/customModules/{customModulesId}", + // "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.securityHealthAnalyticsSettings.customModules.patch", + // "id": "securitycenter.folders.sources.findings.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Immutable. The resource name of the custom module. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}\" The id {customModule} is server-generated and is not user settable. It will be a numeric id containing 1-20 digits.", + // "description": "The [relative resource name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) of the finding. Example: \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}\", \"folders/{folder_id}/sources/{source_id}/findings/{finding_id}\", \"projects/{project_id}/sources/{source_id}/findings/{finding_id}\".", // "location": "path", - // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+$", + // "pattern": "^folders/[^/]+/sources/[^/]+/findings/[^/]+$", // "required": true, // "type": "string" // }, // "updateMask": { - // "description": "The list of fields to update.", + // "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" @@ -11382,10 +12420,10 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Do(opts . // }, // "path": "v1/{+name}", // "request": { - // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" + // "$ref": "Finding" // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" + // "$ref": "Finding" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -11394,83 +12432,76 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Do(opts . } -// method id "securitycenter.folders.securityHealthAnalyticsSettings.effectiveCustomModules.get": +// method id "securitycenter.folders.sources.findings.setMute": -type FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type FoldersSourcesFindingsSetMuteCall struct { + s *Service + name string + setmuterequest *SetMuteRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Retrieves an EffectiveSecurityHealthAnalyticsCustomModule. +// SetMute: Updates the mute state of a finding. // -// - name: Name of the effective custom module to get. Its format is -// "organizations/{organization}/securityHealthAnalyticsSettings/effect -// iveCustomModules/{customModule}", -// "folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomMod -// ules/{customModule}", or -// "projects/{project}/securityHealthAnalyticsSettings/effectiveCustomM -// odules/{customModule}". -func (r *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesService) Get(name string) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { - c := &FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The relative resource name +// (https://cloud.google.com/apis/design/resource_names#relative_resource_name) +// of the finding. Example: +// "organizations/{organization_id}/sources/{source_id}/findings/{findi +// ng_id}", +// "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", +// "projects/{project_id}/sources/{source_id}/findings/{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 *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { +func (c *FoldersSourcesFindingsSetMuteCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsSetMuteCall { 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 *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) IfNoneMatch(entityTag string) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { - 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 *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { +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 *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Header() http.Header { +func (c *FoldersSourcesFindingsSetMuteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) 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_ { 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.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}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setMute") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -11481,17 +12512,14 @@ func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) do return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.effectiveCustomModules.get" call. -// Exactly one of -// *GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModu -// le or error will be non-nil. Any non-2xx status code is an error. -// Response headers are in either -// *GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModu -// le.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModule, 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 { @@ -11510,7 +12538,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Do if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModule{ + ret := &Finding{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11522,25 +12550,28 @@ func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Do } return ret, nil // { - // "description": "Retrieves an EffectiveSecurityHealthAnalyticsCustomModule.", - // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/effectiveCustomModules/{effectiveCustomModulesId}", - // "httpMethod": "GET", - // "id": "securitycenter.folders.securityHealthAnalyticsSettings.effectiveCustomModules.get", + // "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", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the effective custom module to get. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}\", \"folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}\"", + // "description": "Required. The [relative resource name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) of the finding. Example: \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}\", \"folders/{folder_id}/sources/{source_id}/findings/{finding_id}\", \"projects/{project_id}/sources/{source_id}/findings/{finding_id}\".", // "location": "path", - // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings/effectiveCustomModules/[^/]+$", + // "pattern": "^folders/[^/]+/sources/[^/]+/findings/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+name}:setMute", + // "request": { + // "$ref": "SetMuteRequest" + // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModule" + // "$ref": "Finding" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -11549,119 +12580,94 @@ func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Do } -// method id "securitycenter.folders.securityHealthAnalyticsSettings.effectiveCustomModules.list": +// method id "securitycenter.folders.sources.findings.setState": -type FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall 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: Returns a list of all -// EffectiveSecurityHealthAnalyticsCustomModules for the given parent. -// This includes resident modules defined at the scope of the parent, -// and inherited modules, inherited from CRM ancestors. +// SetState: Updates the state of a finding. // -// - parent: Name of parent to list effective custom modules. Its format -// is "organizations/{organization}/securityHealthAnalyticsSettings", -// "folders/{folder}/securityHealthAnalyticsSettings", or -// "projects/{project}/securityHealthAnalyticsSettings". -func (r *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesService) List(parent string) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { - c := &FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall{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 *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) PageSize(pageSize int64) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The value returned -// by the last call indicating a continuation -func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) PageToken(pageToken string) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { - c.urlParams_.Set("pageToken", pageToken) +// - name: The relative resource name +// (https://cloud.google.com/apis/design/resource_names#relative_resource_name) +// of the finding. Example: +// "organizations/{organization_id}/sources/{source_id}/findings/{findi +// ng_id}", +// "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", +// "projects/{project_id}/sources/{source_id}/findings/{finding_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 } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { +func (c *FoldersSourcesFindingsSetStateCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsSetStateCall { 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 *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) IfNoneMatch(entityTag string) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { - 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 *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { +func (c *FoldersSourcesFindingsSetStateCall) Context(ctx context.Context) *FoldersSourcesFindingsSetStateCall { 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 *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Header() http.Header { +func (c *FoldersSourcesFindingsSetStateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) doRequest(alt string) (*http.Response, error) { +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()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } 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/{+parent}/effectiveCustomModules") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setState") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.effectiveCustomModules.list" call. -// Exactly one of -// *ListEffectiveSecurityHealthAnalyticsCustomModulesResponse or error -// will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.ServerRespo -// nse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Do(opts ...googleapi.CallOption) (*ListEffectiveSecurityHealthAnalyticsCustomModulesResponse, error) { +// 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 { @@ -11680,7 +12686,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) D if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListEffectiveSecurityHealthAnalyticsCustomModulesResponse{ + ret := &Finding{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11692,36 +12698,28 @@ func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) D } return ret, nil // { - // "description": "Returns a list of all EffectiveSecurityHealthAnalyticsCustomModules for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from CRM ancestors.", - // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/effectiveCustomModules", - // "httpMethod": "GET", - // "id": "securitycenter.folders.securityHealthAnalyticsSettings.effectiveCustomModules.list", + // "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": [ - // "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 call indicating a continuation", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. Name of parent to list effective custom modules. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", + // "name": { + // "description": "Required. The [relative resource name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) of the finding. Example: \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}\", \"folders/{folder_id}/sources/{source_id}/findings/{finding_id}\", \"projects/{project_id}/sources/{source_id}/findings/{finding_id}\".", // "location": "path", - // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings$", + // "pattern": "^folders/[^/]+/sources/[^/]+/findings/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/effectiveCustomModules", + // "path": "v1/{+name}:setState", + // "request": { + // "$ref": "SetFindingStateRequest" + // }, // "response": { - // "$ref": "ListEffectiveSecurityHealthAnalyticsCustomModulesResponse" + // "$ref": "Finding" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -11730,135 +12728,112 @@ func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) D } -// 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 *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Pages(ctx context.Context, f func(*ListEffectiveSecurityHealthAnalyticsCustomModulesResponse) 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.list": +// method id "securitycenter.folders.sources.findings.updateSecurityMarks": -type FoldersSourcesListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type FoldersSourcesFindingsUpdateSecurityMarksCall struct { + s *Service + name string + securitymarks *SecurityMarks + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists all sources belonging to an organization. +// UpdateSecurityMarks: Updates security marks. // -// - 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 +// - 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 } -// 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)) +// 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 } -// 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) +// 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 *FoldersSourcesListCall) Fields(s ...googleapi.Field) *FoldersSourcesListCall { +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 *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 *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 *FoldersSourcesListCall) Header() http.Header { +func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) 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 *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}/sources") + 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.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 +// 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 *FoldersSourcesListCall) Do(opts ...googleapi.CallOption) (*ListSourcesResponse, 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 { @@ -11877,7 +12852,7 @@ func (c *FoldersSourcesListCall) Do(opts ...googleapi.CallOption) (*ListSourcesR if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListSourcesResponse{ + ret := &SecurityMarks{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11889,36 +12864,40 @@ 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": "Updates security marks.", + // "flatPath": "v1/folders/{foldersId}/sources/{sourcesId}/findings/{findingsId}/securityMarks", + // "httpMethod": "PATCH", + // "id": "securitycenter.folders.sources.findings.updateSecurityMarks", // "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" + // "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": "^folders/[^/]+/sources/[^/]+/findings/[^/]+/securityMarks$", + // "required": true, + // "type": "string" // }, - // "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.", + // "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" // }, - // "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/[^/]+$", - // "required": true, + // "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}/sources", + // "path": "v1/{+name}", + // "request": { + // "$ref": "SecurityMarks" + // }, // "response": { - // "$ref": "ListSourcesResponse" + // "$ref": "SecurityMarks" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -11927,63 +12906,43 @@ 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.sources.findings.externalSystems.patch": -type FoldersSourcesFindingsGroupCall struct { - s *Service - parent string - groupfindingsrequest *GroupFindingsRequest - 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 } -// 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 +// Patch: Updates external system. This is for a given finding. // -// - 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: Full resource name of the external system, for example: +// "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 *FoldersSourcesFindingsGroupCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsGroupCall { +func (c *FoldersSourcesFindingsExternalSystemsPatchCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsExternalSystemsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -11991,21 +12950,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 *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 *FoldersSourcesFindingsGroupCall) Header() http.Header { +func (c *FoldersSourcesFindingsExternalSystemsPatchCall) 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 *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_ { @@ -12013,34 +12972,36 @@ 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) + 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}/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("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.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.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 { @@ -12059,7 +13020,7 @@ func (c *FoldersSourcesFindingsGroupCall) Do(opts ...googleapi.CallOption) (*Gro if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GroupFindingsResponse{ + ret := &GoogleCloudSecuritycenterV1ExternalSystem{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12071,28 +13032,34 @@ 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": "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 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": "Full resource name of the external system, for example: \"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/[^/]+$", + // "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}/findings:group", + // "path": "v1/{+name}", // "request": { - // "$ref": "GroupFindingsRequest" + // "$ref": "GoogleCloudSecuritycenterV1ExternalSystem" // }, // "response": { - // "$ref": "GroupFindingsResponse" + // "$ref": "GoogleCloudSecuritycenterV1ExternalSystem" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -12101,173 +13068,32 @@ 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.organizations.getOrganizationSettings": -type FoldersSourcesFindingsListCall struct { +type OrganizationsGetOrganizationSettingsCall 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 +// GetOrganizationSettings: Gets the settings for 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 *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 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 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 *OrganizationsGetOrganizationSettingsCall) Fields(s ...googleapi.Field) *OrganizationsGetOrganizationSettingsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -12277,7 +13103,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 *OrganizationsGetOrganizationSettingsCall) IfNoneMatch(entityTag string) *OrganizationsGetOrganizationSettingsCall { c.ifNoneMatch_ = entityTag return c } @@ -12285,21 +13111,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 *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 *FoldersSourcesFindingsListCall) Header() http.Header { +func (c *OrganizationsGetOrganizationSettingsCall) 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 *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_ { @@ -12312,7 +13138,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 { @@ -12320,19 +13146,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.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 -// *ListFindingsResponse.ServerResponse.Header or (if a response was +// *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 *FoldersSourcesFindingsListCall) Do(opts ...googleapi.CallOption) (*ListFindingsResponse, 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 { @@ -12351,7 +13177,7 @@ func (c *FoldersSourcesFindingsListCall) Do(opts ...googleapi.CallOption) (*List if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListFindingsResponse{ + ret := &OrganizationSettings{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12363,64 +13189,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 the settings for an organization.", + // "flatPath": "v1/organizations/{organizationsId}/organizationSettings", // "httpMethod": "GET", - // "id": "securitycenter.folders.sources.findings.list", + // "id": "securitycenter.organizations.getOrganizationSettings", // "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 organization to get organization settings for. Its format is \"organizations/[organization_id]/organizationSettings\".", // "location": "path", - // "pattern": "^folders/[^/]+/sources/[^/]+$", + // "pattern": "^organizations/[^/]+/organizationSettings$", // "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": "OrganizationSettings" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -12429,62 +13216,33 @@ 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.organizations.updateOrganizationSettings": -type FoldersSourcesFindingsPatchCall struct { - s *Service - name string - finding *Finding - 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 } -// Patch: Creates or updates a finding. The corresponding source must -// exist for a finding creation to succeed. +// UpdateOrganizationSettings: Updates an organization's settings. // -// - name: The relative resource name -// (https://cloud.google.com/apis/design/resource_names#relative_resource_name) -// of the finding. Example: -// "organizations/{organization_id}/sources/{source_id}/findings/{findi -// ng_id}", -// "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", -// "projects/{project_id}/sources/{source_id}/findings/{finding_id}". -func (r *FoldersSourcesFindingsService) Patch(name string, finding *Finding) *FoldersSourcesFindingsPatchCall { - c := &FoldersSourcesFindingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - 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.finding = finding + c.organizationsettings = organizationsettings 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 { +// 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 } @@ -12492,7 +13250,7 @@ func (c *FoldersSourcesFindingsPatchCall) UpdateMask(updateMask string) *Folders // 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 *OrganizationsUpdateOrganizationSettingsCall) Fields(s ...googleapi.Field) *OrganizationsUpdateOrganizationSettingsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -12500,21 +13258,21 @@ func (c *FoldersSourcesFindingsPatchCall) 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 *FoldersSourcesFindingsPatchCall) Context(ctx context.Context) *FoldersSourcesFindingsPatchCall { +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 *FoldersSourcesFindingsPatchCall) Header() http.Header { +func (c *OrganizationsUpdateOrganizationSettingsCall) 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 *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_ { @@ -12522,7 +13280,7 @@ func (c *FoldersSourcesFindingsPatchCall) doRequest(alt string) (*http.Response, } 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.organizationsettings) if err != nil { return nil, err } @@ -12542,14 +13300,14 @@ func (c *FoldersSourcesFindingsPatchCall) doRequest(alt string) (*http.Response, 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.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 { @@ -12568,7 +13326,7 @@ func (c *FoldersSourcesFindingsPatchCall) Do(opts ...googleapi.CallOption) (*Fin if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Finding{ + ret := &OrganizationSettings{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12580,23 +13338,23 @@ 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}", + // "description": "Updates an organization's settings.", + // "flatPath": "v1/organizations/{organizationsId}/organizationSettings", // "httpMethod": "PATCH", - // "id": "securitycenter.folders.sources.findings.patch", + // "id": "securitycenter.organizations.updateOrganizationSettings", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "The [relative resource name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) of the finding. Example: \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}\", \"folders/{folder_id}/sources/{source_id}/findings/{finding_id}\", \"projects/{project_id}/sources/{source_id}/findings/{finding_id}\".", + // "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": "^folders/[^/]+/sources/[^/]+/findings/[^/]+$", + // "pattern": "^organizations/[^/]+/organizationSettings$", // "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 settings resource. If empty all mutable fields will be updated.", // "format": "google-fieldmask", // "location": "query", // "type": "string" @@ -12604,10 +13362,10 @@ func (c *FoldersSourcesFindingsPatchCall) Do(opts ...googleapi.CallOption) (*Fin // }, // "path": "v1/{+name}", // "request": { - // "$ref": "Finding" + // "$ref": "OrganizationSettings" // }, // "response": { - // "$ref": "Finding" + // "$ref": "OrganizationSettings" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -12616,37 +13374,34 @@ func (c *FoldersSourcesFindingsPatchCall) Do(opts ...googleapi.CallOption) (*Fin } -// method id "securitycenter.folders.sources.findings.setMute": +// method id "securitycenter.organizations.assets.group": -type FoldersSourcesFindingsSetMuteCall struct { - s *Service - name string - setmuterequest *SetMuteRequest - 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 } -// SetMute: Updates the mute state of a finding. +// Group: Filters an organization's assets and groups them by their +// specified properties. // -// - name: The relative resource name -// (https://cloud.google.com/apis/design/resource_names#relative_resource_name) -// of the finding. Example: -// "organizations/{organization_id}/sources/{source_id}/findings/{findi -// ng_id}", -// "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", -// "projects/{project_id}/sources/{source_id}/findings/{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 +// - parent: The name of the parent to group the assets by. 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 *FoldersSourcesFindingsSetMuteCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsSetMuteCall { +func (c *OrganizationsAssetsGroupCall) Fields(s ...googleapi.Field) *OrganizationsAssetsGroupCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -12654,21 +13409,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 *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 *FoldersSourcesFindingsSetMuteCall) Header() http.Header { +func (c *OrganizationsAssetsGroupCall) 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 *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_ { @@ -12676,14 +13431,14 @@ 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.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}:setMute") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/assets:group") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -12691,19 +13446,19 @@ func (c *FoldersSourcesFindingsSetMuteCall) doRequest(alt string) (*http.Respons } 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.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.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 { @@ -12722,7 +13477,7 @@ func (c *FoldersSourcesFindingsSetMuteCall) Do(opts ...googleapi.CallOption) (*F if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Finding{ + ret := &GroupAssetsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12734,28 +13489,29 @@ 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", + // "deprecated": true, + // "description": "Filters an organization's assets and groups them by their specified properties.", + // "flatPath": "v1/organizations/{organizationsId}/assets:group", // "httpMethod": "POST", - // "id": "securitycenter.folders.sources.findings.setMute", + // "id": "securitycenter.organizations.assets.group", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The [relative resource name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) of the finding. Example: \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}\", \"folders/{folder_id}/sources/{source_id}/findings/{finding_id}\", \"projects/{project_id}/sources/{source_id}/findings/{finding_id}\".", + // "parent": { + // "description": "Required. The name of the parent to group the assets by. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", // "location": "path", - // "pattern": "^folders/[^/]+/sources/[^/]+/findings/[^/]+$", + // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}:setMute", + // "path": "v1/{+parent}/assets:group", // "request": { - // "$ref": "SetMuteRequest" + // "$ref": "GroupAssetsRequest" // }, // "response": { - // "$ref": "Finding" + // "$ref": "GroupAssetsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -12764,520 +13520,178 @@ func (c *FoldersSourcesFindingsSetMuteCall) Do(opts ...googleapi.CallOption) (*F } -// method id "securitycenter.folders.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 *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 + } +} -type FoldersSourcesFindingsSetStateCall struct { - s *Service - name string - setfindingstaterequest *SetFindingStateRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "securitycenter.organizations.assets.list": + +type OrganizationsAssetsListCall 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 an organization's assets. // -// - name: The relative resource name -// (https://cloud.google.com/apis/design/resource_names#relative_resource_name) -// of the finding. Example: -// "organizations/{organization_id}/sources/{source_id}/findings/{findi -// ng_id}", -// "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", -// "projects/{project_id}/sources/{source_id}/findings/{finding_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: The name of the parent resource that contains the assets. +// The value that you can specify on parent depends on the method in +// which you specify parent. You can specify one of the following +// values: "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 } -// 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)) +// 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 } -// Context sets the context 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 +// 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 } -// 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_ -} - -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) -} - -// 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, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &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](https://cloud.google.com/apis/design/resource_names#relative_resource_name) of the finding. Example: \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}\", \"folders/{folder_id}/sources/{source_id}/findings/{finding_id}\", \"projects/{project_id}/sources/{source_id}/findings/{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 -} - -// 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 -} - -// 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 *FoldersSourcesFindingsUpdateSecurityMarksCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsUpdateSecurityMarksCall { - 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 *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 *FoldersSourcesFindingsUpdateSecurityMarksCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -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()) - 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.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 *FoldersSourcesFindingsUpdateSecurityMarksCall) 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, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &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/folders/{foldersId}/sources/{sourcesId}/findings/{findingsId}/securityMarks", - // "httpMethod": "PATCH", - // "id": "securitycenter.folders.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": "^folders/[^/]+/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.folders.sources.findings.externalSystems.patch": - -type FoldersSourcesFindingsExternalSystemsPatchCall 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: Full resource name of the external system, for example: -// "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 +// 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 } -// 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) +// 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 } -// 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)) +// 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 } -// Context sets the context 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 +// 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 } -// 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_ -} - -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, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &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": "Full resource name of the external system, for example: \"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" - // ] - // } - -} - -// method id "securitycenter.organizations.getOrganizationSettings": - -type OrganizationsGetOrganizationSettingsCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// 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 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 *OrganizationsGetOrganizationSettingsCall) Fields(s ...googleapi.Field) *OrganizationsGetOrganizationSettingsCall { +func (c *OrganizationsAssetsListCall) Fields(s ...googleapi.Field) *OrganizationsAssetsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -13287,7 +13701,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 *OrganizationsAssetsListCall) IfNoneMatch(entityTag string) *OrganizationsAssetsListCall { c.ifNoneMatch_ = entityTag return c } @@ -13295,21 +13709,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 *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 *OrganizationsGetOrganizationSettingsCall) Header() http.Header { +func (c *OrganizationsAssetsListCall) 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 *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_ { @@ -13322,7 +13736,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}/assets") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -13330,19 +13744,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.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 -// *OrganizationSettings.ServerResponse.Header or (if a response was +// *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 *OrganizationsGetOrganizationSettingsCall) Do(opts ...googleapi.CallOption) (*OrganizationSettings, error) { +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 { @@ -13361,7 +13775,7 @@ func (c *OrganizationsGetOrganizationSettingsCall) Do(opts ...googleapi.CallOpti if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &OrganizationSettings{ + ret := &ListAssetsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13373,25 +13787,65 @@ func (c *OrganizationsGetOrganizationSettingsCall) Do(opts ...googleapi.CallOpti } return ret, nil // { - // "description": "Gets the settings for an organization.", - // "flatPath": "v1/organizations/{organizationsId}/organizationSettings", + // "deprecated": true, + // "description": "Lists an organization's assets.", + // "flatPath": "v1/organizations/{organizationsId}/assets", // "httpMethod": "GET", - // "id": "securitycenter.organizations.getOrganizationSettings", + // "id": "securitycenter.organizations.assets.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 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. The name of the parent resource that contains the assets. The value that you can specify on parent depends on the method in which you specify parent. You can specify one of the following values: \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", // "location": "path", - // "pattern": "^organizations/[^/]+/organizationSettings$", + // "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": "OrganizationSettings" + // "$ref": "ListAssetsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -13400,41 +13854,56 @@ func (c *OrganizationsGetOrganizationSettingsCall) Do(opts ...googleapi.CallOpti } -// method id "securitycenter.organizations.updateOrganizationSettings": - -type OrganizationsUpdateOrganizationSettingsCall struct { - s *Service - name string - organizationsettings *OrganizationSettings - 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 *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) + } } -// UpdateOrganizationSettings: Updates an organization's settings. -// -// - 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 +// method id "securitycenter.organizations.assets.runDiscovery": + +type OrganizationsAssetsRunDiscoveryCall struct { + s *Service + parent string + runassetdiscoveryrequest *RunAssetDiscoveryRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// 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) +// 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 *OrganizationsUpdateOrganizationSettingsCall) Fields(s ...googleapi.Field) *OrganizationsUpdateOrganizationSettingsCall { +func (c *OrganizationsAssetsRunDiscoveryCall) Fields(s ...googleapi.Field) *OrganizationsAssetsRunDiscoveryCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -13442,21 +13911,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 *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 *OrganizationsUpdateOrganizationSettingsCall) Header() http.Header { +func (c *OrganizationsAssetsRunDiscoveryCall) 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 *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_ { @@ -13464,34 +13933,34 @@ 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.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/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/assets:runDiscovery") 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.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.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 { @@ -13510,7 +13979,7 @@ func (c *OrganizationsUpdateOrganizationSettingsCall) Do(opts ...googleapi.CallO if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &OrganizationSettings{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13522,34 +13991,29 @@ func (c *OrganizationsUpdateOrganizationSettingsCall) Do(opts ...googleapi.CallO } return ret, nil // { - // "description": "Updates an organization's settings.", - // "flatPath": "v1/organizations/{organizationsId}/organizationSettings", - // "httpMethod": "PATCH", - // "id": "securitycenter.organizations.updateOrganizationSettings", + // "deprecated": true, + // "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": [ - // "name" + // "parent" // ], // "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\".", + // "parent": { + // "description": "Required. Name of the organization to run asset discovery for. Its format is \"organizations/[organization_id]\".", // "location": "path", - // "pattern": "^organizations/[^/]+/organizationSettings$", + // "pattern": "^organizations/[^/]+$", // "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/{+name}", + // "path": "v1/{+parent}/assets:runDiscovery", // "request": { - // "$ref": "OrganizationSettings" + // "$ref": "RunAssetDiscoveryRequest" // }, // "response": { - // "$ref": "OrganizationSettings" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -13558,34 +14022,55 @@ func (c *OrganizationsUpdateOrganizationSettingsCall) Do(opts ...googleapi.CallO } -// method id "securitycenter.organizations.assets.group": +// method id "securitycenter.organizations.assets.updateSecurityMarks": -type OrganizationsAssetsGroupCall struct { - s *Service - parent string - groupassetsrequest *GroupAssetsRequest - 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 } -// Group: Filters an organization's assets and groups them by their -// specified properties. +// UpdateSecurityMarks: Updates security marks. // -// - parent: The name of the parent to group the assets by. 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 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.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 *OrganizationsAssetsGroupCall) Fields(s ...googleapi.Field) *OrganizationsAssetsGroupCall { +func (c *OrganizationsAssetsUpdateSecurityMarksCall) Fields(s ...googleapi.Field) *OrganizationsAssetsUpdateSecurityMarksCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -13593,21 +14078,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 *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 *OrganizationsAssetsGroupCall) Header() http.Header { +func (c *OrganizationsAssetsUpdateSecurityMarksCall) 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 *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_ { @@ -13615,34 +14100,34 @@ 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.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:group") + 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.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 +// 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 *OrganizationsAssetsGroupCall) Do(opts ...googleapi.CallOption) (*GroupAssetsResponse, error) { +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 { @@ -13661,7 +14146,7 @@ func (c *OrganizationsAssetsGroupCall) Do(opts ...googleapi.CallOption) (*GroupA if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GroupAssetsResponse{ + ret := &SecurityMarks{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13673,29 +14158,40 @@ func (c *OrganizationsAssetsGroupCall) Do(opts ...googleapi.CallOption) (*GroupA } return ret, nil // { - // "deprecated": true, - // "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", + // "description": "Updates security marks.", + // "flatPath": "v1/organizations/{organizationsId}/assets/{assetsId}/securityMarks", + // "httpMethod": "PATCH", + // "id": "securitycenter.organizations.assets.updateSecurityMarks", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. The name of the parent to group the assets by. 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": "^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 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:group", + // "path": "v1/{+name}", // "request": { - // "$ref": "GroupAssetsRequest" + // "$ref": "SecurityMarks" // }, // "response": { - // "$ref": "GroupAssetsResponse" + // "$ref": "SecurityMarks" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -13704,225 +14200,82 @@ 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.organizations.bigQueryExports.create": -type OrganizationsAssetsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsBigQueryExportsCreateCall struct { + s *Service + parent string + googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists an organization's assets. +// Create: Creates a BigQuery export. // -// - parent: The name of the parent resource that contains the assets. -// The value that you can specify on parent depends on the method in -// which you specify parent. You can specify one of the following -// values: "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)} +// - parent: The name of the parent resource of the new BigQuery export. +// 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 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) +// BigQueryExportId sets the optional parameter "bigQueryExportId": +// Required. Unique identifier provided by the client within the parent +// scope. It must consist of only lowercase letters, numbers, and +// hyphens, must start with a letter, must end with either a letter or a +// number, and must be 63 characters or less. +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 *OrganizationsAssetsListCall) Fields(s ...googleapi.Field) *OrganizationsAssetsListCall { +func (c *OrganizationsBigQueryExportsCreateCall) Fields(s ...googleapi.Field) *OrganizationsBigQueryExportsCreateCall { 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 *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 *OrganizationsAssetsListCall) Header() http.Header { +func (c *OrganizationsBigQueryExportsCreateCall) 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 *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_ { 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.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}/assets") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/bigQueryExports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -13933,14 +14286,16 @@ func (c *OrganizationsAssetsListCall) doRequest(alt string) (*http.Response, err 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 -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAssetsResponse, 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 { @@ -13959,7 +14314,7 @@ func (c *OrganizationsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAss if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListAssetsResponse{ + ret := &GoogleCloudSecuritycenterV1BigQueryExport{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13971,65 +14326,33 @@ func (c *OrganizationsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAss } return ret, nil // { - // "deprecated": true, - // "description": "Lists an organization's assets.", - // "flatPath": "v1/organizations/{organizationsId}/assets", - // "httpMethod": "GET", - // "id": "securitycenter.organizations.assets.list", + // "description": "Creates a BigQuery export.", + // "flatPath": "v1/organizations/{organizationsId}/bigQueryExports", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.bigQueryExports.create", // "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.", + // "bigQueryExportId": { + // "description": "Required. Unique identifier provided by the client within the parent scope. It must consist of only lowercase letters, numbers, and hyphens, must start with a letter, must end with either a letter or a number, and must be 63 characters or less.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. The name of the parent resource that contains the assets. The value that you can specify on parent depends on the method in which you specify parent. You can specify one of the following values: \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "description": "Required. The name of the parent resource of the new BigQuery export. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", // "location": "path", // "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/{+parent}/assets", + // "path": "v1/{+parent}/bigQueryExports", + // "request": { + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // }, // "response": { - // "$ref": "ListAssetsResponse" + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -14038,56 +14361,32 @@ 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.organizations.bigQueryExports.delete": -type OrganizationsAssetsRunDiscoveryCall struct { - s *Service - parent string - runassetdiscoveryrequest *RunAssetDiscoveryRequest - 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 } -// 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. +// Delete: Deletes an existing BigQuery export. // -// - 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: The name of the BigQuery 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 *OrganizationsAssetsRunDiscoveryCall) Fields(s ...googleapi.Field) *OrganizationsAssetsRunDiscoveryCall { +func (c *OrganizationsBigQueryExportsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsBigQueryExportsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -14095,21 +14394,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 *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 *OrganizationsAssetsRunDiscoveryCall) Header() http.Header { +func (c *OrganizationsBigQueryExportsDeleteCall) 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 *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_ { @@ -14117,34 +14416,29 @@ 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) - 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("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.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.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 { @@ -14163,7 +14457,7 @@ func (c *OrganizationsAssetsRunDiscoveryCall) Do(opts ...googleapi.CallOption) ( if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14175,29 +14469,25 @@ func (c *OrganizationsAssetsRunDiscoveryCall) Do(opts ...googleapi.CallOption) ( } return ret, nil // { - // "deprecated": true, - // "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": "Deletes an existing BigQuery export.", + // "flatPath": "v1/organizations/{organizationsId}/bigQueryExports/{bigQueryExportsId}", + // "httpMethod": "DELETE", + // "id": "securitycenter.organizations.bigQueryExports.delete", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. Name of the organization to run asset discovery for. Its format is \"organizations/[organization_id]\".", + // "name": { + // "description": "Required. The name of the BigQuery 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}/assets:runDiscovery", - // "request": { - // "$ref": "RunAssetDiscoveryRequest" - // }, + // "path": "v1/{+name}", // "response": { - // "$ref": "Operation" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -14206,94 +14496,80 @@ func (c *OrganizationsAssetsRunDiscoveryCall) Do(opts ...googleapi.CallOption) ( } -// method id "securitycenter.organizations.assets.updateSecurityMarks": +// method id "securitycenter.organizations.bigQueryExports.get": -type OrganizationsAssetsUpdateSecurityMarksCall struct { - s *Service - name string - securitymarks *SecurityMarks - 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 } -// UpdateSecurityMarks: Updates security marks. +// Get: Gets 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 *OrganizationsAssetsService) UpdateSecurityMarks(name string, securitymarks *SecurityMarks) *OrganizationsAssetsUpdateSecurityMarksCall { - c := &OrganizationsAssetsUpdateSecurityMarksCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Name of the BigQuery 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 - 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 *OrganizationsBigQueryExportsGetCall) Fields(s ...googleapi.Field) *OrganizationsBigQueryExportsGetCall { 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 *OrganizationsBigQueryExportsGetCall) IfNoneMatch(entityTag string) *OrganizationsBigQueryExportsGetCall { + 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 *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 *OrganizationsAssetsUpdateSecurityMarksCall) Header() http.Header { +func (c *OrganizationsBigQueryExportsGetCall) 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 *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_ { reqHeaders[k] = v } - reqHeaders.Set("User-Agent", c.s.userAgent()) + 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 } @@ -14304,14 +14580,16 @@ 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 -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsAssetsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOption) (*SecurityMarks, 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 { @@ -14330,7 +14608,7 @@ func (c *OrganizationsAssetsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOp if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &SecurityMarks{ + ret := &GoogleCloudSecuritycenterV1BigQueryExport{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14342,40 +14620,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 a BigQuery export.", + // "flatPath": "v1/organizations/{organizationsId}/bigQueryExports/{bigQueryExportsId}", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.bigQueryExports.get", // "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 BigQuery 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/[^/]+/assets/[^/]+/securityMarks$", + // "pattern": "^organizations/[^/]+/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.\".", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, // "path": "v1/{+name}", - // "request": { - // "$ref": "SecurityMarks" - // }, // "response": { - // "$ref": "SecurityMarks" + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -14384,82 +14647,102 @@ func (c *OrganizationsAssetsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOp } -// method id "securitycenter.organizations.bigQueryExports.create": +// method id "securitycenter.organizations.bigQueryExports.list": -type OrganizationsBigQueryExportsCreateCall struct { - s *Service - parent string - googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsBigQueryExportsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Create: Creates a BigQuery export. +// 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 name of the parent resource of the new BigQuery export. +// - parent: The parent, which owns the collection of BigQuery exports. // 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)} +// "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 - 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 only lowercase letters, numbers, and -// hyphens, must start with a letter, must end with either a letter or a -// number, and must be 63 characters or less. -func (c *OrganizationsBigQueryExportsCreateCall) BigQueryExportId(bigQueryExportId string) *OrganizationsBigQueryExportsCreateCall { - c.urlParams_.Set("bigQueryExportId", bigQueryExportId) +// 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 +} + +// 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) 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 *OrganizationsBigQueryExportsListCall) Fields(s ...googleapi.Field) *OrganizationsBigQueryExportsListCall { 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 *OrganizationsBigQueryExportsCreateCall) Context(ctx context.Context) *OrganizationsBigQueryExportsCreateCall { +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 *OrganizationsBigQueryExportsCreateCall) Header() http.Header { +func (c *OrganizationsBigQueryExportsListCall) 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 *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_ { 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/{+parent}/bigQueryExports") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -14470,16 +14753,14 @@ func (c *OrganizationsBigQueryExportsCreateCall) doRequest(alt string) (*http.Re 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.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) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14498,7 +14779,7 @@ func (c *OrganizationsBigQueryExportsCreateCall) Do(opts ...googleapi.CallOption if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1BigQueryExport{ + ret := &ListBigQueryExportsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14510,21 +14791,27 @@ func (c *OrganizationsBigQueryExportsCreateCall) Do(opts ...googleapi.CallOption } return ret, nil // { - // "description": "Creates a BigQuery export.", + // "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": "POST", - // "id": "securitycenter.organizations.bigQueryExports.create", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.bigQueryExports.list", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "bigQueryExportId": { - // "description": "Required. Unique identifier provided by the client within the parent scope. It must consist of only lowercase letters, numbers, and hyphens, must start with a letter, must end with either a letter or a number, and must be 63 characters or less.", + // "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 name of the parent resource of the new BigQuery export. 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": "^organizations/[^/]+$", // "required": true, @@ -14532,11 +14819,8 @@ func (c *OrganizationsBigQueryExportsCreateCall) Do(opts ...googleapi.CallOption // } // }, // "path": "v1/{+parent}/bigQueryExports", - // "request": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" - // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // "$ref": "ListBigQueryExportsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -14545,32 +14829,66 @@ func (c *OrganizationsBigQueryExportsCreateCall) Do(opts ...googleapi.CallOption } -// method id "securitycenter.organizations.bigQueryExports.delete": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *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) + } +} -type OrganizationsBigQueryExportsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "securitycenter.organizations.bigQueryExports.patch": + +type OrganizationsBigQueryExportsPatchCall struct { + s *Service + name string + googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes an existing BigQuery export. +// Patch: Updates a BigQuery export. // -// - name: The name of the BigQuery 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)} +// - 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.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 *OrganizationsBigQueryExportsPatchCall) UpdateMask(updateMask string) *OrganizationsBigQueryExportsPatchCall { + 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 *OrganizationsBigQueryExportsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsBigQueryExportsDeleteCall { +func (c *OrganizationsBigQueryExportsPatchCall) Fields(s ...googleapi.Field) *OrganizationsBigQueryExportsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -14578,21 +14896,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 *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 *OrganizationsBigQueryExportsDeleteCall) Header() http.Header { +func (c *OrganizationsBigQueryExportsPatchCall) 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 *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_ { @@ -14600,11 +14918,16 @@ 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.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 += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -14615,14 +14938,16 @@ func (c *OrganizationsBigQueryExportsDeleteCall) doRequest(alt string) (*http.Re 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.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 { @@ -14641,7 +14966,7 @@ func (c *OrganizationsBigQueryExportsDeleteCall) Do(opts ...googleapi.CallOption if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &GoogleCloudSecuritycenterV1BigQueryExport{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14653,25 +14978,34 @@ func (c *OrganizationsBigQueryExportsDeleteCall) Do(opts ...googleapi.CallOption } return ret, nil // { - // "description": "Deletes an existing BigQuery export.", + // "description": "Updates a BigQuery export.", // "flatPath": "v1/organizations/{organizationsId}/bigQueryExports/{bigQueryExportsId}", - // "httpMethod": "DELETE", - // "id": "securitycenter.organizations.bigQueryExports.delete", + // "httpMethod": "PATCH", + // "id": "securitycenter.organizations.bigQueryExports.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The name of the BigQuery export to delete. Its format is organizations/{organization}/bigQueryExports/{export_id}, folders/{folder}/bigQueryExports/{export_id}, or projects/{project}/bigQueryExports/{export_id}", + // "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/[^/]+/bigQueryExports/[^/]+$", // "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}", + // "request": { + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // }, // "response": { - // "$ref": "Empty" + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -14680,100 +15014,93 @@ func (c *OrganizationsBigQueryExportsDeleteCall) Do(opts ...googleapi.CallOption } -// method id "securitycenter.organizations.bigQueryExports.get": +// method id "securitycenter.organizations.eventThreatDetectionSettings.validateCustomModule": -type OrganizationsBigQueryExportsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall struct { + s *Service + parent string + validateeventthreatdetectioncustommodulerequest *ValidateEventThreatDetectionCustomModuleRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a BigQuery export. +// ValidateCustomModule: Validates the given Event Threat Detection +// custom module. // -// - name: Name of the BigQuery 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: Resource name of the parent to validate the Custom Module +// under. Its format is: * +// "organizations/{organization}/eventThreatDetectionSettings". +func (r *OrganizationsEventThreatDetectionSettingsService) ValidateCustomModule(parent string, validateeventthreatdetectioncustommodulerequest *ValidateEventThreatDetectionCustomModuleRequest) *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall { + c := &OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.validateeventthreatdetectioncustommodulerequest = validateeventthreatdetectioncustommodulerequest 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 *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall { 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 *OrganizationsBigQueryExportsGetCall) IfNoneMatch(entityTag string) *OrganizationsBigQueryExportsGetCall { - 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 *OrganizationsBigQueryExportsGetCall) Context(ctx context.Context) *OrganizationsBigQueryExportsGetCall { +func (c *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) Context(ctx context.Context) *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall { 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 *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) 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 *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) doRequest(alt string) (*http.Response, 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.validateeventthreatdetectioncustommodulerequest) + 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}:validateCustomModule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.bigQueryExports.get" call. -// Exactly one of *GoogleCloudSecuritycenterV1BigQueryExport or error -// will be non-nil. Any non-2xx status code is an error. Response +// Do executes the "securitycenter.organizations.eventThreatDetectionSettings.validateCustomModule" call. +// Exactly one of *ValidateEventThreatDetectionCustomModuleResponse 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 +// *ValidateEventThreatDetectionCustomModuleResponse.ServerResponse.Heade +// r or (if a response was returned 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) { +func (c *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) Do(opts ...googleapi.CallOption) (*ValidateEventThreatDetectionCustomModuleResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14792,7 +15119,7 @@ func (c *OrganizationsBigQueryExportsGetCall) Do(opts ...googleapi.CallOption) ( if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1BigQueryExport{ + ret := &ValidateEventThreatDetectionCustomModuleResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14804,25 +15131,28 @@ func (c *OrganizationsBigQueryExportsGetCall) Do(opts ...googleapi.CallOption) ( } return ret, nil // { - // "description": "Gets a BigQuery export.", - // "flatPath": "v1/organizations/{organizationsId}/bigQueryExports/{bigQueryExportsId}", - // "httpMethod": "GET", - // "id": "securitycenter.organizations.bigQueryExports.get", + // "description": "Validates the given Event Threat Detection custom module.", + // "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings:validateCustomModule", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.eventThreatDetectionSettings.validateCustomModule", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. Name of the BigQuery export to retrieve. Its format is organizations/{organization}/bigQueryExports/{export_id}, folders/{folder}/bigQueryExports/{export_id}, or projects/{project}/bigQueryExports/{export_id}", + // "parent": { + // "description": "Required. Resource name of the parent to validate the Custom Module under. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\".", // "location": "path", - // "pattern": "^organizations/[^/]+/bigQueryExports/[^/]+$", + // "pattern": "^organizations/[^/]+/eventThreatDetectionSettings$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}:validateCustomModule", + // "request": { + // "$ref": "ValidateEventThreatDetectionCustomModuleRequest" + // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // "$ref": "ValidateEventThreatDetectionCustomModuleResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -14831,102 +15161,71 @@ func (c *OrganizationsBigQueryExportsGetCall) Do(opts ...googleapi.CallOption) ( } -// method id "securitycenter.organizations.bigQueryExports.list": +// method id "securitycenter.organizations.eventThreatDetectionSettings.customModules.create": -type OrganizationsBigQueryExportsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall struct { + s *Service + parent string + eventthreatdetectioncustommodule *EventThreatDetectionCustomModule + urlParams_ gensupport.URLParams + 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. +// Create: Creates an Event Threat Detection custom module. // -// - 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)} +// - parent: The new custom module's parent. Its format is: * +// "organizations/{organization}/eventThreatDetectionSettings". +func (r *OrganizationsEventThreatDetectionSettingsCustomModulesService) Create(parent string, eventthreatdetectioncustommodule *EventThreatDetectionCustomModule) *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall { + c := &OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall{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 *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 `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) + c.eventthreatdetectioncustommodule = eventthreatdetectioncustommodule 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 *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall { 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 *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) Context(ctx context.Context) *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall { 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 *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) 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 *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) doRequest(alt string) (*http.Response, 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.eventthreatdetectioncustommodule) + 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}/customModules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -14937,14 +15236,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 +// Do executes the "securitycenter.organizations.eventThreatDetectionSettings.customModules.create" call. +// Exactly one of *EventThreatDetectionCustomModule or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *EventThreatDetectionCustomModule.ServerResponse.Header or (if +// a response was returned 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) { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) Do(opts ...googleapi.CallOption) (*EventThreatDetectionCustomModule, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14963,7 +15262,7 @@ func (c *OrganizationsBigQueryExportsListCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListBigQueryExportsResponse{ + ret := &EventThreatDetectionCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14975,36 +15274,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", - // "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" - // }, + // "description": "Creates an Event Threat Detection custom module.", + // "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.create", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { // "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. The new custom module's parent. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\".", // "location": "path", - // "pattern": "^organizations/[^/]+$", + // "pattern": "^organizations/[^/]+/eventThreatDetectionSettings$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/bigQueryExports", + // "path": "v1/{+parent}/customModules", + // "request": { + // "$ref": "EventThreatDetectionCustomModule" + // }, // "response": { - // "$ref": "ListBigQueryExportsResponse" + // "$ref": "EventThreatDetectionCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -15013,66 +15304,31 @@ 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.eventThreatDetectionSettings.customModules.delete": -type OrganizationsBigQueryExportsPatchCall struct { - s *Service - name string - googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates a BigQuery export. +// Delete: Deletes an Event Threat Detection custom module. // -// - 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: Name of the custom module to delete. Its format is: * +// "organizations/{organization}/eventThreatDetectionSettings/customMod +// ules/{module}". +func (r *OrganizationsEventThreatDetectionSettingsCustomModulesService) Delete(name string) *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall { + c := &OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - 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 *OrganizationsBigQueryExportsPatchCall) UpdateMask(updateMask string) *OrganizationsBigQueryExportsPatchCall { - 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 *OrganizationsBigQueryExportsPatchCall) Fields(s ...googleapi.Field) *OrganizationsBigQueryExportsPatchCall { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -15080,21 +15336,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 *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) Context(ctx context.Context) *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall { 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 *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) 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 *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -15102,16 +15358,11 @@ 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) - 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 } @@ -15122,16 +15373,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.eventThreatDetectionSettings.customModules.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 *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15150,7 +15399,7 @@ func (c *OrganizationsBigQueryExportsPatchCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1BigQueryExport{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -15162,34 +15411,25 @@ func (c *OrganizationsBigQueryExportsPatchCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Updates a BigQuery export.", - // "flatPath": "v1/organizations/{organizationsId}/bigQueryExports/{bigQueryExportsId}", - // "httpMethod": "PATCH", - // "id": "securitycenter.organizations.bigQueryExports.patch", + // "description": "Deletes an Event Threat Detection custom module.", + // "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules/{customModulesId}", + // "httpMethod": "DELETE", + // "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.delete", // "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": "Required. Name of the custom module to delete. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\".", // "location": "path", - // "pattern": "^organizations/[^/]+/bigQueryExports/[^/]+$", + // "pattern": "^organizations/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", // "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}", - // "request": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" - // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -15198,95 +15438,97 @@ func (c *OrganizationsBigQueryExportsPatchCall) Do(opts ...googleapi.CallOption) } -// method id "securitycenter.organizations.eventThreatDetectionSettings.validateCustomModule": +// method id "securitycenter.organizations.eventThreatDetectionSettings.customModules.get": -type OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall struct { - s *Service - parent string - validateeventthreatdetectioncustommodulerequest *ValidateEventThreatDetectionCustomModuleRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsEventThreatDetectionSettingsCustomModulesGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// ValidateCustomModule: Validates the given Event Threat Detection -// Custom Module. +// Get: Gets an Event Threat Detection custom module. // -// - parent: Resource name of the parent to validate the Custom Module -// under. Its format is: * -// "organizations/{organization}/eventThreatDetectionSettings". * -// "folders/{folder}/eventThreatDetectionSettings". * -// "projects/{project}/eventThreatDetectionSettings". -func (r *OrganizationsEventThreatDetectionSettingsService) ValidateCustomModule(parent string, validateeventthreatdetectioncustommodulerequest *ValidateEventThreatDetectionCustomModuleRequest) *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall { - c := &OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.validateeventthreatdetectioncustommodulerequest = validateeventthreatdetectioncustommodulerequest +// - name: Name of the custom module to get. Its format is: * +// "organizations/{organization}/eventThreatDetectionSettings/customMod +// ules/{module}". +func (r *OrganizationsEventThreatDetectionSettingsCustomModulesService) Get(name string) *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall { + c := &OrganizationsEventThreatDetectionSettingsCustomModulesGetCall{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 *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall { 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 *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) IfNoneMatch(entityTag string) *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall { + 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 *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) Context(ctx context.Context) *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) Context(ctx context.Context) *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall { 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 *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) Header() http.Header { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) doRequest(alt string) (*http.Response, 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.validateeventthreatdetectioncustommodulerequest) - 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}:validateCustomModule") + 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.eventThreatDetectionSettings.validateCustomModule" call. -// Exactly one of *ValidateEventThreatDetectionCustomModuleResponse or -// error will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *ValidateEventThreatDetectionCustomModuleResponse.ServerResponse.Heade -// r or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) Do(opts ...googleapi.CallOption) (*ValidateEventThreatDetectionCustomModuleResponse, error) { +// Do executes the "securitycenter.organizations.eventThreatDetectionSettings.customModules.get" call. +// Exactly one of *EventThreatDetectionCustomModule or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *EventThreatDetectionCustomModule.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) Do(opts ...googleapi.CallOption) (*EventThreatDetectionCustomModule, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15305,7 +15547,7 @@ func (c *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) Do(o if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ValidateEventThreatDetectionCustomModuleResponse{ + ret := &EventThreatDetectionCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -15317,28 +15559,25 @@ func (c *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) Do(o } return ret, nil // { - // "description": "Validates the given Event Threat Detection Custom Module.", - // "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings:validateCustomModule", - // "httpMethod": "POST", - // "id": "securitycenter.organizations.eventThreatDetectionSettings.validateCustomModule", + // "description": "Gets an Event Threat Detection custom module.", + // "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules/{customModulesId}", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.get", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. Resource name of the parent to validate the Custom Module under. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", + // "name": { + // "description": "Required. Name of the custom module to get. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\".", // "location": "path", - // "pattern": "^organizations/[^/]+/eventThreatDetectionSettings$", + // "pattern": "^organizations/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}:validateCustomModule", - // "request": { - // "$ref": "ValidateEventThreatDetectionCustomModuleRequest" - // }, + // "path": "v1/{+name}", // "response": { - // "$ref": "ValidateEventThreatDetectionCustomModuleResponse" + // "$ref": "EventThreatDetectionCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -15347,74 +15586,98 @@ func (c *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) Do(o } -// method id "securitycenter.organizations.eventThreatDetectionSettings.customModules.create": +// method id "securitycenter.organizations.eventThreatDetectionSettings.customModules.list": -type OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall struct { - s *Service - parent string - eventthreatdetectioncustommodule *EventThreatDetectionCustomModule - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsEventThreatDetectionSettingsCustomModulesListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists Event Threat Detection custom modules. +// +// - parent: Name of the parent to list custom modules under. Its format +// is: * "organizations/{organization}/eventThreatDetectionSettings". +func (r *OrganizationsEventThreatDetectionSettingsCustomModulesService) List(parent string) *OrganizationsEventThreatDetectionSettingsCustomModulesListCall { + c := &OrganizationsEventThreatDetectionSettingsCustomModulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of modules 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 *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) PageSize(pageSize int64) *OrganizationsEventThreatDetectionSettingsCustomModulesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c } -// Create: Creates an ETD custom module at the given level. Creating a -// module has a side-effect of creating modules at all descendants. -// -// - parent: The new custom module's parent. Its format is: * -// "organizations/{organization}/eventThreatDetectionSettings". * -// "folders/{folder}/eventThreatDetectionSettings". * -// "projects/{project}/eventThreatDetectionSettings". -func (r *OrganizationsEventThreatDetectionSettingsCustomModulesService) Create(parent string, eventthreatdetectioncustommodule *EventThreatDetectionCustomModule) *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall { - c := &OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.eventthreatdetectioncustommodule = eventthreatdetectioncustommodule +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous `ListEventThreatDetectionCustomModules` +// call. Provide this to retrieve the subsequent page. When paginating, +// all other parameters provided to +// `ListEventThreatDetectionCustomModules` must match the call that +// provided the page token. +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) PageToken(pageToken string) *OrganizationsEventThreatDetectionSettingsCustomModulesListCall { + 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 *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsCustomModulesListCall { 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 *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) IfNoneMatch(entityTag string) *OrganizationsEventThreatDetectionSettingsCustomModulesListCall { + 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 *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) Context(ctx context.Context) *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) Context(ctx context.Context) *OrganizationsEventThreatDetectionSettingsCustomModulesListCall { 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 *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) Header() http.Header { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) doRequest(alt string) (*http.Response, 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.eventthreatdetectioncustommodule) - 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}/customModules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -15425,14 +15688,16 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) doReq return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.eventThreatDetectionSettings.customModules.create" call. -// Exactly one of *EventThreatDetectionCustomModule or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *EventThreatDetectionCustomModule.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) Do(opts ...googleapi.CallOption) (*EventThreatDetectionCustomModule, error) { +// Do executes the "securitycenter.organizations.eventThreatDetectionSettings.customModules.list" call. +// Exactly one of *ListEventThreatDetectionCustomModulesResponse or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *ListEventThreatDetectionCustomModulesResponse.ServerResponse.Header +// or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) Do(opts ...googleapi.CallOption) (*ListEventThreatDetectionCustomModulesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15451,7 +15716,7 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) Do(op if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &EventThreatDetectionCustomModule{ + ret := &ListEventThreatDetectionCustomModulesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -15463,16 +15728,27 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) Do(op } return ret, nil // { - // "description": "Creates an ETD custom module at the given level. Creating a module has a side-effect of creating modules at all descendants.", + // "description": "Lists Event Threat Detection custom modules.", // "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules", - // "httpMethod": "POST", - // "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.create", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.list", // "parameterOrder": [ // "parent" // ], // "parameters": { + // "pageSize": { + // "description": "The maximum number of modules 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 `ListEventThreatDetectionCustomModules` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListEventThreatDetectionCustomModules` must match the call that provided the page token.", + // "location": "query", + // "type": "string" + // }, // "parent": { - // "description": "Required. The new custom module's parent. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", + // "description": "Required. Name of the parent to list custom modules under. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\".", // "location": "path", // "pattern": "^organizations/[^/]+/eventThreatDetectionSettings$", // "required": true, @@ -15480,11 +15756,8 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) Do(op // } // }, // "path": "v1/{+parent}/customModules", - // "request": { - // "$ref": "EventThreatDetectionCustomModule" - // }, // "response": { - // "$ref": "EventThreatDetectionCustomModule" + // "$ref": "ListEventThreatDetectionCustomModulesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -15493,37 +15766,66 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) Do(op } -// method id "securitycenter.organizations.eventThreatDetectionSettings.customModules.delete": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) Pages(ctx context.Context, f func(*ListEventThreatDetectionCustomModulesResponse) 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 OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "securitycenter.organizations.eventThreatDetectionSettings.customModules.patch": + +type OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall struct { + s *Service + name string + eventthreatdetectioncustommodule *EventThreatDetectionCustomModule + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes an ETD custom module. Deletion at resident level also -// deletes modules at all descendants. Deletion at any other level is -// not supported. +// Patch: Updates an Event Threat Detection custom module. // -// - name: Name of the custom module to delete. Its format is: * +// - name: Immutable. The resource name of the Event Threat Detection +// custom module. Its format is: * // "organizations/{organization}/eventThreatDetectionSettings/customMod // ules/{module}". * // "folders/{folder}/eventThreatDetectionSettings/customModules/{module // }". * // "projects/{project}/eventThreatDetectionSettings/customModules/{modu // le}". -func (r *OrganizationsEventThreatDetectionSettingsCustomModulesService) Delete(name string) *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall { - c := &OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *OrganizationsEventThreatDetectionSettingsCustomModulesService) Patch(name string, eventthreatdetectioncustommodule *EventThreatDetectionCustomModule) *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall { + c := &OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.eventthreatdetectioncustommodule = eventthreatdetectioncustommodule + 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 *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) UpdateMask(updateMask string) *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall { + 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 *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -15531,21 +15833,21 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) 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 *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) Context(ctx context.Context) *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) Context(ctx context.Context) *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall { 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 *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) Header() http.Header { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -15553,11 +15855,16 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) doReq } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventthreatdetectioncustommodule) + 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("DELETE", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -15568,14 +15875,14 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) doReq return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.eventThreatDetectionSettings.customModules.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 *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "securitycenter.organizations.eventThreatDetectionSettings.customModules.patch" call. +// Exactly one of *EventThreatDetectionCustomModule or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *EventThreatDetectionCustomModule.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) Do(opts ...googleapi.CallOption) (*EventThreatDetectionCustomModule, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15594,7 +15901,7 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) Do(op if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &EventThreatDetectionCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -15606,25 +15913,34 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) Do(op } return ret, nil // { - // "description": "Deletes an ETD custom module. Deletion at resident level also deletes modules at all descendants. Deletion at any other level is not supported.", + // "description": "Updates an Event Threat Detection custom module.", // "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules/{customModulesId}", - // "httpMethod": "DELETE", - // "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.delete", + // "httpMethod": "PATCH", + // "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the custom module to delete. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", + // "description": "Immutable. The resource name of the Event Threat Detection custom module. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", // "location": "path", // "pattern": "^organizations/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", // "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}", + // "request": { + // "$ref": "EventThreatDetectionCustomModule" + // }, // "response": { - // "$ref": "Empty" + // "$ref": "EventThreatDetectionCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -15633,102 +15949,93 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) Do(op } -// method id "securitycenter.organizations.eventThreatDetectionSettings.customModules.get": +// method id "securitycenter.organizations.findings.bulkMute": -type OrganizationsEventThreatDetectionSettingsCustomModulesGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsFindingsBulkMuteCall struct { + s *Service + parent string + bulkmutefindingsrequest *BulkMuteFindingsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets an ETD custom module. Retrieves the module at the given -// level. +// 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. // -// - name: Name of the custom module to get. Its format is: * -// "organizations/{organization}/eventThreatDetectionSettings/customMod -// ules/{module}". * -// "folders/{folder}/eventThreatDetectionSettings/customModules/{module -// }". * -// "projects/{project}/eventThreatDetectionSettings/customModules/{modu -// le}". -func (r *OrganizationsEventThreatDetectionSettingsCustomModulesService) Get(name string) *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall { - c := &OrganizationsEventThreatDetectionSettingsCustomModulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - 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 *OrganizationsFindingsService) BulkMute(parent string, bulkmutefindingsrequest *BulkMuteFindingsRequest) *OrganizationsFindingsBulkMuteCall { + c := &OrganizationsFindingsBulkMuteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + 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 *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall { +func (c *OrganizationsFindingsBulkMuteCall) Fields(s ...googleapi.Field) *OrganizationsFindingsBulkMuteCall { 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 *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) IfNoneMatch(entityTag string) *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall { - 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 *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) Context(ctx context.Context) *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall { +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 *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) Header() http.Header { +func (c *OrganizationsFindingsBulkMuteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) 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_ { 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.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/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findings:bulkMute") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.eventThreatDetectionSettings.customModules.get" call. -// Exactly one of *EventThreatDetectionCustomModule or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *EventThreatDetectionCustomModule.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) Do(opts ...googleapi.CallOption) (*EventThreatDetectionCustomModule, 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 { @@ -15747,7 +16054,7 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) Do(opts if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &EventThreatDetectionCustomModule{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -15759,25 +16066,28 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) Do(opts } return ret, nil // { - // "description": "Gets an ETD custom module. Retrieves the module at the given level.", - // "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules/{customModulesId}", - // "httpMethod": "GET", - // "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.get", + // "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.findings.bulkMute", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. Name of the custom module to get. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", + // "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]\".", // "location": "path", - // "pattern": "^organizations/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", + // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/findings:bulkMute", + // "request": { + // "$ref": "BulkMuteFindingsRequest" + // }, // "response": { - // "$ref": "EventThreatDetectionCustomModule" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -15786,101 +16096,82 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) Do(opts } -// method id "securitycenter.organizations.eventThreatDetectionSettings.customModules.list": +// method id "securitycenter.organizations.muteConfigs.create": -type OrganizationsEventThreatDetectionSettingsCustomModulesListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsMuteConfigsCreateCall struct { + s *Service + parent string + googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists ETD custom modules. Retrieve all resident and inherited -// modules at the given level (no descendants). +// Create: Creates a mute config. // -// - parent: Name of the parent to list custom modules. Its format is: * -// "organizations/{organization}/eventThreatDetectionSettings". * -// "folders/{folder}/eventThreatDetectionSettings". * -// "projects/{project}/eventThreatDetectionSettings". -func (r *OrganizationsEventThreatDetectionSettingsCustomModulesService) List(parent string) *OrganizationsEventThreatDetectionSettingsCustomModulesListCall { - c := &OrganizationsEventThreatDetectionSettingsCustomModulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - 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 } -// PageSize sets the optional parameter "pageSize": The maximum number -// of modules 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 *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) PageSize(pageSize int64) *OrganizationsEventThreatDetectionSettingsCustomModulesListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": A page token, -// received from a previous `ListEventThreatDetectionCustomModules` -// call. Provide this to retrieve the subsequent page. When paginating, -// all other parameters provided to -// `ListEventThreatDetectionCustomModules` must match the call that -// provided the page token. -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) PageToken(pageToken string) *OrganizationsEventThreatDetectionSettingsCustomModulesListCall { - c.urlParams_.Set("pageToken", pageToken) +// MuteConfigId sets the optional parameter "muteConfigId": Required. +// Unique identifier provided by the client within the parent scope. It +// must consist of only lowercase letters, numbers, and hyphens, must +// start with a letter, must end with either a letter or a number, and +// must be 63 characters or less. +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 *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsCustomModulesListCall { +func (c *OrganizationsMuteConfigsCreateCall) Fields(s ...googleapi.Field) *OrganizationsMuteConfigsCreateCall { 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 *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) IfNoneMatch(entityTag string) *OrganizationsEventThreatDetectionSettingsCustomModulesListCall { - 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 *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) Context(ctx context.Context) *OrganizationsEventThreatDetectionSettingsCustomModulesListCall { +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 *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) Header() http.Header { +func (c *OrganizationsMuteConfigsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) 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_ { 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.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}/customModules") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/muteConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -15891,16 +16182,15 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) doReque return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.eventThreatDetectionSettings.customModules.list" call. -// Exactly one of *ListEventThreatDetectionCustomModulesResponse or -// error will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *ListEventThreatDetectionCustomModulesResponse.ServerResponse.Header -// or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) Do(opts ...googleapi.CallOption) (*ListEventThreatDetectionCustomModulesResponse, 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 { @@ -15919,7 +16209,7 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) Do(opts if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListEventThreatDetectionCustomModulesResponse{ + ret := &GoogleCloudSecuritycenterV1MuteConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -15931,36 +16221,33 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) Do(opts } return ret, nil // { - // "description": "Lists ETD custom modules. Retrieve all resident and inherited modules at the given level (no descendants).", - // "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules", - // "httpMethod": "GET", - // "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.list", + // "description": "Creates a mute config.", + // "flatPath": "v1/organizations/{organizationsId}/muteConfigs", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.muteConfigs.create", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "pageSize": { - // "description": "The maximum number of modules 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 `ListEventThreatDetectionCustomModules` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListEventThreatDetectionCustomModules` must match the call that provided the page token.", + // "muteConfigId": { + // "description": "Required. Unique identifier provided by the client within the parent scope. It must consist of only lowercase letters, numbers, and hyphens, must start with a letter, must end with either a letter or a number, and must be 63 characters or less.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. Name of the parent to list custom modules. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", + // "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/[^/]+/eventThreatDetectionSettings$", + // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/customModules", + // "path": "v1/{+parent}/muteConfigs", + // "request": { + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // }, // "response": { - // "$ref": "ListEventThreatDetectionCustomModulesResponse" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -15969,70 +16256,32 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) Do(opts } -// 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 *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) Pages(ctx context.Context, f func(*ListEventThreatDetectionCustomModulesResponse) 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.eventThreatDetectionSettings.customModules.patch": +// method id "securitycenter.organizations.muteConfigs.delete": -type OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall struct { - s *Service - name string - eventthreatdetectioncustommodule *EventThreatDetectionCustomModule - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsMuteConfigsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates an ETD custom module at the given level. All config -// fields can be updated when updating the module at resident level. -// Only enablement state can be updated when updating the module at -// inherited levels. Updating the module has a side-effect that it -// updates all descendants that are inherited from this module. +// Delete: Deletes an existing mute config. // -// - name: Immutable. The resource name of the Event Threat Detection -// custom module. Its format is: * -// "organizations/{organization}/eventThreatDetectionSettings/customMod -// ules/{module}". * -// "folders/{folder}/eventThreatDetectionSettings/customModules/{module -// }". * -// "projects/{project}/eventThreatDetectionSettings/customModules/{modu -// le}". -func (r *OrganizationsEventThreatDetectionSettingsCustomModulesService) Patch(name string, eventthreatdetectioncustommodule *EventThreatDetectionCustomModule) *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall { - c := &OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall{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 - c.eventthreatdetectioncustommodule = eventthreatdetectioncustommodule - 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 *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) UpdateMask(updateMask string) *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall { - 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 *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall { +func (c *OrganizationsMuteConfigsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsMuteConfigsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -16040,21 +16289,21 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) Fields // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) Context(ctx context.Context) *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall { +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 *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) Header() http.Header { +func (c *OrganizationsMuteConfigsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) 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_ { @@ -16062,16 +16311,11 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) doRequ } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventthreatdetectioncustommodule) - 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 } @@ -16082,14 +16326,14 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) doRequ return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.eventThreatDetectionSettings.customModules.patch" call. -// Exactly one of *EventThreatDetectionCustomModule or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *EventThreatDetectionCustomModule.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) Do(opts ...googleapi.CallOption) (*EventThreatDetectionCustomModule, 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 { @@ -16108,7 +16352,7 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) Do(opt if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &EventThreatDetectionCustomModule{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -16120,34 +16364,25 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) Do(opt } return ret, nil // { - // "description": "Updates an ETD custom module at the given level. All config fields can be updated when updating the module at resident level. Only enablement state can be updated when updating the module at inherited levels. Updating the module has a side-effect that it updates all descendants that are inherited from this module.", - // "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules/{customModulesId}", - // "httpMethod": "PATCH", - // "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.patch", + // "description": "Deletes an existing mute config.", + // "flatPath": "v1/organizations/{organizationsId}/muteConfigs/{muteConfigsId}", + // "httpMethod": "DELETE", + // "id": "securitycenter.organizations.muteConfigs.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Immutable. The resource name of the Event Threat Detection custom module. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", + // "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/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", + // "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}", - // "request": { - // "$ref": "EventThreatDetectionCustomModule" - // }, // "response": { - // "$ref": "EventThreatDetectionCustomModule" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -16156,93 +16391,99 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) Do(opt } -// method id "securitycenter.organizations.findings.bulkMute": +// method id "securitycenter.organizations.muteConfigs.get": -type OrganizationsFindingsBulkMuteCall struct { - s *Service - parent string - bulkmutefindingsrequest *BulkMuteFindingsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsMuteConfigsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + 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. +// Get: Gets 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 *OrganizationsFindingsService) BulkMute(parent string, bulkmutefindingsrequest *BulkMuteFindingsRequest) *OrganizationsFindingsBulkMuteCall { - c := &OrganizationsFindingsBulkMuteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.bulkmutefindingsrequest = bulkmutefindingsrequest +// - 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 *OrganizationsFindingsBulkMuteCall) Fields(s ...googleapi.Field) *OrganizationsFindingsBulkMuteCall { +func (c *OrganizationsMuteConfigsGetCall) Fields(s ...googleapi.Field) *OrganizationsMuteConfigsGetCall { 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 *OrganizationsMuteConfigsGetCall) IfNoneMatch(entityTag string) *OrganizationsMuteConfigsGetCall { + 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 *OrganizationsFindingsBulkMuteCall) Context(ctx context.Context) *OrganizationsFindingsBulkMuteCall { +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 *OrganizationsFindingsBulkMuteCall) Header() http.Header { +func (c *OrganizationsMuteConfigsGetCall) 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 *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_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkmutefindingsrequest) - 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:bulkMute") + 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.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.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) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -16261,7 +16502,7 @@ func (c *OrganizationsFindingsBulkMuteCall) Do(opts ...googleapi.CallOption) (*O if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &GoogleCloudSecuritycenterV1MuteConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -16273,28 +16514,25 @@ 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", - // "httpMethod": "POST", - // "id": "securitycenter.organizations.findings.bulkMute", + // "description": "Gets a mute config.", + // "flatPath": "v1/organizations/{organizationsId}/muteConfigs/{muteConfigsId}", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.muteConfigs.get", // "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": "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}/findings:bulkMute", - // "request": { - // "$ref": "BulkMuteFindingsRequest" - // }, + // "path": "v1/{+name}", // "response": { - // "$ref": "Operation" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -16303,82 +16541,98 @@ func (c *OrganizationsFindingsBulkMuteCall) Do(opts ...googleapi.CallOption) (*O } -// method id "securitycenter.organizations.muteConfigs.create": +// method id "securitycenter.organizations.muteConfigs.list": -type OrganizationsMuteConfigsCreateCall struct { - s *Service - parent string - googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig - 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 } -// Create: Creates a mute config. +// List: Lists mute configs. // -// - parent: Resource name of the new mute configs's parent. Its format -// is "organizations/[organization_id]", "folders/[folder_id]", or +// - 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) Create(parent string, googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig) *OrganizationsMuteConfigsCreateCall { - c := &OrganizationsMuteConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *OrganizationsMuteConfigsService) List(parent string) *OrganizationsMuteConfigsListCall { + c := &OrganizationsMuteConfigsListCall{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 only lowercase letters, numbers, and hyphens, must -// start with a letter, must end with either a letter or a number, and -// must be 63 characters or less. -func (c *OrganizationsMuteConfigsCreateCall) MuteConfigId(muteConfigId string) *OrganizationsMuteConfigsCreateCall { - c.urlParams_.Set("muteConfigId", muteConfigId) +// 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 *OrganizationsMuteConfigsCreateCall) Fields(s ...googleapi.Field) *OrganizationsMuteConfigsCreateCall { +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 *OrganizationsMuteConfigsCreateCall) Context(ctx context.Context) *OrganizationsMuteConfigsCreateCall { +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 *OrganizationsMuteConfigsCreateCall) Header() http.Header { +func (c *OrganizationsMuteConfigsListCall) 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 *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.googlecloudsecuritycenterv1muteconfig) - 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}/muteConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -16389,15 +16643,14 @@ func (c *OrganizationsMuteConfigsCreateCall) doRequest(alt string) (*http.Respon 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 +// 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 // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *OrganizationsMuteConfigsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, 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 { @@ -16416,7 +16669,7 @@ func (c *OrganizationsMuteConfigsCreateCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1MuteConfig{ + ret := &ListMuteConfigsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -16428,21 +16681,27 @@ func (c *OrganizationsMuteConfigsCreateCall) Do(opts ...googleapi.CallOption) (* } return ret, nil // { - // "description": "Creates a mute config.", + // "description": "Lists mute configs.", // "flatPath": "v1/organizations/{organizationsId}/muteConfigs", - // "httpMethod": "POST", - // "id": "securitycenter.organizations.muteConfigs.create", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.muteConfigs.list", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "muteConfigId": { - // "description": "Required. Unique identifier provided by the client within the parent scope. It must consist of only lowercase letters, numbers, and hyphens, must start with a letter, must end with either a letter or a number, and must be 63 characters or less.", + // "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 `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. Resource name of the new mute configs's parent. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "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, @@ -16450,11 +16709,8 @@ func (c *OrganizationsMuteConfigsCreateCall) Do(opts ...googleapi.CallOption) (* // } // }, // "path": "v1/{+parent}/muteConfigs", - // "request": { - // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" - // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // "$ref": "ListMuteConfigsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -16463,32 +16719,62 @@ func (c *OrganizationsMuteConfigsCreateCall) Do(opts ...googleapi.CallOption) (* } -// method id "securitycenter.organizations.muteConfigs.delete": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *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) + } +} + +// method id "securitycenter.organizations.muteConfigs.patch": -type OrganizationsMuteConfigsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsMuteConfigsPatchCall struct { + s *Service + name string + googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes an existing mute config. +// Patch: Updates a mute 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 *OrganizationsMuteConfigsService) Delete(name string) *OrganizationsMuteConfigsDeleteCall { - c := &OrganizationsMuteConfigsDeleteCall{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 *OrganizationsMuteConfigsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsMuteConfigsDeleteCall { +func (c *OrganizationsMuteConfigsPatchCall) Fields(s ...googleapi.Field) *OrganizationsMuteConfigsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -16496,21 +16782,21 @@ func (c *OrganizationsMuteConfigsDeleteCall) 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 *OrganizationsMuteConfigsDeleteCall) Context(ctx context.Context) *OrganizationsMuteConfigsDeleteCall { +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 *OrganizationsMuteConfigsDeleteCall) Header() http.Header { +func (c *OrganizationsMuteConfigsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsMuteConfigsDeleteCall) 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_ { @@ -16518,11 +16804,16 @@ func (c *OrganizationsMuteConfigsDeleteCall) 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/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -16533,14 +16824,15 @@ func (c *OrganizationsMuteConfigsDeleteCall) doRequest(alt string) (*http.Respon 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) { +// 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 { @@ -16559,7 +16851,7 @@ func (c *OrganizationsMuteConfigsDeleteCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &GoogleCloudSecuritycenterV1MuteConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -16571,25 +16863,34 @@ func (c *OrganizationsMuteConfigsDeleteCall) Do(opts ...googleapi.CallOption) (* } return ret, nil // { - // "description": "Deletes an existing mute config.", + // "description": "Updates a mute config.", // "flatPath": "v1/organizations/{organizationsId}/muteConfigs/{muteConfigsId}", - // "httpMethod": "DELETE", - // "id": "securitycenter.organizations.muteConfigs.delete", + // "httpMethod": "PATCH", + // "id": "securitycenter.organizations.muteConfigs.patch", // "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": "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/[^/]+/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}", + // "request": { + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // }, // "response": { - // "$ref": "Empty" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -16598,99 +16899,99 @@ func (c *OrganizationsMuteConfigsDeleteCall) Do(opts ...googleapi.CallOption) (* } -// method id "securitycenter.organizations.muteConfigs.get": +// method id "securitycenter.organizations.notificationConfigs.create": -type OrganizationsMuteConfigsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsNotificationConfigsCreateCall struct { + s *Service + parent string + notificationconfig *NotificationConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a mute config. +// Create: Creates 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 *OrganizationsMuteConfigsService) Get(name string) *OrganizationsMuteConfigsGetCall { - c := &OrganizationsMuteConfigsGetCall{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 +} + +// 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 contain 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 *OrganizationsMuteConfigsGetCall) Fields(s ...googleapi.Field) *OrganizationsMuteConfigsGetCall { +func (c *OrganizationsNotificationConfigsCreateCall) Fields(s ...googleapi.Field) *OrganizationsNotificationConfigsCreateCall { 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 *OrganizationsMuteConfigsGetCall) IfNoneMatch(entityTag string) *OrganizationsMuteConfigsGetCall { - 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 *OrganizationsMuteConfigsGetCall) Context(ctx context.Context) *OrganizationsMuteConfigsGetCall { +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 *OrganizationsMuteConfigsGetCall) Header() http.Header { +func (c *OrganizationsNotificationConfigsCreateCall) 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 *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_ { 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 := 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 } 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.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.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 *OrganizationsMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { +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 { @@ -16709,7 +17010,7 @@ func (c *OrganizationsMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*Goo if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1MuteConfig{ + ret := &NotificationConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -16721,143 +17022,119 @@ func (c *OrganizationsMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*Goo } return ret, nil // { - // "description": "Gets a mute config.", - // "flatPath": "v1/organizations/{organizationsId}/muteConfigs/{muteConfigsId}", - // "httpMethod": "GET", - // "id": "securitycenter.organizations.muteConfigs.get", + // "description": "Creates a notification config.", + // "flatPath": "v1/organizations/{organizationsId}/notificationConfigs", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.notificationConfigs.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "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}", + // "configId": { + // "description": "Required. Unique identifier provided by the client within the parent scope. It must be between 1 and 128 characters and contain 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/[^/]+/muteConfigs/[^/]+$", + // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/notificationConfigs", + // "request": { + // "$ref": "NotificationConfig" + // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // "$ref": "NotificationConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" // ] - // } - -} - -// method id "securitycenter.organizations.muteConfigs.list": - -type OrganizationsMuteConfigsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// List: Lists mute configs. -// -// - 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 -} - -// 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) +// method id "securitycenter.organizations.notificationConfigs.delete": + +type OrganizationsNotificationConfigsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a notification config. +// +// - name: Name of the notification config to delete. Its format is +// "organizations/[organization_id]/notificationConfigs/[config_id]", +// "folders/[folder_id]/notificationConfigs/[config_id]", or +// "projects/[project_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 } // 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 *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 *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 *OrganizationsMuteConfigsListCall) Context(ctx context.Context) *OrganizationsMuteConfigsListCall { +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 *OrganizationsMuteConfigsListCall) Header() http.Header { +func (c *OrganizationsNotificationConfigsDeleteCall) 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 *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/{+parent}/muteConfigs") + 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.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 *OrganizationsMuteConfigsListCall) Do(opts ...googleapi.CallOption) (*ListMuteConfigsResponse, 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 { @@ -16876,7 +17153,7 @@ func (c *OrganizationsMuteConfigsListCall) Do(opts ...googleapi.CallOption) (*Li if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListMuteConfigsResponse{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -16888,36 +17165,25 @@ func (c *OrganizationsMuteConfigsListCall) Do(opts ...googleapi.CallOption) (*Li } return ret, nil // { - // "description": "Lists mute configs.", - // "flatPath": "v1/organizations/{organizationsId}/muteConfigs", - // "httpMethod": "GET", - // "id": "securitycenter.organizations.muteConfigs.list", + // "description": "Deletes a notification config.", + // "flatPath": "v1/organizations/{organizationsId}/notificationConfigs/{notificationConfigsId}", + // "httpMethod": "DELETE", + // "id": "securitycenter.organizations.notificationConfigs.delete", // "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 `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]\".", + // "name": { + // "description": "Required. Name of the notification config to delete. Its format is \"organizations/[organization_id]/notificationConfigs/[config_id]\", \"folders/[folder_id]/notificationConfigs/[config_id]\", or \"projects/[project_id]/notificationConfigs/[config_id]\".", // "location": "path", - // "pattern": "^organizations/[^/]+$", + // "pattern": "^organizations/[^/]+/notificationConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/muteConfigs", + // "path": "v1/{+name}", // "response": { - // "$ref": "ListMuteConfigsResponse" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -16926,101 +17192,80 @@ 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 { - 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.muteConfigs.patch": +// method id "securitycenter.organizations.notificationConfigs.get": -type OrganizationsMuteConfigsPatchCall struct { - s *Service - name string - googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsNotificationConfigsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Patch: Updates a mute config. +// Get: Gets a notification config. // -// - 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: Name of the notification config to get. Its format is +// "organizations/[organization_id]/notificationConfigs/[config_id]", +// "folders/[folder_id]/notificationConfigs/[config_id]", or +// "projects/[project_id]/notificationConfigs/[config_id]". +func (r *OrganizationsNotificationConfigsService) Get(name string) *OrganizationsNotificationConfigsGetCall { + c := &OrganizationsNotificationConfigsGetCall{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 *OrganizationsMuteConfigsPatchCall) Fields(s ...googleapi.Field) *OrganizationsMuteConfigsPatchCall { +func (c *OrganizationsNotificationConfigsGetCall) Fields(s ...googleapi.Field) *OrganizationsNotificationConfigsGetCall { 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 *OrganizationsMuteConfigsPatchCall) Context(ctx context.Context) *OrganizationsMuteConfigsPatchCall { +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 *OrganizationsMuteConfigsPatchCall) Header() http.Header { +func (c *OrganizationsNotificationConfigsGetCall) 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 *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_ { reqHeaders[k] = v } 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 + 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 } @@ -17031,15 +17276,14 @@ 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 +// 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 *OrganizationsMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, 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 { @@ -17058,7 +17302,7 @@ func (c *OrganizationsMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*G if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1MuteConfig{ + ret := &NotificationConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -17070,34 +17314,25 @@ func (c *OrganizationsMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*G } return ret, nil // { - // "description": "Updates a mute config.", - // "flatPath": "v1/organizations/{organizationsId}/muteConfigs/{muteConfigsId}", - // "httpMethod": "PATCH", - // "id": "securitycenter.organizations.muteConfigs.patch", + // "description": "Gets a notification config.", + // "flatPath": "v1/organizations/{organizationsId}/notificationConfigs/{notificationConfigsId}", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.notificationConfigs.get", // "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": "Required. Name of the notification config to get. Its format is \"organizations/[organization_id]/notificationConfigs/[config_id]\", \"folders/[folder_id]/notificationConfigs/[config_id]\", or \"projects/[project_id]/notificationConfigs/[config_id]\".", // "location": "path", - // "pattern": "^organizations/[^/]+/muteConfigs/[^/]+$", + // "pattern": "^organizations/[^/]+/notificationConfigs/[^/]+$", // "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}", - // "request": { - // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" - // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // "$ref": "NotificationConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -17106,81 +17341,96 @@ func (c *OrganizationsMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*G } -// method id "securitycenter.organizations.notificationConfigs.create": +// method id "securitycenter.organizations.notificationConfigs.list": -type OrganizationsNotificationConfigsCreateCall struct { - s *Service - parent string - notificationconfig *NotificationConfig - 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 +} + +// List: Lists notification configs. +// +// - parent: The name of the parent in which to list the notification +// configurations. 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 + return c } -// Create: Creates a notification config. -// -// - 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 +// 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 } -// 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 contain alphanumeric characters, -// underscores, or hyphens only. -func (c *OrganizationsNotificationConfigsCreateCall) ConfigId(configId string) *OrganizationsNotificationConfigsCreateCall { - c.urlParams_.Set("configId", configId) +// 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 *OrganizationsNotificationConfigsCreateCall) Fields(s ...googleapi.Field) *OrganizationsNotificationConfigsCreateCall { +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 *OrganizationsNotificationConfigsCreateCall) Context(ctx context.Context) *OrganizationsNotificationConfigsCreateCall { +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 *OrganizationsNotificationConfigsCreateCall) Header() http.Header { +func (c *OrganizationsNotificationConfigsListCall) 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 *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.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/{+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 } @@ -17191,14 +17441,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 +// 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 *OrganizationsNotificationConfigsCreateCall) Do(opts ...googleapi.CallOption) (*NotificationConfig, error) { +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 { @@ -17217,7 +17467,7 @@ func (c *OrganizationsNotificationConfigsCreateCall) Do(opts ...googleapi.CallOp if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &NotificationConfig{ + ret := &ListNotificationConfigsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -17229,21 +17479,27 @@ func (c *OrganizationsNotificationConfigsCreateCall) Do(opts ...googleapi.CallOp } return ret, nil // { - // "description": "Creates a notification config.", + // "description": "Lists notification configs.", // "flatPath": "v1/organizations/{organizationsId}/notificationConfigs", - // "httpMethod": "POST", - // "id": "securitycenter.organizations.notificationConfigs.create", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.notificationConfigs.list", // "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 contain alphanumeric characters, underscores, or hyphens only.", + // "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 notification config's parent. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "description": "Required. The name of the parent in which to list the notification configurations. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", // "location": "path", // "pattern": "^organizations/[^/]+$", // "required": true, @@ -17251,11 +17507,8 @@ func (c *OrganizationsNotificationConfigsCreateCall) Do(opts ...googleapi.CallOp // } // }, // "path": "v1/{+parent}/notificationConfigs", - // "request": { - // "$ref": "NotificationConfig" - // }, // "response": { - // "$ref": "NotificationConfig" + // "$ref": "ListNotificationConfigsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -17264,32 +17517,67 @@ func (c *OrganizationsNotificationConfigsCreateCall) Do(opts ...googleapi.CallOp } -// method id "securitycenter.organizations.notificationConfigs.delete": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *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 OrganizationsNotificationConfigsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - 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 } -// Delete: Deletes a notification config. +// Patch: Updates a notification config. The following update fields +// are allowed: description, pubsub_topic, streaming_config.filter // -// - name: Name of the notification config to delete. Its format is -// "organizations/[organization_id]/notificationConfigs/[config_id]", -// "folders/[folder_id]/notificationConfigs/[config_id]", or -// "projects/[project_id]/notificationConfigs/[config_id]". -func (r *OrganizationsNotificationConfigsService) Delete(name string) *OrganizationsNotificationConfigsDeleteCall { - c := &OrganizationsNotificationConfigsDeleteCall{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", +// "folders/{folder_id}/notificationConfigs/notify_public_bucket", or +// "projects/{project_id}/notificationConfigs/notify_public_bucket". +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 *OrganizationsNotificationConfigsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsNotificationConfigsDeleteCall { +func (c *OrganizationsNotificationConfigsPatchCall) Fields(s ...googleapi.Field) *OrganizationsNotificationConfigsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -17297,21 +17585,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 *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 *OrganizationsNotificationConfigsDeleteCall) Header() http.Header { +func (c *OrganizationsNotificationConfigsPatchCall) 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 *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_ { @@ -17319,11 +17607,16 @@ 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.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("DELETE", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -17334,14 +17627,14 @@ func (c *OrganizationsNotificationConfigsDeleteCall) doRequest(alt string) (*htt 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.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 { @@ -17360,7 +17653,7 @@ func (c *OrganizationsNotificationConfigsDeleteCall) Do(opts ...googleapi.CallOp if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &NotificationConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -17372,25 +17665,34 @@ func (c *OrganizationsNotificationConfigsDeleteCall) Do(opts ...googleapi.CallOp } return ret, nil // { - // "description": "Deletes a notification config.", + // "description": " Updates a notification config. The following update fields are allowed: description, pubsub_topic, streaming_config.filter", // "flatPath": "v1/organizations/{organizationsId}/notificationConfigs/{notificationConfigsId}", - // "httpMethod": "DELETE", - // "id": "securitycenter.organizations.notificationConfigs.delete", + // "httpMethod": "PATCH", + // "id": "securitycenter.organizations.notificationConfigs.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the notification config to delete. Its format is \"organizations/[organization_id]/notificationConfigs/[config_id]\", \"folders/[folder_id]/notificationConfigs/[config_id]\", or \"projects/[project_id]/notificationConfigs/[config_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\", \"folders/{folder_id}/notificationConfigs/notify_public_bucket\", or \"projects/{project_id}/notificationConfigs/notify_public_bucket\".", // "location": "path", // "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}", + // "request": { + // "$ref": "NotificationConfig" + // }, // "response": { - // "$ref": "Empty" + // "$ref": "NotificationConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -17399,25 +17701,30 @@ func (c *OrganizationsNotificationConfigsDeleteCall) Do(opts ...googleapi.CallOp } -// method id "securitycenter.organizations.notificationConfigs.get": +// method id "securitycenter.organizations.operations.cancel": -type OrganizationsNotificationConfigsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsOperationsCancelCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a notification config. +// Cancel: Starts asynchronous cancellation on a long-running operation. +// The server makes a best effort to cancel the operation, but success +// is not guaranteed. If the server doesn't support this method, it +// returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use +// Operations.GetOperation or other methods to check whether the +// cancellation succeeded or whether the operation completed despite +// cancellation. On successful cancellation, the operation is not +// deleted; instead, it becomes an operation with an Operation.error +// value with a google.rpc.Status.code of 1, corresponding to +// `Code.CANCELLED`. // -// - name: Name of the notification config to get. Its format is -// "organizations/[organization_id]/notificationConfigs/[config_id]", -// "folders/[folder_id]/notificationConfigs/[config_id]", or -// "projects/[project_id]/notificationConfigs/[config_id]". -func (r *OrganizationsNotificationConfigsService) Get(name string) *OrganizationsNotificationConfigsGetCall { - c := &OrganizationsNotificationConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - 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 } @@ -17425,54 +17732,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 { - 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 +func (c *OrganizationsOperationsCancelCall) Fields(s ...googleapi.Field) *OrganizationsOperationsCancelCall { + 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 *OrganizationsNotificationConfigsGetCall) Context(ctx context.Context) *OrganizationsNotificationConfigsGetCall { +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 *OrganizationsNotificationConfigsGetCall) Header() http.Header { +func (c *OrganizationsOperationsCancelCall) 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 *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_ { 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 := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -17483,14 +17777,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.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) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -17509,7 +17803,7 @@ func (c *OrganizationsNotificationConfigsGetCall) Do(opts ...googleapi.CallOptio if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &NotificationConfig{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -17521,25 +17815,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": "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", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the notification config to get. Its format is \"organizations/[organization_id]/notificationConfigs/[config_id]\", \"folders/[folder_id]/notificationConfigs/[config_id]\", or \"projects/[project_id]/notificationConfigs/[config_id]\".", + // "description": "The name of the operation resource to be cancelled.", // "location": "path", - // "pattern": "^organizations/[^/]+/notificationConfigs/[^/]+$", + // "pattern": "^organizations/[^/]+/operations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+name}:cancel", // "response": { - // "$ref": "NotificationConfig" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -17548,114 +17842,84 @@ func (c *OrganizationsNotificationConfigsGetCall) Do(opts ...googleapi.CallOptio } -// method id "securitycenter.organizations.notificationConfigs.list": +// method id "securitycenter.organizations.operations.delete": -type OrganizationsNotificationConfigsListCall 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 notification configs. +// 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: The name of the parent in which to list the notification -// configurations. 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 - 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: 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 *OrganizationsNotificationConfigsListCall) Fields(s ...googleapi.Field) *OrganizationsNotificationConfigsListCall { +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 *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 *OrganizationsNotificationConfigsListCall) Context(ctx context.Context) *OrganizationsNotificationConfigsListCall { +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 *OrganizationsNotificationConfigsListCall) Header() http.Header { +func (c *OrganizationsOperationsDeleteCall) 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 *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}/notificationConfigs") + 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.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) { +// 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 { @@ -17674,7 +17938,7 @@ func (c *OrganizationsNotificationConfigsListCall) Do(opts ...googleapi.CallOpti if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListNotificationConfigsResponse{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -17686,36 +17950,25 @@ func (c *OrganizationsNotificationConfigsListCall) Do(opts ...googleapi.CallOpti } return ret, nil // { - // "description": "Lists notification configs.", - // "flatPath": "v1/organizations/{organizationsId}/notificationConfigs", - // "httpMethod": "GET", - // "id": "securitycenter.organizations.notificationConfigs.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 `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 name of the parent in which to list the notification configurations. Its format is \"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}/notificationConfigs", + // "path": "v1/{+name}", // "response": { - // "$ref": "ListNotificationConfigsResponse" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -17724,106 +17977,79 @@ 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.operations.get": -type OrganizationsNotificationConfigsPatchCall struct { - s *Service - name string - notificationconfig *NotificationConfig - 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 notification config. The following update fields -// are allowed: description, pubsub_topic, streaming_config.filter +// 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 notification config. See: -// https://cloud.google.com/apis/design/resource_names#relative_resource_name -// Example: -// "organizations/{organization_id}/notificationConfigs/notify_public_b -// ucket", -// "folders/{folder_id}/notificationConfigs/notify_public_bucket", or -// "projects/{project_id}/notificationConfigs/notify_public_bucket". -func (r *OrganizationsNotificationConfigsService) Patch(name string, notificationconfig *NotificationConfig) *OrganizationsNotificationConfigsPatchCall { - c := &OrganizationsNotificationConfigsPatchCall{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.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 *OrganizationsNotificationConfigsPatchCall) Fields(s ...googleapi.Field) *OrganizationsNotificationConfigsPatchCall { +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 *OrganizationsNotificationConfigsPatchCall) Context(ctx context.Context) *OrganizationsNotificationConfigsPatchCall { +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 *OrganizationsNotificationConfigsPatchCall) Header() http.Header { +func (c *OrganizationsOperationsGetCall) 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 *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()) + 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("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -17834,14 +18060,14 @@ func (c *OrganizationsNotificationConfigsPatchCall) doRequest(alt string) (*http 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 -// 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) { +// 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 { @@ -17860,7 +18086,7 @@ func (c *OrganizationsNotificationConfigsPatchCall) Do(opts ...googleapi.CallOpt if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &NotificationConfig{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -17872,34 +18098,25 @@ 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": "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 notification config. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/notificationConfigs/notify_public_bucket\", \"folders/{folder_id}/notificationConfigs/notify_public_bucket\", or \"projects/{project_id}/notificationConfigs/notify_public_bucket\".", + // "description": "The name of the operation resource.", // "location": "path", - // "pattern": "^organizations/[^/]+/notificationConfigs/[^/]+$", + // "pattern": "^organizations/[^/]+/operations/[^/]+$", // "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" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -17908,72 +18125,100 @@ func (c *OrganizationsNotificationConfigsPatchCall) Do(opts ...googleapi.CallOpt } -// method id "securitycenter.organizations.operations.cancel": +// method id "securitycenter.organizations.operations.list": -type OrganizationsOperationsCancelCall struct { - s *Service - name string - 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 } -// Cancel: Starts asynchronous cancellation on a long-running operation. -// The server makes a best effort to cancel the operation, but success -// is not guaranteed. If the server doesn't support this method, it -// returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use -// Operations.GetOperation or other methods to check whether the -// cancellation succeeded or whether the operation completed despite -// cancellation. On successful cancellation, the operation is not -// deleted; instead, it becomes an operation with an Operation.error -// value with a google.rpc.Status.code of 1, corresponding to -// `Code.CANCELLED`. +// List: Lists operations that match the specified filter in the +// request. If the server doesn't support this method, it returns +// `UNIMPLEMENTED`. // -// - 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: 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 *OrganizationsOperationsCancelCall) Fields(s ...googleapi.Field) *OrganizationsOperationsCancelCall { +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 *OrganizationsOperationsCancelCall) Context(ctx context.Context) *OrganizationsOperationsCancelCall { +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 *OrganizationsOperationsCancelCall) Header() http.Header { +func (c *OrganizationsOperationsListCall) 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 *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()) + 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}:cancel") + 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 } @@ -17984,14 +18229,14 @@ 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.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 { @@ -18010,7 +18255,7 @@ func (c *OrganizationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*E if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &ListOperationsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -18022,25 +18267,41 @@ 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": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", + // "flatPath": "v1/organizations/{organizationsId}/operations", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.operations.list", // "parameterOrder": [ // "name" // ], // "parameters": { + // "filter": { + // "description": "The standard list filter.", + // "location": "query", + // "type": "string" + // }, // "name": { - // "description": "The name of the operation resource to be cancelled.", + // "description": "The name of the operation's parent resource.", // "location": "path", - // "pattern": "^organizations/[^/]+/operations/[^/]+$", + // "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/{+name}:cancel", + // "path": "v1/{+name}", // "response": { - // "$ref": "Empty" + // "$ref": "ListOperationsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -18049,32 +18310,56 @@ func (c *OrganizationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*E } -// method id "securitycenter.organizations.operations.delete": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *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 OrganizationsOperationsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "securitycenter.organizations.resourceValueConfigs.batchCreate": + +type OrganizationsResourceValueConfigsBatchCreateCall struct { + s *Service + parent string + batchcreateresourcevalueconfigsrequest *BatchCreateResourceValueConfigsRequest + 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`. +// BatchCreate: Creates a ResourceValueConfig for an organization. Maps +// user's tags to difference resource values for use by the attack path +// simulation. // -// - 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 ResourceValueConfig's parent. The +// parent field in the CreateResourceValueConfigRequest messages must +// either be empty or match this field. +func (r *OrganizationsResourceValueConfigsService) BatchCreate(parent string, batchcreateresourcevalueconfigsrequest *BatchCreateResourceValueConfigsRequest) *OrganizationsResourceValueConfigsBatchCreateCall { + c := &OrganizationsResourceValueConfigsBatchCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.batchcreateresourcevalueconfigsrequest = batchcreateresourcevalueconfigsrequest 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 *OrganizationsResourceValueConfigsBatchCreateCall) Fields(s ...googleapi.Field) *OrganizationsResourceValueConfigsBatchCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -18082,21 +18367,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 *OrganizationsResourceValueConfigsBatchCreateCall) Context(ctx context.Context) *OrganizationsResourceValueConfigsBatchCreateCall { 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 *OrganizationsResourceValueConfigsBatchCreateCall) 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 *OrganizationsResourceValueConfigsBatchCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -18104,29 +18389,35 @@ 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.batchcreateresourcevalueconfigsrequest) + 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}/resourceValueConfigs:batchCreate") 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.resourceValueConfigs.batchCreate" call. +// Exactly one of *BatchCreateResourceValueConfigsResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *BatchCreateResourceValueConfigsResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsResourceValueConfigsBatchCreateCall) Do(opts ...googleapi.CallOption) (*BatchCreateResourceValueConfigsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18145,7 +18436,7 @@ func (c *OrganizationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*E if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &BatchCreateResourceValueConfigsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -18157,25 +18448,28 @@ 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 ResourceValueConfig for an organization. Maps user's tags to difference resource values for use by the attack path simulation.", + // "flatPath": "v1/organizations/{organizationsId}/resourceValueConfigs:batchCreate", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.resourceValueConfigs.batchCreate", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "The name of the operation resource to be deleted.", + // "parent": { + // "description": "Required. Resource name of the new ResourceValueConfig's parent. The parent field in the CreateResourceValueConfigRequest messages must either be empty or match this field.", // "location": "path", - // "pattern": "^organizations/[^/]+/operations/[^/]+$", + // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/resourceValueConfigs:batchCreate", + // "request": { + // "$ref": "BatchCreateResourceValueConfigsRequest" + // }, // "response": { - // "$ref": "Empty" + // "$ref": "BatchCreateResourceValueConfigsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -18184,24 +18478,21 @@ func (c *OrganizationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*E } -// method id "securitycenter.organizations.operations.get": +// method id "securitycenter.organizations.resourceValueConfigs.delete": -type OrganizationsOperationsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsResourceValueConfigsDeleteCall 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 ResourceValueConfig. // -// - 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 ResourceValueConfig to delete. +func (r *OrganizationsResourceValueConfigsService) Delete(name string) *OrganizationsResourceValueConfigsDeleteCall { + c := &OrganizationsResourceValueConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -18209,54 +18500,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 *OrganizationsResourceValueConfigsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsResourceValueConfigsDeleteCall { 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 *OrganizationsResourceValueConfigsDeleteCall) Context(ctx context.Context) *OrganizationsResourceValueConfigsDeleteCall { 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 *OrganizationsResourceValueConfigsDeleteCall) 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 *OrganizationsResourceValueConfigsDeleteCall) doRequest(alt string) (*http.Response, 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 } @@ -18267,14 +18545,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.resourceValueConfigs.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 *OrganizationsResourceValueConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18293,7 +18571,7 @@ func (c *OrganizationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Oper if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -18305,25 +18583,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 ResourceValueConfig.", + // "flatPath": "v1/organizations/{organizationsId}/resourceValueConfigs/{resourceValueConfigsId}", + // "httpMethod": "DELETE", + // "id": "securitycenter.organizations.resourceValueConfigs.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "The name of the operation resource.", + // "description": "Required. Name of the ResourceValueConfig to delete", // "location": "path", - // "pattern": "^organizations/[^/]+/operations/[^/]+$", + // "pattern": "^organizations/[^/]+/resourceValueConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1/{+name}", // "response": { - // "$ref": "Operation" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -18332,9 +18610,9 @@ func (c *OrganizationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Oper } -// method id "securitycenter.organizations.operations.list": +// method id "securitycenter.organizations.resourceValueConfigs.get": -type OrganizationsOperationsListCall struct { +type OrganizationsResourceValueConfigsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -18343,42 +18621,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`. +// Get: Gets a ResourceValueConfig. // -// - 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 resource value config to retrieve. Its format is +// organizations/{organization}/resourceValueConfigs/{config_id}. +func (r *OrganizationsResourceValueConfigsService) Get(name string) *OrganizationsResourceValueConfigsGetCall { + c := &OrganizationsResourceValueConfigsGetCall{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 *OrganizationsResourceValueConfigsGetCall) Fields(s ...googleapi.Field) *OrganizationsResourceValueConfigsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -18388,7 +18644,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 *OrganizationsResourceValueConfigsGetCall) IfNoneMatch(entityTag string) *OrganizationsResourceValueConfigsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -18396,21 +18652,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 *OrganizationsResourceValueConfigsGetCall) Context(ctx context.Context) *OrganizationsResourceValueConfigsGetCall { 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 *OrganizationsResourceValueConfigsGetCall) 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 *OrganizationsResourceValueConfigsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -18436,14 +18692,16 @@ 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 -// 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) { +// Do executes the "securitycenter.organizations.resourceValueConfigs.get" call. +// Exactly one of *GoogleCloudSecuritycenterV1ResourceValueConfig or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudSecuritycenterV1ResourceValueConfig.ServerResponse.Header +// or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrganizationsResourceValueConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1ResourceValueConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18462,7 +18720,7 @@ func (c *OrganizationsOperationsListCall) Do(opts ...googleapi.CallOption) (*Lis if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListOperationsResponse{ + ret := &GoogleCloudSecuritycenterV1ResourceValueConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -18474,41 +18732,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`.", - // "flatPath": "v1/organizations/{organizationsId}/operations", + // "description": "Gets a ResourceValueConfig.", + // "flatPath": "v1/organizations/{organizationsId}/resourceValueConfigs/{resourceValueConfigsId}", // "httpMethod": "GET", - // "id": "securitycenter.organizations.operations.list", + // "id": "securitycenter.organizations.resourceValueConfigs.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 resource value config to retrieve. Its format is organizations/{organization}/resourceValueConfigs/{config_id}.", // "location": "path", - // "pattern": "^organizations/[^/]+/operations$", + // "pattern": "^organizations/[^/]+/resourceValueConfigs/[^/]+$", // "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": "GoogleCloudSecuritycenterV1ResourceValueConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -18517,97 +18759,98 @@ 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.securityHealthAnalyticsSettings.customModules.create": +// method id "securitycenter.organizations.resourceValueConfigs.list": -type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall struct { - s *Service - parent string - googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsResourceValueConfigsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Create: Creates a resident SecurityHealthAnalyticsCustomModule at the -// scope of the given CRM parent, and also creates inherited -// SecurityHealthAnalyticsCustomModules for all CRM descendants of the -// given parent. These modules are enabled by default. +// List: Lists all ResourceValueConfigs. // -// - parent: Resource name of the new custom module's parent. Its format -// is "organizations/{organization}/securityHealthAnalyticsSettings", -// "folders/{folder}/securityHealthAnalyticsSettings", or -// "projects/{project}/securityHealthAnalyticsSettings". -func (r *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesService) Create(parent string, googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall { - c := &OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The parent, which owns the collection of resource value +// configs. Its format is "organizations/[organization_id]". +func (r *OrganizationsResourceValueConfigsService) List(parent string) *OrganizationsResourceValueConfigsListCall { + c := &OrganizationsResourceValueConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule = googlecloudsecuritycenterv1securityhealthanalyticscustommodule + return c +} + +// PageSize sets the optional parameter "pageSize": The number of +// results 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 *OrganizationsResourceValueConfigsListCall) PageSize(pageSize int64) *OrganizationsResourceValueConfigsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous `ListResourceValueConfigs` call. Provide +// this to retrieve the subsequent page. When paginating, all other +// parameters provided to `ListResourceValueConfigs` must match the call +// that provided the page token. page_size can be specified, and the new +// page_size will be used. +func (c *OrganizationsResourceValueConfigsListCall) PageToken(pageToken string) *OrganizationsResourceValueConfigsListCall { + 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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall { +func (c *OrganizationsResourceValueConfigsListCall) Fields(s ...googleapi.Field) *OrganizationsResourceValueConfigsListCall { 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 *OrganizationsResourceValueConfigsListCall) IfNoneMatch(entityTag string) *OrganizationsResourceValueConfigsListCall { + 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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall { +func (c *OrganizationsResourceValueConfigsListCall) Context(ctx context.Context) *OrganizationsResourceValueConfigsListCall { 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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Header() http.Header { +func (c *OrganizationsResourceValueConfigsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsResourceValueConfigsListCall) doRequest(alt string) (*http.Response, 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.googlecloudsecuritycenterv1securityhealthanalyticscustommodule) - 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}/customModules") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/resourceValueConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -18618,17 +18861,14 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) do return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.create" call. -// Exactly one of -// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule or -// error will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule.Server -// Response.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule, error) { +// Do executes the "securitycenter.organizations.resourceValueConfigs.list" call. +// Exactly one of *ListResourceValueConfigsResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ListResourceValueConfigsResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsResourceValueConfigsListCall) Do(opts ...googleapi.CallOption) (*ListResourceValueConfigsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18647,7 +18887,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Do if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule{ + ret := &ListResourceValueConfigsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -18659,28 +18899,36 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Do } return ret, nil // { - // "description": "Creates a resident SecurityHealthAnalyticsCustomModule at the scope of the given CRM parent, and also creates inherited SecurityHealthAnalyticsCustomModules for all CRM descendants of the given parent. These modules are enabled by default.", - // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules", - // "httpMethod": "POST", - // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.create", + // "description": "Lists all ResourceValueConfigs.", + // "flatPath": "v1/organizations/{organizationsId}/resourceValueConfigs", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.resourceValueConfigs.list", // "parameterOrder": [ // "parent" // ], // "parameters": { + // "pageSize": { + // "description": "The number of results 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 `ListResourceValueConfigs` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListResourceValueConfigs` must match the call that provided the page token. page_size can be specified, and the new page_size will be used.", + // "location": "query", + // "type": "string" + // }, // "parent": { - // "description": "Required. Resource name of the new custom module's parent. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", + // "description": "Required. The parent, which owns the collection of resource value configs. Its format is \"organizations/[organization_id]\"", // "location": "path", - // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings$", + // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/customModules", - // "request": { - // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" - // }, + // "path": "v1/{+parent}/resourceValueConfigs", // "response": { - // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" + // "$ref": "ListResourceValueConfigsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -18689,37 +18937,59 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Do } -// method id "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.delete": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *OrganizationsResourceValueConfigsListCall) Pages(ctx context.Context, f func(*ListResourceValueConfigsResponse) 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.resourceValueConfigs.patch": -type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsResourceValueConfigsPatchCall struct { + s *Service + name string + googlecloudsecuritycenterv1resourcevalueconfig *GoogleCloudSecuritycenterV1ResourceValueConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes the specified SecurityHealthAnalyticsCustomModule and -// all of its descendants in the CRM hierarchy. This method is only -// supported for resident custom modules. +// Patch: Updates an existing ResourceValueConfigs with new rules. // -// - name: Name of the custom module to delete. Its format is -// "organizations/{organization}/securityHealthAnalyticsSettings/custom -// Modules/{customModule}", -// "folders/{folder}/securityHealthAnalyticsSettings/customModules/{cus -// tomModule}", or -// "projects/{project}/securityHealthAnalyticsSettings/customModules/{c -// ustomModule}". -func (r *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesService) Delete(name string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall { - c := &OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Name for the resource value config. +func (r *OrganizationsResourceValueConfigsService) Patch(name string, googlecloudsecuritycenterv1resourcevalueconfig *GoogleCloudSecuritycenterV1ResourceValueConfig) *OrganizationsResourceValueConfigsPatchCall { + c := &OrganizationsResourceValueConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.googlecloudsecuritycenterv1resourcevalueconfig = googlecloudsecuritycenterv1resourcevalueconfig + 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 *OrganizationsResourceValueConfigsPatchCall) UpdateMask(updateMask string) *OrganizationsResourceValueConfigsPatchCall { + 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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall { +func (c *OrganizationsResourceValueConfigsPatchCall) Fields(s ...googleapi.Field) *OrganizationsResourceValueConfigsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -18727,21 +18997,21 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) 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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall { +func (c *OrganizationsResourceValueConfigsPatchCall) Context(ctx context.Context) *OrganizationsResourceValueConfigsPatchCall { 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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Header() http.Header { +func (c *OrganizationsResourceValueConfigsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsResourceValueConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -18749,11 +19019,16 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) do } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1resourcevalueconfig) + 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("DELETE", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -18764,14 +19039,16 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) do return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "securitycenter.organizations.resourceValueConfigs.patch" call. +// Exactly one of *GoogleCloudSecuritycenterV1ResourceValueConfig or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudSecuritycenterV1ResourceValueConfig.ServerResponse.Header +// or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrganizationsResourceValueConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1ResourceValueConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18790,7 +19067,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Do if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &GoogleCloudSecuritycenterV1ResourceValueConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -18802,25 +19079,34 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Do } return ret, nil // { - // "description": "Deletes the specified SecurityHealthAnalyticsCustomModule and all of its descendants in the CRM hierarchy. This method is only supported for resident custom modules.", - // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules/{customModulesId}", - // "httpMethod": "DELETE", - // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.delete", + // "description": "Updates an existing ResourceValueConfigs with new rules.", + // "flatPath": "v1/organizations/{organizationsId}/resourceValueConfigs/{resourceValueConfigsId}", + // "httpMethod": "PATCH", + // "id": "securitycenter.organizations.resourceValueConfigs.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the custom module to delete. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}\", \"folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}\"", + // "description": "Name for the resource value config", // "location": "path", - // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+$", + // "pattern": "^organizations/[^/]+/resourceValueConfigs/[^/]+$", // "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}", + // "request": { + // "$ref": "GoogleCloudSecuritycenterV1ResourceValueConfig" + // }, // "response": { - // "$ref": "Empty" + // "$ref": "GoogleCloudSecuritycenterV1ResourceValueConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -18829,94 +19115,87 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Do } -// method id "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.get": +// method id "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.create": -type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall struct { + s *Service + parent string + googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Retrieves a SecurityHealthAnalyticsCustomModule. +// Create: Creates a resident SecurityHealthAnalyticsCustomModule at the +// scope of the given CRM parent, and also creates inherited +// SecurityHealthAnalyticsCustomModules for all CRM descendants of the +// given parent. These modules are enabled by default. // -// - name: Name of the custom module to get. Its format is -// "organizations/{organization}/securityHealthAnalyticsSettings/custom -// Modules/{customModule}", -// "folders/{folder}/securityHealthAnalyticsSettings/customModules/{cus -// tomModule}", or -// "projects/{project}/securityHealthAnalyticsSettings/customModules/{c -// ustomModule}". -func (r *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesService) Get(name string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall { - c := &OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: Resource name of the new custom module's parent. Its format +// is "organizations/{organization}/securityHealthAnalyticsSettings", +// "folders/{folder}/securityHealthAnalyticsSettings", or +// "projects/{project}/securityHealthAnalyticsSettings". +func (r *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesService) Create(parent string, googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall { + c := &OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule = googlecloudsecuritycenterv1securityhealthanalyticscustommodule 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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall { 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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) IfNoneMatch(entityTag string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall { - 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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall { 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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) Header() http.Header { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) doRequest(alt string) (*http.Response, 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.googlecloudsecuritycenterv1securityhealthanalyticscustommodule) + 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}/customModules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.get" call. +// Do executes the "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.create" call. // Exactly one of // *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule or // error will be non-nil. Any non-2xx status code is an error. Response @@ -18926,7 +19205,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) doReq // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was // returned. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule, error) { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18957,23 +19236,26 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) Do(op } return ret, nil // { - // "description": "Retrieves a SecurityHealthAnalyticsCustomModule.", - // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules/{customModulesId}", - // "httpMethod": "GET", - // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.get", + // "description": "Creates a resident SecurityHealthAnalyticsCustomModule at the scope of the given CRM parent, and also creates inherited SecurityHealthAnalyticsCustomModules for all CRM descendants of the given parent. These modules are enabled by default.", + // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. Name of the custom module to get. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}\", \"folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}\"", + // "parent": { + // "description": "Required. Resource name of the new custom module's parent. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", // "location": "path", - // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+$", + // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/customModules", + // "request": { + // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" + // }, // "response": { // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" // }, @@ -18984,117 +19266,89 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) Do(op } -// method id "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.list": +// method id "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.delete": -type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Returns a list of all SecurityHealthAnalyticsCustomModules for -// the given parent. This includes resident modules defined at the scope -// of the parent, and inherited modules, inherited from CRM ancestors. +// Delete: Deletes the specified SecurityHealthAnalyticsCustomModule and +// all of its descendants in the CRM hierarchy. This method is only +// supported for resident custom modules. // -// - parent: Name of parent to list custom modules. Its format is -// "organizations/{organization}/securityHealthAnalyticsSettings", -// "folders/{folder}/securityHealthAnalyticsSettings", or -// "projects/{project}/securityHealthAnalyticsSettings". -func (r *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesService) List(parent string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall { - c := &OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall{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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) PageSize(pageSize int64) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The value returned -// by the last call indicating a continuation -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) PageToken(pageToken string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall { - c.urlParams_.Set("pageToken", pageToken) +// - name: Name of the custom module to delete. Its format is +// "organizations/{organization}/securityHealthAnalyticsSettings/custom +// Modules/{customModule}", +// "folders/{folder}/securityHealthAnalyticsSettings/customModules/{cus +// tomModule}", or +// "projects/{project}/securityHealthAnalyticsSettings/customModules/{c +// ustomModule}". +func (r *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesService) Delete(name string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall { + c := &OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall{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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall { 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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) IfNoneMatch(entityTag string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall { - 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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall { 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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) Header() http.Header { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) doRequest(alt string) (*http.Response, 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}/customModules") + 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.securityHealthAnalyticsSettings.customModules.list" call. -// Exactly one of *ListSecurityHealthAnalyticsCustomModulesResponse or -// error will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *ListSecurityHealthAnalyticsCustomModulesResponse.ServerResponse.Heade -// r or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) Do(opts ...googleapi.CallOption) (*ListSecurityHealthAnalyticsCustomModulesResponse, error) { +// Do executes the "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -19113,7 +19367,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) Do(o if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListSecurityHealthAnalyticsCustomModulesResponse{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -19125,36 +19379,25 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) Do(o } return ret, nil // { - // "description": "Returns a list of all SecurityHealthAnalyticsCustomModules for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from CRM ancestors.", - // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules", - // "httpMethod": "GET", - // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.list", + // "description": "Deletes the specified SecurityHealthAnalyticsCustomModule and all of its descendants in the CRM hierarchy. This method is only supported for resident custom modules.", + // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules/{customModulesId}", + // "httpMethod": "DELETE", + // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.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 call indicating a continuation", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. Name of parent to list custom modules. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", + // "name": { + // "description": "Required. Name of the custom module to delete. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}\", \"folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}\"", // "location": "path", - // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings$", + // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/customModules", + // "path": "v1/{+name}", // "response": { - // "$ref": "ListSecurityHealthAnalyticsCustomModulesResponse" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -19163,72 +19406,36 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) Do(o } -// 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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) Pages(ctx context.Context, f func(*ListSecurityHealthAnalyticsCustomModulesResponse) 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.securityHealthAnalyticsSettings.customModules.listDescendant": +// method id "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.get": -type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall struct { +type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall struct { s *Service - parent string + name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// ListDescendant: Returns a list of all resident -// SecurityHealthAnalyticsCustomModules under the given CRM parent and -// all of the parent’s CRM descendants. +// Get: Retrieves a SecurityHealthAnalyticsCustomModule. // -// - parent: Name of parent to list descendant custom modules. Its -// format is -// "organizations/{organization}/securityHealthAnalyticsSettings", -// "folders/{folder}/securityHealthAnalyticsSettings", or -// "projects/{project}/securityHealthAnalyticsSettings". -func (r *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesService) ListDescendant(parent string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { - c := &OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall{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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) PageSize(pageSize int64) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The value returned -// by the last call indicating a continuation -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) PageToken(pageToken string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { - c.urlParams_.Set("pageToken", pageToken) +// - name: Name of the custom module to get. Its format is +// "organizations/{organization}/securityHealthAnalyticsSettings/custom +// Modules/{customModule}", +// "folders/{folder}/securityHealthAnalyticsSettings/customModules/{cus +// tomModule}", or +// "projects/{project}/securityHealthAnalyticsSettings/customModules/{c +// ustomModule}". +func (r *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesService) Get(name string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall { + c := &OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall{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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -19238,7 +19445,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendant // 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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) IfNoneMatch(entityTag string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) IfNoneMatch(entityTag string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall { c.ifNoneMatch_ = entityTag return c } @@ -19246,21 +19453,21 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendant // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall { 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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Header() http.Header { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -19273,7 +19480,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendant var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules:listDescendant") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -19281,22 +19488,22 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendant } 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.securityHealthAnalyticsSettings.customModules.listDescendant" call. +// Do executes the "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.get" call. // Exactly one of -// *ListDescendantSecurityHealthAnalyticsCustomModulesResponse or error -// will be non-nil. Any non-2xx status code is an error. Response +// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule or +// error will be non-nil. Any non-2xx status code is an error. Response // headers are in either -// *ListDescendantSecurityHealthAnalyticsCustomModulesResponse.ServerResp -// onse.Header or (if a response was returned at all) in +// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule.Server +// Response.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was // returned. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Do(opts ...googleapi.CallOption) (*ListDescendantSecurityHealthAnalyticsCustomModulesResponse, error) { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -19315,7 +19522,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendant if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListDescendantSecurityHealthAnalyticsCustomModulesResponse{ + ret := &GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -19327,36 +19534,25 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendant } return ret, nil // { - // "description": "Returns a list of all resident SecurityHealthAnalyticsCustomModules under the given CRM parent and all of the parent’s CRM descendants.", - // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules:listDescendant", + // "description": "Retrieves a SecurityHealthAnalyticsCustomModule.", + // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules/{customModulesId}", // "httpMethod": "GET", - // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.listDescendant", + // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.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 call indicating a continuation", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. Name of parent to list descendant custom modules. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", + // "name": { + // "description": "Required. Name of the custom module to get. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}\", \"folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}\"", // "location": "path", - // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings$", + // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/customModules:listDescendant", + // "path": "v1/{+name}", // "response": { - // "$ref": "ListDescendantSecurityHealthAnalyticsCustomModulesResponse" + // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -19365,132 +19561,117 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendant } -// 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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Pages(ctx context.Context, f func(*ListDescendantSecurityHealthAnalyticsCustomModulesResponse) 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.securityHealthAnalyticsSettings.customModules.patch": +// method id "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.list": -type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall struct { - s *Service - name string - googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Patch: Updates the SecurityHealthAnalyticsCustomModule under the -// given name based on the given update mask. Updating the enablement -// state is supported on both resident and inherited modules (though -// resident modules cannot have an enablement state of "inherited"). -// Updating the display name and custom config of a module is supported -// on resident modules only. +// List: Returns a list of all SecurityHealthAnalyticsCustomModules for +// the given parent. This includes resident modules defined at the scope +// of the parent, and inherited modules, inherited from CRM ancestors. // -// - name: Immutable. The resource name of the custom module. Its format -// is -// "organizations/{organization}/securityHealthAnalyticsSettings/custom -// Modules/{customModule}", or -// "folders/{folder}/securityHealthAnalyticsSettings/customModules/{cus -// tomModule}", or -// "projects/{project}/securityHealthAnalyticsSettings/customModules/{c -// ustomModule}" The id {customModule} is server-generated and is not -// user settable. It will be a numeric id containing 1-20 digits. -func (r *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesService) Patch(name string, googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall { - c := &OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule = googlecloudsecuritycenterv1securityhealthanalyticscustommodule +// - parent: Name of parent to list custom modules. Its format is +// "organizations/{organization}/securityHealthAnalyticsSettings", +// "folders/{folder}/securityHealthAnalyticsSettings", or +// "projects/{project}/securityHealthAnalyticsSettings". +func (r *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesService) List(parent string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall { + c := &OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent return c } -// UpdateMask sets the optional parameter "updateMask": The list of -// fields to update. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) UpdateMask(updateMask string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall { - 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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) PageSize(pageSize int64) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last call indicating a continuation +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) PageToken(pageToken string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall { + 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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall { 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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) IfNoneMatch(entityTag string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall { + 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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall { 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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Header() http.Header { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) doRequest(alt string) (*http.Response, 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.googlecloudsecuritycenterv1securityhealthanalyticscustommodule) - 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}/customModules") 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.securityHealthAnalyticsSettings.customModules.patch" call. -// Exactly one of -// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule or +// Do executes the "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.list" call. +// Exactly one of *ListSecurityHealthAnalyticsCustomModulesResponse or // error will be non-nil. Any non-2xx status code is an error. Response // headers are in either -// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule.Server -// Response.Header or (if a response was returned at all) in +// *ListSecurityHealthAnalyticsCustomModulesResponse.ServerResponse.Heade +// r or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was // returned. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule, error) { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) Do(opts ...googleapi.CallOption) (*ListSecurityHealthAnalyticsCustomModulesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -19509,7 +19690,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Do( if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule{ + ret := &ListSecurityHealthAnalyticsCustomModulesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -19521,34 +19702,36 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Do( } return ret, nil // { - // "description": "Updates the SecurityHealthAnalyticsCustomModule under the given name based on the given update mask. Updating the enablement state is supported on both resident and inherited modules (though resident modules cannot have an enablement state of \"inherited\"). Updating the display name and custom config of a module is supported on resident modules only.", - // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules/{customModulesId}", - // "httpMethod": "PATCH", - // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.patch", + // "description": "Returns a list of all SecurityHealthAnalyticsCustomModules for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from CRM ancestors.", + // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Immutable. The resource name of the custom module. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}\" The id {customModule} is server-generated and is not user settable. It will be a numeric id containing 1-20 digits.", - // "location": "path", - // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+$", - // "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 list of fields to update.", - // "format": "google-fieldmask", + // "pageToken": { + // "description": "The value returned by the last call indicating a continuation", // "location": "query", // "type": "string" + // }, + // "parent": { + // "description": "Required. Name of parent to list custom modules. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", + // "location": "path", + // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings$", + // "required": true, + // "type": "string" // } // }, - // "path": "v1/{+name}", - // "request": { - // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" - // }, + // "path": "v1/{+parent}/customModules", // "response": { - // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" + // "$ref": "ListSecurityHealthAnalyticsCustomModulesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -19557,36 +19740,72 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Do( } -// method id "securitycenter.organizations.securityHealthAnalyticsSettings.effectiveCustomModules.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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) Pages(ctx context.Context, f func(*ListSecurityHealthAnalyticsCustomModulesResponse) 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 OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall struct { +// method id "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.listDescendant": + +type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall struct { s *Service - name string + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Retrieves an EffectiveSecurityHealthAnalyticsCustomModule. +// ListDescendant: Returns a list of all resident +// SecurityHealthAnalyticsCustomModules under the given CRM parent and +// all of the parent’s CRM descendants. // -// - name: Name of the effective custom module to get. Its format is -// "organizations/{organization}/securityHealthAnalyticsSettings/effect -// iveCustomModules/{customModule}", -// "folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomMod -// ules/{customModule}", or -// "projects/{project}/securityHealthAnalyticsSettings/effectiveCustomM -// odules/{customModule}". -func (r *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesService) Get(name string) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { - c := &OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: Name of parent to list descendant custom modules. Its +// format is +// "organizations/{organization}/securityHealthAnalyticsSettings", +// "folders/{folder}/securityHealthAnalyticsSettings", or +// "projects/{project}/securityHealthAnalyticsSettings". +func (r *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesService) ListDescendant(parent string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { + c := &OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall{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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) PageSize(pageSize int64) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last call indicating a continuation +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) PageToken(pageToken string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { + 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 *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -19596,7 +19815,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCa // 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 *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) IfNoneMatch(entityTag string) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) IfNoneMatch(entityTag string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { c.ifNoneMatch_ = entityTag return c } @@ -19604,21 +19823,21 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCa // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { 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 *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Header() http.Header { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -19631,7 +19850,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCa 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}/customModules:listDescendant") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -19639,22 +19858,22 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCa } 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.securityHealthAnalyticsSettings.effectiveCustomModules.get" call. +// Do executes the "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.listDescendant" call. // Exactly one of -// *GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModu -// le or error will be non-nil. Any non-2xx status code is an error. -// Response headers are in either -// *GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModu -// le.ServerResponse.Header or (if a response was returned at all) in +// *ListDescendantSecurityHealthAnalyticsCustomModulesResponse or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *ListDescendantSecurityHealthAnalyticsCustomModulesResponse.ServerResp +// onse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was // returned. -func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModule, error) { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Do(opts ...googleapi.CallOption) (*ListDescendantSecurityHealthAnalyticsCustomModulesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -19673,7 +19892,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCa if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModule{ + ret := &ListDescendantSecurityHealthAnalyticsCustomModulesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -19685,25 +19904,36 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCa } return ret, nil // { - // "description": "Retrieves an EffectiveSecurityHealthAnalyticsCustomModule.", - // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/effectiveCustomModules/{effectiveCustomModulesId}", + // "description": "Returns a list of all resident SecurityHealthAnalyticsCustomModules under the given CRM parent and all of the parent’s CRM descendants.", + // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules:listDescendant", // "httpMethod": "GET", - // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.effectiveCustomModules.get", + // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.listDescendant", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. Name of the effective custom module to get. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}\", \"folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}\"", + // "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 call indicating a continuation", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. Name of parent to list descendant custom modules. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", // "location": "path", - // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings/effectiveCustomModules/[^/]+$", + // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/customModules:listDescendant", // "response": { - // "$ref": "GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModule" + // "$ref": "ListDescendantSecurityHealthAnalyticsCustomModulesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -19712,119 +19942,132 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCa } -// method id "securitycenter.organizations.securityHealthAnalyticsSettings.effectiveCustomModules.list": - -type OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall 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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Pages(ctx context.Context, f func(*ListDescendantSecurityHealthAnalyticsCustomModulesResponse) 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: Returns a list of all -// EffectiveSecurityHealthAnalyticsCustomModules for the given parent. -// This includes resident modules defined at the scope of the parent, -// and inherited modules, inherited from CRM ancestors. -// -// - parent: Name of parent to list effective custom modules. Its format -// is "organizations/{organization}/securityHealthAnalyticsSettings", -// "folders/{folder}/securityHealthAnalyticsSettings", or -// "projects/{project}/securityHealthAnalyticsSettings". -func (r *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesService) List(parent string) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { - c := &OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c +// method id "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.patch": + +type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall struct { + s *Service + name string + googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// 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 *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) PageSize(pageSize int64) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) +// Patch: Updates the SecurityHealthAnalyticsCustomModule under the +// given name based on the given update mask. Updating the enablement +// state is supported on both resident and inherited modules (though +// resident modules cannot have an enablement state of "inherited"). +// Updating the display name and custom config of a module is supported +// on resident modules only. +// +// - name: Immutable. The resource name of the custom module. Its format +// is +// "organizations/{organization}/securityHealthAnalyticsSettings/custom +// Modules/{customModule}", or +// "folders/{folder}/securityHealthAnalyticsSettings/customModules/{cus +// tomModule}", or +// "projects/{project}/securityHealthAnalyticsSettings/customModules/{c +// ustomModule}" The id {customModule} is server-generated and is not +// user settable. It will be a numeric id containing 1-20 digits. +func (r *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesService) Patch(name string, googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall { + c := &OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule = googlecloudsecuritycenterv1securityhealthanalyticscustommodule return c } -// PageToken sets the optional parameter "pageToken": The value returned -// by the last call indicating a continuation -func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) PageToken(pageToken string) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { - c.urlParams_.Set("pageToken", pageToken) +// UpdateMask sets the optional parameter "updateMask": The list of +// fields to update. +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) UpdateMask(updateMask string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall { + 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 *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall { 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 *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) IfNoneMatch(entityTag string) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { - 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 *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall { 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 *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Header() http.Header { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) doRequest(alt string) (*http.Response, 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.googlecloudsecuritycenterv1securityhealthanalyticscustommodule) + 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}/effectiveCustomModules") + 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.securityHealthAnalyticsSettings.effectiveCustomModules.list" call. +// Do executes the "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.patch" call. // Exactly one of -// *ListEffectiveSecurityHealthAnalyticsCustomModulesResponse or error -// will be non-nil. Any non-2xx status code is an error. Response +// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule or +// error will be non-nil. Any non-2xx status code is an error. Response // headers are in either -// *ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.ServerRespo -// nse.Header or (if a response was returned at all) in +// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule.Server +// Response.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was // returned. -func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Do(opts ...googleapi.CallOption) (*ListEffectiveSecurityHealthAnalyticsCustomModulesResponse, error) { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -19843,7 +20086,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListC if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListEffectiveSecurityHealthAnalyticsCustomModulesResponse{ + ret := &GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -19855,36 +20098,34 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListC } return ret, nil // { - // "description": "Returns a list of all EffectiveSecurityHealthAnalyticsCustomModules for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from CRM ancestors.", - // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/effectiveCustomModules", - // "httpMethod": "GET", - // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.effectiveCustomModules.list", + // "description": "Updates the SecurityHealthAnalyticsCustomModule under the given name based on the given update mask. Updating the enablement state is supported on both resident and inherited modules (though resident modules cannot have an enablement state of \"inherited\"). Updating the display name and custom config of a module is supported on resident modules only.", + // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules/{customModulesId}", + // "httpMethod": "PATCH", + // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.patch", // "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 call indicating a continuation", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. Name of parent to list effective custom modules. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", + // "name": { + // "description": "Immutable. The resource name of the custom module. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}\" The id {customModule} is server-generated and is not user settable. It will be a numeric id containing 1-20 digits.", // "location": "path", - // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings$", + // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "The list of fields to update.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v1/{+parent}/effectiveCustomModules", + // "path": "v1/{+name}", + // "request": { + // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" + // }, // "response": { - // "$ref": "ListEffectiveSecurityHealthAnalyticsCustomModulesResponse" + // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -19893,110 +20134,104 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListC } -// 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 *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Pages(ctx context.Context, f func(*ListEffectiveSecurityHealthAnalyticsCustomModulesResponse) 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.securityHealthAnalyticsSettings.effectiveCustomModules.get": -type OrganizationsSourcesCreateCall struct { - s *Service - parent string - source *Source - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Create: Creates a source. +// Get: Retrieves an EffectiveSecurityHealthAnalyticsCustomModule. // -// - 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 +// - name: Name of the effective custom module to get. Its format is +// "organizations/{organization}/securityHealthAnalyticsSettings/effect +// iveCustomModules/{customModule}", +// "folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomMod +// ules/{customModule}", or +// "projects/{project}/securityHealthAnalyticsSettings/effectiveCustomM +// odules/{customModule}". +func (r *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesService) Get(name string) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { + c := &OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall{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 *OrganizationsSourcesCreateCall) Fields(s ...googleapi.Field) *OrganizationsSourcesCreateCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { 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 *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) IfNoneMatch(entityTag string) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { + 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 *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { 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 *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) 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 *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) doRequest(alt string) (*http.Response, 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/{+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.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.securityHealthAnalyticsSettings.effectiveCustomModules.get" call. +// Exactly one of +// *GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModu +// le or error will be non-nil. Any non-2xx status code is an error. +// Response headers are in either +// *GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModu +// le.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModule, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -20015,7 +20250,7 @@ func (c *OrganizationsSourcesCreateCall) Do(opts ...googleapi.CallOption) (*Sour if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Source{ + ret := &GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -20027,28 +20262,25 @@ 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": "Retrieves an EffectiveSecurityHealthAnalyticsCustomModule.", + // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/effectiveCustomModules/{effectiveCustomModulesId}", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.effectiveCustomModules.get", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. Resource name of the new source's parent. Its format should be \"organizations/[organization_id]\".", + // "name": { + // "description": "Required. Name of the effective custom module to get. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}\", \"folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}\"", // "location": "path", - // "pattern": "^organizations/[^/]+$", + // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings/effectiveCustomModules/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/sources", - // "request": { - // "$ref": "Source" - // }, + // "path": "v1/{+name}", // "response": { - // "$ref": "Source" + // "$ref": "GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -20057,31 +20289,51 @@ func (c *OrganizationsSourcesCreateCall) Do(opts ...googleapi.CallOption) (*Sour } -// method id "securitycenter.organizations.sources.get": +// method id "securitycenter.organizations.securityHealthAnalyticsSettings.effectiveCustomModules.list": -type OrganizationsSourcesGetCall struct { +type OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall struct { s *Service - name string + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Gets a source. +// List: Returns a list of all +// EffectiveSecurityHealthAnalyticsCustomModules for the given parent. +// This includes resident modules defined at the scope of the parent, +// and inherited modules, inherited from CRM ancestors. // -// - 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 +// - parent: Name of parent to list effective custom modules. Its format +// is "organizations/{organization}/securityHealthAnalyticsSettings", +// "folders/{folder}/securityHealthAnalyticsSettings", or +// "projects/{project}/securityHealthAnalyticsSettings". +func (r *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesService) List(parent string) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { + c := &OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall{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 *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) PageSize(pageSize int64) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last call indicating a continuation +func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) PageToken(pageToken string) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { + 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 *OrganizationsSourcesGetCall) Fields(s ...googleapi.Field) *OrganizationsSourcesGetCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -20091,7 +20343,7 @@ func (c *OrganizationsSourcesGetCall) Fields(s ...googleapi.Field) *Organization // 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 { +func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) IfNoneMatch(entityTag string) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { c.ifNoneMatch_ = entityTag return c } @@ -20099,21 +20351,21 @@ func (c *OrganizationsSourcesGetCall) IfNoneMatch(entityTag string) *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 *OrganizationsSourcesGetCall) Context(ctx context.Context) *OrganizationsSourcesGetCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { 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 *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) 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 *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -20126,7 +20378,7 @@ func (c *OrganizationsSourcesGetCall) 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/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/effectiveCustomModules") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -20134,19 +20386,22 @@ func (c *OrganizationsSourcesGetCall) doRequest(alt string) (*http.Response, 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.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.securityHealthAnalyticsSettings.effectiveCustomModules.list" call. +// Exactly one of +// *ListEffectiveSecurityHealthAnalyticsCustomModulesResponse or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.ServerRespo +// nse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Do(opts ...googleapi.CallOption) (*ListEffectiveSecurityHealthAnalyticsCustomModulesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -20165,7 +20420,7 @@ func (c *OrganizationsSourcesGetCall) Do(opts ...googleapi.CallOption) (*Source, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Source{ + ret := &ListEffectiveSecurityHealthAnalyticsCustomModulesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -20177,25 +20432,36 @@ func (c *OrganizationsSourcesGetCall) Do(opts ...googleapi.CallOption) (*Source, } return ret, nil // { - // "description": "Gets a source.", - // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}", + // "description": "Returns a list of all EffectiveSecurityHealthAnalyticsCustomModules for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from CRM ancestors.", + // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/effectiveCustomModules", // "httpMethod": "GET", - // "id": "securitycenter.organizations.sources.get", + // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.effectiveCustomModules.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. Relative resource name of the source. Its format is \"organizations/[organization_id]/source/[source_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 call indicating a continuation", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. Name of parent to list effective custom modules. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", // "location": "path", - // "pattern": "^organizations/[^/]+/sources/[^/]+$", + // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/effectiveCustomModules", // "response": { - // "$ref": "Source" + // "$ref": "ListEffectiveSecurityHealthAnalyticsCustomModulesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -20204,91 +20470,119 @@ func (c *OrganizationsSourcesGetCall) Do(opts ...googleapi.CallOption) (*Source, } -// method id "securitycenter.organizations.sources.getIamPolicy": +// 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 *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Pages(ctx context.Context, f func(*ListEffectiveSecurityHealthAnalyticsCustomModulesResponse) 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 OrganizationsSourcesGetIamPolicyCall struct { - s *Service - resource string - getiampolicyrequest *GetIamPolicyRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "securitycenter.organizations.simulations.get": + +type OrganizationsSimulationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// GetIamPolicy: Gets the access control policy on the specified Source. +// Get: Get the simulation by name or the latest simulation for the +// given organization. // -// - 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 organization name or simulation name of this simulation +// Valid format: "organizations/{organization}/simulations/latest" +// "organizations/{organization}/simulations/{simulation}". +func (r *OrganizationsSimulationsService) Get(name string) *OrganizationsSimulationsGetCall { + c := &OrganizationsSimulationsGetCall{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 *OrganizationsSimulationsGetCall) Fields(s ...googleapi.Field) *OrganizationsSimulationsGetCall { 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 *OrganizationsSimulationsGetCall) IfNoneMatch(entityTag string) *OrganizationsSimulationsGetCall { + 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 *OrganizationsSourcesGetIamPolicyCall) Context(ctx context.Context) *OrganizationsSourcesGetIamPolicyCall { +func (c *OrganizationsSimulationsGetCall) Context(ctx context.Context) *OrganizationsSimulationsGetCall { 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 *OrganizationsSimulationsGetCall) 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 *OrganizationsSimulationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) - if err != nil { - return nil, err + 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}:getIamPolicy") + 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.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) { +// Do executes the "securitycenter.organizations.simulations.get" call. +// Exactly one of *Simulation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Simulation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *OrganizationsSimulationsGetCall) Do(opts ...googleapi.CallOption) (*Simulation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -20307,7 +20601,7 @@ func (c *OrganizationsSourcesGetIamPolicyCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Policy{ + ret := &Simulation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -20319,28 +20613,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", - // "httpMethod": "POST", - // "id": "securitycenter.organizations.sources.getIamPolicy", + // "description": "Get the simulation by name or the latest simulation for the given organization.", + // "flatPath": "v1/organizations/{organizationsId}/simulations/{simulationsId}", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.simulations.get", // "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": "Required. The organization name or simulation name of this simulation Valid format: \"organizations/{organization}/simulations/latest\" \"organizations/{organization}/simulations/{simulation}\"", // "location": "path", - // "pattern": "^organizations/[^/]+/sources/[^/]+$", + // "pattern": "^organizations/[^/]+/simulations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+resource}:getIamPolicy", - // "request": { - // "$ref": "GetIamPolicyRequest" - // }, + // "path": "v1/{+name}", // "response": { - // "$ref": "Policy" + // "$ref": "Simulation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -20349,9 +20640,9 @@ func (c *OrganizationsSourcesGetIamPolicyCall) Do(opts ...googleapi.CallOption) } -// method id "securitycenter.organizations.sources.list": +// method id "securitycenter.organizations.simulations.attackExposureResults.attackPaths.list": -type OrganizationsSourcesListCall struct { +type OrganizationsSimulationsAttackExposureResultsAttackPathsListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -20360,30 +20651,43 @@ type OrganizationsSourcesListCall struct { header_ http.Header } -// List: Lists all sources belonging to an organization. +// List: Lists the attack paths for a set of simulation results or +// valued resources and filter. // -// - 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)} +// - parent: Name of parent to list attack paths. Valid formats: +// "organizations/{organization}", +// "organizations/{organization}/simulations/{simulation}" +// "organizations/{organization}/simulations/{simulation}/attackExposur +// eResults/{attack_exposure_result_v2}" +// "organizations/{organization}/simulations/{simulation}/valuedResourc +// es/{valued_resource}". +func (r *OrganizationsSimulationsAttackExposureResultsAttackPathsService) List(parent string) *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall { + c := &OrganizationsSimulationsAttackExposureResultsAttackPathsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } +// Filter sets the optional parameter "filter": The filter expression +// that filters the attack path in the response. Supported fields: * +// `valued_resources` supports = +func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) Filter(filter string) *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall { + c.urlParams_.Set("filter", filter) + 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 { +func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) PageSize(pageSize int64) *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall { 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 +// by the last `ListAttackPathsResponse`; indicates that this is a +// continuation of a prior `ListAttackPaths` call, and that the system // should return the next page of data. -func (c *OrganizationsSourcesListCall) PageToken(pageToken string) *OrganizationsSourcesListCall { +func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) PageToken(pageToken string) *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -20391,7 +20695,7 @@ func (c *OrganizationsSourcesListCall) PageToken(pageToken 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 *OrganizationsSourcesListCall) Fields(s ...googleapi.Field) *OrganizationsSourcesListCall { +func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) Fields(s ...googleapi.Field) *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -20401,7 +20705,7 @@ func (c *OrganizationsSourcesListCall) Fields(s ...googleapi.Field) *Organizatio // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsSourcesListCall) IfNoneMatch(entityTag string) *OrganizationsSourcesListCall { +func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) IfNoneMatch(entityTag string) *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall { c.ifNoneMatch_ = entityTag return c } @@ -20409,21 +20713,21 @@ func (c *OrganizationsSourcesListCall) IfNoneMatch(entityTag string) *Organizati // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSourcesListCall) Context(ctx context.Context) *OrganizationsSourcesListCall { +func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) Context(ctx context.Context) *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall { 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 *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) 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 *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -20436,7 +20740,7 @@ func (c *OrganizationsSourcesListCall) doRequest(alt string) (*http.Response, er var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/sources") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/attackPaths") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -20449,14 +20753,14 @@ func (c *OrganizationsSourcesListCall) doRequest(alt string) (*http.Response, er 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 +// Do executes the "securitycenter.organizations.simulations.attackExposureResults.attackPaths.list" call. +// Exactly one of *ListAttackPathsResponse 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 +// *ListAttackPathsResponse.ServerResponse.Header or (if a response was // returned 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) { +func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) Do(opts ...googleapi.CallOption) (*ListAttackPathsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -20475,7 +20779,7 @@ func (c *OrganizationsSourcesListCall) Do(opts ...googleapi.CallOption) (*ListSo if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListSourcesResponse{ + ret := &ListAttackPathsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -20487,14 +20791,19 @@ func (c *OrganizationsSourcesListCall) Do(opts ...googleapi.CallOption) (*ListSo } return ret, nil // { - // "description": "Lists all sources belonging to an organization.", - // "flatPath": "v1/organizations/{organizationsId}/sources", + // "description": "Lists the attack paths for a set of simulation results or valued resources and filter.", + // "flatPath": "v1/organizations/{organizationsId}/simulations/{simulationsId}/attackExposureResults/{attackExposureResultsId}/attackPaths", // "httpMethod": "GET", - // "id": "securitycenter.organizations.sources.list", + // "id": "securitycenter.organizations.simulations.attackExposureResults.attackPaths.list", // "parameterOrder": [ // "parent" // ], // "parameters": { + // "filter": { + // "description": "The filter expression that filters the attack path in the response. Supported fields: * `valued_resources` supports =", + // "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", @@ -20502,21 +20811,21 @@ func (c *OrganizationsSourcesListCall) Do(opts ...googleapi.CallOption) (*ListSo // "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.", + // "description": "The value returned by the last `ListAttackPathsResponse`; indicates that this is a continuation of a prior `ListAttackPaths` 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]\".", + // "description": "Required. Name of parent to list attack paths. Valid formats: \"organizations/{organization}\", \"organizations/{organization}/simulations/{simulation}\" \"organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}\" \"organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}\"", // "location": "path", - // "pattern": "^organizations/[^/]+$", + // "pattern": "^organizations/[^/]+/simulations/[^/]+/attackExposureResults/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/sources", + // "path": "v1/{+parent}/attackPaths", // "response": { - // "$ref": "ListSourcesResponse" + // "$ref": "ListAttackPathsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -20528,7 +20837,7 @@ 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 { +func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) Pages(ctx context.Context, f func(*ListAttackPathsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -20546,98 +20855,125 @@ func (c *OrganizationsSourcesListCall) Pages(ctx context.Context, f func(*ListSo } } -// method id "securitycenter.organizations.sources.patch": +// method id "securitycenter.organizations.simulations.attackExposureResults.valuedResources.list": -type OrganizationsSourcesPatchCall struct { - s *Service - name string - source *Source - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Patch: Updates a source. +// List: Lists the valued resources for a set of simulation results and +// filter. // -// - 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)} - c.name = name - c.source = source +// - parent: Name of parent to list valued resources. Valid formats: +// "organizations/{organization}", +// "organizations/{organization}/simulations/{simulation}" +// "organizations/{organization}/simulations/{simulation}/attackExposur +// eResults/{attack_exposure_result_v2}". +func (r *OrganizationsSimulationsAttackExposureResultsValuedResourcesService) List(parent string) *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall { + c := &OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall{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 source resource. If empty all mutable fields -// will be updated. -func (c *OrganizationsSourcesPatchCall) UpdateMask(updateMask string) *OrganizationsSourcesPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// Filter sets the optional parameter "filter": The filter expression +// that filters the valued resources in the response. Supported fields: +// * `resource_value` supports = * `resource_type` supports = +func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) Filter(filter string) *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall { + c.urlParams_.Set("filter", filter) + 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 *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) PageSize(pageSize int64) *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last `ListValuedResourcesResponse`; indicates that this is a +// continuation of a prior `ListValuedResources` call, and that the +// system should return the next page of data. +func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) PageToken(pageToken string) *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall { + 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 *OrganizationsSourcesPatchCall) Fields(s ...googleapi.Field) *OrganizationsSourcesPatchCall { +func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) Fields(s ...googleapi.Field) *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall { 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 *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) IfNoneMatch(entityTag string) *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall { + 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 *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) Context(ctx context.Context) *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall { 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 *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) 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 *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) doRequest(alt string) (*http.Response, 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 := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/valuedResources") 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.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.simulations.attackExposureResults.valuedResources.list" call. +// Exactly one of *ListValuedResourcesResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ListValuedResourcesResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) Do(opts ...googleapi.CallOption) (*ListValuedResourcesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -20656,7 +20992,7 @@ func (c *OrganizationsSourcesPatchCall) Do(opts ...googleapi.CallOption) (*Sourc if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Source{ + ret := &ListValuedResourcesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -20668,34 +21004,41 @@ 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": "Lists the valued resources for a set of simulation results and filter.", + // "flatPath": "v1/organizations/{organizationsId}/simulations/{simulationsId}/attackExposureResults/{attackExposureResultsId}/valuedResources", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.simulations.attackExposureResults.valuedResources.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "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}\"", - // "location": "path", - // "pattern": "^organizations/[^/]+/sources/[^/]+$", - // "required": true, + // "filter": { + // "description": "The filter expression that filters the valued resources in the response. Supported fields: * `resource_value` supports = * `resource_type` supports =", + // "location": "query", // "type": "string" // }, - // "updateMask": { - // "description": "The FieldMask to use when updating the source resource. If empty all mutable fields will be updated.", - // "format": "google-fieldmask", + // "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 `ListValuedResourcesResponse`; indicates that this is a continuation of a prior `ListValuedResources` call, and that the system should return the next page of data.", // "location": "query", // "type": "string" + // }, + // "parent": { + // "description": "Required. Name of parent to list valued resources. Valid formats: \"organizations/{organization}\", \"organizations/{organization}/simulations/{simulation}\" \"organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}\"", + // "location": "path", + // "pattern": "^organizations/[^/]+/simulations/[^/]+/attackExposureResults/[^/]+$", + // "required": true, + // "type": "string" // } // }, - // "path": "v1/{+name}", - // "request": { - // "$ref": "Source" - // }, + // "path": "v1/{+parent}/valuedResources", // "response": { - // "$ref": "Source" + // "$ref": "ListValuedResourcesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -20704,91 +21047,148 @@ func (c *OrganizationsSourcesPatchCall) Do(opts ...googleapi.CallOption) (*Sourc } -// method id "securitycenter.organizations.sources.setIamPolicy": +// 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 *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) Pages(ctx context.Context, f func(*ListValuedResourcesResponse) 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 OrganizationsSourcesSetIamPolicyCall struct { - s *Service - resource string - setiampolicyrequest *SetIamPolicyRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "securitycenter.organizations.simulations.attackPaths.list": + +type OrganizationsSimulationsAttackPathsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// SetIamPolicy: Sets the access control policy on the specified Source. +// List: Lists the attack paths for a set of simulation results or +// valued resources and filter. // -// - 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 +// - parent: Name of parent to list attack paths. Valid formats: +// "organizations/{organization}", +// "organizations/{organization}/simulations/{simulation}" +// "organizations/{organization}/simulations/{simulation}/attackExposur +// eResults/{attack_exposure_result_v2}" +// "organizations/{organization}/simulations/{simulation}/valuedResourc +// es/{valued_resource}". +func (r *OrganizationsSimulationsAttackPathsService) List(parent string) *OrganizationsSimulationsAttackPathsListCall { + c := &OrganizationsSimulationsAttackPathsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Filter sets the optional parameter "filter": The filter expression +// that filters the attack path in the response. Supported fields: * +// `valued_resources` supports = +func (c *OrganizationsSimulationsAttackPathsListCall) Filter(filter string) *OrganizationsSimulationsAttackPathsListCall { + c.urlParams_.Set("filter", filter) + 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 *OrganizationsSimulationsAttackPathsListCall) PageSize(pageSize int64) *OrganizationsSimulationsAttackPathsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last `ListAttackPathsResponse`; indicates that this is a +// continuation of a prior `ListAttackPaths` call, and that the system +// should return the next page of data. +func (c *OrganizationsSimulationsAttackPathsListCall) PageToken(pageToken string) *OrganizationsSimulationsAttackPathsListCall { + 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 *OrganizationsSimulationsAttackPathsListCall) Fields(s ...googleapi.Field) *OrganizationsSimulationsAttackPathsListCall { 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 *OrganizationsSimulationsAttackPathsListCall) IfNoneMatch(entityTag string) *OrganizationsSimulationsAttackPathsListCall { + 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 *OrganizationsSimulationsAttackPathsListCall) Context(ctx context.Context) *OrganizationsSimulationsAttackPathsListCall { 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 *OrganizationsSimulationsAttackPathsListCall) 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 *OrganizationsSimulationsAttackPathsListCall) doRequest(alt string) (*http.Response, 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/{+parent}/attackPaths") 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, + "parent": c.parent, }) 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.simulations.attackPaths.list" call. +// Exactly one of *ListAttackPathsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListAttackPathsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsSimulationsAttackPathsListCall) Do(opts ...googleapi.CallOption) (*ListAttackPathsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -20807,7 +21207,7 @@ func (c *OrganizationsSourcesSetIamPolicyCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Policy{ + ret := &ListAttackPathsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -20819,28 +21219,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 the attack paths for a set of simulation results or valued resources and filter.", + // "flatPath": "v1/organizations/{organizationsId}/simulations/{simulationsId}/attackPaths", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.simulations.attackPaths.list", // "parameterOrder": [ - // "resource" + // "parent" // ], // "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 filter expression that filters the attack path in the response. Supported fields: * `valued_resources` supports =", + // "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 `ListAttackPathsResponse`; indicates that this is a continuation of a prior `ListAttackPaths` call, and that the system should return the next page of data.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. Name of parent to list attack paths. Valid formats: \"organizations/{organization}\", \"organizations/{organization}/simulations/{simulation}\" \"organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}\" \"organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}\"", // "location": "path", - // "pattern": "^organizations/[^/]+/sources/[^/]+$", + // "pattern": "^organizations/[^/]+/simulations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+resource}:setIamPolicy", - // "request": { - // "$ref": "SetIamPolicyRequest" - // }, + // "path": "v1/{+parent}/attackPaths", // "response": { - // "$ref": "Policy" + // "$ref": "ListAttackPathsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -20849,92 +21262,146 @@ 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 *OrganizationsSimulationsAttackPathsListCall) Pages(ctx context.Context, f func(*ListAttackPathsResponse) 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.simulations.valuedResources.list": + +type OrganizationsSimulationsValuedResourcesListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists the valued resources for a set of simulation results and +// filter. +// +// - parent: Name of parent to list valued resources. Valid formats: +// "organizations/{organization}", +// "organizations/{organization}/simulations/{simulation}" +// "organizations/{organization}/simulations/{simulation}/attackExposur +// eResults/{attack_exposure_result_v2}". +func (r *OrganizationsSimulationsValuedResourcesService) List(parent string) *OrganizationsSimulationsValuedResourcesListCall { + c := &OrganizationsSimulationsValuedResourcesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Filter sets the optional parameter "filter": The filter expression +// that filters the valued resources in the response. Supported fields: +// * `resource_value` supports = * `resource_type` supports = +func (c *OrganizationsSimulationsValuedResourcesListCall) Filter(filter string) *OrganizationsSimulationsValuedResourcesListCall { + c.urlParams_.Set("filter", filter) + return c +} -type OrganizationsSourcesTestIamPermissionsCall struct { - s *Service - resource string - testiampermissionsrequest *TestIamPermissionsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// 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 *OrganizationsSimulationsValuedResourcesListCall) PageSize(pageSize int64) *OrganizationsSimulationsValuedResourcesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c } -// 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 +// PageToken sets the optional parameter "pageToken": The value returned +// by the last `ListValuedResourcesResponse`; indicates that this is a +// continuation of a prior `ListValuedResources` call, and that the +// system should return the next page of data. +func (c *OrganizationsSimulationsValuedResourcesListCall) PageToken(pageToken string) *OrganizationsSimulationsValuedResourcesListCall { + 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 *OrganizationsSourcesTestIamPermissionsCall) Fields(s ...googleapi.Field) *OrganizationsSourcesTestIamPermissionsCall { +func (c *OrganizationsSimulationsValuedResourcesListCall) Fields(s ...googleapi.Field) *OrganizationsSimulationsValuedResourcesListCall { 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 *OrganizationsSimulationsValuedResourcesListCall) IfNoneMatch(entityTag string) *OrganizationsSimulationsValuedResourcesListCall { + 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 *OrganizationsSourcesTestIamPermissionsCall) Context(ctx context.Context) *OrganizationsSourcesTestIamPermissionsCall { +func (c *OrganizationsSimulationsValuedResourcesListCall) Context(ctx context.Context) *OrganizationsSimulationsValuedResourcesListCall { 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 *OrganizationsSimulationsValuedResourcesListCall) 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 *OrganizationsSimulationsValuedResourcesListCall) doRequest(alt string) (*http.Response, 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 + 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}:testIamPermissions") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/valuedResources") 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, + "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. +// Do executes the "securitycenter.organizations.simulations.valuedResources.list" call. +// Exactly one of *ListValuedResourcesResponse 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 +// *ListValuedResourcesResponse.ServerResponse.Header or (if a response // was returned 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) { +func (c *OrganizationsSimulationsValuedResourcesListCall) Do(opts ...googleapi.CallOption) (*ListValuedResourcesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -20953,7 +21420,7 @@ func (c *OrganizationsSourcesTestIamPermissionsCall) Do(opts ...googleapi.CallOp if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &TestIamPermissionsResponse{ + ret := &ListValuedResourcesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -20965,28 +21432,41 @@ 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", - // "httpMethod": "POST", - // "id": "securitycenter.organizations.sources.testIamPermissions", + // "description": "Lists the valued resources for a set of simulation results and filter.", + // "flatPath": "v1/organizations/{organizationsId}/simulations/{simulationsId}/valuedResources", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.simulations.valuedResources.list", // "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.", + // "filter": { + // "description": "The filter expression that filters the valued resources in the response. Supported fields: * `resource_value` supports = * `resource_type` supports =", + // "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 `ListValuedResourcesResponse`; indicates that this is a continuation of a prior `ListValuedResources` call, and that the system should return the next page of data.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. Name of parent to list valued resources. Valid formats: \"organizations/{organization}\", \"organizations/{organization}/simulations/{simulation}\" \"organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}\"", // "location": "path", - // "pattern": "^organizations/[^/]+/sources/[^/]+$", + // "pattern": "^organizations/[^/]+/simulations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+resource}:testIamPermissions", - // "request": { - // "$ref": "TestIamPermissionsRequest" - // }, + // "path": "v1/{+parent}/valuedResources", // "response": { - // "$ref": "TestIamPermissionsResponse" + // "$ref": "ListValuedResourcesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -20995,81 +21475,130 @@ func (c *OrganizationsSourcesTestIamPermissionsCall) Do(opts ...googleapi.CallOp } -// method id "securitycenter.organizations.sources.findings.create": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *OrganizationsSimulationsValuedResourcesListCall) Pages(ctx context.Context, f func(*ListValuedResourcesResponse) 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 OrganizationsSourcesFindingsCreateCall struct { - s *Service - parent string - finding *Finding - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "securitycenter.organizations.simulations.valuedResources.attackPaths.list": + +type OrganizationsSimulationsValuedResourcesAttackPathsListCall struct { + s *Service + parent 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. +// List: Lists the attack paths for a set of simulation results or +// valued resources and filter. // -// - 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)} +// - parent: Name of parent to list attack paths. Valid formats: +// "organizations/{organization}", +// "organizations/{organization}/simulations/{simulation}" +// "organizations/{organization}/simulations/{simulation}/attackExposur +// eResults/{attack_exposure_result_v2}" +// "organizations/{organization}/simulations/{simulation}/valuedResourc +// es/{valued_resource}". +func (r *OrganizationsSimulationsValuedResourcesAttackPathsService) List(parent string) *OrganizationsSimulationsValuedResourcesAttackPathsListCall { + c := &OrganizationsSimulationsValuedResourcesAttackPathsListCall{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) +// Filter sets the optional parameter "filter": The filter expression +// that filters the attack path in the response. Supported fields: * +// `valued_resources` supports = +func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) Filter(filter string) *OrganizationsSimulationsValuedResourcesAttackPathsListCall { + c.urlParams_.Set("filter", filter) + 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 *OrganizationsSimulationsValuedResourcesAttackPathsListCall) PageSize(pageSize int64) *OrganizationsSimulationsValuedResourcesAttackPathsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last `ListAttackPathsResponse`; indicates that this is a +// continuation of a prior `ListAttackPaths` call, and that the system +// should return the next page of data. +func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) PageToken(pageToken string) *OrganizationsSimulationsValuedResourcesAttackPathsListCall { + 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 *OrganizationsSourcesFindingsCreateCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsCreateCall { +func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) Fields(s ...googleapi.Field) *OrganizationsSimulationsValuedResourcesAttackPathsListCall { 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 *OrganizationsSimulationsValuedResourcesAttackPathsListCall) IfNoneMatch(entityTag string) *OrganizationsSimulationsValuedResourcesAttackPathsListCall { + 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 *OrganizationsSimulationsValuedResourcesAttackPathsListCall) Context(ctx context.Context) *OrganizationsSimulationsValuedResourcesAttackPathsListCall { 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 *OrganizationsSimulationsValuedResourcesAttackPathsListCall) 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 *OrganizationsSimulationsValuedResourcesAttackPathsListCall) doRequest(alt string) (*http.Response, 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/{+parent}/attackPaths") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -21080,14 +21609,14 @@ func (c *OrganizationsSourcesFindingsCreateCall) doRequest(alt string) (*http.Re 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) { +// Do executes the "securitycenter.organizations.simulations.valuedResources.attackPaths.list" call. +// Exactly one of *ListAttackPathsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListAttackPathsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) Do(opts ...googleapi.CallOption) (*ListAttackPathsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -21106,7 +21635,7 @@ func (c *OrganizationsSourcesFindingsCreateCall) Do(opts ...googleapi.CallOption if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Finding{ + ret := &ListAttackPathsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -21118,33 +21647,41 @@ 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": "Lists the attack paths for a set of simulation results or valued resources and filter.", + // "flatPath": "v1/organizations/{organizationsId}/simulations/{simulationsId}/valuedResources/{valuedResourcesId}/attackPaths", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.simulations.valuedResources.attackPaths.list", // "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.", + // "filter": { + // "description": "The filter expression that filters the attack path in the response. Supported fields: * `valued_resources` supports =", + // "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 `ListAttackPathsResponse`; indicates that this is a continuation of a prior `ListAttackPaths` call, and that the system should return the next page of data.", // "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]\".", + // "description": "Required. Name of parent to list attack paths. Valid formats: \"organizations/{organization}\", \"organizations/{organization}/simulations/{simulation}\" \"organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}\" \"organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}\"", // "location": "path", - // "pattern": "^organizations/[^/]+/sources/[^/]+$", + // "pattern": "^organizations/[^/]+/simulations/[^/]+/valuedResources/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/findings", - // "request": { - // "$ref": "Finding" - // }, + // "path": "v1/{+parent}/attackPaths", // "response": { - // "$ref": "Finding" + // "$ref": "ListAttackPathsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -21153,42 +21690,53 @@ func (c *OrganizationsSourcesFindingsCreateCall) Do(opts ...googleapi.CallOption } -// method id "securitycenter.organizations.sources.findings.group": +// 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 *OrganizationsSimulationsValuedResourcesAttackPathsListCall) Pages(ctx context.Context, f func(*ListAttackPathsResponse) 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 OrganizationsSourcesFindingsGroupCall struct { - s *Service - parent string - groupfindingsrequest *GroupFindingsRequest - 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 } -// 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 +// Create: Creates a 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)} +// - 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.groupfindingsrequest = groupfindingsrequest + 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 *OrganizationsSourcesFindingsGroupCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsGroupCall { +func (c *OrganizationsSourcesCreateCall) Fields(s ...googleapi.Field) *OrganizationsSourcesCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -21196,21 +21744,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 *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 *OrganizationsSourcesFindingsGroupCall) Header() http.Header { +func (c *OrganizationsSourcesCreateCall) 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 *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_ { @@ -21218,14 +21766,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.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/{+parent}/findings:group") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/sources") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -21238,14 +21786,14 @@ func (c *OrganizationsSourcesFindingsGroupCall) doRequest(alt string) (*http.Res 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.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 { @@ -21264,7 +21812,7 @@ func (c *OrganizationsSourcesFindingsGroupCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GroupFindingsResponse{ + ret := &Source{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -21276,28 +21824,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": "Creates a source.", + // "flatPath": "v1/organizations/{organizationsId}/sources", // "httpMethod": "POST", - // "id": "securitycenter.organizations.sources.findings.group", + // "id": "securitycenter.organizations.sources.create", // "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/-", + // "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/{+parent}/findings:group", + // "path": "v1/{+parent}/sources", // "request": { - // "$ref": "GroupFindingsRequest" + // "$ref": "Source" // }, // "response": { - // "$ref": "GroupFindingsResponse" + // "$ref": "Source" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -21306,238 +21854,238 @@ 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.get": -type OrganizationsSourcesFindingsListCall struct { +type OrganizationsSourcesGetCall 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 source. // -// - 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 +// - 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 } -// 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) +// 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 { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) 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) +// 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 } -// 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) +// Context sets the context 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 { + c.ctx_ = ctx 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 +// 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 { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +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()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "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) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Source{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a source.", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.sources.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "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/{+name}", + // "response": { + // "$ref": "Source" + // }, + // "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 *OrganizationsSourcesFindingsListCall) PageSize(pageSize int64) *OrganizationsSourcesFindingsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} +// method id "securitycenter.organizations.sources.getIamPolicy": -// 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 +type OrganizationsSourcesGetIamPolicyCall struct { + s *Service + resource string + getiampolicyrequest *GetIamPolicyRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// 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) +// GetIamPolicy: Gets the access control policy on the specified Source. +// +// - 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 *OrganizationsSourcesFindingsListCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsListCall { +func (c *OrganizationsSourcesGetIamPolicyCall) Fields(s ...googleapi.Field) *OrganizationsSourcesGetIamPolicyCall { 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 { +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 *OrganizationsSourcesFindingsListCall) Header() http.Header { +func (c *OrganizationsSourcesGetIamPolicyCall) 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 *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_ { 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.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") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "resource": c.resource, }) 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) { +// 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 { @@ -21556,7 +22104,7 @@ func (c *OrganizationsSourcesFindingsListCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListFindingsResponse{ + ret := &Policy{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -21568,64 +22116,28 @@ 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", - // "httpMethod": "GET", - // "id": "securitycenter.organizations.sources.findings.list", + // "description": "Gets the access control policy on the specified Source.", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}:getIamPolicy", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.sources.getIamPolicy", // "parameterOrder": [ - // "parent" + // "resource" // ], // "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/-", + // "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" - // }, - // "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/{+resource}:getIamPolicy", + // "request": { + // "$ref": "GetIamPolicyRequest" + // }, // "response": { - // "$ref": "ListFindingsResponse" + // "$ref": "Policy" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -21634,127 +22146,114 @@ 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 { - 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": +// method id "securitycenter.organizations.sources.list": -type OrganizationsSourcesFindingsPatchCall struct { - s *Service - name string - finding *Finding - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsSourcesListCall 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 all sources belonging to an organization. // -// - name: The relative resource name -// (https://cloud.google.com/apis/design/resource_names#relative_resource_name) -// of the finding. Example: -// "organizations/{organization_id}/sources/{source_id}/findings/{findi -// ng_id}", -// "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", -// "projects/{project_id}/sources/{source_id}/findings/{finding_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 +// - 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 } -// 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) +// 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) 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 { +func (c *OrganizationsSourcesListCall) Fields(s ...googleapi.Field) *OrganizationsSourcesListCall { 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 *OrganizationsSourcesFindingsPatchCall) Context(ctx context.Context) *OrganizationsSourcesFindingsPatchCall { +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 *OrganizationsSourcesFindingsPatchCall) Header() http.Header { +func (c *OrganizationsSourcesListCall) 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 *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_ { 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}/sources") 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.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) { +// 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) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -21773,7 +22272,7 @@ func (c *OrganizationsSourcesFindingsPatchCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Finding{ + ret := &ListSourcesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -21785,34 +22284,36 @@ 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}", - // "httpMethod": "PATCH", - // "id": "securitycenter.organizations.sources.findings.patch", + // "description": "Lists all sources belonging to an organization.", + // "flatPath": "v1/organizations/{organizationsId}/sources", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.sources.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "The [relative resource name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) of the finding. Example: \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}\", \"folders/{folder_id}/sources/{source_id}/findings/{finding_id}\", \"projects/{project_id}/sources/{source_id}/findings/{finding_id}\".", - // "location": "path", - // "pattern": "^organizations/[^/]+/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 `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": "^organizations/[^/]+$", + // "required": true, + // "type": "string" // } // }, - // "path": "v1/{+name}", - // "request": { - // "$ref": "Finding" - // }, + // "path": "v1/{+parent}/sources", // "response": { - // "$ref": "Finding" + // "$ref": "ListSourcesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -21821,37 +22322,62 @@ func (c *OrganizationsSourcesFindingsPatchCall) Do(opts ...googleapi.CallOption) } -// method id "securitycenter.organizations.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 *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) + } +} -type OrganizationsSourcesFindingsSetMuteCall struct { - s *Service - name string - setmuterequest *SetMuteRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "securitycenter.organizations.sources.patch": + +type OrganizationsSourcesPatchCall struct { + s *Service + name string + source *Source + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// SetMute: Updates the mute state of a finding. +// Patch: Updates a source. // -// - name: The relative resource name -// (https://cloud.google.com/apis/design/resource_names#relative_resource_name) -// of the finding. Example: -// "organizations/{organization_id}/sources/{source_id}/findings/{findi -// ng_id}", -// "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", -// "projects/{project_id}/sources/{source_id}/findings/{finding_id}". -func (r *OrganizationsSourcesFindingsService) SetMute(name string, setmuterequest *SetMuteRequest) *OrganizationsSourcesFindingsSetMuteCall { - c := &OrganizationsSourcesFindingsSetMuteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - 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)} c.name = name - c.setmuterequest = setmuterequest + 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 *OrganizationsSourcesFindingsSetMuteCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsSetMuteCall { +func (c *OrganizationsSourcesPatchCall) Fields(s ...googleapi.Field) *OrganizationsSourcesPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -21859,21 +22385,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 *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 *OrganizationsSourcesFindingsSetMuteCall) Header() http.Header { +func (c *OrganizationsSourcesPatchCall) 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 *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_ { @@ -21881,16 +22407,16 @@ 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.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/{+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 } @@ -21901,14 +22427,14 @@ func (c *OrganizationsSourcesFindingsSetMuteCall) doRequest(alt string) (*http.R 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.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 *OrganizationsSourcesFindingsSetMuteCall) 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 { @@ -21927,7 +22453,7 @@ func (c *OrganizationsSourcesFindingsSetMuteCall) Do(opts ...googleapi.CallOptio if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Finding{ + ret := &Source{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -21939,28 +22465,34 @@ 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", - // "httpMethod": "POST", - // "id": "securitycenter.organizations.sources.findings.setMute", + // "description": "Updates a source.", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}", + // "httpMethod": "PATCH", + // "id": "securitycenter.organizations.sources.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The [relative resource name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) of the finding. Example: \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}\", \"folders/{folder_id}/sources/{source_id}/findings/{finding_id}\", \"projects/{project_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 source resource. 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": "Source" // }, // "response": { - // "$ref": "Finding" + // "$ref": "Source" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -21969,37 +22501,34 @@ func (c *OrganizationsSourcesFindingsSetMuteCall) Do(opts ...googleapi.CallOptio } -// 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 -} +// method id "securitycenter.organizations.sources.setIamPolicy": -// SetState: Updates the state of a finding. -// -// - name: The relative resource name -// (https://cloud.google.com/apis/design/resource_names#relative_resource_name) -// of the finding. Example: -// "organizations/{organization_id}/sources/{source_id}/findings/{findi -// ng_id}", -// "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", -// "projects/{project_id}/sources/{source_id}/findings/{finding_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 +type OrganizationsSourcesSetIamPolicyCall struct { + s *Service + resource string + setiampolicyrequest *SetIamPolicyRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// SetIamPolicy: Sets the access control policy on the specified Source. +// +// - 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 *OrganizationsSourcesFindingsSetStateCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsSetStateCall { +func (c *OrganizationsSourcesSetIamPolicyCall) Fields(s ...googleapi.Field) *OrganizationsSourcesSetIamPolicyCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -22007,21 +22536,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 *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 *OrganizationsSourcesFindingsSetStateCall) Header() http.Header { +func (c *OrganizationsSourcesSetIamPolicyCall) 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 *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_ { @@ -22029,14 +22558,14 @@ 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.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}:setState") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -22044,19 +22573,19 @@ func (c *OrganizationsSourcesFindingsSetStateCall) doRequest(alt string) (*http. } 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.setState" 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 *OrganizationsSourcesFindingsSetStateCall) 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 { @@ -22075,7 +22604,7 @@ func (c *OrganizationsSourcesFindingsSetStateCall) Do(opts ...googleapi.CallOpti if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Finding{ + ret := &Policy{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -22087,28 +22616,28 @@ 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", + // "description": "Sets the access control policy on the specified Source.", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}:setIamPolicy", // "httpMethod": "POST", - // "id": "securitycenter.organizations.sources.findings.setState", + // "id": "securitycenter.organizations.sources.setIamPolicy", // "parameterOrder": [ - // "name" + // "resource" // ], // "parameters": { - // "name": { - // "description": "Required. The [relative resource name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) of the finding. Example: \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}\", \"folders/{folder_id}/sources/{source_id}/findings/{finding_id}\", \"projects/{project_id}/sources/{source_id}/findings/{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/[^/]+/findings/[^/]+$", + // "pattern": "^organizations/[^/]+/sources/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}:setState", + // "path": "v1/{+resource}:setIamPolicy", // "request": { - // "$ref": "SetFindingStateRequest" + // "$ref": "SetIamPolicyRequest" // }, // "response": { - // "$ref": "Finding" + // "$ref": "Policy" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -22117,55 +22646,35 @@ func (c *OrganizationsSourcesFindingsSetStateCall) Do(opts ...googleapi.CallOpti } -// method id "securitycenter.organizations.sources.findings.updateSecurityMarks": +// method id "securitycenter.organizations.sources.testIamPermissions": -type OrganizationsSourcesFindingsUpdateSecurityMarksCall struct { - s *Service - name string - securitymarks *SecurityMarks - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsSourcesTestIamPermissionsCall struct { + s *Service + resource string + testiampermissionsrequest *TestIamPermissionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// UpdateSecurityMarks: Updates security marks. +// TestIamPermissions: Returns the permissions that a caller has on the +// specified source. // -// - 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) +// - 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 *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsUpdateSecurityMarksCall { +func (c *OrganizationsSourcesTestIamPermissionsCall) Fields(s ...googleapi.Field) *OrganizationsSourcesTestIamPermissionsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -22173,21 +22682,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 *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 *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Header() http.Header { +func (c *OrganizationsSourcesTestIamPermissionsCall) 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 *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_ { @@ -22195,34 +22704,34 @@ 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.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/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions") 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, + "resource": c.resource, }) 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 +// 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 *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOption) (*SecurityMarks, error) { +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 { @@ -22241,7 +22750,7 @@ func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Do(opts ...googlea if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &SecurityMarks{ + ret := &TestIamPermissionsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -22253,40 +22762,28 @@ 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": "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": [ - // "name" + // "resource" // ], // "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\".", + // "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/[^/]+/findings/[^/]+/securityMarks$", + // "pattern": "^organizations/[^/]+/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/{+resource}:testIamPermissions", // "request": { - // "$ref": "SecurityMarks" + // "$ref": "TestIamPermissionsRequest" // }, // "response": { - // "$ref": "SecurityMarks" + // "$ref": "TestIamPermissionsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -22295,43 +22792,42 @@ func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Do(opts ...googlea } -// method id "securitycenter.organizations.sources.findings.externalSystems.patch": +// method id "securitycenter.organizations.sources.findings.create": -type OrganizationsSourcesFindingsExternalSystemsPatchCall struct { - s *Service - name string - googlecloudsecuritycenterv1externalsystem *GoogleCloudSecuritycenterV1ExternalSystem - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsSourcesFindingsCreateCall struct { + s *Service + parent string + finding *Finding + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates external system. This is for a given finding. +// Create: Creates a finding. The corresponding source must exist for +// finding creation to succeed. // -// - name: Full resource name of the external system, for example: -// "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 +// - 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 } -// 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) +// 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 *OrganizationsSourcesFindingsExternalSystemsPatchCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsExternalSystemsPatchCall { +func (c *OrganizationsSourcesFindingsCreateCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -22339,21 +22835,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 *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 *OrganizationsSourcesFindingsExternalSystemsPatchCall) Header() http.Header { +func (c *OrganizationsSourcesFindingsCreateCall) 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 *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_ { @@ -22361,36 +22857,34 @@ 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) + 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 := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findings") 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.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.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 { @@ -22409,7 +22903,7 @@ func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) Do(opts ...google if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1ExternalSystem{ + ret := &Finding{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -22421,34 +22915,33 @@ 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": "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": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Full resource name of the external system, for example: \"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, + // "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" // }, - // "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", + // "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/{+name}", + // "path": "v1/{+parent}/findings", // "request": { - // "$ref": "GoogleCloudSecuritycenterV1ExternalSystem" + // "$ref": "Finding" // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1ExternalSystem" + // "$ref": "Finding" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -22457,34 +22950,42 @@ func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) Do(opts ...google } -// method id "securitycenter.projects.assets.group": +// method id "securitycenter.organizations.sources.findings.group": -type ProjectsAssetsGroupCall struct { - s *Service - parent string - groupassetsrequest *GroupAssetsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsSourcesFindingsGroupCall struct { + s *Service + parent string + groupfindingsrequest *GroupFindingsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Group: Filters an organization's assets and groups them by their -// specified properties. +// 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: The name of the parent to group the assets by. 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)} +// - 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.groupassetsrequest = groupassetsrequest + 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 *ProjectsAssetsGroupCall) Fields(s ...googleapi.Field) *ProjectsAssetsGroupCall { +func (c *OrganizationsSourcesFindingsGroupCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsGroupCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -22492,21 +22993,21 @@ func (c *ProjectsAssetsGroupCall) Fields(s ...googleapi.Field) *ProjectsAssetsGr // Context sets the context 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 *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 *ProjectsAssetsGroupCall) Header() http.Header { +func (c *OrganizationsSourcesFindingsGroupCall) 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 *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_ { @@ -22514,14 +23015,14 @@ func (c *ProjectsAssetsGroupCall) doRequest(alt string) (*http.Response, error) } 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.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}/assets:group") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findings:group") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -22534,14 +23035,14 @@ func (c *ProjectsAssetsGroupCall) doRequest(alt string) (*http.Response, error) 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 +// 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 -// *GroupAssetsResponse.ServerResponse.Header or (if a response was +// *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 *ProjectsAssetsGroupCall) Do(opts ...googleapi.CallOption) (*GroupAssetsResponse, error) { +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 { @@ -22560,7 +23061,7 @@ func (c *ProjectsAssetsGroupCall) Do(opts ...googleapi.CallOption) (*GroupAssets if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GroupAssetsResponse{ + ret := &GroupFindingsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -22572,29 +23073,28 @@ func (c *ProjectsAssetsGroupCall) Do(opts ...googleapi.CallOption) (*GroupAssets } return ret, nil // { - // "deprecated": true, - // "description": "Filters an organization's assets and groups them by their specified properties.", - // "flatPath": "v1/projects/{projectsId}/assets:group", + // "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.projects.assets.group", + // "id": "securitycenter.organizations.sources.findings.group", // "parameterOrder": [ // "parent" // ], // "parameters": { // "parent": { - // "description": "Required. The name of the parent to group the assets by. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "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": "^projects/[^/]+$", + // "pattern": "^organizations/[^/]+/sources/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/assets:group", + // "path": "v1/{+parent}/findings:group", // "request": { - // "$ref": "GroupAssetsRequest" + // "$ref": "GroupFindingsRequest" // }, // "response": { - // "$ref": "GroupAssetsResponse" + // "$ref": "GroupFindingsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -22606,9 +23106,9 @@ func (c *ProjectsAssetsGroupCall) Do(opts ...googleapi.CallOption) (*GroupAssets // 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 { +func (c *OrganizationsSourcesFindingsGroupCall) Pages(ctx context.Context, f func(*GroupFindingsResponse) error) error { c.ctx_ = ctx - defer func(pt string) { c.groupassetsrequest.PageToken = pt }(c.groupassetsrequest.PageToken) // reset paging to original point + defer func(pt string) { c.groupfindingsrequest.PageToken = pt }(c.groupfindingsrequest.PageToken) // reset paging to original point for { x, err := c.Do() if err != nil { @@ -22620,13 +23120,13 @@ func (c *ProjectsAssetsGroupCall) Pages(ctx context.Context, f func(*GroupAssets if x.NextPageToken == "" { return nil } - c.groupassetsrequest.PageToken = x.NextPageToken + c.groupfindingsrequest.PageToken = x.NextPageToken } } -// method id "securitycenter.projects.assets.list": +// method id "securitycenter.organizations.sources.findings.list": -type ProjectsAssetsListCall struct { +type OrganizationsSourcesFindingsListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -22635,88 +23135,90 @@ type ProjectsAssetsListCall struct { header_ http.Header } -// List: Lists an organization's assets. +// 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: The name of the parent resource that contains the assets. -// The value that you can specify on parent depends on the method in -// which you specify parent. You can specify one of the following -// values: "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: 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 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 +// 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 -// assets present at read_time. -func (c *ProjectsAssetsListCall) CompareDuration(compareDuration string) *ProjectsAssetsListCall { +// 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 ListAssetsResult fields to be listed in the response. An -// empty field mask will list all fields. -func (c *ProjectsAssetsListCall) FieldMask(fieldMask string) *ProjectsAssetsListCall { +// 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 assets. The expression is a list of zero +// 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. 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 +// 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 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 { +// `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 } @@ -22725,21 +23227,14 @@ func (c *ProjectsAssetsListCall) Filter(filter string) *ProjectsAssetsListCall { // 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 { +// 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 } @@ -22747,26 +23242,26 @@ func (c *ProjectsAssetsListCall) OrderBy(orderBy string) *ProjectsAssetsListCall // 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 { +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 `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 { +// 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 assets. The filter is limited to -// assets existing at the supplied time and their values are those at +// 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 *ProjectsAssetsListCall) ReadTime(readTime string) *ProjectsAssetsListCall { +func (c *OrganizationsSourcesFindingsListCall) ReadTime(readTime string) *OrganizationsSourcesFindingsListCall { c.urlParams_.Set("readTime", readTime) return c } @@ -22774,7 +23269,7 @@ func (c *ProjectsAssetsListCall) ReadTime(readTime string) *ProjectsAssetsListCa // 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 *OrganizationsSourcesFindingsListCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -22784,7 +23279,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 *OrganizationsSourcesFindingsListCall) IfNoneMatch(entityTag string) *OrganizationsSourcesFindingsListCall { c.ifNoneMatch_ = entityTag return c } @@ -22792,21 +23287,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 *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 *ProjectsAssetsListCall) Header() http.Header { +func (c *OrganizationsSourcesFindingsListCall) 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 *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_ { @@ -22819,7 +23314,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}/findings") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -22832,14 +23327,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 +// 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 -// *ListAssetsResponse.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 *ProjectsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAssetsResponse, error) { +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 { @@ -22858,7 +23353,7 @@ func (c *ProjectsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAssetsRe if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListAssetsResponse{ + ret := &ListFindingsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -22870,34 +23365,33 @@ func (c *ProjectsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAssetsRe } return ret, nil // { - // "deprecated": true, - // "description": "Lists an organization's assets.", - // "flatPath": "v1/projects/{projectsId}/assets", + // "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.projects.assets.list", + // "id": "securitycenter.organizations.sources.findings.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.", + // "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 ListAssetsResult fields to be listed in the response. An empty field mask will list all fields.", + // "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 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 : \"\"`", + // "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,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", + // "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" // }, @@ -22908,27 +23402,214 @@ func (c *ProjectsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAssetsRe // "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": "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. The name of the parent resource that contains the assets. The value that you can specify on parent depends on the method in which you specify parent. You can specify one of the following values: \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "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": "^projects/[^/]+$", + // "pattern": "^organizations/[^/]+/sources/[^/]+$", // "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.", + // "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}/assets", + // "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 +// (https://cloud.google.com/apis/design/resource_names#relative_resource_name) +// of the finding. Example: +// "organizations/{organization_id}/sources/{source_id}/findings/{findi +// ng_id}", +// "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", +// "projects/{project_id}/sources/{source_id}/findings/{finding_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, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &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](https://cloud.google.com/apis/design/resource_names#relative_resource_name) of the finding. Example: \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}\", \"folders/{folder_id}/sources/{source_id}/findings/{finding_id}\", \"projects/{project_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": "ListAssetsResponse" + // "$ref": "Finding" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -22937,76 +23618,37 @@ 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 { - 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.assets.updateSecurityMarks": +// method id "securitycenter.organizations.sources.findings.setMute": -type ProjectsAssetsUpdateSecurityMarksCall struct { - s *Service - name string - securitymarks *SecurityMarks - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsSourcesFindingsSetMuteCall struct { + s *Service + name string + setmuterequest *SetMuteRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// UpdateSecurityMarks: Updates security marks. +// SetMute: Updates the mute state of a finding. // -// - 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" +// - name: The relative resource name +// (https://cloud.google.com/apis/design/resource_names#relative_resource_name) +// of the finding. Example: // "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)} +// ng_id}", +// "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", +// "projects/{project_id}/sources/{source_id}/findings/{finding_id}". +func (r *OrganizationsSourcesFindingsService) SetMute(name string, setmuterequest *SetMuteRequest) *OrganizationsSourcesFindingsSetMuteCall { + c := &OrganizationsSourcesFindingsSetMuteCall{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) - 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) + 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 *ProjectsAssetsUpdateSecurityMarksCall) Fields(s ...googleapi.Field) *ProjectsAssetsUpdateSecurityMarksCall { +func (c *OrganizationsSourcesFindingsSetMuteCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsSetMuteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -23014,21 +23656,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 *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 *ProjectsAssetsUpdateSecurityMarksCall) Header() http.Header { +func (c *OrganizationsSourcesFindingsSetMuteCall) 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 *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_ { @@ -23036,16 +23678,16 @@ 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.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}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setMute") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -23056,14 +23698,14 @@ 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.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 { @@ -23082,7 +23724,7 @@ func (c *ProjectsAssetsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &SecurityMarks{ + ret := &Finding{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -23094,40 +23736,28 @@ func (c *ProjectsAssetsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Updates security marks.", - // "flatPath": "v1/projects/{projectsId}/assets/{assetsId}/securityMarks", - // "httpMethod": "PATCH", - // "id": "securitycenter.projects.assets.updateSecurityMarks", + // "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": "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. The [relative resource name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) of the finding. Example: \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}\", \"folders/{folder_id}/sources/{source_id}/findings/{finding_id}\", \"projects/{project_id}/sources/{source_id}/findings/{finding_id}\".", // "location": "path", - // "pattern": "^projects/[^/]+/assets/[^/]+/securityMarks$", + // "pattern": "^organizations/[^/]+/sources/[^/]+/findings/[^/]+$", // "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/{+name}:setMute", // "request": { - // "$ref": "SecurityMarks" + // "$ref": "SetMuteRequest" // }, // "response": { - // "$ref": "SecurityMarks" + // "$ref": "Finding" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -23136,43 +23766,37 @@ func (c *ProjectsAssetsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOption) } -// method id "securitycenter.projects.bigQueryExports.create": +// method id "securitycenter.organizations.sources.findings.setState": -type ProjectsBigQueryExportsCreateCall struct { - s *Service - parent string - googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsSourcesFindingsSetStateCall struct { + s *Service + name string + setfindingstaterequest *SetFindingStateRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates a BigQuery export. +// SetState: Updates the state of a finding. // -// - parent: The name of the parent resource of the new BigQuery export. -// 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 -} - -// BigQueryExportId sets the optional parameter "bigQueryExportId": -// Required. Unique identifier provided by the client within the parent -// scope. It must consist of only lowercase letters, numbers, and -// hyphens, must start with a letter, must end with either a letter or a -// number, and must be 63 characters or less. -func (c *ProjectsBigQueryExportsCreateCall) BigQueryExportId(bigQueryExportId string) *ProjectsBigQueryExportsCreateCall { - c.urlParams_.Set("bigQueryExportId", bigQueryExportId) +// - name: The relative resource name +// (https://cloud.google.com/apis/design/resource_names#relative_resource_name) +// of the finding. Example: +// "organizations/{organization_id}/sources/{source_id}/findings/{findi +// ng_id}", +// "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", +// "projects/{project_id}/sources/{source_id}/findings/{finding_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 *ProjectsBigQueryExportsCreateCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsCreateCall { +func (c *OrganizationsSourcesFindingsSetStateCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsSetStateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -23180,21 +23804,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 *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 *ProjectsBigQueryExportsCreateCall) Header() http.Header { +func (c *OrganizationsSourcesFindingsSetStateCall) 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 *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_ { @@ -23202,14 +23826,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.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/{+parent}/bigQueryExports") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setState") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -23217,21 +23841,19 @@ func (c *ProjectsBigQueryExportsCreateCall) doRequest(alt string) (*http.Respons } 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.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.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 { @@ -23250,7 +23872,7 @@ func (c *ProjectsBigQueryExportsCreateCall) Do(opts ...googleapi.CallOption) (*G if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1BigQueryExport{ + ret := &Finding{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -23262,33 +23884,28 @@ func (c *ProjectsBigQueryExportsCreateCall) Do(opts ...googleapi.CallOption) (*G } return ret, nil // { - // "description": "Creates a BigQuery export.", - // "flatPath": "v1/projects/{projectsId}/bigQueryExports", + // "description": "Updates the state of a finding.", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings/{findingsId}:setState", // "httpMethod": "POST", - // "id": "securitycenter.projects.bigQueryExports.create", + // "id": "securitycenter.organizations.sources.findings.setState", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "bigQueryExportId": { - // "description": "Required. Unique identifier provided by the client within the parent scope. It must consist of only lowercase letters, numbers, and hyphens, must start with a letter, must end with either a letter or a number, and must be 63 characters or less.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The name of the parent resource of the new BigQuery export. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "name": { + // "description": "Required. The [relative resource name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) of the finding. Example: \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}\", \"folders/{folder_id}/sources/{source_id}/findings/{finding_id}\", \"projects/{project_id}/sources/{source_id}/findings/{finding_id}\".", // "location": "path", - // "pattern": "^projects/[^/]+$", + // "pattern": "^organizations/[^/]+/sources/[^/]+/findings/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/bigQueryExports", + // "path": "v1/{+name}:setState", // "request": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // "$ref": "SetFindingStateRequest" // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // "$ref": "Finding" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -23297,32 +23914,55 @@ func (c *ProjectsBigQueryExportsCreateCall) Do(opts ...googleapi.CallOption) (*G } -// method id "securitycenter.projects.bigQueryExports.delete": +// method id "securitycenter.organizations.sources.findings.updateSecurityMarks": -type ProjectsBigQueryExportsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsSourcesFindingsUpdateSecurityMarksCall struct { + s *Service + name string + securitymarks *SecurityMarks + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes an existing BigQuery export. +// UpdateSecurityMarks: Updates security marks. // -// - name: The name of the BigQuery 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)} +// - 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 *ProjectsBigQueryExportsDeleteCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsDeleteCall { +func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsUpdateSecurityMarksCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -23330,21 +23970,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 *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 *ProjectsBigQueryExportsDeleteCall) Header() http.Header { +func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) 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 *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_ { @@ -23352,11 +23992,16 @@ 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.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("DELETE", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -23367,14 +24012,14 @@ func (c *ProjectsBigQueryExportsDeleteCall) doRequest(alt string) (*http.Respons 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.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 { @@ -23393,7 +24038,7 @@ func (c *ProjectsBigQueryExportsDeleteCall) Do(opts ...googleapi.CallOption) (*E if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &SecurityMarks{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -23405,25 +24050,40 @@ func (c *ProjectsBigQueryExportsDeleteCall) Do(opts ...googleapi.CallOption) (*E } return ret, nil // { - // "description": "Deletes an existing BigQuery export.", - // "flatPath": "v1/projects/{projectsId}/bigQueryExports/{bigQueryExportsId}", - // "httpMethod": "DELETE", - // "id": "securitycenter.projects.bigQueryExports.delete", + // "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": "Required. The name of the BigQuery export to delete. Its format is organizations/{organization}/bigQueryExports/{export_id}, folders/{folder}/bigQueryExports/{export_id}, or projects/{project}/bigQueryExports/{export_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": "^projects/[^/]+/bigQueryExports/[^/]+$", + // "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": "Empty" + // "$ref": "SecurityMarks" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -23432,80 +24092,82 @@ func (c *ProjectsBigQueryExportsDeleteCall) Do(opts ...googleapi.CallOption) (*E } -// method id "securitycenter.projects.bigQueryExports.get": +// method id "securitycenter.organizations.sources.findings.externalSystems.patch": -type ProjectsBigQueryExportsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsSourcesFindingsExternalSystemsPatchCall struct { + s *Service + name string + googlecloudsecuritycenterv1externalsystem *GoogleCloudSecuritycenterV1ExternalSystem + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a BigQuery export. +// Patch: Updates external system. This is for a given finding. // -// - name: Name of the BigQuery 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: Full resource name of the external system, for example: +// "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 *ProjectsBigQueryExportsGetCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsGetCall { +func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsExternalSystemsPatchCall { 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 *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 *ProjectsBigQueryExportsGetCall) Header() http.Header { +func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) 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 *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()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } 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("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -23516,16 +24178,16 @@ 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 +// 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 -// *GoogleCloudSecuritycenterV1BigQueryExport.ServerResponse.Header or +// *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 *ProjectsBigQueryExportsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1BigQueryExport, error) { +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 { @@ -23544,7 +24206,7 @@ func (c *ProjectsBigQueryExportsGetCall) Do(opts ...googleapi.CallOption) (*Goog if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1BigQueryExport{ + ret := &GoogleCloudSecuritycenterV1ExternalSystem{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -23556,25 +24218,34 @@ func (c *ProjectsBigQueryExportsGetCall) Do(opts ...googleapi.CallOption) (*Goog } return ret, nil // { - // "description": "Gets a BigQuery export.", - // "flatPath": "v1/projects/{projectsId}/bigQueryExports/{bigQueryExportsId}", - // "httpMethod": "GET", - // "id": "securitycenter.projects.bigQueryExports.get", + // "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": "Required. Name of the BigQuery export to retrieve. Its format is organizations/{organization}/bigQueryExports/{export_id}, folders/{folder}/bigQueryExports/{export_id}, or projects/{project}/bigQueryExports/{export_id}", + // "description": "Full resource name of the external system, for example: \"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": "^projects/[^/]+/bigQueryExports/[^/]+$", + // "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": "GoogleCloudSecuritycenterV1BigQueryExport" + // "$ref": "GoogleCloudSecuritycenterV1ExternalSystem" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -23583,102 +24254,73 @@ func (c *ProjectsBigQueryExportsGetCall) Do(opts ...googleapi.CallOption) (*Goog } -// method id "securitycenter.projects.bigQueryExports.list": +// method id "securitycenter.projects.assets.group": -type ProjectsBigQueryExportsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsAssetsGroupCall struct { + s *Service + parent string + groupassetsrequest *GroupAssetsRequest + urlParams_ gensupport.URLParams + 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. +// Group: Filters an organization's assets and groups them by their +// specified properties. // -// - 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)} +// - parent: The name of the parent to group the assets by. 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 - 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) + 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 *ProjectsBigQueryExportsListCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsListCall { +func (c *ProjectsAssetsGroupCall) Fields(s ...googleapi.Field) *ProjectsAssetsGroupCall { 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 *ProjectsBigQueryExportsListCall) IfNoneMatch(entityTag string) *ProjectsBigQueryExportsListCall { - 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 *ProjectsBigQueryExportsListCall) Context(ctx context.Context) *ProjectsBigQueryExportsListCall { +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 *ProjectsBigQueryExportsListCall) Header() http.Header { +func (c *ProjectsAssetsGroupCall) 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 *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()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } 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}/bigQueryExports") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/assets:group") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -23689,14 +24331,14 @@ func (c *ProjectsBigQueryExportsListCall) doRequest(alt string) (*http.Response, 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.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 *ProjectsBigQueryExportsListCall) Do(opts ...googleapi.CallOption) (*ListBigQueryExportsResponse, error) { +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 { @@ -23715,7 +24357,7 @@ func (c *ProjectsBigQueryExportsListCall) Do(opts ...googleapi.CallOption) (*Lis if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListBigQueryExportsResponse{ + ret := &GroupAssetsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -23727,36 +24369,29 @@ 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", - // "httpMethod": "GET", - // "id": "securitycenter.projects.bigQueryExports.list", + // "deprecated": true, + // "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": { - // "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. The name of the parent to group the assets by. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", // "location": "path", // "pattern": "^projects/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/bigQueryExports", + // "path": "v1/{+parent}/assets:group", + // "request": { + // "$ref": "GroupAssetsRequest" + // }, // "response": { - // "$ref": "ListBigQueryExportsResponse" + // "$ref": "GroupAssetsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -23768,9 +24403,9 @@ 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 { +func (c *ProjectsAssetsGroupCall) Pages(ctx context.Context, f func(*GroupAssetsResponse) error) error { c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + defer func(pt string) { c.groupassetsrequest.PageToken = pt }(c.groupassetsrequest.PageToken) // reset paging to original point for { x, err := c.Do() if err != nil { @@ -23782,108 +24417,226 @@ func (c *ProjectsBigQueryExportsListCall) Pages(ctx context.Context, f func(*Lis if x.NextPageToken == "" { return nil } - c.PageToken(x.NextPageToken) + c.groupassetsrequest.PageToken = x.NextPageToken } } -// method id "securitycenter.projects.bigQueryExports.patch": +// method id "securitycenter.projects.assets.list": -type ProjectsBigQueryExportsPatchCall struct { - s *Service - name string - googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsAssetsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Patch: Updates a BigQuery export. +// List: Lists an organization's assets. // -// - 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 name of the parent resource that contains the assets. +// The value that you can specify on parent depends on the method in +// which you specify parent. You can specify one of the following +// values: "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 } -// 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) +// 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 *ProjectsBigQueryExportsPatchCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsPatchCall { +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 *ProjectsBigQueryExportsPatchCall) Context(ctx context.Context) *ProjectsBigQueryExportsPatchCall { +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 *ProjectsBigQueryExportsPatchCall) Header() http.Header { +func (c *ProjectsAssetsListCall) 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 *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()) - 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}/assets") 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.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 { @@ -23902,7 +24655,7 @@ func (c *ProjectsBigQueryExportsPatchCall) Do(opts ...googleapi.CallOption) (*Go if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1BigQueryExport{ + ret := &ListAssetsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -23914,34 +24667,65 @@ 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", + // "deprecated": true, + // "description": "Lists an organization's assets.", + // "flatPath": "v1/projects/{projectsId}/assets", + // "httpMethod": "GET", + // "id": "securitycenter.projects.assets.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.", + // "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. The name of the parent resource that contains the assets. The value that you can specify on parent depends on the method in which you specify parent. You can specify one of the following values: \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", // "location": "path", - // "pattern": "^projects/[^/]+/bigQueryExports/[^/]+$", + // "pattern": "^projects/[^/]+$", // "required": true, // "type": "string" // }, - // "updateMask": { - // "description": "The list of fields to be updated. If empty all mutable fields will be updated.", - // "format": "google-fieldmask", + // "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}", - // "request": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" - // }, + // "path": "v1/{+parent}/assets", // "response": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // "$ref": "ListAssetsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -23950,36 +24734,76 @@ func (c *ProjectsBigQueryExportsPatchCall) Do(opts ...googleapi.CallOption) (*Go } -// method id "securitycenter.projects.eventThreatDetectionSettings.validateCustomModule": +// 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 ProjectsEventThreatDetectionSettingsValidateCustomModuleCall struct { - s *Service - parent string - validateeventthreatdetectioncustommodulerequest *ValidateEventThreatDetectionCustomModuleRequest - 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 } -// ValidateCustomModule: Validates the given Event Threat Detection -// Custom Module. +// UpdateSecurityMarks: Updates security marks. // -// - parent: Resource name of the parent to validate the Custom Module -// under. Its format is: * -// "organizations/{organization}/eventThreatDetectionSettings". * -// "folders/{folder}/eventThreatDetectionSettings". * -// "projects/{project}/eventThreatDetectionSettings". -func (r *ProjectsEventThreatDetectionSettingsService) ValidateCustomModule(parent string, validateeventthreatdetectioncustommodulerequest *ValidateEventThreatDetectionCustomModuleRequest) *ProjectsEventThreatDetectionSettingsValidateCustomModuleCall { - c := &ProjectsEventThreatDetectionSettingsValidateCustomModuleCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.validateeventthreatdetectioncustommodulerequest = validateeventthreatdetectioncustommodulerequest +// - 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)} + 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) + 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 *ProjectsEventThreatDetectionSettingsValidateCustomModuleCall) Fields(s ...googleapi.Field) *ProjectsEventThreatDetectionSettingsValidateCustomModuleCall { +func (c *ProjectsAssetsUpdateSecurityMarksCall) Fields(s ...googleapi.Field) *ProjectsAssetsUpdateSecurityMarksCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -23987,21 +24811,21 @@ func (c *ProjectsEventThreatDetectionSettingsValidateCustomModuleCall) Fields(s // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsEventThreatDetectionSettingsValidateCustomModuleCall) Context(ctx context.Context) *ProjectsEventThreatDetectionSettingsValidateCustomModuleCall { +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 *ProjectsEventThreatDetectionSettingsValidateCustomModuleCall) Header() http.Header { +func (c *ProjectsAssetsUpdateSecurityMarksCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsEventThreatDetectionSettingsValidateCustomModuleCall) 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_ { @@ -24009,36 +24833,34 @@ func (c *ProjectsEventThreatDetectionSettingsValidateCustomModuleCall) doRequest } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.validateeventthreatdetectioncustommodulerequest) + 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}:validateCustomModule") + 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.eventThreatDetectionSettings.validateCustomModule" call. -// Exactly one of *ValidateEventThreatDetectionCustomModuleResponse or -// error will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *ValidateEventThreatDetectionCustomModuleResponse.ServerResponse.Heade -// r or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *ProjectsEventThreatDetectionSettingsValidateCustomModuleCall) Do(opts ...googleapi.CallOption) (*ValidateEventThreatDetectionCustomModuleResponse, 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 { @@ -24057,7 +24879,7 @@ func (c *ProjectsEventThreatDetectionSettingsValidateCustomModuleCall) Do(opts . if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ValidateEventThreatDetectionCustomModuleResponse{ + ret := &SecurityMarks{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -24069,28 +24891,40 @@ func (c *ProjectsEventThreatDetectionSettingsValidateCustomModuleCall) Do(opts . } return ret, nil // { - // "description": "Validates the given Event Threat Detection Custom Module.", - // "flatPath": "v1/projects/{projectsId}/eventThreatDetectionSettings:validateCustomModule", - // "httpMethod": "POST", - // "id": "securitycenter.projects.eventThreatDetectionSettings.validateCustomModule", + // "description": "Updates security marks.", + // "flatPath": "v1/projects/{projectsId}/assets/{assetsId}/securityMarks", + // "httpMethod": "PATCH", + // "id": "securitycenter.projects.assets.updateSecurityMarks", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. Resource name of the parent to validate the Custom Module under. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", + // "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": "^projects/[^/]+/eventThreatDetectionSettings$", + // "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/{+parent}:validateCustomModule", + // "path": "v1/{+name}", // "request": { - // "$ref": "ValidateEventThreatDetectionCustomModuleRequest" + // "$ref": "SecurityMarks" // }, // "response": { - // "$ref": "ValidateEventThreatDetectionCustomModuleResponse" + // "$ref": "SecurityMarks" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -24099,35 +24933,43 @@ func (c *ProjectsEventThreatDetectionSettingsValidateCustomModuleCall) Do(opts . } -// method id "securitycenter.projects.eventThreatDetectionSettings.customModules.create": +// method id "securitycenter.projects.bigQueryExports.create": -type ProjectsEventThreatDetectionSettingsCustomModulesCreateCall struct { - s *Service - parent string - eventthreatdetectioncustommodule *EventThreatDetectionCustomModule - 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 } -// Create: Creates an ETD custom module at the given level. Creating a -// module has a side-effect of creating modules at all descendants. +// Create: Creates a BigQuery export. // -// - parent: The new custom module's parent. Its format is: * -// "organizations/{organization}/eventThreatDetectionSettings". * -// "folders/{folder}/eventThreatDetectionSettings". * -// "projects/{project}/eventThreatDetectionSettings". -func (r *ProjectsEventThreatDetectionSettingsCustomModulesService) Create(parent string, eventthreatdetectioncustommodule *EventThreatDetectionCustomModule) *ProjectsEventThreatDetectionSettingsCustomModulesCreateCall { - c := &ProjectsEventThreatDetectionSettingsCustomModulesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The name of the parent resource of the new BigQuery export. +// 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.eventthreatdetectioncustommodule = eventthreatdetectioncustommodule + 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 only lowercase letters, numbers, and +// hyphens, must start with a letter, must end with either a letter or a +// number, and must be 63 characters or less. +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 *ProjectsEventThreatDetectionSettingsCustomModulesCreateCall) Fields(s ...googleapi.Field) *ProjectsEventThreatDetectionSettingsCustomModulesCreateCall { +func (c *ProjectsBigQueryExportsCreateCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -24135,21 +24977,21 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesCreateCall) Fields(s . // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsEventThreatDetectionSettingsCustomModulesCreateCall) Context(ctx context.Context) *ProjectsEventThreatDetectionSettingsCustomModulesCreateCall { +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 *ProjectsEventThreatDetectionSettingsCustomModulesCreateCall) Header() http.Header { +func (c *ProjectsBigQueryExportsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsEventThreatDetectionSettingsCustomModulesCreateCall) 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_ { @@ -24157,14 +24999,14 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesCreateCall) doRequest( } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventthreatdetectioncustommodule) + 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}/customModules") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/bigQueryExports") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -24177,14 +25019,16 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesCreateCall) doRequest( return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.projects.eventThreatDetectionSettings.customModules.create" call. -// Exactly one of *EventThreatDetectionCustomModule or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *EventThreatDetectionCustomModule.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsEventThreatDetectionSettingsCustomModulesCreateCall) Do(opts ...googleapi.CallOption) (*EventThreatDetectionCustomModule, 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 { @@ -24203,7 +25047,7 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesCreateCall) Do(opts .. if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &EventThreatDetectionCustomModule{ + ret := &GoogleCloudSecuritycenterV1BigQueryExport{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -24215,28 +25059,33 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesCreateCall) Do(opts .. } return ret, nil // { - // "description": "Creates an ETD custom module at the given level. Creating a module has a side-effect of creating modules at all descendants.", - // "flatPath": "v1/projects/{projectsId}/eventThreatDetectionSettings/customModules", + // "description": "Creates a BigQuery export.", + // "flatPath": "v1/projects/{projectsId}/bigQueryExports", // "httpMethod": "POST", - // "id": "securitycenter.projects.eventThreatDetectionSettings.customModules.create", + // "id": "securitycenter.projects.bigQueryExports.create", // "parameterOrder": [ // "parent" // ], // "parameters": { + // "bigQueryExportId": { + // "description": "Required. Unique identifier provided by the client within the parent scope. It must consist of only lowercase letters, numbers, and hyphens, must start with a letter, must end with either a letter or a number, and must be 63 characters or less.", + // "location": "query", + // "type": "string" + // }, // "parent": { - // "description": "Required. The new custom module's parent. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", + // "description": "Required. The name of the parent resource of the new BigQuery export. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", // "location": "path", - // "pattern": "^projects/[^/]+/eventThreatDetectionSettings$", + // "pattern": "^projects/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/customModules", + // "path": "v1/{+parent}/bigQueryExports", // "request": { - // "$ref": "EventThreatDetectionCustomModule" + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" // }, // "response": { - // "$ref": "EventThreatDetectionCustomModule" + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -24245,9 +25094,9 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesCreateCall) Do(opts .. } -// method id "securitycenter.projects.eventThreatDetectionSettings.customModules.delete": +// method id "securitycenter.projects.bigQueryExports.delete": -type ProjectsEventThreatDetectionSettingsCustomModulesDeleteCall struct { +type ProjectsBigQueryExportsDeleteCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -24255,19 +25104,14 @@ type ProjectsEventThreatDetectionSettingsCustomModulesDeleteCall struct { header_ http.Header } -// Delete: Deletes an ETD custom module. Deletion at resident level also -// deletes modules at all descendants. Deletion at any other level is -// not supported. +// Delete: Deletes an existing BigQuery export. // -// - name: Name of the custom module to delete. Its format is: * -// "organizations/{organization}/eventThreatDetectionSettings/customMod -// ules/{module}". * -// "folders/{folder}/eventThreatDetectionSettings/customModules/{module -// }". * -// "projects/{project}/eventThreatDetectionSettings/customModules/{modu -// le}". -func (r *ProjectsEventThreatDetectionSettingsCustomModulesService) Delete(name string) *ProjectsEventThreatDetectionSettingsCustomModulesDeleteCall { - c := &ProjectsEventThreatDetectionSettingsCustomModulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the BigQuery 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 return c } @@ -24275,7 +25119,7 @@ func (r *ProjectsEventThreatDetectionSettingsCustomModulesService) Delete(name s // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsEventThreatDetectionSettingsCustomModulesDeleteCall) Fields(s ...googleapi.Field) *ProjectsEventThreatDetectionSettingsCustomModulesDeleteCall { +func (c *ProjectsBigQueryExportsDeleteCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -24283,21 +25127,21 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesDeleteCall) Fields(s . // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsEventThreatDetectionSettingsCustomModulesDeleteCall) Context(ctx context.Context) *ProjectsEventThreatDetectionSettingsCustomModulesDeleteCall { +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 *ProjectsEventThreatDetectionSettingsCustomModulesDeleteCall) Header() http.Header { +func (c *ProjectsBigQueryExportsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsEventThreatDetectionSettingsCustomModulesDeleteCall) 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_ { @@ -24320,14 +25164,14 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesDeleteCall) doRequest( return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.projects.eventThreatDetectionSettings.customModules.delete" call. +// 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 *ProjectsEventThreatDetectionSettingsCustomModulesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +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 { @@ -24358,18 +25202,18 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesDeleteCall) Do(opts .. } return ret, nil // { - // "description": "Deletes an ETD custom module. Deletion at resident level also deletes modules at all descendants. Deletion at any other level is not supported.", - // "flatPath": "v1/projects/{projectsId}/eventThreatDetectionSettings/customModules/{customModulesId}", + // "description": "Deletes an existing BigQuery export.", + // "flatPath": "v1/projects/{projectsId}/bigQueryExports/{bigQueryExportsId}", // "httpMethod": "DELETE", - // "id": "securitycenter.projects.eventThreatDetectionSettings.customModules.delete", + // "id": "securitycenter.projects.bigQueryExports.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the custom module to delete. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", + // "description": "Required. The name of the BigQuery 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": "^projects/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", + // "pattern": "^projects/[^/]+/bigQueryExports/[^/]+$", // "required": true, // "type": "string" // } @@ -24385,9 +25229,9 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesDeleteCall) Do(opts .. } -// method id "securitycenter.projects.eventThreatDetectionSettings.customModules.get": +// method id "securitycenter.projects.bigQueryExports.get": -type ProjectsEventThreatDetectionSettingsCustomModulesGetCall struct { +type ProjectsBigQueryExportsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -24396,18 +25240,14 @@ type ProjectsEventThreatDetectionSettingsCustomModulesGetCall struct { header_ http.Header } -// Get: Gets an ETD custom module. Retrieves the module at the given -// level. +// Get: Gets a BigQuery export. // -// - name: Name of the custom module to get. Its format is: * -// "organizations/{organization}/eventThreatDetectionSettings/customMod -// ules/{module}". * -// "folders/{folder}/eventThreatDetectionSettings/customModules/{module -// }". * -// "projects/{project}/eventThreatDetectionSettings/customModules/{modu -// le}". -func (r *ProjectsEventThreatDetectionSettingsCustomModulesService) Get(name string) *ProjectsEventThreatDetectionSettingsCustomModulesGetCall { - c := &ProjectsEventThreatDetectionSettingsCustomModulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Name of the BigQuery 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 } @@ -24415,7 +25255,7 @@ func (r *ProjectsEventThreatDetectionSettingsCustomModulesService) Get(name stri // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsEventThreatDetectionSettingsCustomModulesGetCall) Fields(s ...googleapi.Field) *ProjectsEventThreatDetectionSettingsCustomModulesGetCall { +func (c *ProjectsBigQueryExportsGetCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -24425,7 +25265,7 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesGetCall) Fields(s ...g // 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 *ProjectsEventThreatDetectionSettingsCustomModulesGetCall) IfNoneMatch(entityTag string) *ProjectsEventThreatDetectionSettingsCustomModulesGetCall { +func (c *ProjectsBigQueryExportsGetCall) IfNoneMatch(entityTag string) *ProjectsBigQueryExportsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -24433,21 +25273,21 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesGetCall) IfNoneMatch(e // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsEventThreatDetectionSettingsCustomModulesGetCall) Context(ctx context.Context) *ProjectsEventThreatDetectionSettingsCustomModulesGetCall { +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 *ProjectsEventThreatDetectionSettingsCustomModulesGetCall) Header() http.Header { +func (c *ProjectsBigQueryExportsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsEventThreatDetectionSettingsCustomModulesGetCall) 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_ { @@ -24473,14 +25313,16 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesGetCall) doRequest(alt return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.projects.eventThreatDetectionSettings.customModules.get" call. -// Exactly one of *EventThreatDetectionCustomModule or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *EventThreatDetectionCustomModule.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsEventThreatDetectionSettingsCustomModulesGetCall) Do(opts ...googleapi.CallOption) (*EventThreatDetectionCustomModule, 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 { @@ -24499,7 +25341,7 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesGetCall) Do(opts ...go if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &EventThreatDetectionCustomModule{ + ret := &GoogleCloudSecuritycenterV1BigQueryExport{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -24511,25 +25353,25 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesGetCall) Do(opts ...go } return ret, nil // { - // "description": "Gets an ETD custom module. Retrieves the module at the given level.", - // "flatPath": "v1/projects/{projectsId}/eventThreatDetectionSettings/customModules/{customModulesId}", + // "description": "Gets a BigQuery export.", + // "flatPath": "v1/projects/{projectsId}/bigQueryExports/{bigQueryExportsId}", // "httpMethod": "GET", - // "id": "securitycenter.projects.eventThreatDetectionSettings.customModules.get", + // "id": "securitycenter.projects.bigQueryExports.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the custom module to get. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", + // "description": "Required. Name of the BigQuery 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/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", + // "pattern": "^projects/[^/]+/bigQueryExports/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1/{+name}", // "response": { - // "$ref": "EventThreatDetectionCustomModule" + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -24538,9 +25380,9 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesGetCall) Do(opts ...go } -// method id "securitycenter.projects.eventThreatDetectionSettings.customModules.list": +// method id "securitycenter.projects.bigQueryExports.list": -type ProjectsEventThreatDetectionSettingsCustomModulesListCall struct { +type ProjectsBigQueryExportsListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -24549,35 +25391,36 @@ type ProjectsEventThreatDetectionSettingsCustomModulesListCall struct { header_ http.Header } -// List: Lists ETD custom modules. Retrieve all resident and inherited -// modules at the given level (no descendants). +// 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 parent to list custom modules. Its format is: * -// "organizations/{organization}/eventThreatDetectionSettings". * -// "folders/{folder}/eventThreatDetectionSettings". * -// "projects/{project}/eventThreatDetectionSettings". -func (r *ProjectsEventThreatDetectionSettingsCustomModulesService) List(parent string) *ProjectsEventThreatDetectionSettingsCustomModulesListCall { - c := &ProjectsEventThreatDetectionSettingsCustomModulesListCall{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 } // PageSize sets the optional parameter "pageSize": The maximum number -// of modules to return. The service may return fewer than this value. +// 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 *ProjectsEventThreatDetectionSettingsCustomModulesListCall) PageSize(pageSize int64) *ProjectsEventThreatDetectionSettingsCustomModulesListCall { +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 `ListEventThreatDetectionCustomModules` -// call. Provide this to retrieve the subsequent page. When paginating, -// all other parameters provided to -// `ListEventThreatDetectionCustomModules` must match the call that -// provided the page token. -func (c *ProjectsEventThreatDetectionSettingsCustomModulesListCall) PageToken(pageToken string) *ProjectsEventThreatDetectionSettingsCustomModulesListCall { +// 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 } @@ -24585,7 +25428,7 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesListCall) PageToken(pa // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsEventThreatDetectionSettingsCustomModulesListCall) Fields(s ...googleapi.Field) *ProjectsEventThreatDetectionSettingsCustomModulesListCall { +func (c *ProjectsBigQueryExportsListCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -24595,7 +25438,7 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesListCall) Fields(s ... // 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 *ProjectsEventThreatDetectionSettingsCustomModulesListCall) IfNoneMatch(entityTag string) *ProjectsEventThreatDetectionSettingsCustomModulesListCall { +func (c *ProjectsBigQueryExportsListCall) IfNoneMatch(entityTag string) *ProjectsBigQueryExportsListCall { c.ifNoneMatch_ = entityTag return c } @@ -24603,21 +25446,21 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesListCall) IfNoneMatch( // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsEventThreatDetectionSettingsCustomModulesListCall) Context(ctx context.Context) *ProjectsEventThreatDetectionSettingsCustomModulesListCall { +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 *ProjectsEventThreatDetectionSettingsCustomModulesListCall) Header() http.Header { +func (c *ProjectsBigQueryExportsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsEventThreatDetectionSettingsCustomModulesListCall) 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_ { @@ -24630,7 +25473,7 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesListCall) doRequest(al var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/bigQueryExports") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -24643,16 +25486,14 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesListCall) doRequest(al return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.projects.eventThreatDetectionSettings.customModules.list" call. -// Exactly one of *ListEventThreatDetectionCustomModulesResponse or -// error will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *ListEventThreatDetectionCustomModulesResponse.ServerResponse.Header -// or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *ProjectsEventThreatDetectionSettingsCustomModulesListCall) Do(opts ...googleapi.CallOption) (*ListEventThreatDetectionCustomModulesResponse, error) { +// 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 *ProjectsBigQueryExportsListCall) Do(opts ...googleapi.CallOption) (*ListBigQueryExportsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -24671,7 +25512,7 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesListCall) Do(opts ...g if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListEventThreatDetectionCustomModulesResponse{ + ret := &ListBigQueryExportsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -24683,36 +25524,36 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesListCall) Do(opts ...g } return ret, nil // { - // "description": "Lists ETD custom modules. Retrieve all resident and inherited modules at the given level (no descendants).", - // "flatPath": "v1/projects/{projectsId}/eventThreatDetectionSettings/customModules", + // "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.eventThreatDetectionSettings.customModules.list", + // "id": "securitycenter.projects.bigQueryExports.list", // "parameterOrder": [ // "parent" // ], // "parameters": { // "pageSize": { - // "description": "The maximum number of modules 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 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 `ListEventThreatDetectionCustomModules` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListEventThreatDetectionCustomModules` 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. Name of the parent to list custom modules. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\". * \"folders/{folder}/eventThreatDetectionSettings\". * \"projects/{project}/eventThreatDetectionSettings\".", + // "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/[^/]+/eventThreatDetectionSettings$", + // "pattern": "^projects/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/customModules", + // "path": "v1/{+parent}/bigQueryExports", // "response": { - // "$ref": "ListEventThreatDetectionCustomModulesResponse" + // "$ref": "ListBigQueryExportsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -24724,7 +25565,7 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesListCall) Do(opts ...g // 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 *ProjectsEventThreatDetectionSettingsCustomModulesListCall) Pages(ctx context.Context, f func(*ListEventThreatDetectionCustomModulesResponse) 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 { @@ -24742,41 +25583,37 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesListCall) Pages(ctx co } } -// method id "securitycenter.projects.eventThreatDetectionSettings.customModules.patch": +// method id "securitycenter.projects.bigQueryExports.patch": -type ProjectsEventThreatDetectionSettingsCustomModulesPatchCall struct { - s *Service - name string - eventthreatdetectioncustommodule *EventThreatDetectionCustomModule - 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 } -// Patch: Updates an ETD custom module at the given level. All config -// fields can be updated when updating the module at resident level. -// Only enablement state can be updated when updating the module at -// inherited levels. Updating the module has a side-effect that it -// updates all descendants that are inherited from this module. +// Patch: Updates a BigQuery export. // -// - name: Immutable. The resource name of the Event Threat Detection -// custom module. Its format is: * -// "organizations/{organization}/eventThreatDetectionSettings/customMod -// ules/{module}". * -// "folders/{folder}/eventThreatDetectionSettings/customModules/{module -// }". * -// "projects/{project}/eventThreatDetectionSettings/customModules/{modu -// le}". -func (r *ProjectsEventThreatDetectionSettingsCustomModulesService) Patch(name string, eventthreatdetectioncustommodule *EventThreatDetectionCustomModule) *ProjectsEventThreatDetectionSettingsCustomModulesPatchCall { - c := &ProjectsEventThreatDetectionSettingsCustomModulesPatchCall{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.eventthreatdetectioncustommodule = eventthreatdetectioncustommodule + 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 *ProjectsEventThreatDetectionSettingsCustomModulesPatchCall) UpdateMask(updateMask string) *ProjectsEventThreatDetectionSettingsCustomModulesPatchCall { +func (c *ProjectsBigQueryExportsPatchCall) UpdateMask(updateMask string) *ProjectsBigQueryExportsPatchCall { c.urlParams_.Set("updateMask", updateMask) return c } @@ -24784,7 +25621,7 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesPatchCall) UpdateMask( // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsEventThreatDetectionSettingsCustomModulesPatchCall) Fields(s ...googleapi.Field) *ProjectsEventThreatDetectionSettingsCustomModulesPatchCall { +func (c *ProjectsBigQueryExportsPatchCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -24792,21 +25629,21 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesPatchCall) Fields(s .. // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsEventThreatDetectionSettingsCustomModulesPatchCall) Context(ctx context.Context) *ProjectsEventThreatDetectionSettingsCustomModulesPatchCall { +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 *ProjectsEventThreatDetectionSettingsCustomModulesPatchCall) Header() http.Header { +func (c *ProjectsBigQueryExportsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsEventThreatDetectionSettingsCustomModulesPatchCall) 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_ { @@ -24814,7 +25651,7 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesPatchCall) doRequest(a } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventthreatdetectioncustommodule) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1bigqueryexport) if err != nil { return nil, err } @@ -24834,14 +25671,16 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesPatchCall) doRequest(a return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.projects.eventThreatDetectionSettings.customModules.patch" call. -// Exactly one of *EventThreatDetectionCustomModule or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *EventThreatDetectionCustomModule.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsEventThreatDetectionSettingsCustomModulesPatchCall) Do(opts ...googleapi.CallOption) (*EventThreatDetectionCustomModule, 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 { @@ -24860,7 +25699,7 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesPatchCall) Do(opts ... if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &EventThreatDetectionCustomModule{ + ret := &GoogleCloudSecuritycenterV1BigQueryExport{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -24872,18 +25711,18 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesPatchCall) Do(opts ... } return ret, nil // { - // "description": "Updates an ETD custom module at the given level. All config fields can be updated when updating the module at resident level. Only enablement state can be updated when updating the module at inherited levels. Updating the module has a side-effect that it updates all descendants that are inherited from this module.", - // "flatPath": "v1/projects/{projectsId}/eventThreatDetectionSettings/customModules/{customModulesId}", + // "description": "Updates a BigQuery export.", + // "flatPath": "v1/projects/{projectsId}/bigQueryExports/{bigQueryExportsId}", // "httpMethod": "PATCH", - // "id": "securitycenter.projects.eventThreatDetectionSettings.customModules.patch", + // "id": "securitycenter.projects.bigQueryExports.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Immutable. The resource name of the Event Threat Detection custom module. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\". * \"folders/{folder}/eventThreatDetectionSettings/customModules/{module}\". * \"projects/{project}/eventThreatDetectionSettings/customModules/{module}\".", + // "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/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", + // "pattern": "^projects/[^/]+/bigQueryExports/[^/]+$", // "required": true, // "type": "string" // }, @@ -24896,10 +25735,10 @@ func (c *ProjectsEventThreatDetectionSettingsCustomModulesPatchCall) Do(opts ... // }, // "path": "v1/{+name}", // "request": { - // "$ref": "EventThreatDetectionCustomModule" + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" // }, // "response": { - // "$ref": "EventThreatDetectionCustomModule" + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" diff --git a/securitycenter/v1beta1/securitycenter-api.json b/securitycenter/v1beta1/securitycenter-api.json index c4c879e5736..1d3ab75317f 100644 --- a/securitycenter/v1beta1/securitycenter-api.json +++ b/securitycenter/v1beta1/securitycenter-api.json @@ -896,7 +896,7 @@ } } }, - "revision": "20230713", + "revision": "20230727", "rootUrl": "https://securitycenter.googleapis.com/", "schemas": { "Access": { @@ -1052,6 +1052,56 @@ }, "type": "object" }, + "AttackExposure": { + "description": "An attack exposure contains the results of an attack path simulation run.", + "id": "AttackExposure", + "properties": { + "attackExposureResult": { + "description": "The resource name of the attack path simulation result that contains the details regarding this attack exposure score. Example: organizations/123/attackExposureResults/456", + "type": "string" + }, + "exposedHighValueResourcesCount": { + "description": "The number of high value resources that are exposed as a result of this finding.", + "format": "int32", + "type": "integer" + }, + "exposedLowValueResourcesCount": { + "description": "The number of high value resources that are exposed as a result of this finding.", + "format": "int32", + "type": "integer" + }, + "exposedMediumValueResourcesCount": { + "description": "The number of medium value resources that are exposed as a result of this finding.", + "format": "int32", + "type": "integer" + }, + "latestCalculationTime": { + "description": "The most recent time the attack exposure was updated on this finding.", + "format": "google-datetime", + "type": "string" + }, + "score": { + "description": "A number between 0 (inclusive) and infinity that represents how important this finding is to remediate. The higher the score, the more important it is to remediate.", + "format": "double", + "type": "number" + }, + "state": { + "description": "What state this AttackExposure is in. This captures whether or not an attack exposure has been calculated or not.", + "enum": [ + "STATE_UNSPECIFIED", + "CALCULATED", + "NOT_CALCULATED" + ], + "enumDescriptions": [ + "The state is not specified.", + "The attack exposure has been calculated.", + "The attack exposure has not been calculated." + ], + "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", @@ -1636,6 +1686,10 @@ "$ref": "Access", "description": "Access details associated with the finding, such as more information on the caller, which method was accessed, and from where." }, + "attackExposure": { + "$ref": "AttackExposure", + "description": "The results of an attack path simulation relevant to this finding." + }, "canonicalName": { "description": "The canonical name of the finding. It's either \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}\", \"folders/{folder_id}/sources/{source_id}/findings/{finding_id}\" or \"projects/{project_number}/sources/{source_id}/findings/{finding_id}\", depending on the closest CRM ancestor of the resource associated with the finding.", "type": "string" @@ -2259,6 +2313,73 @@ }, "type": "object" }, + "GoogleCloudSecuritycenterV1ResourceValueConfig": { + "description": "A resource value config is a mapping configuration of user's tag values to resource values. Used by the attack path simulation.", + "id": "GoogleCloudSecuritycenterV1ResourceValueConfig", + "properties": { + "createTime": { + "description": "Output only. Timestamp this resource value config was created.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "description": { + "description": "Description of the resource value config.", + "type": "string" + }, + "name": { + "description": "Name for the resource value config", + "type": "string" + }, + "resourceLabelsSelector": { + "additionalProperties": { + "type": "string" + }, + "description": "List of resource labels to search for, evaluated with AND. E.g. \"resource_labels_selector\": {\"key\": \"value\", \"env\": \"prod\"} will match resources with labels \"key\": \"value\" AND \"env\": \"prod\" https://cloud.google.com/resource-manager/docs/creating-managing-labels", + "type": "object" + }, + "resourceType": { + "description": "Apply resource_value only to resources that match resource_type. resource_type will be checked with \"AND\" of other resources. E.g. \"storage.googleapis.com/Bucket\" with resource_value \"HIGH\" will apply \"HIGH\" value only to \"storage.googleapis.com/Bucket\" resources.", + "type": "string" + }, + "resourceValue": { + "description": "Required. Resource value level this expression represents", + "enum": [ + "RESOURCE_VALUE_UNSPECIFIED", + "HIGH", + "MEDIUM", + "LOW", + "NONE" + ], + "enumDescriptions": [ + "Unspecific value", + "High resource value", + "Medium resource value", + "Low resource value", + "No resource value, e.g. ignore these resources" + ], + "type": "string" + }, + "scope": { + "description": "Project or folder to scope this config to. For example, \"project/456\" would apply this config only to resources in \"project/456\" scope will be checked with \"AND\" of other resources.", + "type": "string" + }, + "tagValues": { + "description": "Required. Tag values combined with AND to check against. Values in the form \"tagValues/123\" E.g. [ \"tagValues/123\", \"tagValues/456\", \"tagValues/789\" ] https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing", + "items": { + "type": "string" + }, + "type": "array" + }, + "updateTime": { + "description": "Output only. Timestamp this resource value config was last updated.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudSecuritycenterV1RunAssetDiscoveryResponse": { "description": "Response of asset discovery run", "id": "GoogleCloudSecuritycenterV1RunAssetDiscoveryResponse", diff --git a/securitycenter/v1beta1/securitycenter-gen.go b/securitycenter/v1beta1/securitycenter-gen.go index 1d510dc32a9..fe382d99390 100644 --- a/securitycenter/v1beta1/securitycenter-gen.go +++ b/securitycenter/v1beta1/securitycenter-gen.go @@ -437,6 +437,83 @@ func (s *AssetDiscoveryConfig) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// AttackExposure: An attack exposure contains the results of an attack +// path simulation run. +type AttackExposure struct { + // AttackExposureResult: The resource name of the attack path simulation + // result that contains the details regarding this attack exposure + // score. Example: organizations/123/attackExposureResults/456 + AttackExposureResult string `json:"attackExposureResult,omitempty"` + + // ExposedHighValueResourcesCount: The number of high value resources + // that are exposed as a result of this finding. + ExposedHighValueResourcesCount int64 `json:"exposedHighValueResourcesCount,omitempty"` + + // ExposedLowValueResourcesCount: The number of high value resources + // that are exposed as a result of this finding. + ExposedLowValueResourcesCount int64 `json:"exposedLowValueResourcesCount,omitempty"` + + // ExposedMediumValueResourcesCount: The number of medium value + // resources that are exposed as a result of this finding. + ExposedMediumValueResourcesCount int64 `json:"exposedMediumValueResourcesCount,omitempty"` + + // LatestCalculationTime: The most recent time the attack exposure was + // updated on this finding. + LatestCalculationTime string `json:"latestCalculationTime,omitempty"` + + // Score: A number between 0 (inclusive) and infinity that represents + // how important this finding is to remediate. The higher the score, the + // more important it is to remediate. + Score float64 `json:"score,omitempty"` + + // State: What state this AttackExposure is in. This captures whether or + // not an attack exposure has been calculated or not. + // + // Possible values: + // "STATE_UNSPECIFIED" - The state is not specified. + // "CALCULATED" - The attack exposure has been calculated. + // "NOT_CALCULATED" - The attack exposure has not been calculated. + State string `json:"state,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "AttackExposureResult") 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. "AttackExposureResult") 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 *AttackExposure) MarshalJSON() ([]byte, error) { + type NoMethod AttackExposure + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +func (s *AttackExposure) UnmarshalJSON(data []byte) error { + type NoMethod AttackExposure + var s1 struct { + Score gensupport.JSONFloat64 `json:"score"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Score = float64(s1.Score) + return nil +} + // 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 @@ -1432,6 +1509,10 @@ type Finding struct { // information on the caller, which method was accessed, and from where. Access *Access `json:"access,omitempty"` + // AttackExposure: The results of an attack path simulation relevant to + // this finding. + AttackExposure *AttackExposure `json:"attackExposure,omitempty"` + // CanonicalName: The canonical name of the finding. It's either // "organizations/{organization_id}/sources/{source_id}/findings/{finding // _id}", @@ -2387,6 +2468,83 @@ func (s *GoogleCloudSecuritycenterV1ResourceSelector) MarshalJSON() ([]byte, err return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudSecuritycenterV1ResourceValueConfig: A resource value +// config is a mapping configuration of user's tag values to resource +// values. Used by the attack path simulation. +type GoogleCloudSecuritycenterV1ResourceValueConfig struct { + // CreateTime: Output only. Timestamp this resource value config was + // created. + CreateTime string `json:"createTime,omitempty"` + + // Description: Description of the resource value config. + Description string `json:"description,omitempty"` + + // Name: Name for the resource value config + Name string `json:"name,omitempty"` + + // ResourceLabelsSelector: List of resource labels to search for, + // evaluated with AND. E.g. "resource_labels_selector": {"key": "value", + // "env": "prod"} will match resources with labels "key": "value" AND + // "env": "prod" + // https://cloud.google.com/resource-manager/docs/creating-managing-labels + ResourceLabelsSelector map[string]string `json:"resourceLabelsSelector,omitempty"` + + // ResourceType: Apply resource_value only to resources that match + // resource_type. resource_type will be checked with "AND" of other + // resources. E.g. "storage.googleapis.com/Bucket" with resource_value + // "HIGH" will apply "HIGH" value only to + // "storage.googleapis.com/Bucket" resources. + ResourceType string `json:"resourceType,omitempty"` + + // ResourceValue: Required. Resource value level this expression + // represents + // + // Possible values: + // "RESOURCE_VALUE_UNSPECIFIED" - Unspecific value + // "HIGH" - High resource value + // "MEDIUM" - Medium resource value + // "LOW" - Low resource value + // "NONE" - No resource value, e.g. ignore these resources + ResourceValue string `json:"resourceValue,omitempty"` + + // Scope: Project or folder to scope this config to. For example, + // "project/456" would apply this config only to resources in + // "project/456" scope will be checked with "AND" of other resources. + Scope string `json:"scope,omitempty"` + + // TagValues: Required. Tag values combined with AND to check against. + // Values in the form "tagValues/123" E.g. [ "tagValues/123", + // "tagValues/456", "tagValues/789" ] + // https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing + TagValues []string `json:"tagValues,omitempty"` + + // UpdateTime: Output only. Timestamp this resource value config was + // last updated. + UpdateTime string `json:"updateTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudSecuritycenterV1ResourceValueConfig) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudSecuritycenterV1ResourceValueConfig + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudSecuritycenterV1RunAssetDiscoveryResponse: Response of // asset discovery run type GoogleCloudSecuritycenterV1RunAssetDiscoveryResponse struct { diff --git a/securitycenter/v1beta2/securitycenter-api.json b/securitycenter/v1beta2/securitycenter-api.json index 6d38057f66c..3ff6174f521 100644 --- a/securitycenter/v1beta2/securitycenter-api.json +++ b/securitycenter/v1beta2/securitycenter-api.json @@ -1981,7 +1981,7 @@ } } }, - "revision": "20230713", + "revision": "20230727", "rootUrl": "https://securitycenter.googleapis.com/", "schemas": { "Access": { @@ -2073,6 +2073,56 @@ }, "type": "object" }, + "AttackExposure": { + "description": "An attack exposure contains the results of an attack path simulation run.", + "id": "AttackExposure", + "properties": { + "attackExposureResult": { + "description": "The resource name of the attack path simulation result that contains the details regarding this attack exposure score. Example: organizations/123/attackExposureResults/456", + "type": "string" + }, + "exposedHighValueResourcesCount": { + "description": "The number of high value resources that are exposed as a result of this finding.", + "format": "int32", + "type": "integer" + }, + "exposedLowValueResourcesCount": { + "description": "The number of high value resources that are exposed as a result of this finding.", + "format": "int32", + "type": "integer" + }, + "exposedMediumValueResourcesCount": { + "description": "The number of medium value resources that are exposed as a result of this finding.", + "format": "int32", + "type": "integer" + }, + "latestCalculationTime": { + "description": "The most recent time the attack exposure was updated on this finding.", + "format": "google-datetime", + "type": "string" + }, + "score": { + "description": "A number between 0 (inclusive) and infinity that represents how important this finding is to remediate. The higher the score, the more important it is to remediate.", + "format": "double", + "type": "number" + }, + "state": { + "description": "What state this AttackExposure is in. This captures whether or not an attack exposure has been calculated or not.", + "enum": [ + "STATE_UNSPECIFIED", + "CALCULATED", + "NOT_CALCULATED" + ], + "enumDescriptions": [ + "The state is not specified.", + "The attack exposure has been calculated.", + "The attack exposure has not been calculated." + ], + "type": "string" + } + }, + "type": "object" + }, "CloudDlpDataProfile": { "description": "The [data profile](https://cloud.google.com/dlp/docs/data-profiles) associated with the finding.", "id": "CloudDlpDataProfile", @@ -2728,6 +2778,10 @@ "$ref": "Access", "description": "Access details associated with the finding, such as more information on the caller, which method was accessed, and from where." }, + "attackExposure": { + "$ref": "AttackExposure", + "description": "The results of an attack path simulation relevant to this finding." + }, "canonicalName": { "description": "The canonical name of the finding. It's either \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}\", \"folders/{folder_id}/sources/{source_id}/findings/{finding_id}\" or \"projects/{project_number}/sources/{source_id}/findings/{finding_id}\", depending on the closest CRM ancestor of the resource associated with the finding.", "type": "string" @@ -3328,6 +3382,73 @@ }, "type": "object" }, + "GoogleCloudSecuritycenterV1ResourceValueConfig": { + "description": "A resource value config is a mapping configuration of user's tag values to resource values. Used by the attack path simulation.", + "id": "GoogleCloudSecuritycenterV1ResourceValueConfig", + "properties": { + "createTime": { + "description": "Output only. Timestamp this resource value config was created.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "description": { + "description": "Description of the resource value config.", + "type": "string" + }, + "name": { + "description": "Name for the resource value config", + "type": "string" + }, + "resourceLabelsSelector": { + "additionalProperties": { + "type": "string" + }, + "description": "List of resource labels to search for, evaluated with AND. E.g. \"resource_labels_selector\": {\"key\": \"value\", \"env\": \"prod\"} will match resources with labels \"key\": \"value\" AND \"env\": \"prod\" https://cloud.google.com/resource-manager/docs/creating-managing-labels", + "type": "object" + }, + "resourceType": { + "description": "Apply resource_value only to resources that match resource_type. resource_type will be checked with \"AND\" of other resources. E.g. \"storage.googleapis.com/Bucket\" with resource_value \"HIGH\" will apply \"HIGH\" value only to \"storage.googleapis.com/Bucket\" resources.", + "type": "string" + }, + "resourceValue": { + "description": "Required. Resource value level this expression represents", + "enum": [ + "RESOURCE_VALUE_UNSPECIFIED", + "HIGH", + "MEDIUM", + "LOW", + "NONE" + ], + "enumDescriptions": [ + "Unspecific value", + "High resource value", + "Medium resource value", + "Low resource value", + "No resource value, e.g. ignore these resources" + ], + "type": "string" + }, + "scope": { + "description": "Project or folder to scope this config to. For example, \"project/456\" would apply this config only to resources in \"project/456\" scope will be checked with \"AND\" of other resources.", + "type": "string" + }, + "tagValues": { + "description": "Required. Tag values combined with AND to check against. Values in the form \"tagValues/123\" E.g. [ \"tagValues/123\", \"tagValues/456\", \"tagValues/789\" ] https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing", + "items": { + "type": "string" + }, + "type": "array" + }, + "updateTime": { + "description": "Output only. Timestamp this resource value config was last updated.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudSecuritycenterV1RunAssetDiscoveryResponse": { "description": "Response of asset discovery run", "id": "GoogleCloudSecuritycenterV1RunAssetDiscoveryResponse", diff --git a/securitycenter/v1beta2/securitycenter-gen.go b/securitycenter/v1beta2/securitycenter-gen.go index ea512f05046..98d9cb0e68a 100644 --- a/securitycenter/v1beta2/securitycenter-gen.go +++ b/securitycenter/v1beta2/securitycenter-gen.go @@ -567,6 +567,83 @@ func (s *AccessReview) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// AttackExposure: An attack exposure contains the results of an attack +// path simulation run. +type AttackExposure struct { + // AttackExposureResult: The resource name of the attack path simulation + // result that contains the details regarding this attack exposure + // score. Example: organizations/123/attackExposureResults/456 + AttackExposureResult string `json:"attackExposureResult,omitempty"` + + // ExposedHighValueResourcesCount: The number of high value resources + // that are exposed as a result of this finding. + ExposedHighValueResourcesCount int64 `json:"exposedHighValueResourcesCount,omitempty"` + + // ExposedLowValueResourcesCount: The number of high value resources + // that are exposed as a result of this finding. + ExposedLowValueResourcesCount int64 `json:"exposedLowValueResourcesCount,omitempty"` + + // ExposedMediumValueResourcesCount: The number of medium value + // resources that are exposed as a result of this finding. + ExposedMediumValueResourcesCount int64 `json:"exposedMediumValueResourcesCount,omitempty"` + + // LatestCalculationTime: The most recent time the attack exposure was + // updated on this finding. + LatestCalculationTime string `json:"latestCalculationTime,omitempty"` + + // Score: A number between 0 (inclusive) and infinity that represents + // how important this finding is to remediate. The higher the score, the + // more important it is to remediate. + Score float64 `json:"score,omitempty"` + + // State: What state this AttackExposure is in. This captures whether or + // not an attack exposure has been calculated or not. + // + // Possible values: + // "STATE_UNSPECIFIED" - The state is not specified. + // "CALCULATED" - The attack exposure has been calculated. + // "NOT_CALCULATED" - The attack exposure has not been calculated. + State string `json:"state,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "AttackExposureResult") 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. "AttackExposureResult") 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 *AttackExposure) MarshalJSON() ([]byte, error) { + type NoMethod AttackExposure + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +func (s *AttackExposure) UnmarshalJSON(data []byte) error { + type NoMethod AttackExposure + var s1 struct { + Score gensupport.JSONFloat64 `json:"score"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Score = float64(s1.Score) + return nil +} + // CloudDlpDataProfile: The data profile // (https://cloud.google.com/dlp/docs/data-profiles) associated with the // finding. @@ -1576,6 +1653,10 @@ type Finding struct { // information on the caller, which method was accessed, and from where. Access *Access `json:"access,omitempty"` + // AttackExposure: The results of an attack path simulation relevant to + // this finding. + AttackExposure *AttackExposure `json:"attackExposure,omitempty"` + // CanonicalName: The canonical name of the finding. It's either // "organizations/{organization_id}/sources/{source_id}/findings/{finding // _id}", @@ -2461,6 +2542,83 @@ func (s *GoogleCloudSecuritycenterV1ResourceSelector) MarshalJSON() ([]byte, err return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudSecuritycenterV1ResourceValueConfig: A resource value +// config is a mapping configuration of user's tag values to resource +// values. Used by the attack path simulation. +type GoogleCloudSecuritycenterV1ResourceValueConfig struct { + // CreateTime: Output only. Timestamp this resource value config was + // created. + CreateTime string `json:"createTime,omitempty"` + + // Description: Description of the resource value config. + Description string `json:"description,omitempty"` + + // Name: Name for the resource value config + Name string `json:"name,omitempty"` + + // ResourceLabelsSelector: List of resource labels to search for, + // evaluated with AND. E.g. "resource_labels_selector": {"key": "value", + // "env": "prod"} will match resources with labels "key": "value" AND + // "env": "prod" + // https://cloud.google.com/resource-manager/docs/creating-managing-labels + ResourceLabelsSelector map[string]string `json:"resourceLabelsSelector,omitempty"` + + // ResourceType: Apply resource_value only to resources that match + // resource_type. resource_type will be checked with "AND" of other + // resources. E.g. "storage.googleapis.com/Bucket" with resource_value + // "HIGH" will apply "HIGH" value only to + // "storage.googleapis.com/Bucket" resources. + ResourceType string `json:"resourceType,omitempty"` + + // ResourceValue: Required. Resource value level this expression + // represents + // + // Possible values: + // "RESOURCE_VALUE_UNSPECIFIED" - Unspecific value + // "HIGH" - High resource value + // "MEDIUM" - Medium resource value + // "LOW" - Low resource value + // "NONE" - No resource value, e.g. ignore these resources + ResourceValue string `json:"resourceValue,omitempty"` + + // Scope: Project or folder to scope this config to. For example, + // "project/456" would apply this config only to resources in + // "project/456" scope will be checked with "AND" of other resources. + Scope string `json:"scope,omitempty"` + + // TagValues: Required. Tag values combined with AND to check against. + // Values in the form "tagValues/123" E.g. [ "tagValues/123", + // "tagValues/456", "tagValues/789" ] + // https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing + TagValues []string `json:"tagValues,omitempty"` + + // UpdateTime: Output only. Timestamp this resource value config was + // last updated. + UpdateTime string `json:"updateTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudSecuritycenterV1ResourceValueConfig) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudSecuritycenterV1ResourceValueConfig + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudSecuritycenterV1RunAssetDiscoveryResponse: Response of // asset discovery run type GoogleCloudSecuritycenterV1RunAssetDiscoveryResponse struct { diff --git a/servicecontrol/v2/servicecontrol-api.json b/servicecontrol/v2/servicecontrol-api.json index 54a43577029..d14f1c4c66c 100644 --- a/servicecontrol/v2/servicecontrol-api.json +++ b/servicecontrol/v2/servicecontrol-api.json @@ -169,7 +169,7 @@ } } }, - "revision": "20230707", + "revision": "20230728", "rootUrl": "https://servicecontrol.googleapis.com/", "schemas": { "Api": { @@ -397,6 +397,10 @@ "description": "The name of the service account key used to create or exchange credentials for authenticating the service account making the request. This is a scheme-less URI full resource name. For example: \"//iam.googleapis.com/projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}\"", "type": "string" }, + "serviceDelegationHistory": { + "$ref": "ServiceDelegationHistory", + "description": "Records the history of delegated resource access across Google services." + }, "thirdPartyPrincipal": { "additionalProperties": { "description": "Properties of the object.", @@ -845,6 +849,47 @@ }, "type": "object" }, + "ServiceDelegationHistory": { + "description": "The history of delegation across multiple services as the result of the original user's action. Such as \"service A uses its own account to do something for user B\". This differs from ServiceAccountDelegationInfo, which only tracks the history of direct token exchanges (impersonation).", + "id": "ServiceDelegationHistory", + "properties": { + "originalPrincipal": { + "description": "The original end user who initiated the request to GCP.", + "type": "string" + }, + "serviceMetadata": { + "description": "Data identifying the service specific jobs or units of work that were involved in a chain of service calls.", + "items": { + "$ref": "ServiceMetadata" + }, + "type": "array" + } + }, + "type": "object" + }, + "ServiceMetadata": { + "description": "Metadata describing the service and additional service specific information used to identify the job or unit of work at hand.", + "id": "ServiceMetadata", + "properties": { + "jobMetadata": { + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + }, + "description": "Additional metadata provided by service teams to describe service specific job information that was triggered by the original principal.", + "type": "object" + }, + "principalSubject": { + "description": "A string representing the principal_subject associated with the identity. For most identities, the format will be `principal://iam.googleapis.com/{identity pool name}/subject/{subject)` except for some GKE identities (GKE_WORKLOAD, FREEFORM, GKE_HUB_WORKLOAD) that are still in the legacy format `serviceAccount:{identity pool name}[{subject}]` If the identity is a Google account (e.g. workspace user account or service account), this will be the email of the prefixed by `serviceAccount:`. For example: `serviceAccount:my-service-account@project-1.iam.gserviceaccount.com`. If the identity is an individual user, the identity will be formatted as: `user:user_ABC@email.com`.", + "type": "string" + }, + "serviceDomain": { + "description": "The service's fully qualified domain name, e.g. \"dataproc.googleapis.com\".", + "type": "string" + } + }, + "type": "object" + }, "SpanContext": { "description": "The context of a span. This is attached to an Exemplar in Distribution values during aggregation. It contains the name of a span with format: projects/[PROJECT_ID_OR_NUMBER]/traces/[TRACE_ID]/spans/[SPAN_ID]", "id": "SpanContext", diff --git a/servicecontrol/v2/servicecontrol-gen.go b/servicecontrol/v2/servicecontrol-gen.go index 17e49a65868..0e31f82b911 100644 --- a/servicecontrol/v2/servicecontrol-gen.go +++ b/servicecontrol/v2/servicecontrol-gen.go @@ -488,6 +488,10 @@ type AuthenticationInfo struct { // keys/{key}" ServiceAccountKeyName string `json:"serviceAccountKeyName,omitempty"` + // ServiceDelegationHistory: Records the history of delegated resource + // access across Google services. + ServiceDelegationHistory *ServiceDelegationHistory `json:"serviceDelegationHistory,omitempty"` + // ThirdPartyPrincipal: The third party identification (if any) of the // authenticated user making the request. When the JSON object // represented here has a proto equivalent, the proto name will be @@ -1274,6 +1278,94 @@ func (s *ServiceAccountDelegationInfo) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// ServiceDelegationHistory: The history of delegation across multiple +// services as the result of the original user's action. Such as +// "service A uses its own account to do something for user B". This +// differs from ServiceAccountDelegationInfo, which only tracks the +// history of direct token exchanges (impersonation). +type ServiceDelegationHistory struct { + // OriginalPrincipal: The original end user who initiated the request to + // GCP. + OriginalPrincipal string `json:"originalPrincipal,omitempty"` + + // ServiceMetadata: Data identifying the service specific jobs or units + // of work that were involved in a chain of service calls. + ServiceMetadata []*ServiceMetadata `json:"serviceMetadata,omitempty"` + + // ForceSendFields is a list of field names (e.g. "OriginalPrincipal") + // 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. "OriginalPrincipal") 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 *ServiceDelegationHistory) MarshalJSON() ([]byte, error) { + type NoMethod ServiceDelegationHistory + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ServiceMetadata: Metadata describing the service and additional +// service specific information used to identify the job or unit of work +// at hand. +type ServiceMetadata struct { + // JobMetadata: Additional metadata provided by service teams to + // describe service specific job information that was triggered by the + // original principal. + JobMetadata googleapi.RawMessage `json:"jobMetadata,omitempty"` + + // PrincipalSubject: A string representing the principal_subject + // associated with the identity. For most identities, the format will be + // `principal://iam.googleapis.com/{identity pool + // name}/subject/{subject)` except for some GKE identities + // (GKE_WORKLOAD, FREEFORM, GKE_HUB_WORKLOAD) that are still in the + // legacy format `serviceAccount:{identity pool name}[{subject}]` If the + // identity is a Google account (e.g. workspace user account or service + // account), this will be the email of the prefixed by + // `serviceAccount:`. For example: + // `serviceAccount:my-service-account@project-1.iam.gserviceaccount.com`. + // If the identity is an individual user, the identity will be + // formatted as: `user:user_ABC@email.com`. + PrincipalSubject string `json:"principalSubject,omitempty"` + + // ServiceDomain: The service's fully qualified domain name, e.g. + // "dataproc.googleapis.com". + ServiceDomain string `json:"serviceDomain,omitempty"` + + // ForceSendFields is a list of field names (e.g. "JobMetadata") 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. "JobMetadata") 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 *ServiceMetadata) MarshalJSON() ([]byte, error) { + type NoMethod ServiceMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // SpanContext: The context of a span. This is attached to an Exemplar // in Distribution values during aggregation. It contains the name of a // span with format: diff --git a/verifiedaccess/v2/verifiedaccess-api.json b/verifiedaccess/v2/verifiedaccess-api.json index a6a06246310..4badbaeacf9 100644 --- a/verifiedaccess/v2/verifiedaccess-api.json +++ b/verifiedaccess/v2/verifiedaccess-api.json @@ -146,7 +146,7 @@ } } }, - "revision": "20230718", + "revision": "20230801", "rootUrl": "https://verifiedaccess.googleapis.com/", "schemas": { "Challenge": { @@ -469,6 +469,10 @@ "description": "Unique customer id that this device belongs to, as defined by the Google Admin SDK at https://developers.google.com/admin-sdk/directory/v1/guides/manage-customers", "type": "string" }, + "deviceEnrollmentId": { + "description": "Device enrollment id for ChromeOS devices.", + "type": "string" + }, "devicePermanentId": { "description": "Device permanent id is returned in this field (for the machine response only).", "type": "string" diff --git a/verifiedaccess/v2/verifiedaccess-gen.go b/verifiedaccess/v2/verifiedaccess-gen.go index 4ed535ef801..93c8c0c91c2 100644 --- a/verifiedaccess/v2/verifiedaccess-gen.go +++ b/verifiedaccess/v2/verifiedaccess-gen.go @@ -508,6 +508,9 @@ type VerifyChallengeResponseResult struct { // https://developers.google.com/admin-sdk/directory/v1/guides/manage-customers CustomerId string `json:"customerId,omitempty"` + // DeviceEnrollmentId: Device enrollment id for ChromeOS devices. + DeviceEnrollmentId string `json:"deviceEnrollmentId,omitempty"` + // DevicePermanentId: Device permanent id is returned in this field (for // the machine response only). DevicePermanentId string `json:"devicePermanentId,omitempty"`