From cc28ceb36a083703dd7bb46fa3b7baadad381b25 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 24 Oct 2023 00:22:36 -0700 Subject: [PATCH] feat(all): auto-regenerate discovery clients (#2235) --- accessapproval/v1/accessapproval-api.json | 9 +- accessapproval/v1/accessapproval-gen.go | 9 +- .../v1/androidmanagement-api.json | 6 +- androidmanagement/v1/androidmanagement-gen.go | 27 +- .../v2/baremetalsolution-api.json | 8 +- baremetalsolution/v2/baremetalsolution-gen.go | 7 +- cloudbuild/v1/cloudbuild-api.json | 16 +- cloudbuild/v1/cloudbuild-gen.go | 10 + cloudbuild/v2/cloudbuild-api.json | 6 +- cloudbuild/v2/cloudbuild-gen.go | 5 +- .../v1/cloudresourcemanager-api.json | 8 +- .../v1/cloudresourcemanager-gen.go | 14 +- .../v1beta1/cloudresourcemanager-api.json | 4 +- .../v1beta1/cloudresourcemanager-gen.go | 7 +- .../v3/cloudresourcemanager-api.json | 6 +- .../v3/cloudresourcemanager-gen.go | 9 +- compute/v0.beta/compute-api.json | 224 +- compute/v0.beta/compute-gen.go | 797 +- .../v1/contactcenterinsights-api.json | 22 +- .../v1/contactcenterinsights-gen.go | 14 +- dialogflow/v2/dialogflow-api.json | 78 +- dialogflow/v2/dialogflow-gen.go | 208 + dialogflow/v2beta1/dialogflow-api.json | 78 +- dialogflow/v2beta1/dialogflow-gen.go | 208 + dialogflow/v3beta1/dialogflow-api.json | 78 +- dialogflow/v3beta1/dialogflow-gen.go | 208 + places/v1/places-api.json | 4 +- places/v1/places-gen.go | 4 +- securitycenter/v1/securitycenter-api.json | 468 +- securitycenter/v1/securitycenter-gen.go | 14771 +++++++++------- .../v1beta1/securitycenter-api.json | 22 +- securitycenter/v1beta1/securitycenter-gen.go | 37 + .../v1beta2/securitycenter-api.json | 24 +- securitycenter/v1beta2/securitycenter-gen.go | 39 +- 34 files changed, 10978 insertions(+), 6457 deletions(-) diff --git a/accessapproval/v1/accessapproval-api.json b/accessapproval/v1/accessapproval-api.json index 4c3d87d5284..f4dce49adb1 100644 --- a/accessapproval/v1/accessapproval-api.json +++ b/accessapproval/v1/accessapproval-api.json @@ -913,7 +913,7 @@ } } }, - "revision": "20230915", + "revision": "20231020", "rootUrl": "https://accessapproval.googleapis.com/", "schemas": { "AccessApprovalServiceAccount": { @@ -1054,8 +1054,13 @@ "format": "google-datetime", "type": "string" }, + "requestedDuration": { + "description": "The requested access duration.", + "format": "google-duration", + "type": "string" + }, "requestedExpiration": { - "description": "The requested expiration for the approval. If the request is approved, access will be granted from the time of approval until the expiration time.", + "description": "The original requested expiration for the approval. Calculated by adding the requested_duration to the request_time.", "format": "google-datetime", "type": "string" }, diff --git a/accessapproval/v1/accessapproval-gen.go b/accessapproval/v1/accessapproval-gen.go index 1d907f6cf82..31785f70986 100644 --- a/accessapproval/v1/accessapproval-gen.go +++ b/accessapproval/v1/accessapproval-gen.go @@ -474,9 +474,12 @@ type ApprovalRequest struct { // RequestTime: The time at which approval was requested. RequestTime string `json:"requestTime,omitempty"` - // RequestedExpiration: The requested expiration for the approval. If - // the request is approved, access will be granted from the time of - // approval until the expiration time. + // RequestedDuration: The requested access duration. + RequestedDuration string `json:"requestedDuration,omitempty"` + + // RequestedExpiration: The original requested expiration for the + // approval. Calculated by adding the requested_duration to the + // request_time. RequestedExpiration string `json:"requestedExpiration,omitempty"` // RequestedLocations: The locations for which approval is being diff --git a/androidmanagement/v1/androidmanagement-api.json b/androidmanagement/v1/androidmanagement-api.json index ddf586bca4b..2ea24c9a1ba 100644 --- a/androidmanagement/v1/androidmanagement-api.json +++ b/androidmanagement/v1/androidmanagement-api.json @@ -1095,7 +1095,7 @@ } } }, - "revision": "20231009", + "revision": "20231016", "rootUrl": "https://androidmanagement.googleapis.com/", "schemas": { "AdbShellCommandEvent": { @@ -3031,7 +3031,7 @@ "type": "object" }, "FreezePeriod": { - "description": "A system freeze period. When a device’s clock is within the freeze period, all incoming system updates (including security patches) are blocked and won’t be installed. When a device is outside the freeze period, normal update behavior applies. Leap years are ignored in freeze period calculations, in particular: * If Feb. 29th is set as the start or end date of a freeze period, the freeze period will start or end on Feb. 28th instead. * When a device’s system clock reads Feb. 29th, it’s treated as Feb. 28th. * When calculating the number of days in a freeze period or the time between two freeze periods, Feb. 29th is ignored and not counted as a day.Note: For Freeze Periods to take effect, SystemUpdateType cannot be specified as SYSTEM_UPDATE_TYPE_UNSPECIFIED, because freeze periods require a defined policy to be specified.", + "description": "A system freeze period. When a device’s clock is within the freeze period, all incoming system updates (including security patches) are blocked and won’t be installed.When the device is outside any set freeze periods, the normal policy behavior (automatic, windowed, or postponed) applies.Leap years are ignored in freeze period calculations, in particular: If Feb. 29th is set as the start or end date of a freeze period, the freeze period will start or end on Feb. 28th instead. When a device’s system clock reads Feb. 29th, it’s treated as Feb. 28th. When calculating the number of days in a freeze period or the time between two freeze periods, Feb. 29th is ignored and not counted as a day.Note: For Freeze Periods to take effect, SystemUpdateType cannot be specified as SYSTEM_UPDATE_TYPE_UNSPECIFIED, because freeze periods require a defined policy to be specified.", "id": "FreezePeriod", "properties": { "endDate": { @@ -4375,7 +4375,7 @@ "type": "boolean" }, "maxDaysWithWorkOff": { - "description": "Controls how long the work profile can stay off. The minimum duration must be at least 3 days. Other details are as follows: - If the duration is set to 0, the feature is turned off. - If the duration is set to any value between 1-2 days, the feature is automatically set to 3 days. *Note:* If you want to avoid personal profiles being suspended during long periods of off-time, you can temporarily set a large value for this parameter.", + "description": "Controls how long the work profile can stay off. The minimum duration must be at least 3 days. Other details are as follows: - If the duration is set to 0, the feature is turned off. - If the duration is set to a value smaller than the minimum duration, the feature returns an error. *Note:* If you want to avoid personal profiles being suspended during long periods of off-time, you can temporarily set a large value for this parameter.", "format": "int32", "type": "integer" }, diff --git a/androidmanagement/v1/androidmanagement-gen.go b/androidmanagement/v1/androidmanagement-gen.go index e0b0d93efc7..d58c6b80a5a 100644 --- a/androidmanagement/v1/androidmanagement-gen.go +++ b/androidmanagement/v1/androidmanagement-gen.go @@ -3034,17 +3034,18 @@ func (s *FilePushedEvent) MarshalJSON() ([]byte, error) { // FreezePeriod: A system freeze period. When a device’s clock is // within the freeze period, all incoming system updates (including -// security patches) are blocked and won’t be installed. When a device -// is outside the freeze period, normal update behavior applies. Leap -// years are ignored in freeze period calculations, in particular: * If -// Feb. 29th is set as the start or end date of a freeze period, the -// freeze period will start or end on Feb. 28th instead. * When a -// device’s system clock reads Feb. 29th, it’s treated as Feb. 28th. -// * When calculating the number of days in a freeze period or the time -// between two freeze periods, Feb. 29th is ignored and not counted as a -// day.Note: For Freeze Periods to take effect, SystemUpdateType cannot -// be specified as SYSTEM_UPDATE_TYPE_UNSPECIFIED, because freeze -// periods require a defined policy to be specified. +// security patches) are blocked and won’t be installed.When the +// device is outside any set freeze periods, the normal policy behavior +// (automatic, windowed, or postponed) applies.Leap years are ignored in +// freeze period calculations, in particular: If Feb. 29th is set as the +// start or end date of a freeze period, the freeze period will start or +// end on Feb. 28th instead. When a device’s system clock reads Feb. +// 29th, it’s treated as Feb. 28th. When calculating the number of +// days in a freeze period or the time between two freeze periods, Feb. +// 29th is ignored and not counted as a day.Note: For Freeze Periods to +// take effect, SystemUpdateType cannot be specified as +// SYSTEM_UPDATE_TYPE_UNSPECIFIED, because freeze periods require a +// defined policy to be specified. type FreezePeriod struct { // EndDate: The end date (inclusive) of the freeze period. Must be no // later than 90 days from the start date. If the end date is earlier @@ -5172,8 +5173,8 @@ type PersonalUsagePolicies struct { // MaxDaysWithWorkOff: Controls how long the work profile can stay off. // The minimum duration must be at least 3 days. Other details are as // follows: - If the duration is set to 0, the feature is turned off. - - // If the duration is set to any value between 1-2 days, the feature is - // automatically set to 3 days. *Note:* If you want to avoid personal + // If the duration is set to a value smaller than the minimum duration, + // the feature returns an error. *Note:* If you want to avoid personal // profiles being suspended during long periods of off-time, you can // temporarily set a large value for this parameter. MaxDaysWithWorkOff int64 `json:"maxDaysWithWorkOff,omitempty"` diff --git a/baremetalsolution/v2/baremetalsolution-api.json b/baremetalsolution/v2/baremetalsolution-api.json index 906290609d7..edda7046fcb 100644 --- a/baremetalsolution/v2/baremetalsolution-api.json +++ b/baremetalsolution/v2/baremetalsolution-api.json @@ -1613,7 +1613,7 @@ } } }, - "revision": "20231009", + "revision": "20231018", "rootUrl": "https://baremetalsolution.googleapis.com/", "schemas": { "AllowedClient": { @@ -2563,7 +2563,11 @@ }, "vrf": { "$ref": "VRF", - "description": "The vrf for the Network." + "description": "The Vrf for the Network. Use this only if a new Vrf needs to be created." + }, + "vrfAttachment": { + "description": "Optional. The name of a pre-existing Vrf that the network should be attached to. Format is `vrfs/{vrf}`.", + "type": "string" } }, "type": "object" diff --git a/baremetalsolution/v2/baremetalsolution-gen.go b/baremetalsolution/v2/baremetalsolution-gen.go index 28fb10415b5..5e1ef897a7b 100644 --- a/baremetalsolution/v2/baremetalsolution-gen.go +++ b/baremetalsolution/v2/baremetalsolution-gen.go @@ -1503,9 +1503,14 @@ type Network struct { // VlanId: The vlan id of the Network. VlanId string `json:"vlanId,omitempty"` - // Vrf: The vrf for the Network. + // Vrf: The Vrf for the Network. Use this only if a new Vrf needs to be + // created. Vrf *VRF `json:"vrf,omitempty"` + // VrfAttachment: Optional. The name of a pre-existing Vrf that the + // network should be attached to. Format is `vrfs/{vrf}`. + VrfAttachment string `json:"vrfAttachment,omitempty"` + // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` diff --git a/cloudbuild/v1/cloudbuild-api.json b/cloudbuild/v1/cloudbuild-api.json index 1ef9aaa1903..0c519b87118 100644 --- a/cloudbuild/v1/cloudbuild-api.json +++ b/cloudbuild/v1/cloudbuild-api.json @@ -2319,7 +2319,7 @@ } } }, - "revision": "20230920", + "revision": "20231017", "rootUrl": "https://cloudbuild.googleapis.com/", "schemas": { "ApprovalConfig": { @@ -5041,6 +5041,20 @@ "object": { "description": "Cloud Storage object containing the source. This object must be a zipped (`.zip`) or gzipped archive file (`.tar.gz`) containing source to build.", "type": "string" + }, + "sourceFetcher": { + "description": "Optional. Option to specify the tool to fetch the source file for the build.", + "enum": [ + "SOURCE_FETCHER_UNSPECIFIED", + "GSUTIL", + "GCS_FETCHER" + ], + "enumDescriptions": [ + "Unspecified defaults to GSUTIL.", + "Use the \"gsutil\" tool to download the source file.", + "Use the Cloud Storage Fetcher tool to download the source file." + ], + "type": "string" } }, "type": "object" diff --git a/cloudbuild/v1/cloudbuild-gen.go b/cloudbuild/v1/cloudbuild-gen.go index 26d1afb7d54..618ba98caae 100644 --- a/cloudbuild/v1/cloudbuild-gen.go +++ b/cloudbuild/v1/cloudbuild-gen.go @@ -4696,6 +4696,16 @@ type StorageSource struct { // source to build. Object string `json:"object,omitempty"` + // SourceFetcher: Optional. Option to specify the tool to fetch the + // source file for the build. + // + // Possible values: + // "SOURCE_FETCHER_UNSPECIFIED" - Unspecified defaults to GSUTIL. + // "GSUTIL" - Use the "gsutil" tool to download the source file. + // "GCS_FETCHER" - Use the Cloud Storage Fetcher tool to download the + // source file. + SourceFetcher string `json:"sourceFetcher,omitempty"` + // ForceSendFields is a list of field names (e.g. "Bucket") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any diff --git a/cloudbuild/v2/cloudbuild-api.json b/cloudbuild/v2/cloudbuild-api.json index 182b76f5e07..eb509ff7d6a 100644 --- a/cloudbuild/v2/cloudbuild-api.json +++ b/cloudbuild/v2/cloudbuild-api.json @@ -844,7 +844,7 @@ } } }, - "revision": "20230920", + "revision": "20231017", "rootUrl": "https://cloudbuild.googleapis.com/", "schemas": { "AuditConfig": { @@ -987,7 +987,7 @@ "type": "object" }, "Connection": { - "description": "A connection to a SCM like GitHub, GitHub Enterprise, Bitbucket Server or GitLab.", + "description": "A connection to a SCM like GitHub, GitHub Enterprise, Bitbucket Data Center or GitLab.", "id": "Connection", "properties": { "annotations": { @@ -1843,7 +1843,7 @@ "description": "PipelineRef refer to a specific instance of a Pipeline." }, "pipelineRunStatus": { - "description": "Status of the PipelineRun.", + "description": "Pipelinerun status the user can provide. Used for cancellation.", "enum": [ "PIPELINE_RUN_STATUS_UNSPECIFIED", "PIPELINE_RUN_CANCELLED" diff --git a/cloudbuild/v2/cloudbuild-gen.go b/cloudbuild/v2/cloudbuild-gen.go index cdb6ba7d2be..0f49ed03d66 100644 --- a/cloudbuild/v2/cloudbuild-gen.go +++ b/cloudbuild/v2/cloudbuild-gen.go @@ -492,7 +492,7 @@ func (s *ChildStatusReference) MarshalJSON() ([]byte, error) { } // Connection: A connection to a SCM like GitHub, GitHub Enterprise, -// Bitbucket Server or GitLab. +// Bitbucket Data Center or GitLab. type Connection struct { // Annotations: Allows clients to store small amounts of arbitrary data. Annotations map[string]string `json:"annotations,omitempty"` @@ -1813,7 +1813,8 @@ type PipelineRun struct { // PipelineRef: PipelineRef refer to a specific instance of a Pipeline. PipelineRef *PipelineRef `json:"pipelineRef,omitempty"` - // PipelineRunStatus: Status of the PipelineRun. + // PipelineRunStatus: Pipelinerun status the user can provide. Used for + // cancellation. // // Possible values: // "PIPELINE_RUN_STATUS_UNSPECIFIED" - Default enum type; should not diff --git a/cloudresourcemanager/v1/cloudresourcemanager-api.json b/cloudresourcemanager/v1/cloudresourcemanager-api.json index 4d7beabcede..b4b4c615dda 100644 --- a/cloudresourcemanager/v1/cloudresourcemanager-api.json +++ b/cloudresourcemanager/v1/cloudresourcemanager-api.json @@ -624,7 +624,7 @@ ] }, "search": { - "description": "Searches Organization resources that are visible to the user and satisfy the specified filter. This method returns Organizations in an unspecified order. New Organizations do not necessarily appear at the end of the results. Search will only return organizations on which the user has the permission `resourcemanager.organizations.get`", + "description": "Searches Organization resources that are visible to the user and satisfy the specified filter. This method returns Organizations in an unspecified order. New Organizations do not necessarily appear at the end of the results. Search will only return organizations on which the user has the permission `resourcemanager.organizations.get` or has super admin privileges.", "flatPath": "v1/organizations:search", "httpMethod": "POST", "id": "cloudresourcemanager.organizations.search", @@ -1032,7 +1032,7 @@ ] }, "setIamPolicy": { - "description": "Sets the IAM access control policy for the specified Project. CAUTION: This method will replace the existing policy, and cannot be used to append additional IAM settings. NOTE: Removing service accounts from policies or changing their roles can render services completely inoperable. It is important to understand how the service account is being used before removing or updating its roles. For additional information about `resource` (e.g. my-project-id) structure and identification, see [Resource Names](https://cloud.google.com/apis/design/resource_names). The following constraints apply when using `setIamPolicy()`: + Project does not support `allUsers` and `allAuthenticatedUsers` as `members` in a `Binding` of a `Policy`. + The owner role can be granted to a `user`, `serviceAccount`, or a group that is part of an organization. For example, group@myownpersonaldomain.com could be added as an owner to a project in the myownpersonaldomain.com organization, but not the examplepetstore.com organization. + Service accounts can be made owners of a project directly without any restrictions. However, to be added as an owner, a user must be invited via Cloud Platform console and must accept the invitation. + A user cannot be granted the owner role using `setIamPolicy()`. The user must be granted the owner role using the Cloud Platform Console and must explicitly accept the invitation. + You can only grant ownership of a project to a member by using the GCP Console. Inviting a member will deliver an invitation email that they must accept. An invitation email is not generated if you are granting a role other than owner, or if both the member you are inviting and the project are part of your organization. + If the project is not part of an organization, there must be at least one owner who has accepted the Terms of Service (ToS) agreement in the policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner from the policy will fail. This restriction also applies to legacy projects that no longer have owners who have accepted the ToS. Edits to IAM policies will be rejected until the lack of a ToS-accepting owner is rectified. If the project is part of an organization, you can remove all owners, potentially making the organization inaccessible. Authorization requires the Google IAM permission `resourcemanager.projects.setIamPolicy` on the project", + "description": "Sets the IAM access control policy for the specified Project. CAUTION: This method will replace the existing policy, and cannot be used to append additional IAM settings. NOTE: Removing service accounts from policies or changing their roles can render services completely inoperable. It is important to understand how the service account is being used before removing or updating its roles. For additional information about `resource` (e.g. my-project-id) structure and identification, see [Resource Names](https://cloud.google.com/apis/design/resource_names). The following constraints apply when using `setIamPolicy()`: + Project does not support `allUsers` and `allAuthenticatedUsers` as `members` in a `Binding` of a `Policy`. + The owner role can be granted to a `user`, `serviceAccount`, or a group that is part of an organization. For example, group@myownpersonaldomain.com could be added as an owner to a project in the myownpersonaldomain.com organization, but not the examplepetstore.com organization. + Service accounts can be made owners of a project directly without any restrictions. However, to be added as an owner, a user must be invited via Cloud Platform console and must accept the invitation. + A user cannot be granted the owner role using `setIamPolicy()`. The user must be granted the owner role using the Cloud Platform Console and must explicitly accept the invitation. + You can only grant ownership of a project to a member by using the Google Cloud console. Inviting a member will deliver an invitation email that they must accept. An invitation email is not generated if you are granting a role other than owner, or if both the member you are inviting and the project are part of your organization. + If the project is not part of an organization, there must be at least one owner who has accepted the Terms of Service (ToS) agreement in the policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner from the policy will fail. This restriction also applies to legacy projects that no longer have owners who have accepted the ToS. Edits to IAM policies will be rejected until the lack of a ToS-accepting owner is rectified. If the project is part of an organization, you can remove all owners, potentially making the organization inaccessible. Authorization requires the Google IAM permission `resourcemanager.projects.setIamPolicy` on the project", "flatPath": "v1/projects/{resource}:setIamPolicy", "httpMethod": "POST", "id": "cloudresourcemanager.projects.setIamPolicy", @@ -1171,7 +1171,7 @@ } } }, - "revision": "20230806", + "revision": "20231022", "rootUrl": "https://cloudresourcemanager.googleapis.com/", "schemas": { "Ancestor": { @@ -1956,7 +1956,7 @@ "type": "string" }, "displayName": { - "description": "A human-readable string that refers to the Organization in the GCP Console UI. This string is set by the server and cannot be changed. The string will be set to the primary domain (for example, \"google.com\") of the G Suite customer that owns the organization.", + "description": "A human-readable string that refers to the Organization in the Google Cloud console. This string is set by the server and cannot be changed. The string will be set to the primary domain (for example, \"google.com\") of the G Suite customer that owns the organization.", "type": "string" }, "lifecycleState": { diff --git a/cloudresourcemanager/v1/cloudresourcemanager-gen.go b/cloudresourcemanager/v1/cloudresourcemanager-gen.go index c7e43de97aa..5348835a190 100644 --- a/cloudresourcemanager/v1/cloudresourcemanager-gen.go +++ b/cloudresourcemanager/v1/cloudresourcemanager-gen.go @@ -1778,9 +1778,10 @@ type Organization struct { CreationTime string `json:"creationTime,omitempty"` // DisplayName: A human-readable string that refers to the Organization - // in the GCP Console UI. This string is set by the server and cannot be - // changed. The string will be set to the primary domain (for example, - // "google.com") of the G Suite customer that owns the organization. + // in the Google Cloud console. This string is set by the server and + // cannot be changed. The string will be set to the primary domain (for + // example, "google.com") of the G Suite customer that owns the + // organization. DisplayName string `json:"displayName,omitempty"` // LifecycleState: The organization's current lifecycle state. Assigned @@ -5213,6 +5214,7 @@ type OrganizationsSearchCall struct { // in an unspecified order. New Organizations do not necessarily appear // at the end of the results. Search will only return organizations on // which the user has the permission `resourcemanager.organizations.get` +// or has super admin privileges. func (r *OrganizationsService) Search(searchorganizationsrequest *SearchOrganizationsRequest) *OrganizationsSearchCall { c := &OrganizationsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.searchorganizationsrequest = searchorganizationsrequest @@ -5307,7 +5309,7 @@ func (c *OrganizationsSearchCall) Do(opts ...googleapi.CallOption) (*SearchOrgan } return ret, nil // { - // "description": "Searches Organization resources that are visible to the user and satisfy the specified filter. This method returns Organizations in an unspecified order. New Organizations do not necessarily appear at the end of the results. Search will only return organizations on which the user has the permission `resourcemanager.organizations.get`", + // "description": "Searches Organization resources that are visible to the user and satisfy the specified filter. This method returns Organizations in an unspecified order. New Organizations do not necessarily appear at the end of the results. Search will only return organizations on which the user has the permission `resourcemanager.organizations.get` or has super admin privileges.", // "flatPath": "v1/organizations:search", // "httpMethod": "POST", // "id": "cloudresourcemanager.organizations.search", @@ -7545,7 +7547,7 @@ type ProjectsSetIamPolicyCall struct { // role using `setIamPolicy()`. The user must be granted the owner role // using the Cloud Platform Console and must explicitly accept the // invitation. + You can only grant ownership of a project to a member -// by using the GCP Console. Inviting a member will deliver an +// by using the Google Cloud console. Inviting a member will deliver an // invitation email that they must accept. An invitation email is not // generated if you are granting a role other than owner, or if both the // member you are inviting and the project are part of your @@ -7662,7 +7664,7 @@ func (c *ProjectsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, er } return ret, nil // { - // "description": "Sets the IAM access control policy for the specified Project. CAUTION: This method will replace the existing policy, and cannot be used to append additional IAM settings. NOTE: Removing service accounts from policies or changing their roles can render services completely inoperable. It is important to understand how the service account is being used before removing or updating its roles. For additional information about `resource` (e.g. my-project-id) structure and identification, see [Resource Names](https://cloud.google.com/apis/design/resource_names). The following constraints apply when using `setIamPolicy()`: + Project does not support `allUsers` and `allAuthenticatedUsers` as `members` in a `Binding` of a `Policy`. + The owner role can be granted to a `user`, `serviceAccount`, or a group that is part of an organization. For example, group@myownpersonaldomain.com could be added as an owner to a project in the myownpersonaldomain.com organization, but not the examplepetstore.com organization. + Service accounts can be made owners of a project directly without any restrictions. However, to be added as an owner, a user must be invited via Cloud Platform console and must accept the invitation. + A user cannot be granted the owner role using `setIamPolicy()`. The user must be granted the owner role using the Cloud Platform Console and must explicitly accept the invitation. + You can only grant ownership of a project to a member by using the GCP Console. Inviting a member will deliver an invitation email that they must accept. An invitation email is not generated if you are granting a role other than owner, or if both the member you are inviting and the project are part of your organization. + If the project is not part of an organization, there must be at least one owner who has accepted the Terms of Service (ToS) agreement in the policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner from the policy will fail. This restriction also applies to legacy projects that no longer have owners who have accepted the ToS. Edits to IAM policies will be rejected until the lack of a ToS-accepting owner is rectified. If the project is part of an organization, you can remove all owners, potentially making the organization inaccessible. Authorization requires the Google IAM permission `resourcemanager.projects.setIamPolicy` on the project", + // "description": "Sets the IAM access control policy for the specified Project. CAUTION: This method will replace the existing policy, and cannot be used to append additional IAM settings. NOTE: Removing service accounts from policies or changing their roles can render services completely inoperable. It is important to understand how the service account is being used before removing or updating its roles. For additional information about `resource` (e.g. my-project-id) structure and identification, see [Resource Names](https://cloud.google.com/apis/design/resource_names). The following constraints apply when using `setIamPolicy()`: + Project does not support `allUsers` and `allAuthenticatedUsers` as `members` in a `Binding` of a `Policy`. + The owner role can be granted to a `user`, `serviceAccount`, or a group that is part of an organization. For example, group@myownpersonaldomain.com could be added as an owner to a project in the myownpersonaldomain.com organization, but not the examplepetstore.com organization. + Service accounts can be made owners of a project directly without any restrictions. However, to be added as an owner, a user must be invited via Cloud Platform console and must accept the invitation. + A user cannot be granted the owner role using `setIamPolicy()`. The user must be granted the owner role using the Cloud Platform Console and must explicitly accept the invitation. + You can only grant ownership of a project to a member by using the Google Cloud console. Inviting a member will deliver an invitation email that they must accept. An invitation email is not generated if you are granting a role other than owner, or if both the member you are inviting and the project are part of your organization. + If the project is not part of an organization, there must be at least one owner who has accepted the Terms of Service (ToS) agreement in the policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner from the policy will fail. This restriction also applies to legacy projects that no longer have owners who have accepted the ToS. Edits to IAM policies will be rejected until the lack of a ToS-accepting owner is rectified. If the project is part of an organization, you can remove all owners, potentially making the organization inaccessible. Authorization requires the Google IAM permission `resourcemanager.projects.setIamPolicy` on the project", // "flatPath": "v1/projects/{resource}:setIamPolicy", // "httpMethod": "POST", // "id": "cloudresourcemanager.projects.setIamPolicy", diff --git a/cloudresourcemanager/v1beta1/cloudresourcemanager-api.json b/cloudresourcemanager/v1beta1/cloudresourcemanager-api.json index 07215ce172c..b69d7fd95df 100644 --- a/cloudresourcemanager/v1beta1/cloudresourcemanager-api.json +++ b/cloudresourcemanager/v1beta1/cloudresourcemanager-api.json @@ -568,7 +568,7 @@ } } }, - "revision": "20230806", + "revision": "20231022", "rootUrl": "https://cloudresourcemanager.googleapis.com/", "schemas": { "Ancestor": { @@ -1018,7 +1018,7 @@ "type": "string" }, "displayName": { - "description": "A human-readable string that refers to the Organization in the GCP Console UI. This string is set by the server and cannot be changed. The string will be set to the primary domain (for example, \"google.com\") of the G Suite customer that owns the organization.", + "description": "A human-readable string that refers to the Organization in the Google Cloud console. This string is set by the server and cannot be changed. The string will be set to the primary domain (for example, \"google.com\") of the G Suite customer that owns the organization.", "type": "string" }, "lifecycleState": { diff --git a/cloudresourcemanager/v1beta1/cloudresourcemanager-gen.go b/cloudresourcemanager/v1beta1/cloudresourcemanager-gen.go index 9081b1baa19..e8aec84e530 100644 --- a/cloudresourcemanager/v1beta1/cloudresourcemanager-gen.go +++ b/cloudresourcemanager/v1beta1/cloudresourcemanager-gen.go @@ -1008,9 +1008,10 @@ type Organization struct { CreationTime string `json:"creationTime,omitempty"` // DisplayName: A human-readable string that refers to the Organization - // in the GCP Console UI. This string is set by the server and cannot be - // changed. The string will be set to the primary domain (for example, - // "google.com") of the G Suite customer that owns the organization. + // in the Google Cloud console. This string is set by the server and + // cannot be changed. The string will be set to the primary domain (for + // example, "google.com") of the G Suite customer that owns the + // organization. DisplayName string `json:"displayName,omitempty"` // LifecycleState: The organization's current lifecycle state. Assigned diff --git a/cloudresourcemanager/v3/cloudresourcemanager-api.json b/cloudresourcemanager/v3/cloudresourcemanager-api.json index 7c95e52cfdd..d19bc7330bd 100644 --- a/cloudresourcemanager/v3/cloudresourcemanager-api.json +++ b/cloudresourcemanager/v3/cloudresourcemanager-api.json @@ -660,7 +660,7 @@ ] }, "search": { - "description": "Searches organization resources that are visible to the user and satisfy the specified filter. This method returns organizations in an unspecified order. New organizations do not necessarily appear at the end of the results, and may take a small amount of time to appear. Search will only return organizations on which the user has the permission `resourcemanager.organizations.get`", + "description": "Searches organization resources that are visible to the user and satisfy the specified filter. This method returns organizations in an unspecified order. New organizations do not necessarily appear at the end of the results, and may take a small amount of time to appear. Search will only return organizations on which the user has the permission `resourcemanager.organizations.get` or has super admin privileges.", "flatPath": "v3/organizations:search", "httpMethod": "GET", "id": "cloudresourcemanager.organizations.search", @@ -952,7 +952,7 @@ ] }, "search": { - "description": "Search for projects that the caller has both `resourcemanager.projects.get` permission on, and also satisfy the specified query. This method returns projects in an unspecified order. This method is eventually consistent with project mutations; this means that a newly created project may not appear in the results or recent updates to an existing project may not be reflected in the results. To retrieve the latest state of a project, use the GetProject method.", + "description": "Search for projects that the caller has the `resourcemanager.projects.get` permission on, and also satisfy the specified query. This method returns projects in an unspecified order. This method is eventually consistent with project mutations; this means that a newly created project may not appear in the results or recent updates to an existing project may not be reflected in the results. To retrieve the latest state of a project, use the GetProject method.", "flatPath": "v3/projects:search", "httpMethod": "GET", "id": "cloudresourcemanager.projects.search", @@ -1805,7 +1805,7 @@ } } }, - "revision": "20230806", + "revision": "20231022", "rootUrl": "https://cloudresourcemanager.googleapis.com/", "schemas": { "AuditConfig": { diff --git a/cloudresourcemanager/v3/cloudresourcemanager-gen.go b/cloudresourcemanager/v3/cloudresourcemanager-gen.go index 4458859a471..b7a24492095 100644 --- a/cloudresourcemanager/v3/cloudresourcemanager-gen.go +++ b/cloudresourcemanager/v3/cloudresourcemanager-gen.go @@ -5539,7 +5539,8 @@ type OrganizationsSearchCall struct { // in an unspecified order. New organizations do not necessarily appear // at the end of the results, and may take a small amount of time to // appear. Search will only return organizations on which the user has -// the permission `resourcemanager.organizations.get` +// the permission `resourcemanager.organizations.get` or has super admin +// privileges. func (r *OrganizationsService) Search() *OrganizationsSearchCall { c := &OrganizationsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)} return c @@ -5675,7 +5676,7 @@ func (c *OrganizationsSearchCall) Do(opts ...googleapi.CallOption) (*SearchOrgan } return ret, nil // { - // "description": "Searches organization resources that are visible to the user and satisfy the specified filter. This method returns organizations in an unspecified order. New organizations do not necessarily appear at the end of the results, and may take a small amount of time to appear. Search will only return organizations on which the user has the permission `resourcemanager.organizations.get`", + // "description": "Searches organization resources that are visible to the user and satisfy the specified filter. This method returns organizations in an unspecified order. New organizations do not necessarily appear at the end of the results, and may take a small amount of time to appear. Search will only return organizations on which the user has the permission `resourcemanager.organizations.get` or has super admin privileges.", // "flatPath": "v3/organizations:search", // "httpMethod": "GET", // "id": "cloudresourcemanager.organizations.search", @@ -7138,7 +7139,7 @@ type ProjectsSearchCall struct { header_ http.Header } -// Search: Search for projects that the caller has both +// Search: Search for projects that the caller has the // `resourcemanager.projects.get` permission on, and also satisfy the // specified query. This method returns projects in an unspecified // order. This method is eventually consistent with project mutations; @@ -7294,7 +7295,7 @@ func (c *ProjectsSearchCall) Do(opts ...googleapi.CallOption) (*SearchProjectsRe } return ret, nil // { - // "description": "Search for projects that the caller has both `resourcemanager.projects.get` permission on, and also satisfy the specified query. This method returns projects in an unspecified order. This method is eventually consistent with project mutations; this means that a newly created project may not appear in the results or recent updates to an existing project may not be reflected in the results. To retrieve the latest state of a project, use the GetProject method.", + // "description": "Search for projects that the caller has the `resourcemanager.projects.get` permission on, and also satisfy the specified query. This method returns projects in an unspecified order. This method is eventually consistent with project mutations; this means that a newly created project may not appear in the results or recent updates to an existing project may not be reflected in the results. To retrieve the latest state of a project, use the GetProject method.", // "flatPath": "v3/projects:search", // "httpMethod": "GET", // "id": "cloudresourcemanager.projects.search", diff --git a/compute/v0.beta/compute-api.json b/compute/v0.beta/compute-api.json index dcb3d8b7ca9..34ea0ecf940 100644 --- a/compute/v0.beta/compute-api.json +++ b/compute/v0.beta/compute-api.json @@ -20875,6 +20875,44 @@ }, "publicAdvertisedPrefixes": { "methods": { + "announce": { + "description": "Announces the specified PublicAdvertisedPrefix", + "flatPath": "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}/announce", + "httpMethod": "POST", + "id": "compute.publicAdvertisedPrefixes.announce", + "parameterOrder": [ + "project", + "publicAdvertisedPrefix" + ], + "parameters": { + "project": { + "description": "Project ID for this request.", + "location": "path", + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "required": true, + "type": "string" + }, + "publicAdvertisedPrefix": { + "description": "The name of the public advertised prefix. It should comply with RFC1035.", + "location": "path", + "required": true, + "type": "string" + }, + "requestId": { + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).", + "location": "query", + "type": "string" + } + }, + "path": "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}/announce", + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "delete": { "description": "Deletes the specified PublicAdvertisedPrefix", "flatPath": "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}", @@ -21079,6 +21117,44 @@ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/compute" ] + }, + "withdraw": { + "description": "Withdraws the specified PublicAdvertisedPrefix", + "flatPath": "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}/withdraw", + "httpMethod": "POST", + "id": "compute.publicAdvertisedPrefixes.withdraw", + "parameterOrder": [ + "project", + "publicAdvertisedPrefix" + ], + "parameters": { + "project": { + "description": "Project ID for this request.", + "location": "path", + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "required": true, + "type": "string" + }, + "publicAdvertisedPrefix": { + "description": "The name of the public advertised prefix. It should comply with RFC1035.", + "location": "path", + "required": true, + "type": "string" + }, + "requestId": { + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).", + "location": "query", + "type": "string" + } + }, + "path": "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}/withdraw", + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] } } }, @@ -21149,6 +21225,51 @@ "https://www.googleapis.com/auth/compute.readonly" ] }, + "announce": { + "description": "Announces the specified PublicDelegatedPrefix in the given region.", + "flatPath": "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}/announce", + "httpMethod": "POST", + "id": "compute.publicDelegatedPrefixes.announce", + "parameterOrder": [ + "project", + "region", + "publicDelegatedPrefix" + ], + "parameters": { + "project": { + "description": "Project ID for this request.", + "location": "path", + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "required": true, + "type": "string" + }, + "publicDelegatedPrefix": { + "description": "The name of the public delegated prefix. It should comply with RFC1035.", + "location": "path", + "required": true, + "type": "string" + }, + "region": { + "description": "The name of the region where the public delegated prefix is located. It should comply with RFC1035.", + "location": "path", + "required": true, + "type": "string" + }, + "requestId": { + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).", + "location": "query", + "type": "string" + } + }, + "path": "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}/announce", + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "delete": { "description": "Deletes the specified PublicDelegatedPrefix in the given region.", "flatPath": "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}", @@ -21393,6 +21514,51 @@ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/compute" ] + }, + "withdraw": { + "description": "Withdraws the specified PublicDelegatedPrefix in the given region.", + "flatPath": "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}/withdraw", + "httpMethod": "POST", + "id": "compute.publicDelegatedPrefixes.withdraw", + "parameterOrder": [ + "project", + "region", + "publicDelegatedPrefix" + ], + "parameters": { + "project": { + "description": "Project ID for this request.", + "location": "path", + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "required": true, + "type": "string" + }, + "publicDelegatedPrefix": { + "description": "The name of the public delegated prefix. It should comply with RFC1035.", + "location": "path", + "required": true, + "type": "string" + }, + "region": { + "description": "The name of the region where the public delegated prefix is located. It should comply with RFC1035.", + "location": "path", + "required": true, + "type": "string" + }, + "requestId": { + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).", + "location": "query", + "type": "string" + } + }, + "path": "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}/withdraw", + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] } } }, @@ -40049,7 +40215,7 @@ } } }, - "revision": "20231011", + "revision": "20231017", "rootUrl": "https://compute.googleapis.com/", "schemas": { "AWSV4Signature": { @@ -43209,7 +43375,7 @@ "type": "string" }, "ipAddressSelectionPolicy": { - "description": "Specifies preference of traffic to the backend (from the proxy and from the client for proxyless gRPC). The possible values are: - IPV4_ONLY: Only send IPv4 traffic to the backends of the Backend Service (Instance Group, Managed Instance Group, Network Endpoint Group) regardless of traffic from the client to the proxy. Only IPv4 health-checks are used to check the health of the backends. This is the default setting. - PREFER_IPV6: Prioritize the connection to the endpoints IPv6 address over its IPv4 address (provided there is a healthy IPv6 address). - IPV6_ONLY: Only send IPv6 traffic to the backends of the Backend Service (Instance Group, Managed Instance Group, Network Endpoint Group) regardless of traffic from the client to the proxy. Only IPv6 health-checks are used to check the health of the backends. This field is applicable to either: - Advanced Global External HTTPS Load Balancing (load balancing scheme EXTERNAL_MANAGED), - Regional External HTTPS Load Balancing, - Internal TCP Proxy (load balancing scheme INTERNAL_MANAGED), - Regional Internal HTTPS Load Balancing (load balancing scheme INTERNAL_MANAGED), - Traffic Director with Envoy proxies and proxyless gRPC (load balancing scheme INTERNAL_SELF_MANAGED). ", + "description": "Specifies a preference for traffic sent from the proxy to the backend (or from the client to the backend for proxyless gRPC). The possible values are: - IPV4_ONLY: Only send IPv4 traffic to the backends of the backend service (Instance Group, Managed Instance Group, Network Endpoint Group), regardless of traffic from the client to the proxy. Only IPv4 health checks are used to check the health of the backends. This is the default setting. - PREFER_IPV6: Prioritize the connection to the endpoint's IPv6 address over its IPv4 address (provided there is a healthy IPv6 address). - IPV6_ONLY: Only send IPv6 traffic to the backends of the backend service (Instance Group, Managed Instance Group, Network Endpoint Group), regardless of traffic from the client to the proxy. Only IPv6 health checks are used to check the health of the backends. This field is applicable to either: - Advanced Global External HTTPS Load Balancing (load balancing scheme EXTERNAL_MANAGED), - Regional External HTTPS Load Balancing, - Internal TCP Proxy (load balancing scheme INTERNAL_MANAGED), - Regional Internal HTTPS Load Balancing (load balancing scheme INTERNAL_MANAGED), - Traffic Director with Envoy proxies and proxyless gRPC (load balancing scheme INTERNAL_SELF_MANAGED). ", "enum": [ "IPV4_ONLY", "IPV6_ONLY", @@ -68275,7 +68441,7 @@ "description": "[Output Only] The Cloud Armor Managed Protection (CAMP) tier for this project. It can be one of the following values: CA_STANDARD, CAMP_PLUS_MONTHLY. If this field is not specified, it is assumed to be CA_STANDARD.", "enum": [ "CAMP_PLUS_ANNUAL", - "CAMP_PLUS_MONTHLY", + "CAMP_PLUS_PAYGO", "CA_STANDARD" ], "enumDescriptions": [ @@ -68416,7 +68582,7 @@ "description": "Managed protection tier to be set.", "enum": [ "CAMP_PLUS_ANNUAL", - "CAMP_PLUS_MONTHLY", + "CAMP_PLUS_PAYGO", "CA_STANDARD" ], "enumDescriptions": [ @@ -68433,6 +68599,18 @@ "description": "A public advertised prefix represents an aggregated IP prefix or netblock which customers bring to cloud. The IP prefix is a single unit of route advertisement and is announced globally to the internet.", "id": "PublicAdvertisedPrefix", "properties": { + "byoipApiVersion": { + "description": "[Output Only] The version of BYOIP API.", + "enum": [ + "V1", + "V2" + ], + "enumDescriptions": [ + "This public advertised prefix can be used to create both regional and global public delegated prefixes. It usually takes 4 weeks to create or delete a public delegated prefix. The BGP status cannot be changed.", + "This public advertised prefix can only be used to create regional public delegated prefixes. Public delegated prefix creation and deletion takes minutes and the BGP status can be modified." + ], + "type": "string" + }, "creationTimestamp": { "description": "[Output Only] Creation timestamp in RFC3339 text format.", "type": "string" @@ -68474,6 +68652,20 @@ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "type": "string" }, + "pdpScope": { + "description": "Specifies how child public delegated prefix will be scoped. It could be one of following values: - `REGIONAL`: The public delegated prefix is regional only. The provisioning will take a few minutes. - `GLOBAL`: The public delegated prefix is global only. The provisioning will take ~4 weeks. - `GLOBAL_AND_REGIONAL` [output only]: The public delegated prefixes is BYOIP V1 legacy prefix. This is output only value and no longer supported in BYOIP V2. ", + "enum": [ + "GLOBAL", + "GLOBAL_AND_REGIONAL", + "REGIONAL" + ], + "enumDescriptions": [ + "The public delegated prefix is global only. The provisioning will take ~4 weeks.", + "The public delegated prefixes is BYOIP V1 legacy prefix. This is output only value and no longer supported in BYOIP V2.", + "The public delegated prefix is regional only. The provisioning will take a few minutes." + ], + "type": "string" + }, "publicDelegatedPrefixs": { "description": "[Output Only] The list of public delegated prefixes that exist for this public advertised prefix.", "items": { @@ -68492,20 +68684,24 @@ "status": { "description": "The status of the public advertised prefix. Possible values include: - `INITIAL`: RPKI validation is complete. - `PTR_CONFIGURED`: User has configured the PTR. - `VALIDATED`: Reverse DNS lookup is successful. - `REVERSE_DNS_LOOKUP_FAILED`: Reverse DNS lookup failed. - `PREFIX_CONFIGURATION_IN_PROGRESS`: The prefix is being configured. - `PREFIX_CONFIGURATION_COMPLETE`: The prefix is fully configured. - `PREFIX_REMOVAL_IN_PROGRESS`: The prefix is being removed. ", "enum": [ + "ANNOUNCED_TO_INTERNET", "INITIAL", "PREFIX_CONFIGURATION_COMPLETE", "PREFIX_CONFIGURATION_IN_PROGRESS", "PREFIX_REMOVAL_IN_PROGRESS", "PTR_CONFIGURED", + "READY_TO_ANNOUNCE", "REVERSE_DNS_LOOKUP_FAILED", "VALIDATED" ], "enumDescriptions": [ + "The prefix is announced to Internet.", "RPKI validation is complete.", "The prefix is fully configured.", "The prefix is being configured.", "The prefix is being removed.", "User has configured the PTR.", + "The prefix is currently withdrawn but ready to be announced.", "Reverse DNS lookup failed.", "Reverse DNS lookup is successful." ], @@ -68696,6 +68892,18 @@ "description": "A PublicDelegatedPrefix resource represents an IP block within a PublicAdvertisedPrefix that is configured within a single cloud scope (global or region). IPs in the block can be allocated to resources within that scope. Public delegated prefixes may be further broken up into smaller IP blocks in the same scope as the parent block.", "id": "PublicDelegatedPrefix", "properties": { + "byoipApiVersion": { + "description": "[Output Only] The version of BYOIP API.", + "enum": [ + "V1", + "V2" + ], + "enumDescriptions": [ + "This public delegated prefix usually takes 4 weeks to delete, and the BGP status cannot be changed. Announce and Withdraw APIs can not be used on this prefix.", + "This public delegated prefix takes minutes to delete. Announce and Withdraw APIs can be used on this prefix to change the BGP status." + ], + "type": "string" + }, "creationTimestamp": { "description": "[Output Only] Creation timestamp in RFC3339 text format.", "type": "string" @@ -68760,12 +68968,16 @@ "description": "[Output Only] The status of the public delegated prefix, which can be one of following values: - `INITIALIZING` The public delegated prefix is being initialized and addresses cannot be created yet. - `READY_TO_ANNOUNCE` The public delegated prefix is a live migration prefix and is active. - `ANNOUNCED` The public delegated prefix is active. - `DELETING` The public delegated prefix is being deprovsioned. ", "enum": [ "ANNOUNCED", + "ANNOUNCED_TO_GOOGLE", + "ANNOUNCED_TO_INTERNET", "DELETING", "INITIALIZING", "READY_TO_ANNOUNCE" ], "enumDescriptions": [ "The public delegated prefix is active.", + "The prefix is announced within Google network.", + "The prefix is announced to Internet and within Google.", "The public delegated prefix is being deprovsioned.", "The public delegated prefix is being initialized and addresses cannot be created yet.", "The public delegated prefix is currently withdrawn but ready to be announced." @@ -77683,6 +77895,10 @@ "$ref": "CustomerEncryptionKey", "description": "The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key." }, + "sourceDiskForRecoveryCheckpoint": { + "description": "The source disk whose recovery checkpoint will be used to create this snapshot.", + "type": "string" + }, "sourceDiskId": { "description": "[Output Only] The ID value of the disk used to create this snapshot. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given disk name.", "type": "string" diff --git a/compute/v0.beta/compute-gen.go b/compute/v0.beta/compute-gen.go index d507d5986c7..90d5c9dcefd 100644 --- a/compute/v0.beta/compute-gen.go +++ b/compute/v0.beta/compute-gen.go @@ -5975,25 +5975,26 @@ type BackendService struct { // identifier is defined by the server. Id uint64 `json:"id,omitempty,string"` - // IpAddressSelectionPolicy: Specifies preference of traffic to the - // backend (from the proxy and from the client for proxyless gRPC). The - // possible values are: - IPV4_ONLY: Only send IPv4 traffic to the - // backends of the Backend Service (Instance Group, Managed Instance - // Group, Network Endpoint Group) regardless of traffic from the client - // to the proxy. Only IPv4 health-checks are used to check the health of - // the backends. This is the default setting. - PREFER_IPV6: Prioritize - // the connection to the endpoints IPv6 address over its IPv4 address - // (provided there is a healthy IPv6 address). - IPV6_ONLY: Only send - // IPv6 traffic to the backends of the Backend Service (Instance Group, - // Managed Instance Group, Network Endpoint Group) regardless of traffic - // from the client to the proxy. Only IPv6 health-checks are used to - // check the health of the backends. This field is applicable to either: - // - Advanced Global External HTTPS Load Balancing (load balancing - // scheme EXTERNAL_MANAGED), - Regional External HTTPS Load Balancing, - - // Internal TCP Proxy (load balancing scheme INTERNAL_MANAGED), - - // Regional Internal HTTPS Load Balancing (load balancing scheme - // INTERNAL_MANAGED), - Traffic Director with Envoy proxies and - // proxyless gRPC (load balancing scheme INTERNAL_SELF_MANAGED). + // IpAddressSelectionPolicy: Specifies a preference for traffic sent + // from the proxy to the backend (or from the client to the backend for + // proxyless gRPC). The possible values are: - IPV4_ONLY: Only send IPv4 + // traffic to the backends of the backend service (Instance Group, + // Managed Instance Group, Network Endpoint Group), regardless of + // traffic from the client to the proxy. Only IPv4 health checks are + // used to check the health of the backends. This is the default + // setting. - PREFER_IPV6: Prioritize the connection to the endpoint's + // IPv6 address over its IPv4 address (provided there is a healthy IPv6 + // address). - IPV6_ONLY: Only send IPv6 traffic to the backends of the + // backend service (Instance Group, Managed Instance Group, Network + // Endpoint Group), regardless of traffic from the client to the proxy. + // Only IPv6 health checks are used to check the health of the backends. + // This field is applicable to either: - Advanced Global External HTTPS + // Load Balancing (load balancing scheme EXTERNAL_MANAGED), - Regional + // External HTTPS Load Balancing, - Internal TCP Proxy (load balancing + // scheme INTERNAL_MANAGED), - Regional Internal HTTPS Load Balancing + // (load balancing scheme INTERNAL_MANAGED), - Traffic Director with + // Envoy proxies and proxyless gRPC (load balancing scheme + // INTERNAL_SELF_MANAGED). // // Possible values: // "IPV4_ONLY" - Only send IPv4 traffic to the backends of the Backend @@ -41819,7 +41820,7 @@ type Project struct { // // Possible values: // "CAMP_PLUS_ANNUAL" - Plus tier protection annual. - // "CAMP_PLUS_MONTHLY" - Plus tier protection monthly. + // "CAMP_PLUS_PAYGO" - Plus tier protection monthly. // "CA_STANDARD" - Standard protection. ManagedProtectionTier string `json:"managedProtectionTier,omitempty"` @@ -42055,7 +42056,7 @@ type ProjectsSetManagedProtectionTierRequest struct { // // Possible values: // "CAMP_PLUS_ANNUAL" - Plus tier protection annual. - // "CAMP_PLUS_MONTHLY" - Plus tier protection monthly. + // "CAMP_PLUS_PAYGO" - Plus tier protection monthly. // "CA_STANDARD" - Standard protection. ManagedProtectionTier string `json:"managedProtectionTier,omitempty"` @@ -42089,6 +42090,18 @@ func (s *ProjectsSetManagedProtectionTierRequest) MarshalJSON() ([]byte, error) // IP prefix is a single unit of route advertisement and is announced // globally to the internet. type PublicAdvertisedPrefix struct { + // ByoipApiVersion: [Output Only] The version of BYOIP API. + // + // Possible values: + // "V1" - This public advertised prefix can be used to create both + // regional and global public delegated prefixes. It usually takes 4 + // weeks to create or delete a public delegated prefix. The BGP status + // cannot be changed. + // "V2" - This public advertised prefix can only be used to create + // regional public delegated prefixes. Public delegated prefix creation + // and deletion takes minutes and the BGP status can be modified. + ByoipApiVersion string `json:"byoipApiVersion,omitempty"` + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text // format. CreationTimestamp string `json:"creationTimestamp,omitempty"` @@ -42131,6 +42144,24 @@ type PublicAdvertisedPrefix struct { // last character, which cannot be a dash. Name string `json:"name,omitempty"` + // PdpScope: Specifies how child public delegated prefix will be scoped. + // It could be one of following values: - `REGIONAL`: The public + // delegated prefix is regional only. The provisioning will take a few + // minutes. - `GLOBAL`: The public delegated prefix is global only. The + // provisioning will take ~4 weeks. - `GLOBAL_AND_REGIONAL` [output + // only]: The public delegated prefixes is BYOIP V1 legacy prefix. This + // is output only value and no longer supported in BYOIP V2. + // + // Possible values: + // "GLOBAL" - The public delegated prefix is global only. The + // provisioning will take ~4 weeks. + // "GLOBAL_AND_REGIONAL" - The public delegated prefixes is BYOIP V1 + // legacy prefix. This is output only value and no longer supported in + // BYOIP V2. + // "REGIONAL" - The public delegated prefix is regional only. The + // provisioning will take a few minutes. + PdpScope string `json:"pdpScope,omitempty"` + // PublicDelegatedPrefixs: [Output Only] The list of public delegated // prefixes that exist for this public advertised prefix. PublicDelegatedPrefixs []*PublicAdvertisedPrefixPublicDelegatedPrefix `json:"publicDelegatedPrefixs,omitempty"` @@ -42152,12 +42183,15 @@ type PublicAdvertisedPrefix struct { // removed. // // Possible values: + // "ANNOUNCED_TO_INTERNET" - The prefix is announced to Internet. // "INITIAL" - RPKI validation is complete. // "PREFIX_CONFIGURATION_COMPLETE" - The prefix is fully configured. // "PREFIX_CONFIGURATION_IN_PROGRESS" - The prefix is being // configured. // "PREFIX_REMOVAL_IN_PROGRESS" - The prefix is being removed. // "PTR_CONFIGURED" - User has configured the PTR. + // "READY_TO_ANNOUNCE" - The prefix is currently withdrawn but ready + // to be announced. // "REVERSE_DNS_LOOKUP_FAILED" - Reverse DNS lookup failed. // "VALIDATED" - Reverse DNS lookup is successful. Status string `json:"status,omitempty"` @@ -42166,15 +42200,15 @@ type PublicAdvertisedPrefix struct { // server. googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "CreationTimestamp") - // to unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "ByoipApiVersion") 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. "CreationTimestamp") to + // NullFields is a list of field names (e.g. "ByoipApiVersion") 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 @@ -42434,6 +42468,17 @@ func (s *PublicAdvertisedPrefixPublicDelegatedPrefix) MarshalJSON() ([]byte, err // may be further broken up into smaller IP blocks in the same scope as // the parent block. type PublicDelegatedPrefix struct { + // ByoipApiVersion: [Output Only] The version of BYOIP API. + // + // Possible values: + // "V1" - This public delegated prefix usually takes 4 weeks to + // delete, and the BGP status cannot be changed. Announce and Withdraw + // APIs can not be used on this prefix. + // "V2" - This public delegated prefix takes minutes to delete. + // Announce and Withdraw APIs can be used on this prefix to change the + // BGP status. + ByoipApiVersion string `json:"byoipApiVersion,omitempty"` + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text // format. CreationTimestamp string `json:"creationTimestamp,omitempty"` @@ -42502,6 +42547,10 @@ type PublicDelegatedPrefix struct { // // Possible values: // "ANNOUNCED" - The public delegated prefix is active. + // "ANNOUNCED_TO_GOOGLE" - The prefix is announced within Google + // network. + // "ANNOUNCED_TO_INTERNET" - The prefix is announced to Internet and + // within Google. // "DELETING" - The public delegated prefix is being deprovsioned. // "INITIALIZING" - The public delegated prefix is being initialized // and addresses cannot be created yet. @@ -42513,15 +42562,15 @@ type PublicDelegatedPrefix struct { // server. googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "CreationTimestamp") - // to unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "ByoipApiVersion") 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. "CreationTimestamp") to + // NullFields is a list of field names (e.g. "ByoipApiVersion") 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 @@ -54812,6 +54861,10 @@ type Snapshot struct { // customer-supplied encryption key. SourceDiskEncryptionKey *CustomerEncryptionKey `json:"sourceDiskEncryptionKey,omitempty"` + // SourceDiskForRecoveryCheckpoint: The source disk whose recovery + // checkpoint will be used to create this snapshot. + SourceDiskForRecoveryCheckpoint string `json:"sourceDiskForRecoveryCheckpoint,omitempty"` + // SourceDiskId: [Output Only] The ID value of the disk used to create // this snapshot. This value may be used to determine whether the // snapshot was taken from the current or a previous instance of a given @@ -155929,6 +155982,172 @@ func (c *ProjectsSetUsageExportBucketCall) Do(opts ...googleapi.CallOption) (*Op } +// method id "compute.publicAdvertisedPrefixes.announce": + +type PublicAdvertisedPrefixesAnnounceCall struct { + s *Service + project string + publicAdvertisedPrefix string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Announce: Announces the specified PublicAdvertisedPrefix +// +// - project: Project ID for this request. +// - publicAdvertisedPrefix: The name of the public advertised prefix. +// It should comply with RFC1035. +func (r *PublicAdvertisedPrefixesService) Announce(project string, publicAdvertisedPrefix string) *PublicAdvertisedPrefixesAnnounceCall { + c := &PublicAdvertisedPrefixesAnnounceCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.publicAdvertisedPrefix = publicAdvertisedPrefix + return c +} + +// RequestId sets the optional parameter "requestId": An optional +// request ID to identify requests. Specify a unique request ID so that +// if you must retry your request, the server will know to ignore the +// request if it has already been completed. For example, consider a +// situation where you make an initial request and the request times +// out. If you make the request again with the same request ID, the +// server can check if original operation with the same request ID was +// received, and if so, will ignore the second request. This prevents +// clients from accidentally creating duplicate commitments. The request +// ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *PublicAdvertisedPrefixesAnnounceCall) RequestId(requestId string) *PublicAdvertisedPrefixesAnnounceCall { + c.urlParams_.Set("requestId", requestId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PublicAdvertisedPrefixesAnnounceCall) Fields(s ...googleapi.Field) *PublicAdvertisedPrefixesAnnounceCall { + 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 *PublicAdvertisedPrefixesAnnounceCall) Context(ctx context.Context) *PublicAdvertisedPrefixesAnnounceCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *PublicAdvertisedPrefixesAnnounceCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *PublicAdvertisedPrefixesAnnounceCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}/announce") + 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{ + "project": c.project, + "publicAdvertisedPrefix": c.publicAdvertisedPrefix, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.publicAdvertisedPrefixes.announce" 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 *PublicAdvertisedPrefixesAnnounceCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Announces the specified PublicAdvertisedPrefix", + // "flatPath": "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}/announce", + // "httpMethod": "POST", + // "id": "compute.publicAdvertisedPrefixes.announce", + // "parameterOrder": [ + // "project", + // "publicAdvertisedPrefix" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "publicAdvertisedPrefix": { + // "description": "The name of the public advertised prefix. It should comply with RFC1035.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "requestId": { + // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}/announce", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + // method id "compute.publicAdvertisedPrefixes.delete": type PublicAdvertisedPrefixesDeleteCall struct { @@ -156880,6 +157099,172 @@ func (c *PublicAdvertisedPrefixesPatchCall) Do(opts ...googleapi.CallOption) (*O } +// method id "compute.publicAdvertisedPrefixes.withdraw": + +type PublicAdvertisedPrefixesWithdrawCall struct { + s *Service + project string + publicAdvertisedPrefix string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Withdraw: Withdraws the specified PublicAdvertisedPrefix +// +// - project: Project ID for this request. +// - publicAdvertisedPrefix: The name of the public advertised prefix. +// It should comply with RFC1035. +func (r *PublicAdvertisedPrefixesService) Withdraw(project string, publicAdvertisedPrefix string) *PublicAdvertisedPrefixesWithdrawCall { + c := &PublicAdvertisedPrefixesWithdrawCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.publicAdvertisedPrefix = publicAdvertisedPrefix + return c +} + +// RequestId sets the optional parameter "requestId": An optional +// request ID to identify requests. Specify a unique request ID so that +// if you must retry your request, the server will know to ignore the +// request if it has already been completed. For example, consider a +// situation where you make an initial request and the request times +// out. If you make the request again with the same request ID, the +// server can check if original operation with the same request ID was +// received, and if so, will ignore the second request. This prevents +// clients from accidentally creating duplicate commitments. The request +// ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *PublicAdvertisedPrefixesWithdrawCall) RequestId(requestId string) *PublicAdvertisedPrefixesWithdrawCall { + c.urlParams_.Set("requestId", requestId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PublicAdvertisedPrefixesWithdrawCall) Fields(s ...googleapi.Field) *PublicAdvertisedPrefixesWithdrawCall { + 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 *PublicAdvertisedPrefixesWithdrawCall) Context(ctx context.Context) *PublicAdvertisedPrefixesWithdrawCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *PublicAdvertisedPrefixesWithdrawCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *PublicAdvertisedPrefixesWithdrawCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}/withdraw") + 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{ + "project": c.project, + "publicAdvertisedPrefix": c.publicAdvertisedPrefix, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.publicAdvertisedPrefixes.withdraw" 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 *PublicAdvertisedPrefixesWithdrawCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Withdraws the specified PublicAdvertisedPrefix", + // "flatPath": "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}/withdraw", + // "httpMethod": "POST", + // "id": "compute.publicAdvertisedPrefixes.withdraw", + // "parameterOrder": [ + // "project", + // "publicAdvertisedPrefix" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "publicAdvertisedPrefix": { + // "description": "The name of the public advertised prefix. It should comply with RFC1035.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "requestId": { + // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}/withdraw", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + // method id "compute.publicDelegatedPrefixes.aggregatedList": type PublicDelegatedPrefixesAggregatedListCall struct { @@ -157191,6 +157576,185 @@ func (c *PublicDelegatedPrefixesAggregatedListCall) Pages(ctx context.Context, f } } +// method id "compute.publicDelegatedPrefixes.announce": + +type PublicDelegatedPrefixesAnnounceCall struct { + s *Service + project string + region string + publicDelegatedPrefix string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Announce: Announces the specified PublicDelegatedPrefix in the given +// region. +// +// - project: Project ID for this request. +// - publicDelegatedPrefix: The name of the public delegated prefix. It +// should comply with RFC1035. +// - region: The name of the region where the public delegated prefix is +// located. It should comply with RFC1035. +func (r *PublicDelegatedPrefixesService) Announce(project string, region string, publicDelegatedPrefix string) *PublicDelegatedPrefixesAnnounceCall { + c := &PublicDelegatedPrefixesAnnounceCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + c.publicDelegatedPrefix = publicDelegatedPrefix + return c +} + +// RequestId sets the optional parameter "requestId": An optional +// request ID to identify requests. Specify a unique request ID so that +// if you must retry your request, the server will know to ignore the +// request if it has already been completed. For example, consider a +// situation where you make an initial request and the request times +// out. If you make the request again with the same request ID, the +// server can check if original operation with the same request ID was +// received, and if so, will ignore the second request. This prevents +// clients from accidentally creating duplicate commitments. The request +// ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *PublicDelegatedPrefixesAnnounceCall) RequestId(requestId string) *PublicDelegatedPrefixesAnnounceCall { + c.urlParams_.Set("requestId", requestId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PublicDelegatedPrefixesAnnounceCall) Fields(s ...googleapi.Field) *PublicDelegatedPrefixesAnnounceCall { + 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 *PublicDelegatedPrefixesAnnounceCall) Context(ctx context.Context) *PublicDelegatedPrefixesAnnounceCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *PublicDelegatedPrefixesAnnounceCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *PublicDelegatedPrefixesAnnounceCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}/announce") + 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{ + "project": c.project, + "region": c.region, + "publicDelegatedPrefix": c.publicDelegatedPrefix, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.publicDelegatedPrefixes.announce" 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 *PublicDelegatedPrefixesAnnounceCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Announces the specified PublicDelegatedPrefix in the given region.", + // "flatPath": "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}/announce", + // "httpMethod": "POST", + // "id": "compute.publicDelegatedPrefixes.announce", + // "parameterOrder": [ + // "project", + // "region", + // "publicDelegatedPrefix" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "publicDelegatedPrefix": { + // "description": "The name of the public delegated prefix. It should comply with RFC1035.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "The name of the region where the public delegated prefix is located. It should comply with RFC1035.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "requestId": { + // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}/announce", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + // method id "compute.publicDelegatedPrefixes.delete": type PublicDelegatedPrefixesDeleteCall struct { @@ -158206,6 +158770,185 @@ func (c *PublicDelegatedPrefixesPatchCall) Do(opts ...googleapi.CallOption) (*Op } +// method id "compute.publicDelegatedPrefixes.withdraw": + +type PublicDelegatedPrefixesWithdrawCall struct { + s *Service + project string + region string + publicDelegatedPrefix string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Withdraw: Withdraws the specified PublicDelegatedPrefix in the given +// region. +// +// - project: Project ID for this request. +// - publicDelegatedPrefix: The name of the public delegated prefix. It +// should comply with RFC1035. +// - region: The name of the region where the public delegated prefix is +// located. It should comply with RFC1035. +func (r *PublicDelegatedPrefixesService) Withdraw(project string, region string, publicDelegatedPrefix string) *PublicDelegatedPrefixesWithdrawCall { + c := &PublicDelegatedPrefixesWithdrawCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + c.publicDelegatedPrefix = publicDelegatedPrefix + return c +} + +// RequestId sets the optional parameter "requestId": An optional +// request ID to identify requests. Specify a unique request ID so that +// if you must retry your request, the server will know to ignore the +// request if it has already been completed. For example, consider a +// situation where you make an initial request and the request times +// out. If you make the request again with the same request ID, the +// server can check if original operation with the same request ID was +// received, and if so, will ignore the second request. This prevents +// clients from accidentally creating duplicate commitments. The request +// ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *PublicDelegatedPrefixesWithdrawCall) RequestId(requestId string) *PublicDelegatedPrefixesWithdrawCall { + c.urlParams_.Set("requestId", requestId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PublicDelegatedPrefixesWithdrawCall) Fields(s ...googleapi.Field) *PublicDelegatedPrefixesWithdrawCall { + 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 *PublicDelegatedPrefixesWithdrawCall) Context(ctx context.Context) *PublicDelegatedPrefixesWithdrawCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *PublicDelegatedPrefixesWithdrawCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *PublicDelegatedPrefixesWithdrawCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}/withdraw") + 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{ + "project": c.project, + "region": c.region, + "publicDelegatedPrefix": c.publicDelegatedPrefix, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.publicDelegatedPrefixes.withdraw" 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 *PublicDelegatedPrefixesWithdrawCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Withdraws the specified PublicDelegatedPrefix in the given region.", + // "flatPath": "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}/withdraw", + // "httpMethod": "POST", + // "id": "compute.publicDelegatedPrefixes.withdraw", + // "parameterOrder": [ + // "project", + // "region", + // "publicDelegatedPrefix" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "publicDelegatedPrefix": { + // "description": "The name of the public delegated prefix. It should comply with RFC1035.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "The name of the region where the public delegated prefix is located. It should comply with RFC1035.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "requestId": { + // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}/withdraw", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + // method id "compute.regionAutoscalers.delete": type RegionAutoscalersDeleteCall struct { diff --git a/contactcenterinsights/v1/contactcenterinsights-api.json b/contactcenterinsights/v1/contactcenterinsights-api.json index 15963128aea..4796f260e76 100644 --- a/contactcenterinsights/v1/contactcenterinsights-api.json +++ b/contactcenterinsights/v1/contactcenterinsights-api.json @@ -1384,7 +1384,7 @@ } } }, - "revision": "20230923", + "revision": "20231023", "rootUrl": "https://contactcenterinsights.googleapis.com/", "schemas": { "GoogleCloudContactcenterinsightsV1Analysis": { @@ -1668,6 +1668,14 @@ "format": "int32", "type": "integer" }, + "partialErrors": { + "description": "Output only. Partial errors during ingest operation that might cause the operation output to be incomplete.", + "items": { + "$ref": "GoogleRpcStatus" + }, + "readOnly": true, + "type": "array" + }, "request": { "$ref": "GoogleCloudContactcenterinsightsV1BulkAnalyzeConversationsRequest", "description": "The original request for bulk analyze." @@ -2018,7 +2026,7 @@ "type": "object" }, "GoogleCloudContactcenterinsightsV1ConversationDataSource": { - "description": "The conversation source, which is a combination of transcript and audio.", + "description": "The conversation source, which is a combination of transcript, audio, and metadata.", "id": "GoogleCloudContactcenterinsightsV1ConversationDataSource", "properties": { "dialogflowSource": { @@ -3972,6 +3980,14 @@ "format": "int32", "type": "integer" }, + "partialErrors": { + "description": "Output only. Partial errors during ingest operation that might cause the operation output to be incomplete.", + "items": { + "$ref": "GoogleRpcStatus" + }, + "readOnly": true, + "type": "array" + }, "request": { "$ref": "GoogleCloudContactcenterinsightsV1alpha1BulkAnalyzeConversationsRequest", "description": "The original request for bulk analyze." @@ -4217,7 +4233,7 @@ "type": "object" }, "GoogleCloudContactcenterinsightsV1alpha1ConversationDataSource": { - "description": "The conversation source, which is a combination of transcript and audio.", + "description": "The conversation source, which is a combination of transcript, audio, and metadata.", "id": "GoogleCloudContactcenterinsightsV1alpha1ConversationDataSource", "properties": { "dialogflowSource": { diff --git a/contactcenterinsights/v1/contactcenterinsights-gen.go b/contactcenterinsights/v1/contactcenterinsights-gen.go index 7ce88d76bf9..38b3ebc910b 100644 --- a/contactcenterinsights/v1/contactcenterinsights-gen.go +++ b/contactcenterinsights/v1/contactcenterinsights-gen.go @@ -674,6 +674,10 @@ type GoogleCloudContactcenterinsightsV1BulkAnalyzeConversationsMetadata struct { // failed so far. FailedAnalysesCount int64 `json:"failedAnalysesCount,omitempty"` + // PartialErrors: Output only. Partial errors during ingest operation + // that might cause the operation output to be incomplete. + PartialErrors []*GoogleRpcStatus `json:"partialErrors,omitempty"` + // Request: The original request for bulk analyze. Request *GoogleCloudContactcenterinsightsV1BulkAnalyzeConversationsRequest `json:"request,omitempty"` @@ -1178,7 +1182,8 @@ func (s *GoogleCloudContactcenterinsightsV1ConversationCallMetadata) MarshalJSON } // GoogleCloudContactcenterinsightsV1ConversationDataSource: The -// conversation source, which is a combination of transcript and audio. +// conversation source, which is a combination of transcript, audio, and +// metadata. type GoogleCloudContactcenterinsightsV1ConversationDataSource struct { // DialogflowSource: The source when the conversation comes from // Dialogflow. @@ -4501,6 +4506,10 @@ type GoogleCloudContactcenterinsightsV1alpha1BulkAnalyzeConversationsMetadata st // failed so far. FailedAnalysesCount int64 `json:"failedAnalysesCount,omitempty"` + // PartialErrors: Output only. Partial errors during ingest operation + // that might cause the operation output to be incomplete. + PartialErrors []*GoogleRpcStatus `json:"partialErrors,omitempty"` + // Request: The original request for bulk analyze. Request *GoogleCloudContactcenterinsightsV1alpha1BulkAnalyzeConversationsRequest `json:"request,omitempty"` @@ -4829,7 +4838,8 @@ func (s *GoogleCloudContactcenterinsightsV1alpha1ConversationCallMetadata) Marsh } // GoogleCloudContactcenterinsightsV1alpha1ConversationDataSource: The -// conversation source, which is a combination of transcript and audio. +// conversation source, which is a combination of transcript, audio, and +// metadata. type GoogleCloudContactcenterinsightsV1alpha1ConversationDataSource struct { // DialogflowSource: The source when the conversation comes from // Dialogflow. diff --git a/dialogflow/v2/dialogflow-api.json b/dialogflow/v2/dialogflow-api.json index 678a155ed1f..59b14668437 100644 --- a/dialogflow/v2/dialogflow-api.json +++ b/dialogflow/v2/dialogflow-api.json @@ -8327,7 +8327,7 @@ } } }, - "revision": "20230919", + "revision": "20231019", "rootUrl": "https://dialogflow.googleapis.com/", "schemas": { "GoogleCloudDialogflowCxV3AdvancedSettings": { @@ -14155,6 +14155,21 @@ }, "type": "object" }, + "GoogleCloudDialogflowV2EncryptionSpec": { + "description": "A customer-managed encryption key specification that can be applied to all created resources (e.g. Conversation).", + "id": "GoogleCloudDialogflowV2EncryptionSpec", + "properties": { + "kmsKey": { + "description": "Required. The name of customer-managed encryption key that is used to secure a resource and its sub-resources. If empty, the resource is secured by the default Google encryption key. Only the key in the same location as this resource is allowed to be used for encryption. Format: `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}`", + "type": "string" + }, + "name": { + "description": "Immutable. The resource name of the encryption key specification resource. Format: projects/{project}/locations/{location}/encryptionSpec", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDialogflowV2EntityType": { "description": "Each intent parameter has a type, called the entity type, which dictates exactly how data from an end-user expression is extracted. Dialogflow provides predefined system entities that can match many common types of data. For example, there are system entities for matching dates, times, colors, email addresses, and so on. You can also create your own custom entities for matching custom data. For example, you could define a vegetable entity that can match the types of vegetables available for purchase with a grocery store agent. For more information, see the [Entity guide](https://cloud.google.com/dialogflow/docs/entities-overview).", "id": "GoogleCloudDialogflowV2EntityType", @@ -15139,6 +15154,29 @@ }, "type": "object" }, + "GoogleCloudDialogflowV2InitializeEncryptionSpecMetadata": { + "description": "Metadata for initializing a location-level encryption specification.", + "id": "GoogleCloudDialogflowV2InitializeEncryptionSpecMetadata", + "properties": { + "request": { + "$ref": "GoogleCloudDialogflowV2InitializeEncryptionSpecRequest", + "description": "Output only. The original request for initialization.", + "readOnly": true + } + }, + "type": "object" + }, + "GoogleCloudDialogflowV2InitializeEncryptionSpecRequest": { + "description": "The request to initialize a location-level encryption specification.", + "id": "GoogleCloudDialogflowV2InitializeEncryptionSpecRequest", + "properties": { + "encryptionSpec": { + "$ref": "GoogleCloudDialogflowV2EncryptionSpec", + "description": "Required. The encryption spec used for CMEK encryption. It is required that the kms key is in the same region as the endpoint. The same key will be used for all provisioned resources, if encryption is available. If the kms_key_name is left empty, no encryption will be enforced." + } + }, + "type": "object" + }, "GoogleCloudDialogflowV2InputAudioConfig": { "description": "Instructs the speech recognizer how to process the audio content.", "id": "GoogleCloudDialogflowV2InputAudioConfig", @@ -18154,6 +18192,21 @@ }, "type": "object" }, + "GoogleCloudDialogflowV2beta1EncryptionSpec": { + "description": "A customer-managed encryption key specification that can be applied to all created resources (e.g. Conversation).", + "id": "GoogleCloudDialogflowV2beta1EncryptionSpec", + "properties": { + "kmsKey": { + "description": "Required. The name of customer-managed encryption key that is used to secure a resource and its sub-resources. If empty, the resource is secured by the default Google encryption key. Only the key in the same location as this resource is allowed to be used for encryption. Format: `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}`", + "type": "string" + }, + "name": { + "description": "Immutable. The resource name of the encryption key specification resource. Format: projects/{project}/locations/{location}/encryptionSpec", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDialogflowV2beta1EntityType": { "description": "Each intent parameter has a type, called the entity type, which dictates exactly how data from an end-user expression is extracted. Dialogflow provides predefined system entities that can match many common types of data. For example, there are system entities for matching dates, times, colors, email addresses, and so on. You can also create your own custom entities for matching custom data. For example, you could define a vegetable entity that can match the types of vegetables available for purchase with a grocery store agent. For more information, see the [Entity guide](https://cloud.google.com/dialogflow/docs/entities-overview).", "id": "GoogleCloudDialogflowV2beta1EntityType", @@ -18358,6 +18411,29 @@ }, "type": "object" }, + "GoogleCloudDialogflowV2beta1InitializeEncryptionSpecMetadata": { + "description": "Metadata for initializing a location-level encryption specification.", + "id": "GoogleCloudDialogflowV2beta1InitializeEncryptionSpecMetadata", + "properties": { + "request": { + "$ref": "GoogleCloudDialogflowV2beta1InitializeEncryptionSpecRequest", + "description": "Output only. The original request for initialization.", + "readOnly": true + } + }, + "type": "object" + }, + "GoogleCloudDialogflowV2beta1InitializeEncryptionSpecRequest": { + "description": "The request to initialize a location-level encryption specification.", + "id": "GoogleCloudDialogflowV2beta1InitializeEncryptionSpecRequest", + "properties": { + "encryptionSpec": { + "$ref": "GoogleCloudDialogflowV2beta1EncryptionSpec", + "description": "Required. The encryption spec used for CMEK encryption. It is required that the kms key is in the same region as the endpoint. The same key will be used for all provisioned resources, if encryption is available. If the kms_key_name is left empty, no encryption will be enforced." + } + }, + "type": "object" + }, "GoogleCloudDialogflowV2beta1Intent": { "description": "An intent categorizes an end-user's intention for one conversation turn. For each agent, you define many intents, where your combined intents can handle a complete conversation. When an end-user writes or says something, referred to as an end-user expression or end-user input, Dialogflow matches the end-user input to the best intent in your agent. Matching an intent is also known as intent classification. For more information, see the [intent guide](https://cloud.google.com/dialogflow/docs/intents-overview).", "id": "GoogleCloudDialogflowV2beta1Intent", diff --git a/dialogflow/v2/dialogflow-gen.go b/dialogflow/v2/dialogflow-gen.go index 177b7686c69..1f13acb6827 100644 --- a/dialogflow/v2/dialogflow-gen.go +++ b/dialogflow/v2/dialogflow-gen.go @@ -11396,6 +11396,47 @@ func (s *GoogleCloudDialogflowV2DtmfParameters) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudDialogflowV2EncryptionSpec: A customer-managed encryption +// key specification that can be applied to all created resources (e.g. +// Conversation). +type GoogleCloudDialogflowV2EncryptionSpec struct { + // KmsKey: Required. The name of customer-managed encryption key that is + // used to secure a resource and its sub-resources. If empty, the + // resource is secured by the default Google encryption key. Only the + // key in the same location as this resource is allowed to be used for + // encryption. Format: + // `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys + // /{key}` + KmsKey string `json:"kmsKey,omitempty"` + + // Name: Immutable. The resource name of the encryption key + // specification resource. Format: + // projects/{project}/locations/{location}/encryptionSpec + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "KmsKey") 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. "KmsKey") 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 *GoogleCloudDialogflowV2EncryptionSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDialogflowV2EncryptionSpec + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudDialogflowV2EntityType: Each intent parameter has a type, // called the entity type, which dictates exactly how data from an // end-user expression is extracted. Dialogflow provides predefined @@ -13412,6 +13453,69 @@ func (s *GoogleCloudDialogflowV2ImportDocumentsResponse) MarshalJSON() ([]byte, return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudDialogflowV2InitializeEncryptionSpecMetadata: Metadata for +// initializing a location-level encryption specification. +type GoogleCloudDialogflowV2InitializeEncryptionSpecMetadata struct { + // Request: Output only. The original request for initialization. + Request *GoogleCloudDialogflowV2InitializeEncryptionSpecRequest `json:"request,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Request") 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. "Request") 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 *GoogleCloudDialogflowV2InitializeEncryptionSpecMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDialogflowV2InitializeEncryptionSpecMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDialogflowV2InitializeEncryptionSpecRequest: The request +// to initialize a location-level encryption specification. +type GoogleCloudDialogflowV2InitializeEncryptionSpecRequest struct { + // EncryptionSpec: Required. The encryption spec used for CMEK + // encryption. It is required that the kms key is in the same region as + // the endpoint. The same key will be used for all provisioned + // resources, if encryption is available. If the kms_key_name is left + // empty, no encryption will be enforced. + EncryptionSpec *GoogleCloudDialogflowV2EncryptionSpec `json:"encryptionSpec,omitempty"` + + // ForceSendFields is a list of field names (e.g. "EncryptionSpec") 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. "EncryptionSpec") 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 *GoogleCloudDialogflowV2InitializeEncryptionSpecRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDialogflowV2InitializeEncryptionSpecRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudDialogflowV2InputAudioConfig: Instructs the speech // recognizer how to process the audio content. type GoogleCloudDialogflowV2InputAudioConfig struct { @@ -18847,6 +18951,47 @@ func (s *GoogleCloudDialogflowV2beta1DialogflowAssistAnswer) MarshalJSON() ([]by return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudDialogflowV2beta1EncryptionSpec: A customer-managed +// encryption key specification that can be applied to all created +// resources (e.g. Conversation). +type GoogleCloudDialogflowV2beta1EncryptionSpec struct { + // KmsKey: Required. The name of customer-managed encryption key that is + // used to secure a resource and its sub-resources. If empty, the + // resource is secured by the default Google encryption key. Only the + // key in the same location as this resource is allowed to be used for + // encryption. Format: + // `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys + // /{key}` + KmsKey string `json:"kmsKey,omitempty"` + + // Name: Immutable. The resource name of the encryption key + // specification resource. Format: + // projects/{project}/locations/{location}/encryptionSpec + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "KmsKey") 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. "KmsKey") 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 *GoogleCloudDialogflowV2beta1EncryptionSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDialogflowV2beta1EncryptionSpec + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudDialogflowV2beta1EntityType: Each intent parameter has a // type, called the entity type, which dictates exactly how data from an // end-user expression is extracted. Dialogflow provides predefined @@ -19251,6 +19396,69 @@ func (s *GoogleCloudDialogflowV2beta1ImportDocumentsResponse) MarshalJSON() ([]b return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudDialogflowV2beta1InitializeEncryptionSpecMetadata: +// Metadata for initializing a location-level encryption specification. +type GoogleCloudDialogflowV2beta1InitializeEncryptionSpecMetadata struct { + // Request: Output only. The original request for initialization. + Request *GoogleCloudDialogflowV2beta1InitializeEncryptionSpecRequest `json:"request,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Request") 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. "Request") 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 *GoogleCloudDialogflowV2beta1InitializeEncryptionSpecMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDialogflowV2beta1InitializeEncryptionSpecMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDialogflowV2beta1InitializeEncryptionSpecRequest: The +// request to initialize a location-level encryption specification. +type GoogleCloudDialogflowV2beta1InitializeEncryptionSpecRequest struct { + // EncryptionSpec: Required. The encryption spec used for CMEK + // encryption. It is required that the kms key is in the same region as + // the endpoint. The same key will be used for all provisioned + // resources, if encryption is available. If the kms_key_name is left + // empty, no encryption will be enforced. + EncryptionSpec *GoogleCloudDialogflowV2beta1EncryptionSpec `json:"encryptionSpec,omitempty"` + + // ForceSendFields is a list of field names (e.g. "EncryptionSpec") 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. "EncryptionSpec") 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 *GoogleCloudDialogflowV2beta1InitializeEncryptionSpecRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDialogflowV2beta1InitializeEncryptionSpecRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudDialogflowV2beta1Intent: An intent categorizes an // end-user's intention for one conversation turn. For each agent, you // define many intents, where your combined intents can handle a diff --git a/dialogflow/v2beta1/dialogflow-api.json b/dialogflow/v2beta1/dialogflow-api.json index 06de1511853..785fc2da516 100644 --- a/dialogflow/v2beta1/dialogflow-api.json +++ b/dialogflow/v2beta1/dialogflow-api.json @@ -7695,7 +7695,7 @@ } } }, - "revision": "20230919", + "revision": "20231019", "rootUrl": "https://dialogflow.googleapis.com/", "schemas": { "GoogleCloudDialogflowCxV3AdvancedSettings": { @@ -12461,6 +12461,21 @@ }, "type": "object" }, + "GoogleCloudDialogflowV2EncryptionSpec": { + "description": "A customer-managed encryption key specification that can be applied to all created resources (e.g. Conversation).", + "id": "GoogleCloudDialogflowV2EncryptionSpec", + "properties": { + "kmsKey": { + "description": "Required. The name of customer-managed encryption key that is used to secure a resource and its sub-resources. If empty, the resource is secured by the default Google encryption key. Only the key in the same location as this resource is allowed to be used for encryption. Format: `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}`", + "type": "string" + }, + "name": { + "description": "Immutable. The resource name of the encryption key specification resource. Format: projects/{project}/locations/{location}/encryptionSpec", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDialogflowV2EntityType": { "description": "Each intent parameter has a type, called the entity type, which dictates exactly how data from an end-user expression is extracted. Dialogflow provides predefined system entities that can match many common types of data. For example, there are system entities for matching dates, times, colors, email addresses, and so on. You can also create your own custom entities for matching custom data. For example, you could define a vegetable entity that can match the types of vegetables available for purchase with a grocery store agent. For more information, see the [Entity guide](https://cloud.google.com/dialogflow/docs/entities-overview).", "id": "GoogleCloudDialogflowV2EntityType", @@ -12704,6 +12719,29 @@ }, "type": "object" }, + "GoogleCloudDialogflowV2InitializeEncryptionSpecMetadata": { + "description": "Metadata for initializing a location-level encryption specification.", + "id": "GoogleCloudDialogflowV2InitializeEncryptionSpecMetadata", + "properties": { + "request": { + "$ref": "GoogleCloudDialogflowV2InitializeEncryptionSpecRequest", + "description": "Output only. The original request for initialization.", + "readOnly": true + } + }, + "type": "object" + }, + "GoogleCloudDialogflowV2InitializeEncryptionSpecRequest": { + "description": "The request to initialize a location-level encryption specification.", + "id": "GoogleCloudDialogflowV2InitializeEncryptionSpecRequest", + "properties": { + "encryptionSpec": { + "$ref": "GoogleCloudDialogflowV2EncryptionSpec", + "description": "Required. The encryption spec used for CMEK encryption. It is required that the kms key is in the same region as the endpoint. The same key will be used for all provisioned resources, if encryption is available. If the kms_key_name is left empty, no encryption will be enforced." + } + }, + "type": "object" + }, "GoogleCloudDialogflowV2InputDataset": { "description": "InputDataset used to create model or do evaluation. NextID:5", "id": "GoogleCloudDialogflowV2InputDataset", @@ -15523,6 +15561,21 @@ }, "type": "object" }, + "GoogleCloudDialogflowV2beta1EncryptionSpec": { + "description": "A customer-managed encryption key specification that can be applied to all created resources (e.g. Conversation).", + "id": "GoogleCloudDialogflowV2beta1EncryptionSpec", + "properties": { + "kmsKey": { + "description": "Required. The name of customer-managed encryption key that is used to secure a resource and its sub-resources. If empty, the resource is secured by the default Google encryption key. Only the key in the same location as this resource is allowed to be used for encryption. Format: `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}`", + "type": "string" + }, + "name": { + "description": "Immutable. The resource name of the encryption key specification resource. Format: projects/{project}/locations/{location}/encryptionSpec", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDialogflowV2beta1EntityType": { "description": "Each intent parameter has a type, called the entity type, which dictates exactly how data from an end-user expression is extracted. Dialogflow provides predefined system entities that can match many common types of data. For example, there are system entities for matching dates, times, colors, email addresses, and so on. You can also create your own custom entities for matching custom data. For example, you could define a vegetable entity that can match the types of vegetables available for purchase with a grocery store agent. For more information, see the [Entity guide](https://cloud.google.com/dialogflow/docs/entities-overview).", "id": "GoogleCloudDialogflowV2beta1EntityType", @@ -16397,6 +16450,29 @@ }, "type": "object" }, + "GoogleCloudDialogflowV2beta1InitializeEncryptionSpecMetadata": { + "description": "Metadata for initializing a location-level encryption specification.", + "id": "GoogleCloudDialogflowV2beta1InitializeEncryptionSpecMetadata", + "properties": { + "request": { + "$ref": "GoogleCloudDialogflowV2beta1InitializeEncryptionSpecRequest", + "description": "Output only. The original request for initialization.", + "readOnly": true + } + }, + "type": "object" + }, + "GoogleCloudDialogflowV2beta1InitializeEncryptionSpecRequest": { + "description": "The request to initialize a location-level encryption specification.", + "id": "GoogleCloudDialogflowV2beta1InitializeEncryptionSpecRequest", + "properties": { + "encryptionSpec": { + "$ref": "GoogleCloudDialogflowV2beta1EncryptionSpec", + "description": "Required. The encryption spec used for CMEK encryption. It is required that the kms key is in the same region as the endpoint. The same key will be used for all provisioned resources, if encryption is available. If the kms_key_name is left empty, no encryption will be enforced." + } + }, + "type": "object" + }, "GoogleCloudDialogflowV2beta1InputAudioConfig": { "description": "Instructs the speech recognizer on how to process the audio content.", "id": "GoogleCloudDialogflowV2beta1InputAudioConfig", diff --git a/dialogflow/v2beta1/dialogflow-gen.go b/dialogflow/v2beta1/dialogflow-gen.go index d20a0bea21a..246cf7f1182 100644 --- a/dialogflow/v2beta1/dialogflow-gen.go +++ b/dialogflow/v2beta1/dialogflow-gen.go @@ -9554,6 +9554,47 @@ func (s *GoogleCloudDialogflowV2DeployConversationModelOperationMetadata) Marsha return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudDialogflowV2EncryptionSpec: A customer-managed encryption +// key specification that can be applied to all created resources (e.g. +// Conversation). +type GoogleCloudDialogflowV2EncryptionSpec struct { + // KmsKey: Required. The name of customer-managed encryption key that is + // used to secure a resource and its sub-resources. If empty, the + // resource is secured by the default Google encryption key. Only the + // key in the same location as this resource is allowed to be used for + // encryption. Format: + // `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys + // /{key}` + KmsKey string `json:"kmsKey,omitempty"` + + // Name: Immutable. The resource name of the encryption key + // specification resource. Format: + // projects/{project}/locations/{location}/encryptionSpec + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "KmsKey") 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. "KmsKey") 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 *GoogleCloudDialogflowV2EncryptionSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDialogflowV2EncryptionSpec + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudDialogflowV2EntityType: Each intent parameter has a type, // called the entity type, which dictates exactly how data from an // end-user expression is extracted. Dialogflow provides predefined @@ -10029,6 +10070,69 @@ func (s *GoogleCloudDialogflowV2ImportDocumentsResponse) MarshalJSON() ([]byte, return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudDialogflowV2InitializeEncryptionSpecMetadata: Metadata for +// initializing a location-level encryption specification. +type GoogleCloudDialogflowV2InitializeEncryptionSpecMetadata struct { + // Request: Output only. The original request for initialization. + Request *GoogleCloudDialogflowV2InitializeEncryptionSpecRequest `json:"request,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Request") 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. "Request") 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 *GoogleCloudDialogflowV2InitializeEncryptionSpecMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDialogflowV2InitializeEncryptionSpecMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDialogflowV2InitializeEncryptionSpecRequest: The request +// to initialize a location-level encryption specification. +type GoogleCloudDialogflowV2InitializeEncryptionSpecRequest struct { + // EncryptionSpec: Required. The encryption spec used for CMEK + // encryption. It is required that the kms key is in the same region as + // the endpoint. The same key will be used for all provisioned + // resources, if encryption is available. If the kms_key_name is left + // empty, no encryption will be enforced. + EncryptionSpec *GoogleCloudDialogflowV2EncryptionSpec `json:"encryptionSpec,omitempty"` + + // ForceSendFields is a list of field names (e.g. "EncryptionSpec") 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. "EncryptionSpec") 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 *GoogleCloudDialogflowV2InitializeEncryptionSpecRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDialogflowV2InitializeEncryptionSpecRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudDialogflowV2InputDataset: InputDataset used to create // model or do evaluation. NextID:5 type GoogleCloudDialogflowV2InputDataset struct { @@ -14738,6 +14842,47 @@ func (s *GoogleCloudDialogflowV2beta1DtmfParameters) MarshalJSON() ([]byte, erro return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudDialogflowV2beta1EncryptionSpec: A customer-managed +// encryption key specification that can be applied to all created +// resources (e.g. Conversation). +type GoogleCloudDialogflowV2beta1EncryptionSpec struct { + // KmsKey: Required. The name of customer-managed encryption key that is + // used to secure a resource and its sub-resources. If empty, the + // resource is secured by the default Google encryption key. Only the + // key in the same location as this resource is allowed to be used for + // encryption. Format: + // `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys + // /{key}` + KmsKey string `json:"kmsKey,omitempty"` + + // Name: Immutable. The resource name of the encryption key + // specification resource. Format: + // projects/{project}/locations/{location}/encryptionSpec + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "KmsKey") 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. "KmsKey") 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 *GoogleCloudDialogflowV2beta1EncryptionSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDialogflowV2beta1EncryptionSpec + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudDialogflowV2beta1EntityType: Each intent parameter has a // type, called the entity type, which dictates exactly how data from an // end-user expression is extracted. Dialogflow provides predefined @@ -16538,6 +16683,69 @@ func (s *GoogleCloudDialogflowV2beta1ImportDocumentsResponse) MarshalJSON() ([]b return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudDialogflowV2beta1InitializeEncryptionSpecMetadata: +// Metadata for initializing a location-level encryption specification. +type GoogleCloudDialogflowV2beta1InitializeEncryptionSpecMetadata struct { + // Request: Output only. The original request for initialization. + Request *GoogleCloudDialogflowV2beta1InitializeEncryptionSpecRequest `json:"request,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Request") 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. "Request") 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 *GoogleCloudDialogflowV2beta1InitializeEncryptionSpecMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDialogflowV2beta1InitializeEncryptionSpecMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDialogflowV2beta1InitializeEncryptionSpecRequest: The +// request to initialize a location-level encryption specification. +type GoogleCloudDialogflowV2beta1InitializeEncryptionSpecRequest struct { + // EncryptionSpec: Required. The encryption spec used for CMEK + // encryption. It is required that the kms key is in the same region as + // the endpoint. The same key will be used for all provisioned + // resources, if encryption is available. If the kms_key_name is left + // empty, no encryption will be enforced. + EncryptionSpec *GoogleCloudDialogflowV2beta1EncryptionSpec `json:"encryptionSpec,omitempty"` + + // ForceSendFields is a list of field names (e.g. "EncryptionSpec") 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. "EncryptionSpec") 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 *GoogleCloudDialogflowV2beta1InitializeEncryptionSpecRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDialogflowV2beta1InitializeEncryptionSpecRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudDialogflowV2beta1InputAudioConfig: Instructs the speech // recognizer on how to process the audio content. type GoogleCloudDialogflowV2beta1InputAudioConfig struct { diff --git a/dialogflow/v3beta1/dialogflow-api.json b/dialogflow/v3beta1/dialogflow-api.json index 3c784d344c8..ac7e2132a35 100644 --- a/dialogflow/v3beta1/dialogflow-api.json +++ b/dialogflow/v3beta1/dialogflow-api.json @@ -4126,7 +4126,7 @@ } } }, - "revision": "20231011", + "revision": "20231019", "rootUrl": "https://dialogflow.googleapis.com/", "schemas": { "GoogleCloudDialogflowCxV3AdvancedSettings": { @@ -11635,6 +11635,21 @@ }, "type": "object" }, + "GoogleCloudDialogflowV2EncryptionSpec": { + "description": "A customer-managed encryption key specification that can be applied to all created resources (e.g. Conversation).", + "id": "GoogleCloudDialogflowV2EncryptionSpec", + "properties": { + "kmsKey": { + "description": "Required. The name of customer-managed encryption key that is used to secure a resource and its sub-resources. If empty, the resource is secured by the default Google encryption key. Only the key in the same location as this resource is allowed to be used for encryption. Format: `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}`", + "type": "string" + }, + "name": { + "description": "Immutable. The resource name of the encryption key specification resource. Format: projects/{project}/locations/{location}/encryptionSpec", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDialogflowV2EntityType": { "description": "Each intent parameter has a type, called the entity type, which dictates exactly how data from an end-user expression is extracted. Dialogflow provides predefined system entities that can match many common types of data. For example, there are system entities for matching dates, times, colors, email addresses, and so on. You can also create your own custom entities for matching custom data. For example, you could define a vegetable entity that can match the types of vegetables available for purchase with a grocery store agent. For more information, see the [Entity guide](https://cloud.google.com/dialogflow/docs/entities-overview).", "id": "GoogleCloudDialogflowV2EntityType", @@ -11878,6 +11893,29 @@ }, "type": "object" }, + "GoogleCloudDialogflowV2InitializeEncryptionSpecMetadata": { + "description": "Metadata for initializing a location-level encryption specification.", + "id": "GoogleCloudDialogflowV2InitializeEncryptionSpecMetadata", + "properties": { + "request": { + "$ref": "GoogleCloudDialogflowV2InitializeEncryptionSpecRequest", + "description": "Output only. The original request for initialization.", + "readOnly": true + } + }, + "type": "object" + }, + "GoogleCloudDialogflowV2InitializeEncryptionSpecRequest": { + "description": "The request to initialize a location-level encryption specification.", + "id": "GoogleCloudDialogflowV2InitializeEncryptionSpecRequest", + "properties": { + "encryptionSpec": { + "$ref": "GoogleCloudDialogflowV2EncryptionSpec", + "description": "Required. The encryption spec used for CMEK encryption. It is required that the kms key is in the same region as the endpoint. The same key will be used for all provisioned resources, if encryption is available. If the kms_key_name is left empty, no encryption will be enforced." + } + }, + "type": "object" + }, "GoogleCloudDialogflowV2InputDataset": { "description": "InputDataset used to create model or do evaluation. NextID:5", "id": "GoogleCloudDialogflowV2InputDataset", @@ -13577,6 +13615,21 @@ }, "type": "object" }, + "GoogleCloudDialogflowV2beta1EncryptionSpec": { + "description": "A customer-managed encryption key specification that can be applied to all created resources (e.g. Conversation).", + "id": "GoogleCloudDialogflowV2beta1EncryptionSpec", + "properties": { + "kmsKey": { + "description": "Required. The name of customer-managed encryption key that is used to secure a resource and its sub-resources. If empty, the resource is secured by the default Google encryption key. Only the key in the same location as this resource is allowed to be used for encryption. Format: `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}`", + "type": "string" + }, + "name": { + "description": "Immutable. The resource name of the encryption key specification resource. Format: projects/{project}/locations/{location}/encryptionSpec", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDialogflowV2beta1EntityType": { "description": "Each intent parameter has a type, called the entity type, which dictates exactly how data from an end-user expression is extracted. Dialogflow provides predefined system entities that can match many common types of data. For example, there are system entities for matching dates, times, colors, email addresses, and so on. You can also create your own custom entities for matching custom data. For example, you could define a vegetable entity that can match the types of vegetables available for purchase with a grocery store agent. For more information, see the [Entity guide](https://cloud.google.com/dialogflow/docs/entities-overview).", "id": "GoogleCloudDialogflowV2beta1EntityType", @@ -13781,6 +13834,29 @@ }, "type": "object" }, + "GoogleCloudDialogflowV2beta1InitializeEncryptionSpecMetadata": { + "description": "Metadata for initializing a location-level encryption specification.", + "id": "GoogleCloudDialogflowV2beta1InitializeEncryptionSpecMetadata", + "properties": { + "request": { + "$ref": "GoogleCloudDialogflowV2beta1InitializeEncryptionSpecRequest", + "description": "Output only. The original request for initialization.", + "readOnly": true + } + }, + "type": "object" + }, + "GoogleCloudDialogflowV2beta1InitializeEncryptionSpecRequest": { + "description": "The request to initialize a location-level encryption specification.", + "id": "GoogleCloudDialogflowV2beta1InitializeEncryptionSpecRequest", + "properties": { + "encryptionSpec": { + "$ref": "GoogleCloudDialogflowV2beta1EncryptionSpec", + "description": "Required. The encryption spec used for CMEK encryption. It is required that the kms key is in the same region as the endpoint. The same key will be used for all provisioned resources, if encryption is available. If the kms_key_name is left empty, no encryption will be enforced." + } + }, + "type": "object" + }, "GoogleCloudDialogflowV2beta1Intent": { "description": "An intent categorizes an end-user's intention for one conversation turn. For each agent, you define many intents, where your combined intents can handle a complete conversation. When an end-user writes or says something, referred to as an end-user expression or end-user input, Dialogflow matches the end-user input to the best intent in your agent. Matching an intent is also known as intent classification. For more information, see the [intent guide](https://cloud.google.com/dialogflow/docs/intents-overview).", "id": "GoogleCloudDialogflowV2beta1Intent", diff --git a/dialogflow/v3beta1/dialogflow-gen.go b/dialogflow/v3beta1/dialogflow-gen.go index 43929a5ded1..3e01e19350a 100644 --- a/dialogflow/v3beta1/dialogflow-gen.go +++ b/dialogflow/v3beta1/dialogflow-gen.go @@ -14228,6 +14228,47 @@ func (s *GoogleCloudDialogflowV2DeployConversationModelOperationMetadata) Marsha return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudDialogflowV2EncryptionSpec: A customer-managed encryption +// key specification that can be applied to all created resources (e.g. +// Conversation). +type GoogleCloudDialogflowV2EncryptionSpec struct { + // KmsKey: Required. The name of customer-managed encryption key that is + // used to secure a resource and its sub-resources. If empty, the + // resource is secured by the default Google encryption key. Only the + // key in the same location as this resource is allowed to be used for + // encryption. Format: + // `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys + // /{key}` + KmsKey string `json:"kmsKey,omitempty"` + + // Name: Immutable. The resource name of the encryption key + // specification resource. Format: + // projects/{project}/locations/{location}/encryptionSpec + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "KmsKey") 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. "KmsKey") 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 *GoogleCloudDialogflowV2EncryptionSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDialogflowV2EncryptionSpec + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudDialogflowV2EntityType: Each intent parameter has a type, // called the entity type, which dictates exactly how data from an // end-user expression is extracted. Dialogflow provides predefined @@ -14703,6 +14744,69 @@ func (s *GoogleCloudDialogflowV2ImportDocumentsResponse) MarshalJSON() ([]byte, return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudDialogflowV2InitializeEncryptionSpecMetadata: Metadata for +// initializing a location-level encryption specification. +type GoogleCloudDialogflowV2InitializeEncryptionSpecMetadata struct { + // Request: Output only. The original request for initialization. + Request *GoogleCloudDialogflowV2InitializeEncryptionSpecRequest `json:"request,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Request") 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. "Request") 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 *GoogleCloudDialogflowV2InitializeEncryptionSpecMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDialogflowV2InitializeEncryptionSpecMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDialogflowV2InitializeEncryptionSpecRequest: The request +// to initialize a location-level encryption specification. +type GoogleCloudDialogflowV2InitializeEncryptionSpecRequest struct { + // EncryptionSpec: Required. The encryption spec used for CMEK + // encryption. It is required that the kms key is in the same region as + // the endpoint. The same key will be used for all provisioned + // resources, if encryption is available. If the kms_key_name is left + // empty, no encryption will be enforced. + EncryptionSpec *GoogleCloudDialogflowV2EncryptionSpec `json:"encryptionSpec,omitempty"` + + // ForceSendFields is a list of field names (e.g. "EncryptionSpec") 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. "EncryptionSpec") 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 *GoogleCloudDialogflowV2InitializeEncryptionSpecRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDialogflowV2InitializeEncryptionSpecRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudDialogflowV2InputDataset: InputDataset used to create // model or do evaluation. NextID:5 type GoogleCloudDialogflowV2InputDataset struct { @@ -17505,6 +17609,47 @@ func (s *GoogleCloudDialogflowV2beta1DialogflowAssistAnswer) MarshalJSON() ([]by return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudDialogflowV2beta1EncryptionSpec: A customer-managed +// encryption key specification that can be applied to all created +// resources (e.g. Conversation). +type GoogleCloudDialogflowV2beta1EncryptionSpec struct { + // KmsKey: Required. The name of customer-managed encryption key that is + // used to secure a resource and its sub-resources. If empty, the + // resource is secured by the default Google encryption key. Only the + // key in the same location as this resource is allowed to be used for + // encryption. Format: + // `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys + // /{key}` + KmsKey string `json:"kmsKey,omitempty"` + + // Name: Immutable. The resource name of the encryption key + // specification resource. Format: + // projects/{project}/locations/{location}/encryptionSpec + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "KmsKey") 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. "KmsKey") 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 *GoogleCloudDialogflowV2beta1EncryptionSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDialogflowV2beta1EncryptionSpec + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudDialogflowV2beta1EntityType: Each intent parameter has a // type, called the entity type, which dictates exactly how data from an // end-user expression is extracted. Dialogflow provides predefined @@ -17909,6 +18054,69 @@ func (s *GoogleCloudDialogflowV2beta1ImportDocumentsResponse) MarshalJSON() ([]b return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudDialogflowV2beta1InitializeEncryptionSpecMetadata: +// Metadata for initializing a location-level encryption specification. +type GoogleCloudDialogflowV2beta1InitializeEncryptionSpecMetadata struct { + // Request: Output only. The original request for initialization. + Request *GoogleCloudDialogflowV2beta1InitializeEncryptionSpecRequest `json:"request,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Request") 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. "Request") 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 *GoogleCloudDialogflowV2beta1InitializeEncryptionSpecMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDialogflowV2beta1InitializeEncryptionSpecMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDialogflowV2beta1InitializeEncryptionSpecRequest: The +// request to initialize a location-level encryption specification. +type GoogleCloudDialogflowV2beta1InitializeEncryptionSpecRequest struct { + // EncryptionSpec: Required. The encryption spec used for CMEK + // encryption. It is required that the kms key is in the same region as + // the endpoint. The same key will be used for all provisioned + // resources, if encryption is available. If the kms_key_name is left + // empty, no encryption will be enforced. + EncryptionSpec *GoogleCloudDialogflowV2beta1EncryptionSpec `json:"encryptionSpec,omitempty"` + + // ForceSendFields is a list of field names (e.g. "EncryptionSpec") 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. "EncryptionSpec") 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 *GoogleCloudDialogflowV2beta1InitializeEncryptionSpecRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDialogflowV2beta1InitializeEncryptionSpecRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudDialogflowV2beta1Intent: An intent categorizes an // end-user's intention for one conversation turn. For each agent, you // define many intents, where your combined intents can handle a diff --git a/places/v1/places-api.json b/places/v1/places-api.json index 7365ad1a2c2..a750b3b3ce5 100644 --- a/places/v1/places-api.json +++ b/places/v1/places-api.json @@ -136,7 +136,7 @@ } } }, - "revision": "20231016", + "revision": "20231022", "rootUrl": "https://places.googleapis.com/", "schemas": { "GoogleGeoTypeViewport": { @@ -714,7 +714,7 @@ "type": "string" }, "regionCode": { - "description": "The Unicode country/region code (CLDR) of the location where the request is coming from. This parameter is used to display the place details, like region-specific place name, if available. The parameter can affect results based on applicable law. For more information, see http://www.unicode.org/reports/tr35/#unicode_region_subtag. Note that 3-digit region codes are not currently supported.", + "description": "The Unicode country/region code (CLDR) of the location where the request is coming from. This parameter is used to display the place details, like region-specific place name, if available. The parameter can affect results based on applicable law. For more information, see https://www.unicode.org/cldr/charts/latest/supplemental/territory_language_information.html. Note that 3-digit region codes are not currently supported.", "type": "string" }, "strictTypeFiltering": { diff --git a/places/v1/places-gen.go b/places/v1/places-gen.go index 5cf7800b2cb..c7d4bef210b 100644 --- a/places/v1/places-gen.go +++ b/places/v1/places-gen.go @@ -1005,8 +1005,8 @@ type GoogleMapsPlacesV1SearchTextRequest struct { // the place details, like region-specific place name, if available. The // parameter can affect results based on applicable law. For more // information, see - // http://www.unicode.org/reports/tr35/#unicode_region_subtag. Note that - // 3-digit region codes are not currently supported. + // https://www.unicode.org/cldr/charts/latest/supplemental/territory_language_information.html. + // Note that 3-digit region codes are not currently supported. RegionCode string `json:"regionCode,omitempty"` // StrictTypeFiltering: Used to set strict type filtering for diff --git a/securitycenter/v1/securitycenter-api.json b/securitycenter/v1/securitycenter-api.json index b349fddf31b..2e0449dbc5d 100644 --- a/securitycenter/v1/securitycenter-api.json +++ b/securitycenter/v1/securitycenter-api.json @@ -434,6 +434,98 @@ } } }, + "locations": { + "resources": { + "muteConfigs": { + "methods": { + "delete": { + "description": "Deletes an existing mute config.", + "flatPath": "v1/folders/{foldersId}/locations/{locationsId}/muteConfigs/{muteConfigsId}", + "httpMethod": "DELETE", + "id": "securitycenter.folders.locations.muteConfigs.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Name of the mute config to delete. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", + "location": "path", + "pattern": "^folders/[^/]+/locations/[^/]+/muteConfigs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Gets a mute config.", + "flatPath": "v1/folders/{foldersId}/locations/{locationsId}/muteConfigs/{muteConfigsId}", + "httpMethod": "GET", + "id": "securitycenter.folders.locations.muteConfigs.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Name of the mute config to retrieve. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", + "location": "path", + "pattern": "^folders/[^/]+/locations/[^/]+/muteConfigs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "patch": { + "description": "Updates a mute config.", + "flatPath": "v1/folders/{foldersId}/locations/{locationsId}/muteConfigs/{muteConfigsId}", + "httpMethod": "PATCH", + "id": "securitycenter.folders.locations.muteConfigs.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "This field will be ignored if provided on config creation. Format \"organizations/{organization}/muteConfigs/{mute_config}\" \"folders/{folder}/muteConfigs/{mute_config}\" \"projects/{project}/muteConfigs/{mute_config}\" \"organizations/{organization}/locations/global/muteConfigs/{mute_config}\" \"folders/{folder}/locations/global/muteConfigs/{mute_config}\" \"projects/{project}/locations/global/muteConfigs/{mute_config}\"", + "location": "path", + "pattern": "^folders/[^/]+/locations/[^/]+/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": "GoogleCloudSecuritycenterV1MuteConfig" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } + }, "muteConfigs": { "methods": { "create": { @@ -479,7 +571,7 @@ ], "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 mute config to delete. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", "location": "path", "pattern": "^folders/[^/]+/muteConfigs/[^/]+$", "required": true, @@ -504,7 +596,7 @@ ], "parameters": { "name": { - "description": "Required. Name of the mute config to retrieve. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, or projects/{project}/muteConfigs/{config_id}", + "description": "Required. Name of the mute config to retrieve. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", "location": "path", "pattern": "^folders/[^/]+/muteConfigs/[^/]+$", "required": true, @@ -565,7 +657,7 @@ ], "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": "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}\" \"organizations/{organization}/locations/global/muteConfigs/{mute_config}\" \"folders/{folder}/locations/global/muteConfigs/{mute_config}\" \"projects/{project}/locations/global/muteConfigs/{mute_config}\"", "location": "path", "pattern": "^folders/[^/]+/muteConfigs/[^/]+$", "required": true, @@ -935,6 +1027,34 @@ "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ] + }, + "simulate": { + "description": "Simulates a given SecurityHealthAnalyticsCustomModule and Resource.", + "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/customModules:simulate", + "httpMethod": "POST", + "id": "securitycenter.folders.securityHealthAnalyticsSettings.customModules.simulate", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The relative resource name of the organization, project, or folder. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name An example is: \"organizations/{organization_id}\".", + "location": "path", + "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/customModules:simulate", + "request": { + "$ref": "SimulateSecurityHealthAnalyticsCustomModuleRequest" + }, + "response": { + "$ref": "SimulateSecurityHealthAnalyticsCustomModuleResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] } } }, @@ -1920,6 +2040,98 @@ } } }, + "locations": { + "resources": { + "muteConfigs": { + "methods": { + "delete": { + "description": "Deletes an existing mute config.", + "flatPath": "v1/organizations/{organizationsId}/locations/{locationsId}/muteConfigs/{muteConfigsId}", + "httpMethod": "DELETE", + "id": "securitycenter.organizations.locations.muteConfigs.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Name of the mute config to delete. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", + "location": "path", + "pattern": "^organizations/[^/]+/locations/[^/]+/muteConfigs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Gets a mute config.", + "flatPath": "v1/organizations/{organizationsId}/locations/{locationsId}/muteConfigs/{muteConfigsId}", + "httpMethod": "GET", + "id": "securitycenter.organizations.locations.muteConfigs.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Name of the mute config to retrieve. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", + "location": "path", + "pattern": "^organizations/[^/]+/locations/[^/]+/muteConfigs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "patch": { + "description": "Updates a mute config.", + "flatPath": "v1/organizations/{organizationsId}/locations/{locationsId}/muteConfigs/{muteConfigsId}", + "httpMethod": "PATCH", + "id": "securitycenter.organizations.locations.muteConfigs.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "This field will be ignored if provided on config creation. Format \"organizations/{organization}/muteConfigs/{mute_config}\" \"folders/{folder}/muteConfigs/{mute_config}\" \"projects/{project}/muteConfigs/{mute_config}\" \"organizations/{organization}/locations/global/muteConfigs/{mute_config}\" \"folders/{folder}/locations/global/muteConfigs/{mute_config}\" \"projects/{project}/locations/global/muteConfigs/{mute_config}\"", + "location": "path", + "pattern": "^organizations/[^/]+/locations/[^/]+/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": "GoogleCloudSecuritycenterV1MuteConfig" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } + }, "muteConfigs": { "methods": { "create": { @@ -1965,7 +2177,7 @@ ], "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 mute config to delete. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", "location": "path", "pattern": "^organizations/[^/]+/muteConfigs/[^/]+$", "required": true, @@ -1990,7 +2202,7 @@ ], "parameters": { "name": { - "description": "Required. Name of the mute config to retrieve. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, or projects/{project}/muteConfigs/{config_id}", + "description": "Required. Name of the mute config to retrieve. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", "location": "path", "pattern": "^organizations/[^/]+/muteConfigs/[^/]+$", "required": true, @@ -2051,7 +2263,7 @@ ], "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": "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}\" \"organizations/{organization}/locations/global/muteConfigs/{mute_config}\" \"folders/{folder}/locations/global/muteConfigs/{mute_config}\" \"projects/{project}/locations/global/muteConfigs/{mute_config}\"", "location": "path", "pattern": "^organizations/[^/]+/muteConfigs/[^/]+$", "required": true, @@ -2693,6 +2905,34 @@ "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ] + }, + "simulate": { + "description": "Simulates a given SecurityHealthAnalyticsCustomModule and Resource.", + "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules:simulate", + "httpMethod": "POST", + "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.simulate", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The relative resource name of the organization, project, or folder. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name An example is: \"organizations/{organization_id}\".", + "location": "path", + "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/customModules:simulate", + "request": { + "$ref": "SimulateSecurityHealthAnalyticsCustomModuleRequest" + }, + "response": { + "$ref": "SimulateSecurityHealthAnalyticsCustomModuleResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] } } }, @@ -3868,6 +4108,98 @@ } } }, + "locations": { + "resources": { + "muteConfigs": { + "methods": { + "delete": { + "description": "Deletes an existing mute config.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/muteConfigs/{muteConfigsId}", + "httpMethod": "DELETE", + "id": "securitycenter.projects.locations.muteConfigs.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Name of the mute config to delete. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/muteConfigs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Gets a mute config.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/muteConfigs/{muteConfigsId}", + "httpMethod": "GET", + "id": "securitycenter.projects.locations.muteConfigs.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Name of the mute config to retrieve. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/muteConfigs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "patch": { + "description": "Updates a mute config.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/muteConfigs/{muteConfigsId}", + "httpMethod": "PATCH", + "id": "securitycenter.projects.locations.muteConfigs.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "This field will be ignored if provided on config creation. Format \"organizations/{organization}/muteConfigs/{mute_config}\" \"folders/{folder}/muteConfigs/{mute_config}\" \"projects/{project}/muteConfigs/{mute_config}\" \"organizations/{organization}/locations/global/muteConfigs/{mute_config}\" \"folders/{folder}/locations/global/muteConfigs/{mute_config}\" \"projects/{project}/locations/global/muteConfigs/{mute_config}\"", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/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": "GoogleCloudSecuritycenterV1MuteConfig" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } + }, "muteConfigs": { "methods": { "create": { @@ -3913,7 +4245,7 @@ ], "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 mute config to delete. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", "location": "path", "pattern": "^projects/[^/]+/muteConfigs/[^/]+$", "required": true, @@ -3938,7 +4270,7 @@ ], "parameters": { "name": { - "description": "Required. Name of the mute config to retrieve. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, or projects/{project}/muteConfigs/{config_id}", + "description": "Required. Name of the mute config to retrieve. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", "location": "path", "pattern": "^projects/[^/]+/muteConfigs/[^/]+$", "required": true, @@ -3999,7 +4331,7 @@ ], "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": "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}\" \"organizations/{organization}/locations/global/muteConfigs/{mute_config}\" \"folders/{folder}/locations/global/muteConfigs/{mute_config}\" \"projects/{project}/locations/global/muteConfigs/{mute_config}\"", "location": "path", "pattern": "^projects/[^/]+/muteConfigs/[^/]+$", "required": true, @@ -4369,6 +4701,34 @@ "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ] + }, + "simulate": { + "description": "Simulates a given SecurityHealthAnalyticsCustomModule and Resource.", + "flatPath": "v1/projects/{projectsId}/securityHealthAnalyticsSettings/customModules:simulate", + "httpMethod": "POST", + "id": "securitycenter.projects.securityHealthAnalyticsSettings.customModules.simulate", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The relative resource name of the organization, project, or folder. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name An example is: \"organizations/{organization_id}\".", + "location": "path", + "pattern": "^projects/[^/]+/securityHealthAnalyticsSettings$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/customModules:simulate", + "request": { + "$ref": "SimulateSecurityHealthAnalyticsCustomModuleRequest" + }, + "response": { + "$ref": "SimulateSecurityHealthAnalyticsCustomModuleResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] } } }, @@ -4750,7 +5110,7 @@ } } }, - "revision": "20231005", + "revision": "20231023", "rootUrl": "https://securitycenter.googleapis.com/", "schemas": { "Access": { @@ -6006,6 +6366,13 @@ "description": "Steps to address the finding.", "type": "string" }, + "orgPolicies": { + "description": "Contains information about the org policies associated with the finding.", + "items": { + "$ref": "OrgPolicy" + }, + "type": "array" + }, "parent": { "description": "The relative resource name of the source the finding belongs to. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name This field is immutable after creation time. For example: \"organizations/{organization_id}/sources/{source_id}\"", "type": "string" @@ -6363,7 +6730,7 @@ "type": "string" }, "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": "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}\" \"organizations/{organization}/locations/global/muteConfigs/{mute_config}\" \"folders/{folder}/locations/global/muteConfigs/{mute_config}\" \"projects/{project}/locations/global/muteConfigs/{mute_config}\"", "type": "string" }, "updateTime": { @@ -7918,6 +8285,17 @@ }, "type": "object" }, + "OrgPolicy": { + "description": "Contains information about the org policies associated with the finding.", + "id": "OrgPolicy", + "properties": { + "name": { + "description": "The resource name of the org policy. Example: \"organizations/{organization_id}/policies/{constraint_name}\"", + "type": "string" + } + }, + "type": "object" + }, "OrganizationSettings": { "description": "User specified settings that are attached to the Security Command Center organization.", "id": "OrganizationSettings", @@ -8385,6 +8763,74 @@ }, "type": "object" }, + "SimulateSecurityHealthAnalyticsCustomModuleRequest": { + "description": "Request message to simulate a CustomConfig against a given test resource. Maximum size of the request is 4 MB by default.", + "id": "SimulateSecurityHealthAnalyticsCustomModuleRequest", + "properties": { + "customConfig": { + "$ref": "GoogleCloudSecuritycenterV1CustomConfig", + "description": "Required. The user specified custom configuration to test." + }, + "resource": { + "$ref": "SimulatedResource", + "description": "Required. Resource data to simulate custom module against." + } + }, + "type": "object" + }, + "SimulateSecurityHealthAnalyticsCustomModuleResponse": { + "description": "Response message for simulating a SecurityHealthAnalyticsCustomModule against a given resource.", + "id": "SimulateSecurityHealthAnalyticsCustomModuleResponse", + "properties": { + "result": { + "$ref": "SimulatedResult", + "description": "Result for test case in the corresponding request." + } + }, + "type": "object" + }, + "SimulatedResource": { + "description": "Manually constructed resource. If the custom module only evaluates against the resource data, the iam_policy_data field can be omitted, and vice versa.", + "id": "SimulatedResource", + "properties": { + "iamPolicyData": { + "$ref": "Policy", + "description": "Optional. A representation of the IAM policy." + }, + "resourceData": { + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + }, + "description": "Optional. A representation of the GCP resource. Should match the GCP resource JSON format.", + "type": "object" + }, + "resourceType": { + "description": "Required. The type of the resource, e.g. `compute.googleapis.com/Disk`.", + "type": "string" + } + }, + "type": "object" + }, + "SimulatedResult": { + "description": "Possible test result.", + "id": "SimulatedResult", + "properties": { + "error": { + "$ref": "Status", + "description": "Error encountered during the test." + }, + "finding": { + "$ref": "Finding", + "description": "Finding that would be published for the test case, if a violation is detected." + }, + "noViolation": { + "$ref": "Empty", + "description": "Indicates that the test case does not trigger any violation." + } + }, + "type": "object" + }, "Simulation": { "description": "Attack path simulation", "id": "Simulation", diff --git a/securitycenter/v1/securitycenter-gen.go b/securitycenter/v1/securitycenter-gen.go index b3ff337c2b9..fe104a4f2da 100644 --- a/securitycenter/v1/securitycenter-gen.go +++ b/securitycenter/v1/securitycenter-gen.go @@ -162,6 +162,7 @@ func NewFoldersService(s *Service) *FoldersService { rs.Assets = NewFoldersAssetsService(s) rs.BigQueryExports = NewFoldersBigQueryExportsService(s) rs.Findings = NewFoldersFindingsService(s) + rs.Locations = NewFoldersLocationsService(s) rs.MuteConfigs = NewFoldersMuteConfigsService(s) rs.NotificationConfigs = NewFoldersNotificationConfigsService(s) rs.SecurityHealthAnalyticsSettings = NewFoldersSecurityHealthAnalyticsSettingsService(s) @@ -178,6 +179,8 @@ type FoldersService struct { Findings *FoldersFindingsService + Locations *FoldersLocationsService + MuteConfigs *FoldersMuteConfigsService NotificationConfigs *FoldersNotificationConfigsService @@ -214,6 +217,27 @@ type FoldersFindingsService struct { s *Service } +func NewFoldersLocationsService(s *Service) *FoldersLocationsService { + rs := &FoldersLocationsService{s: s} + rs.MuteConfigs = NewFoldersLocationsMuteConfigsService(s) + return rs +} + +type FoldersLocationsService struct { + s *Service + + MuteConfigs *FoldersLocationsMuteConfigsService +} + +func NewFoldersLocationsMuteConfigsService(s *Service) *FoldersLocationsMuteConfigsService { + rs := &FoldersLocationsMuteConfigsService{s: s} + return rs +} + +type FoldersLocationsMuteConfigsService struct { + s *Service +} + func NewFoldersMuteConfigsService(s *Service) *FoldersMuteConfigsService { rs := &FoldersMuteConfigsService{s: s} return rs @@ -304,6 +328,7 @@ func NewOrganizationsService(s *Service) *OrganizationsService { rs.BigQueryExports = NewOrganizationsBigQueryExportsService(s) rs.EventThreatDetectionSettings = NewOrganizationsEventThreatDetectionSettingsService(s) rs.Findings = NewOrganizationsFindingsService(s) + rs.Locations = NewOrganizationsLocationsService(s) rs.MuteConfigs = NewOrganizationsMuteConfigsService(s) rs.NotificationConfigs = NewOrganizationsNotificationConfigsService(s) rs.Operations = NewOrganizationsOperationsService(s) @@ -325,6 +350,8 @@ type OrganizationsService struct { Findings *OrganizationsFindingsService + Locations *OrganizationsLocationsService + MuteConfigs *OrganizationsMuteConfigsService NotificationConfigs *OrganizationsNotificationConfigsService @@ -388,6 +415,27 @@ type OrganizationsFindingsService struct { s *Service } +func NewOrganizationsLocationsService(s *Service) *OrganizationsLocationsService { + rs := &OrganizationsLocationsService{s: s} + rs.MuteConfigs = NewOrganizationsLocationsMuteConfigsService(s) + return rs +} + +type OrganizationsLocationsService struct { + s *Service + + MuteConfigs *OrganizationsLocationsMuteConfigsService +} + +func NewOrganizationsLocationsMuteConfigsService(s *Service) *OrganizationsLocationsMuteConfigsService { + rs := &OrganizationsLocationsMuteConfigsService{s: s} + return rs +} + +type OrganizationsLocationsMuteConfigsService struct { + s *Service +} + func NewOrganizationsMuteConfigsService(s *Service) *OrganizationsMuteConfigsService { rs := &OrganizationsMuteConfigsService{s: s} return rs @@ -576,6 +624,7 @@ func NewProjectsService(s *Service) *ProjectsService { rs.Assets = NewProjectsAssetsService(s) rs.BigQueryExports = NewProjectsBigQueryExportsService(s) rs.Findings = NewProjectsFindingsService(s) + rs.Locations = NewProjectsLocationsService(s) rs.MuteConfigs = NewProjectsMuteConfigsService(s) rs.NotificationConfigs = NewProjectsNotificationConfigsService(s) rs.SecurityHealthAnalyticsSettings = NewProjectsSecurityHealthAnalyticsSettingsService(s) @@ -592,6 +641,8 @@ type ProjectsService struct { Findings *ProjectsFindingsService + Locations *ProjectsLocationsService + MuteConfigs *ProjectsMuteConfigsService NotificationConfigs *ProjectsNotificationConfigsService @@ -628,6 +679,27 @@ type ProjectsFindingsService struct { s *Service } +func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { + rs := &ProjectsLocationsService{s: s} + rs.MuteConfigs = NewProjectsLocationsMuteConfigsService(s) + return rs +} + +type ProjectsLocationsService struct { + s *Service + + MuteConfigs *ProjectsLocationsMuteConfigsService +} + +func NewProjectsLocationsMuteConfigsService(s *Service) *ProjectsLocationsMuteConfigsService { + rs := &ProjectsLocationsMuteConfigsService{s: s} + return rs +} + +type ProjectsLocationsMuteConfigsService struct { + s *Service +} + func NewProjectsMuteConfigsService(s *Service) *ProjectsMuteConfigsService { rs := &ProjectsMuteConfigsService{s: s} return rs @@ -2662,6 +2734,10 @@ type Finding struct { // NextSteps: Steps to address the finding. NextSteps string `json:"nextSteps,omitempty"` + // OrgPolicies: Contains information about the org policies associated + // with the finding. + OrgPolicies []*OrgPolicy `json:"orgPolicies,omitempty"` + // Parent: The relative resource name of the source the finding belongs // to. See: // https://cloud.google.com/apis/design/resource_names#relative_resource_name @@ -3297,6 +3373,9 @@ type GoogleCloudSecuritycenterV1MuteConfig struct { // Format "organizations/{organization}/muteConfigs/{mute_config}" // "folders/{folder}/muteConfigs/{mute_config}" // "projects/{project}/muteConfigs/{mute_config}" + // "organizations/{organization}/locations/global/muteConfigs/{mute_confi + // g}" "folders/{folder}/locations/global/muteConfigs/{mute_config}" + // "projects/{project}/locations/global/muteConfigs/{mute_config}" Name string `json:"name,omitempty"` // UpdateTime: Output only. The most recent time at which the mute @@ -5762,6 +5841,36 @@ func (s *Operation) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// OrgPolicy: Contains information about the org policies associated +// with the finding. +type OrgPolicy struct { + // Name: The resource name of the org policy. Example: + // "organizations/{organization_id}/policies/{constraint_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 *OrgPolicy) MarshalJSON() ([]byte, error) { + type NoMethod OrgPolicy + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // OrganizationSettings: User specified settings that are attached to // the Security Command Center organization. type OrganizationSettings struct { @@ -6603,6 +6712,148 @@ func (s *SetMuteRequest) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// SimulateSecurityHealthAnalyticsCustomModuleRequest: Request message +// to simulate a CustomConfig against a given test resource. Maximum +// size of the request is 4 MB by default. +type SimulateSecurityHealthAnalyticsCustomModuleRequest struct { + // CustomConfig: Required. The user specified custom configuration to + // test. + CustomConfig *GoogleCloudSecuritycenterV1CustomConfig `json:"customConfig,omitempty"` + + // Resource: Required. Resource data to simulate custom module against. + Resource *SimulatedResource `json:"resource,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CustomConfig") 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. "CustomConfig") 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 *SimulateSecurityHealthAnalyticsCustomModuleRequest) MarshalJSON() ([]byte, error) { + type NoMethod SimulateSecurityHealthAnalyticsCustomModuleRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// SimulateSecurityHealthAnalyticsCustomModuleResponse: Response message +// for simulating a SecurityHealthAnalyticsCustomModule against a given +// resource. +type SimulateSecurityHealthAnalyticsCustomModuleResponse struct { + // Result: Result for test case in the corresponding request. + Result *SimulatedResult `json:"result,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Result") 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. "Result") 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 *SimulateSecurityHealthAnalyticsCustomModuleResponse) MarshalJSON() ([]byte, error) { + type NoMethod SimulateSecurityHealthAnalyticsCustomModuleResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// SimulatedResource: Manually constructed resource. If the custom +// module only evaluates against the resource data, the iam_policy_data +// field can be omitted, and vice versa. +type SimulatedResource struct { + // IamPolicyData: Optional. A representation of the IAM policy. + IamPolicyData *Policy `json:"iamPolicyData,omitempty"` + + // ResourceData: Optional. A representation of the GCP resource. Should + // match the GCP resource JSON format. + ResourceData googleapi.RawMessage `json:"resourceData,omitempty"` + + // ResourceType: Required. The type of the resource, e.g. + // `compute.googleapis.com/Disk`. + ResourceType string `json:"resourceType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "IamPolicyData") 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. "IamPolicyData") 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 *SimulatedResource) MarshalJSON() ([]byte, error) { + type NoMethod SimulatedResource + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// SimulatedResult: Possible test result. +type SimulatedResult struct { + // Error: Error encountered during the test. + Error *Status `json:"error,omitempty"` + + // Finding: Finding that would be published for the test case, if a + // violation is detected. + Finding *Finding `json:"finding,omitempty"` + + // NoViolation: Indicates that the test case does not trigger any + // violation. + NoViolation *Empty `json:"noViolation,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Error") 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. "Error") 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 *SimulatedResult) MarshalJSON() ([]byte, error) { + type NoMethod SimulatedResult + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // Simulation: Attack path simulation type Simulation struct { // CreateTime: Output only. Time simulation was created @@ -8732,43 +8983,35 @@ func (c *FoldersFindingsBulkMuteCall) Do(opts ...googleapi.CallOption) (*Operati } -// method id "securitycenter.folders.muteConfigs.create": +// method id "securitycenter.folders.locations.muteConfigs.delete": -type FoldersMuteConfigsCreateCall struct { - s *Service - parent string - googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersLocationsMuteConfigsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates a mute config. +// Delete: Deletes an existing mute 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 mute config to delete. Its format is +// organizations/{organization}/muteConfigs/{config_id}, +// folders/{folder}/muteConfigs/{config_id}, +// projects/{project}/muteConfigs/{config_id}, +// organizations/{organization}/locations/global/muteConfigs/{config_id +// }, folders/{folder}/locations/global/muteConfigs/{config_id}, or +// projects/{project}/locations/global/muteConfigs/{config_id}. +func (r *FoldersLocationsMuteConfigsService) Delete(name string) *FoldersLocationsMuteConfigsDeleteCall { + c := &FoldersLocationsMuteConfigsDeleteCall{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 *FoldersLocationsMuteConfigsDeleteCall) Fields(s ...googleapi.Field) *FoldersLocationsMuteConfigsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -8776,21 +9019,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 *FoldersLocationsMuteConfigsDeleteCall) Context(ctx context.Context) *FoldersLocationsMuteConfigsDeleteCall { c.ctx_ = 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 *FoldersLocationsMuteConfigsDeleteCall) 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 *FoldersLocationsMuteConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -8798,35 +9041,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.locations.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 *FoldersLocationsMuteConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8845,7 +9082,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, @@ -8857,33 +9094,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 an existing mute config.", + // "flatPath": "v1/folders/{foldersId}/locations/{locationsId}/muteConfigs/{muteConfigsId}", + // "httpMethod": "DELETE", + // "id": "securitycenter.folders.locations.muteConfigs.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 mute config to delete. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", // "location": "path", - // "pattern": "^folders/[^/]+$", + // "pattern": "^folders/[^/]+/locations/[^/]+/muteConfigs/[^/]+$", // "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" @@ -8892,24 +9121,28 @@ func (c *FoldersMuteConfigsCreateCall) Do(opts ...googleapi.CallOption) (*Google } -// method id "securitycenter.folders.muteConfigs.delete": +// method id "securitycenter.folders.locations.muteConfigs.get": -type FoldersMuteConfigsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersLocationsMuteConfigsGetCall 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 mute config. // -// - name: Name of the mute config to delete. Its format is +// - 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) Delete(name string) *FoldersMuteConfigsDeleteCall { - c := &FoldersMuteConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// folders/{folder}/muteConfigs/{config_id}, +// projects/{project}/muteConfigs/{config_id}, +// organizations/{organization}/locations/global/muteConfigs/{config_id +// }, folders/{folder}/locations/global/muteConfigs/{config_id}, or +// projects/{project}/locations/global/muteConfigs/{config_id}. +func (r *FoldersLocationsMuteConfigsService) Get(name string) *FoldersLocationsMuteConfigsGetCall { + c := &FoldersLocationsMuteConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -8917,41 +9150,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 *FoldersLocationsMuteConfigsGetCall) Fields(s ...googleapi.Field) *FoldersLocationsMuteConfigsGetCall { 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 *FoldersLocationsMuteConfigsGetCall) IfNoneMatch(entityTag string) *FoldersLocationsMuteConfigsGetCall { + 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 *FoldersLocationsMuteConfigsGetCall) Context(ctx context.Context) *FoldersLocationsMuteConfigsGetCall { c.ctx_ = 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 *FoldersLocationsMuteConfigsGetCall) 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 *FoldersLocationsMuteConfigsGetCall) doRequest(alt string) (*http.Response, 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 } @@ -8962,14 +9208,15 @@ 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.locations.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 *FoldersLocationsMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8988,7 +9235,7 @@ func (c *FoldersMuteConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, 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, @@ -9000,25 +9247,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 mute config.", + // "flatPath": "v1/folders/{foldersId}/locations/{locationsId}/muteConfigs/{muteConfigsId}", + // "httpMethod": "GET", + // "id": "securitycenter.folders.locations.muteConfigs.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 mute config to retrieve. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", // "location": "path", - // "pattern": "^folders/[^/]+/muteConfigs/[^/]+$", + // "pattern": "^folders/[^/]+/locations/[^/]+/muteConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1/{+name}", // "response": { - // "$ref": "Empty" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -9027,80 +9274,83 @@ func (c *FoldersMuteConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, } -// method id "securitycenter.folders.muteConfigs.get": +// method id "securitycenter.folders.locations.muteConfigs.patch": -type FoldersMuteConfigsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type FoldersLocationsMuteConfigsPatchCall struct { + s *Service + name string + googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a mute config. +// Patch: Updates a mute config. // -// - name: Name of the mute config to retrieve. Its format is -// organizations/{organization}/muteConfigs/{config_id}, -// folders/{folder}/muteConfigs/{config_id}, or -// projects/{project}/muteConfigs/{config_id}. -func (r *FoldersMuteConfigsService) Get(name string) *FoldersMuteConfigsGetCall { - c := &FoldersMuteConfigsGetCall{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}" +// "organizations/{organization}/locations/global/muteConfigs/{mute_con +// fig}" "folders/{folder}/locations/global/muteConfigs/{mute_config}" +// "projects/{project}/locations/global/muteConfigs/{mute_config}". +func (r *FoldersLocationsMuteConfigsService) Patch(name string, googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig) *FoldersLocationsMuteConfigsPatchCall { + c := &FoldersLocationsMuteConfigsPatchCall{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 *FoldersLocationsMuteConfigsPatchCall) UpdateMask(updateMask string) *FoldersLocationsMuteConfigsPatchCall { + 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 *FoldersMuteConfigsGetCall) Fields(s ...googleapi.Field) *FoldersMuteConfigsGetCall { +func (c *FoldersLocationsMuteConfigsPatchCall) Fields(s ...googleapi.Field) *FoldersLocationsMuteConfigsPatchCall { 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 *FoldersMuteConfigsGetCall) IfNoneMatch(entityTag string) *FoldersMuteConfigsGetCall { - 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 *FoldersMuteConfigsGetCall) Context(ctx context.Context) *FoldersMuteConfigsGetCall { +func (c *FoldersLocationsMuteConfigsPatchCall) Context(ctx context.Context) *FoldersLocationsMuteConfigsPatchCall { c.ctx_ = 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 *FoldersLocationsMuteConfigsPatchCall) 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 *FoldersLocationsMuteConfigsPatchCall) doRequest(alt string) (*http.Response, 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/{+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 } @@ -9111,7 +9361,7 @@ func (c *FoldersMuteConfigsGetCall) doRequest(alt string) (*http.Response, error return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.muteConfigs.get" call. +// Do executes the "securitycenter.folders.locations.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 @@ -9119,7 +9369,7 @@ func (c *FoldersMuteConfigsGetCall) doRequest(alt string) (*http.Response, error // response was returned 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 *FoldersLocationsMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9150,23 +9400,32 @@ func (c *FoldersMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleClo } return ret, nil // { - // "description": "Gets a mute config.", - // "flatPath": "v1/folders/{foldersId}/muteConfigs/{muteConfigsId}", - // "httpMethod": "GET", - // "id": "securitycenter.folders.muteConfigs.get", + // "description": "Updates a mute config.", + // "flatPath": "v1/folders/{foldersId}/locations/{locationsId}/muteConfigs/{muteConfigsId}", + // "httpMethod": "PATCH", + // "id": "securitycenter.folders.locations.muteConfigs.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the mute config to retrieve. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, or projects/{project}/muteConfigs/{config_id}", + // "description": "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}\" \"organizations/{organization}/locations/global/muteConfigs/{mute_config}\" \"folders/{folder}/locations/global/muteConfigs/{mute_config}\" \"projects/{project}/locations/global/muteConfigs/{mute_config}\"", // "location": "path", - // "pattern": "^folders/[^/]+/muteConfigs/[^/]+$", + // "pattern": "^folders/[^/]+/locations/[^/]+/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": "GoogleCloudSecuritycenterV1MuteConfig" // }, @@ -9177,98 +9436,82 @@ func (c *FoldersMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleClo } -// method id "securitycenter.folders.muteConfigs.list": +// method id "securitycenter.folders.muteConfigs.create": -type FoldersMuteConfigsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type FoldersMuteConfigsCreateCall struct { + s *Service + parent string + googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists mute configs. +// Create: Creates a mute config. // -// - parent: The parent, which owns the collection of mute configs. Its -// format is "organizations/[organization_id]", "folders/[folder_id]", +// - 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) List(parent string) *FoldersMuteConfigsListCall { - c := &FoldersMuteConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +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 } -// 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)) - 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) +// 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 *FoldersMuteConfigsListCall) Fields(s ...googleapi.Field) *FoldersMuteConfigsListCall { +func (c *FoldersMuteConfigsCreateCall) Fields(s ...googleapi.Field) *FoldersMuteConfigsCreateCall { 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 *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 *FoldersMuteConfigsListCall) Header() http.Header { +func (c *FoldersMuteConfigsCreateCall) 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 *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_ { 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}/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 } @@ -9279,14 +9522,15 @@ func (c *FoldersMuteConfigsListCall) doRequest(alt string) (*http.Response, erro 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 -// non-2xx status code is an error. Response headers are in either -// *ListMuteConfigsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use +// Do executes the "securitycenter.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 *FoldersMuteConfigsListCall) Do(opts ...googleapi.CallOption) (*ListMuteConfigsResponse, 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 { @@ -9305,7 +9549,7 @@ func (c *FoldersMuteConfigsListCall) Do(opts ...googleapi.CallOption) (*ListMute if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListMuteConfigsResponse{ + ret := &GoogleCloudSecuritycenterV1MuteConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9317,27 +9561,21 @@ func (c *FoldersMuteConfigsListCall) Do(opts ...googleapi.CallOption) (*ListMute } return ret, nil // { - // "description": "Lists mute configs.", + // "description": "Creates a mute config.", // "flatPath": "v1/folders/{foldersId}/muteConfigs", - // "httpMethod": "GET", - // "id": "securitycenter.folders.muteConfigs.list", + // "httpMethod": "POST", + // "id": "securitycenter.folders.muteConfigs.create", // "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 `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.", + // "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 parent, which owns the collection of mute configs. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", \"projects/[project_id]\".", + // "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/[^/]+$", // "required": true, @@ -9345,8 +9583,11 @@ func (c *FoldersMuteConfigsListCall) Do(opts ...googleapi.CallOption) (*ListMute // } // }, // "path": "v1/{+parent}/muteConfigs", + // "request": { + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" + // }, // "response": { - // "$ref": "ListMuteConfigsResponse" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -9355,62 +9596,35 @@ 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.muteConfigs.delete": -type FoldersMuteConfigsPatchCall struct { - s *Service - name string - googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersMuteConfigsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates a mute config. +// Delete: Deletes an existing mute 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 *FoldersMuteConfigsService) Patch(name string, googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig) *FoldersMuteConfigsPatchCall { - c := &FoldersMuteConfigsPatchCall{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}, +// projects/{project}/muteConfigs/{config_id}, +// organizations/{organization}/locations/global/muteConfigs/{config_id +// }, folders/{folder}/locations/global/muteConfigs/{config_id}, or +// projects/{project}/locations/global/muteConfigs/{config_id}. +func (r *FoldersMuteConfigsService) Delete(name string) *FoldersMuteConfigsDeleteCall { + c := &FoldersMuteConfigsDeleteCall{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) return 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 *FoldersMuteConfigsDeleteCall) Fields(s ...googleapi.Field) *FoldersMuteConfigsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -9418,21 +9632,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 *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 *FoldersMuteConfigsPatchCall) Header() http.Header { +func (c *FoldersMuteConfigsDeleteCall) 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 *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_ { @@ -9440,16 +9654,11 @@ 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) - 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 } @@ -9460,15 +9669,14 @@ func (c *FoldersMuteConfigsPatchCall) doRequest(alt string) (*http.Response, err 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.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) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9487,7 +9695,7 @@ func (c *FoldersMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleC 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, @@ -9499,34 +9707,25 @@ func (c *FoldersMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleC } return ret, nil // { - // "description": "Updates a mute config.", + // "description": "Deletes an existing mute config.", // "flatPath": "v1/folders/{foldersId}/muteConfigs/{muteConfigsId}", - // "httpMethod": "PATCH", - // "id": "securitycenter.folders.muteConfigs.patch", + // "httpMethod": "DELETE", + // "id": "securitycenter.folders.muteConfigs.delete", // "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 mute config to delete. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", // "location": "path", // "pattern": "^folders/[^/]+/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": "GoogleCloudSecuritycenterV1MuteConfig" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -9535,99 +9734,102 @@ func (c *FoldersMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleC } -// method id "securitycenter.folders.notificationConfigs.create": +// method id "securitycenter.folders.muteConfigs.get": -type FoldersNotificationConfigsCreateCall struct { - s *Service - parent string - notificationconfig *NotificationConfig - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersMuteConfigsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Create: Creates a notification config. +// Get: Gets a mute 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 *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 mute config to retrieve. Its format is +// organizations/{organization}/muteConfigs/{config_id}, +// folders/{folder}/muteConfigs/{config_id}, +// projects/{project}/muteConfigs/{config_id}, +// organizations/{organization}/locations/global/muteConfigs/{config_id +// }, folders/{folder}/locations/global/muteConfigs/{config_id}, or +// projects/{project}/locations/global/muteConfigs/{config_id}. +func (r *FoldersMuteConfigsService) Get(name string) *FoldersMuteConfigsGetCall { + c := &FoldersMuteConfigsGetCall{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 *FoldersMuteConfigsGetCall) Fields(s ...googleapi.Field) *FoldersMuteConfigsGetCall { 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 *FoldersMuteConfigsGetCall) IfNoneMatch(entityTag string) *FoldersMuteConfigsGetCall { + 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 *FoldersNotificationConfigsCreateCall) Context(ctx context.Context) *FoldersNotificationConfigsCreateCall { +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 *FoldersNotificationConfigsCreateCall) Header() http.Header { +func (c *FoldersMuteConfigsGetCall) 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 *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_ { 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 := 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.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 +// 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 *FoldersNotificationConfigsCreateCall) Do(opts ...googleapi.CallOption) (*NotificationConfig, 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 { @@ -9646,7 +9848,7 @@ func (c *FoldersNotificationConfigsCreateCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &NotificationConfig{ + ret := &GoogleCloudSecuritycenterV1MuteConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9658,33 +9860,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": "Gets a mute config.", + // "flatPath": "v1/folders/{foldersId}/muteConfigs/{muteConfigsId}", + // "httpMethod": "GET", + // "id": "securitycenter.folders.muteConfigs.get", // "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 mute config to retrieve. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", // "location": "path", - // "pattern": "^folders/[^/]+$", + // "pattern": "^folders/[^/]+/muteConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/notificationConfigs", - // "request": { - // "$ref": "NotificationConfig" - // }, + // "path": "v1/{+name}", // "response": { - // "$ref": "NotificationConfig" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -9693,84 +9887,116 @@ func (c *FoldersNotificationConfigsCreateCall) Do(opts ...googleapi.CallOption) } -// method id "securitycenter.folders.notificationConfigs.delete": +// method id "securitycenter.folders.muteConfigs.list": -type FoldersNotificationConfigsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersMuteConfigsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a notification config. +// List: Lists mute configs. // -// - 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 +// - 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 } -// 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 { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) +// 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)) 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 +// 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) + return 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 { + 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 *FoldersNotificationConfigsDeleteCall) Context(ctx context.Context) *FoldersNotificationConfigsDeleteCall { +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 *FoldersNotificationConfigsDeleteCall) Header() http.Header { +func (c *FoldersMuteConfigsListCall) 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 *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_ { 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}/muteConfigs") 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.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) { +// 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 { @@ -9789,7 +10015,7 @@ func (c *FoldersNotificationConfigsDeleteCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &ListMuteConfigsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9801,25 +10027,36 @@ 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": "Lists mute configs.", + // "flatPath": "v1/folders/{foldersId}/muteConfigs", + // "httpMethod": "GET", + // "id": "securitycenter.folders.muteConfigs.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "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]\".", + // "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]\".", // "location": "path", - // "pattern": "^folders/[^/]+/notificationConfigs/[^/]+$", + // "pattern": "^folders/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/muteConfigs", // "response": { - // "$ref": "Empty" + // "$ref": "ListMuteConfigsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -9828,80 +10065,104 @@ func (c *FoldersNotificationConfigsDeleteCall) Do(opts ...googleapi.CallOption) } -// method id "securitycenter.folders.notificationConfigs.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 *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) + } +} -type FoldersNotificationConfigsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// method id "securitycenter.folders.muteConfigs.patch": + +type FoldersMuteConfigsPatchCall struct { + s *Service + name string + googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a notification config. +// Patch: Updates a mute config. // -// - 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)} +// - 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}" +// "organizations/{organization}/locations/global/muteConfigs/{mute_con +// fig}" "folders/{folder}/locations/global/muteConfigs/{mute_config}" +// "projects/{project}/locations/global/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) return 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 *FoldersMuteConfigsPatchCall) Fields(s ...googleapi.Field) *FoldersMuteConfigsPatchCall { 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 *FoldersNotificationConfigsGetCall) Context(ctx context.Context) *FoldersNotificationConfigsGetCall { +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 *FoldersNotificationConfigsGetCall) Header() http.Header { +func (c *FoldersMuteConfigsPatchCall) 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 *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_ { 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/{+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 } @@ -9912,14 +10173,15 @@ func (c *FoldersNotificationConfigsGetCall) doRequest(alt string) (*http.Respons 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 +// 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 *FoldersNotificationConfigsGetCall) Do(opts ...googleapi.CallOption) (*NotificationConfig, 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 { @@ -9938,7 +10200,7 @@ func (c *FoldersNotificationConfigsGetCall) Do(opts ...googleapi.CallOption) (*N if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &NotificationConfig{ + ret := &GoogleCloudSecuritycenterV1MuteConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9950,25 +10212,34 @@ func (c *FoldersNotificationConfigsGetCall) Do(opts ...googleapi.CallOption) (*N } return ret, nil // { - // "description": "Gets a notification config.", - // "flatPath": "v1/folders/{foldersId}/notificationConfigs/{notificationConfigsId}", - // "httpMethod": "GET", - // "id": "securitycenter.folders.notificationConfigs.get", + // "description": "Updates a mute config.", + // "flatPath": "v1/folders/{foldersId}/muteConfigs/{muteConfigsId}", + // "httpMethod": "PATCH", + // "id": "securitycenter.folders.muteConfigs.patch", // "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": "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}\" \"organizations/{organization}/locations/global/muteConfigs/{mute_config}\" \"folders/{folder}/locations/global/muteConfigs/{mute_config}\" \"projects/{project}/locations/global/muteConfigs/{mute_config}\"", // "location": "path", - // "pattern": "^folders/[^/]+/notificationConfigs/[^/]+$", + // "pattern": "^folders/[^/]+/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": "NotificationConfig" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -9977,96 +10248,81 @@ func (c *FoldersNotificationConfigsGetCall) Do(opts ...googleapi.CallOption) (*N } -// method id "securitycenter.folders.notificationConfigs.list": +// method id "securitycenter.folders.notificationConfigs.create": -type FoldersNotificationConfigsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type FoldersNotificationConfigsCreateCall struct { + s *Service + parent string + notificationconfig *NotificationConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists notification configs. +// Create: Creates a notification config. // -// - 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: Resource name of the new notification config's parent. Its +// format is "organizations/[organization_id]", "folders/[folder_id]", +// or "projects/[project_id]". +func (r *FoldersNotificationConfigsService) Create(parent string, notificationconfig *NotificationConfig) *FoldersNotificationConfigsCreateCall { + c := &FoldersNotificationConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent + c.notificationconfig = notificationconfig return c } -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return in a single response. Default is 10, minimum is -// 1, maximum is 1000. -func (c *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) +// 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 *FoldersNotificationConfigsListCall) Fields(s ...googleapi.Field) *FoldersNotificationConfigsListCall { +func (c *FoldersNotificationConfigsCreateCall) Fields(s ...googleapi.Field) *FoldersNotificationConfigsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *FoldersNotificationConfigsListCall) IfNoneMatch(entityTag string) *FoldersNotificationConfigsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersNotificationConfigsListCall) Context(ctx context.Context) *FoldersNotificationConfigsListCall { +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 *FoldersNotificationConfigsListCall) Header() http.Header { +func (c *FoldersNotificationConfigsCreateCall) 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 *FoldersNotificationConfigsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationconfig) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/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 } @@ -10077,14 +10333,14 @@ 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 +// 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 *FoldersNotificationConfigsListCall) Do(opts ...googleapi.CallOption) (*ListNotificationConfigsResponse, error) { +func (c *FoldersNotificationConfigsCreateCall) Do(opts ...googleapi.CallOption) (*NotificationConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10103,7 +10359,7 @@ func (c *FoldersNotificationConfigsListCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListNotificationConfigsResponse{ + ret := &NotificationConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10115,27 +10371,21 @@ func (c *FoldersNotificationConfigsListCall) Do(opts ...googleapi.CallOption) (* } return ret, nil // { - // "description": "Lists notification configs.", + // "description": "Creates a notification config.", // "flatPath": "v1/folders/{foldersId}/notificationConfigs", - // "httpMethod": "GET", - // "id": "securitycenter.folders.notificationConfigs.list", + // "httpMethod": "POST", + // "id": "securitycenter.folders.notificationConfigs.create", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "pageSize": { - // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The value returned by the last `ListNotificationConfigsResponse`; indicates that this is a continuation of a prior `ListNotificationConfigs` call, and that the system should return the next page of data.", + // "configId": { + // "description": "Required. Unique identifier provided by the client within the parent scope. It must be between 1 and 128 characters and contain alphanumeric characters, underscores, or hyphens only.", // "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. 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, @@ -10143,8 +10393,11 @@ func (c *FoldersNotificationConfigsListCall) Do(opts ...googleapi.CallOption) (* // } // }, // "path": "v1/{+parent}/notificationConfigs", + // "request": { + // "$ref": "NotificationConfig" + // }, // "response": { - // "$ref": "ListNotificationConfigsResponse" + // "$ref": "NotificationConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -10153,67 +10406,32 @@ 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 { - 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.notificationConfigs.patch": +// method id "securitycenter.folders.notificationConfigs.delete": -type FoldersNotificationConfigsPatchCall struct { - s *Service - name string - notificationconfig *NotificationConfig - 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 } -// Patch: Updates a notification config. The following update fields -// are allowed: description, pubsub_topic, streaming_config.filter +// Delete: Deletes a notification config. // -// - 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: 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 - c.notificationconfig = notificationconfig - return c -} - -// UpdateMask sets the optional parameter "updateMask": The FieldMask to -// use when updating the notification config. If empty all mutable -// fields will be updated. -func (c *FoldersNotificationConfigsPatchCall) UpdateMask(updateMask string) *FoldersNotificationConfigsPatchCall { - c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersNotificationConfigsPatchCall) Fields(s ...googleapi.Field) *FoldersNotificationConfigsPatchCall { +func (c *FoldersNotificationConfigsDeleteCall) Fields(s ...googleapi.Field) *FoldersNotificationConfigsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -10221,21 +10439,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 *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 *FoldersNotificationConfigsPatchCall) Header() http.Header { +func (c *FoldersNotificationConfigsDeleteCall) 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 *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_ { @@ -10243,16 +10461,11 @@ 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) - 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 } @@ -10263,14 +10476,14 @@ 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.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 { @@ -10289,7 +10502,7 @@ func (c *FoldersNotificationConfigsPatchCall) 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, @@ -10301,34 +10514,25 @@ 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", + // "description": "Deletes a notification config.", // "flatPath": "v1/folders/{foldersId}/notificationConfigs/{notificationConfigsId}", - // "httpMethod": "PATCH", - // "id": "securitycenter.folders.notificationConfigs.patch", + // "httpMethod": "DELETE", + // "id": "securitycenter.folders.notificationConfigs.delete", // "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": "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/[^/]+/notificationConfigs/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "The FieldMask to use when updating the notification config. If empty all mutable fields will be updated.", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, // "path": "v1/{+name}", - // "request": { - // "$ref": "NotificationConfig" - // }, // "response": { - // "$ref": "NotificationConfig" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -10337,97 +10541,98 @@ func (c *FoldersNotificationConfigsPatchCall) Do(opts ...googleapi.CallOption) ( } -// method id "securitycenter.folders.securityHealthAnalyticsSettings.customModules.create": +// method id "securitycenter.folders.notificationConfigs.get": -type FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall struct { - s *Service - parent string - googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule - 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 } -// 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: Gets a notification config. // -// - 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 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 } // 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 *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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall { +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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Header() http.Header { +func (c *FoldersNotificationConfigsGetCall) 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 *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()) - 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. -// 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) { +// 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 { @@ -10446,7 +10651,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Do(opts if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule{ + ret := &NotificationConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10458,28 +10663,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": "Gets a notification config.", + // "flatPath": "v1/folders/{foldersId}/notificationConfigs/{notificationConfigsId}", + // "httpMethod": "GET", + // "id": "securitycenter.folders.notificationConfigs.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 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/[^/]+/securityHealthAnalyticsSettings$", + // "pattern": "^folders/[^/]+/notificationConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/customModules", - // "request": { - // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" - // }, + // "path": "v1/{+name}", // "response": { - // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" + // "$ref": "NotificationConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -10488,89 +10690,114 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Do(opts } -// method id "securitycenter.folders.securityHealthAnalyticsSettings.customModules.delete": +// method id "securitycenter.folders.notificationConfigs.list": -type FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersNotificationConfigsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes the specified SecurityHealthAnalyticsCustomModule and -// all of its descendants in the CRM hierarchy. This method is only -// supported for resident custom modules. +// List: Lists notification configs. // -// - 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: 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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall { +func (c *FoldersNotificationConfigsListCall) Fields(s ...googleapi.Field) *FoldersNotificationConfigsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FoldersNotificationConfigsListCall) IfNoneMatch(entityTag string) *FoldersNotificationConfigsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall { +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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Header() http.Header { +func (c *FoldersNotificationConfigsListCall) 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 *FoldersNotificationConfigsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + 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}/notificationConfigs") 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.notificationConfigs.list" call. +// Exactly one of *ListNotificationConfigsResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ListNotificationConfigsResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FoldersNotificationConfigsListCall) Do(opts ...googleapi.CallOption) (*ListNotificationConfigsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10589,7 +10816,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Do(opts if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &ListNotificationConfigsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10601,25 +10828,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": "Lists notification configs.", + // "flatPath": "v1/folders/{foldersId}/notificationConfigs", + // "httpMethod": "GET", + // "id": "securitycenter.folders.notificationConfigs.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 `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/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+$", + // "pattern": "^folders/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/notificationConfigs", // "response": { - // "$ref": "Empty" + // "$ref": "ListNotificationConfigsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -10628,83 +10866,106 @@ 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 *FoldersNotificationConfigsListCall) Pages(ctx context.Context, f func(*ListNotificationConfigsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// method id "securitycenter.folders.notificationConfigs.patch": + +type FoldersNotificationConfigsPatchCall struct { + s *Service + name string + notificationconfig *NotificationConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Retrieves a SecurityHealthAnalyticsCustomModule. +// Patch: Updates a notification config. The following update fields +// are allowed: description, pubsub_topic, streaming_config.filter // -// - 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)} +// - 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 +} + +// 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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall { +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 *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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall { +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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) Header() http.Header { +func (c *FoldersNotificationConfigsPatchCall) 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 *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/{+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 } @@ -10715,17 +10976,14 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) doRequest(a 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.notificationConfigs.patch" call. +// Exactly one of *NotificationConfig or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *NotificationConfig.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FoldersNotificationConfigsPatchCall) Do(opts ...googleapi.CallOption) (*NotificationConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10744,7 +11002,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) Do(opts ... if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule{ + ret := &NotificationConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10756,25 +11014,34 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) Do(opts ... } return ret, nil // { - // "description": "Retrieves a SecurityHealthAnalyticsCustomModule.", - // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/customModules/{customModulesId}", - // "httpMethod": "GET", - // "id": "securitycenter.folders.securityHealthAnalyticsSettings.customModules.get", + // "description": " Updates a notification config. The following update fields are allowed: description, pubsub_topic, streaming_config.filter", + // "flatPath": "v1/folders/{foldersId}/notificationConfigs/{notificationConfigsId}", + // "httpMethod": "PATCH", + // "id": "securitycenter.folders.notificationConfigs.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. 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}\"", + // "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/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+$", + // "pattern": "^folders/[^/]+/notificationConfigs/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "The FieldMask to use when updating the notification config. If empty all mutable fields will be updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, // "path": "v1/{+name}", + // "request": { + // "$ref": "NotificationConfig" + // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" + // "$ref": "NotificationConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -10783,97 +11050,76 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) Do(opts ... } -// method id "securitycenter.folders.securityHealthAnalyticsSettings.customModules.list": +// method id "securitycenter.folders.securityHealthAnalyticsSettings.customModules.create": -type FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall struct { + s *Service + parent string + googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule + 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. +// 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. // -// - parent: Name of parent to list custom modules. Its format is -// "organizations/{organization}/securityHealthAnalyticsSettings", +// - 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) List(parent string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall { - c := &FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *FoldersSecurityHealthAnalyticsSettingsCustomModulesService) Create(parent string, googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule) *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall { + c := &FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall{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.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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall { 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 *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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) Header() http.Header { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesCreateCall) 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 *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_ { 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}/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 } @@ -10884,16 +11130,17 @@ 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 +// 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 -// *ListSecurityHealthAnalyticsCustomModulesResponse.ServerResponse.Heade -// r 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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) Do(opts ...googleapi.CallOption) (*ListSecurityHealthAnalyticsCustomModulesResponse, error) { +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 { @@ -10912,7 +11159,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) Do(opts .. if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListSecurityHealthAnalyticsCustomModulesResponse{ + ret := &GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10924,27 +11171,16 @@ 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.", + // "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": "GET", - // "id": "securitycenter.folders.securityHealthAnalyticsSettings.customModules.list", + // "httpMethod": "POST", + // "id": "securitycenter.folders.securityHealthAnalyticsSettings.customModules.create", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "pageSize": { - // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The value returned by the last 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. 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/[^/]+/securityHealthAnalyticsSettings$", // "required": true, @@ -10952,8 +11188,11 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) Do(opts .. // } // }, // "path": "v1/{+parent}/customModules", + // "request": { + // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" + // }, // "response": { - // "$ref": "ListSecurityHealthAnalyticsCustomModulesResponse" + // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -10962,140 +11201,89 @@ 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 { - 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.securityHealthAnalyticsSettings.customModules.listDescendant": +// method id "securitycenter.folders.securityHealthAnalyticsSettings.customModules.delete": -type FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + 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. +// 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 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 -} - -// 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 { - 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 { - 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 *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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall { 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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) IfNoneMatch(entityTag string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { - 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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { +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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Header() http.Header { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) 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 *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_ { 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:listDescendant") + 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.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.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 { @@ -11114,7 +11302,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListDescendantSecurityHealthAnalyticsCustomModulesResponse{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11126,36 +11314,25 @@ 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", - // "httpMethod": "GET", - // "id": "securitycenter.folders.securityHealthAnalyticsSettings.customModules.listDescendant", + // "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": { - // "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 delete. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}\", \"folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}\", or \"projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}\"", // "location": "path", - // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings$", + // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/customModules:listDescendant", + // "path": "v1/{+name}", // "response": { - // "$ref": "ListDescendantSecurityHealthAnalyticsCustomModulesResponse" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -11164,111 +11341,83 @@ 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 { - 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.securityHealthAnalyticsSettings.customModules.patch": +// method id "securitycenter.folders.securityHealthAnalyticsSettings.customModules.get": -type FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall struct { - s *Service - name string - googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule - 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 } -// 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. +// Get: Retrieves a SecurityHealthAnalyticsCustomModule. // -// - name: Immutable. The resource name of the custom module. Its format -// is +// - name: Name of the custom module to get. Its format is // "organizations/{organization}/securityHealthAnalyticsSettings/custom -// Modules/{customModule}", or +// Modules/{customModule}", // "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)} +// ustomModule}". +func (r *FoldersSecurityHealthAnalyticsSettingsCustomModulesService) Get(name string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall { + c := &FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule = googlecloudsecuritycenterv1securityhealthanalyticscustommodule - return c -} - -// 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 } // 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 *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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall { +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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Header() http.Header { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesGetCall) 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 *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()) - 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 += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -11279,7 +11428,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) doRequest return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.customModules.patch" call. +// 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 @@ -11289,7 +11438,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) doRequest // 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) { +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 { @@ -11320,32 +11469,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.", + // "description": "Retrieves a SecurityHealthAnalyticsCustomModule.", // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/customModules/{customModulesId}", - // "httpMethod": "PATCH", - // "id": "securitycenter.folders.securityHealthAnalyticsSettings.customModules.patch", + // "httpMethod": "GET", + // "id": "securitycenter.folders.securityHealthAnalyticsSettings.customModules.get", // "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": "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/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "The list of fields to update.", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, // "path": "v1/{+name}", - // "request": { - // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" - // }, // "response": { // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" // }, @@ -11356,36 +11496,50 @@ func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Do(opts . } -// method id "securitycenter.folders.securityHealthAnalyticsSettings.effectiveCustomModules.get": +// method id "securitycenter.folders.securityHealthAnalyticsSettings.customModules.list": -type FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall struct { +type FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall struct { s *Service - name string + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Retrieves an EffectiveSecurityHealthAnalyticsCustomModule. +// 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 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 +// - 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 *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -11395,7 +11549,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Fi // 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 { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) IfNoneMatch(entityTag string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall { c.ifNoneMatch_ = entityTag return c } @@ -11403,21 +11557,21 @@ func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) If // Context sets the context 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 *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 *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Header() http.Header { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListCall) 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 *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_ { @@ -11430,7 +11584,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) do 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 { @@ -11438,22 +11592,21 @@ func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) do } 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.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 +// 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 *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModule, error) { +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 { @@ -11472,7 +11625,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Do if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModule{ + ret := &ListSecurityHealthAnalyticsCustomModulesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11484,25 +11637,36 @@ func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Do } return ret, nil // { - // "description": "Retrieves an EffectiveSecurityHealthAnalyticsCustomModule.", - // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/effectiveCustomModules/{effectiveCustomModulesId}", + // "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.effectiveCustomModules.get", + // "id": "securitycenter.folders.securityHealthAnalyticsSettings.customModules.list", // "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 custom modules. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", // "location": "path", - // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings/effectiveCustomModules/[^/]+$", + // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/customModules", // "response": { - // "$ref": "GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModule" + // "$ref": "ListSecurityHealthAnalyticsCustomModulesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -11511,9 +11675,30 @@ func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Do } -// method id "securitycenter.folders.securityHealthAnalyticsSettings.effectiveCustomModules.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 FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall struct { +// method id "securitycenter.folders.securityHealthAnalyticsSettings.customModules.listDescendant": + +type FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -11522,17 +11707,17 @@ type FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall struct 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. +// ListDescendant: Returns a list of all resident +// SecurityHealthAnalyticsCustomModules under the given CRM parent and +// all of the parent’s CRM descendants. // -// - parent: Name of parent to list effective custom modules. Its format -// is "organizations/{organization}/securityHealthAnalyticsSettings", +// - parent: Name of parent to list descendant 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)} +func (r *FoldersSecurityHealthAnalyticsSettingsCustomModulesService) ListDescendant(parent string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { + c := &FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } @@ -11540,14 +11725,14 @@ func (r *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesService) Li // 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 { +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 call indicating a continuation -func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) PageToken(pageToken string) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) PageToken(pageToken string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -11555,7 +11740,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) P // 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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -11565,7 +11750,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) F // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) IfNoneMatch(entityTag string) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) IfNoneMatch(entityTag string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { c.ifNoneMatch_ = entityTag return c } @@ -11573,21 +11758,21 @@ func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) I // Context sets the context 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 *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 *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Header() http.Header { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) 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 *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_ { @@ -11600,7 +11785,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) d var body io.Reader = nil 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/{+parent}/customModules:listDescendant") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -11613,17 +11798,17 @@ func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) d return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.effectiveCustomModules.list" call. +// Do executes the "securitycenter.folders.securityHealthAnalyticsSettings.customModules.listDescendant" call. // Exactly one of -// *ListEffectiveSecurityHealthAnalyticsCustomModulesResponse or error +// *ListDescendantSecurityHealthAnalyticsCustomModulesResponse 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 +// *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 *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Do(opts ...googleapi.CallOption) (*ListEffectiveSecurityHealthAnalyticsCustomModulesResponse, error) { +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 { @@ -11642,7 +11827,7 @@ func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) D if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListEffectiveSecurityHealthAnalyticsCustomModulesResponse{ + ret := &ListDescendantSecurityHealthAnalyticsCustomModulesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11654,10 +11839,10 @@ 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", + // "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.securityHealthAnalyticsSettings.effectiveCustomModules.list", + // "id": "securitycenter.folders.securityHealthAnalyticsSettings.customModules.listDescendant", // "parameterOrder": [ // "parent" // ], @@ -11674,16 +11859,16 @@ func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) D // "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\"", + // "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/[^/]+/securityHealthAnalyticsSettings$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/effectiveCustomModules", + // "path": "v1/{+parent}/customModules:listDescendant", // "response": { - // "$ref": "ListEffectiveSecurityHealthAnalyticsCustomModulesResponse" + // "$ref": "ListDescendantSecurityHealthAnalyticsCustomModulesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -11695,7 +11880,7 @@ 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 { +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 { @@ -11713,114 +11898,111 @@ func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) P } } -// method id "securitycenter.folders.sources.list": +// method id "securitycenter.folders.securityHealthAnalyticsSettings.customModules.patch": -type FoldersSourcesListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall struct { + s *Service + name string + googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists all sources belonging to an organization. +// 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. // -// - 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)) +// - 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.googlecloudsecuritycenterv1securityhealthanalyticscustommodule = googlecloudsecuritycenterv1securityhealthanalyticscustommodule 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 list of +// fields to update. +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) UpdateMask(updateMask string) *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall { + 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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall { 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 *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 *FoldersSourcesListCall) Header() http.Header { +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesPatchCall) 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 *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_ { 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}/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 -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *FoldersSourcesListCall) Do(opts ...googleapi.CallOption) (*ListSourcesResponse, 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 { @@ -11839,7 +12021,7 @@ func (c *FoldersSourcesListCall) Do(opts ...googleapi.CallOption) (*ListSourcesR if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListSourcesResponse{ + ret := &GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11851,36 +12033,34 @@ 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 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.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 `ListSourcesResponse`; indicates that this is a continuation of a prior `ListSources` call, and that the system should return the next page of data.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. Resource name of the parent of sources to list. Its format should be \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "name": { + // "description": "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/[^/]+$", + // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+$", // "required": true, // "type": "string" - // } - // }, - // "path": "v1/{+parent}/sources", - // "response": { - // "$ref": "ListSourcesResponse" + // }, + // "updateMask": { + // "description": "The list of fields to update.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "request": { + // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" + // }, + // "response": { + // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -11889,63 +12069,35 @@ 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.securityHealthAnalyticsSettings.customModules.simulate": -type FoldersSourcesFindingsGroupCall struct { - s *Service - parent string - groupfindingsrequest *GroupFindingsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall struct { + s *Service + parent string + simulatesecurityhealthanalyticscustommodulerequest *SimulateSecurityHealthAnalyticsCustomModuleRequest + 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 +// Simulate: Simulates a given SecurityHealthAnalyticsCustomModule and +// Resource. // -// - 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)} +// - parent: The relative resource name of the organization, project, or +// folder. See: +// https://cloud.google.com/apis/design/resource_names#relative_resource_name +// An example is: "organizations/{organization_id}". +func (r *FoldersSecurityHealthAnalyticsSettingsCustomModulesService) Simulate(parent string, simulatesecurityhealthanalyticscustommodulerequest *SimulateSecurityHealthAnalyticsCustomModuleRequest) *FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall { + c := &FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.groupfindingsrequest = groupfindingsrequest + c.simulatesecurityhealthanalyticscustommodulerequest = simulatesecurityhealthanalyticscustommodulerequest return 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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -11953,21 +12105,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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) Context(ctx context.Context) *FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall { c.ctx_ = 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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) 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 *FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -11975,14 +12127,14 @@ 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.simulatesecurityhealthanalyticscustommodulerequest) 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}/customModules:simulate") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -11995,14 +12147,16 @@ func (c *FoldersSourcesFindingsGroupCall) doRequest(alt string) (*http.Response, 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.securityHealthAnalyticsSettings.customModules.simulate" call. +// Exactly one of *SimulateSecurityHealthAnalyticsCustomModuleResponse +// or error will be non-nil. Any non-2xx status code is an error. +// Response headers are in either +// *SimulateSecurityHealthAnalyticsCustomModuleResponse.ServerResponse.He +// ader or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FoldersSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) Do(opts ...googleapi.CallOption) (*SimulateSecurityHealthAnalyticsCustomModuleResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12021,7 +12175,7 @@ func (c *FoldersSourcesFindingsGroupCall) Do(opts ...googleapi.CallOption) (*Gro if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GroupFindingsResponse{ + ret := &SimulateSecurityHealthAnalyticsCustomModuleResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12033,28 +12187,28 @@ 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", + // "description": "Simulates a given SecurityHealthAnalyticsCustomModule and Resource.", + // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/customModules:simulate", // "httpMethod": "POST", - // "id": "securitycenter.folders.sources.findings.group", + // "id": "securitycenter.folders.securityHealthAnalyticsSettings.customModules.simulate", // "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. The relative resource name of the organization, project, or folder. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name An example is: \"organizations/{organization_id}\".", // "location": "path", - // "pattern": "^folders/[^/]+/sources/[^/]+$", + // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/findings:group", + // "path": "v1/{+parent}/customModules:simulate", // "request": { - // "$ref": "GroupFindingsRequest" + // "$ref": "SimulateSecurityHealthAnalyticsCustomModuleRequest" // }, // "response": { - // "$ref": "GroupFindingsResponse" + // "$ref": "SimulateSecurityHealthAnalyticsCustomModuleResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -12063,173 +12217,36 @@ func (c *FoldersSourcesFindingsGroupCall) Do(opts ...googleapi.CallOption) (*Gro } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *FoldersSourcesFindingsGroupCall) Pages(ctx context.Context, f func(*GroupFindingsResponse) error) error { - c.ctx_ = ctx - defer func(pt string) { c.groupfindingsrequest.PageToken = pt }(c.groupfindingsrequest.PageToken) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.groupfindingsrequest.PageToken = x.NextPageToken - } -} - -// method id "securitycenter.folders.sources.findings.list": +// method id "securitycenter.folders.securityHealthAnalyticsSettings.effectiveCustomModules.get": -type FoldersSourcesFindingsListCall struct { +type FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall 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: Retrieves an EffectiveSecurityHealthAnalyticsCustomModule. // -// - 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 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 *FoldersSourcesFindingsListCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsListCall { +func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Fields(s ...googleapi.Field) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -12239,7 +12256,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 *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) IfNoneMatch(entityTag string) *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { c.ifNoneMatch_ = entityTag return c } @@ -12247,21 +12264,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 *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 *FoldersSourcesFindingsListCall) Header() http.Header { +func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) 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 *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_ { @@ -12274,7 +12291,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 { @@ -12282,19 +12299,22 @@ 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 -// 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) { +// 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) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12313,7 +12333,7 @@ func (c *FoldersSourcesFindingsListCall) Do(opts ...googleapi.CallOption) (*List if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListFindingsResponse{ + ret := &GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12325,64 +12345,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": "Retrieves an EffectiveSecurityHealthAnalyticsCustomModule.", + // "flatPath": "v1/folders/{foldersId}/securityHealthAnalyticsSettings/effectiveCustomModules/{effectiveCustomModulesId}", // "httpMethod": "GET", - // "id": "securitycenter.folders.sources.findings.list", + // "id": "securitycenter.folders.securityHealthAnalyticsSettings.effectiveCustomModules.get", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "compareDuration": { - // "description": "When compare_duration is set, the ListFindingsResult's \"state_change\" attribute is updated to indicate whether the finding had its state changed, the finding's state remained unchanged, or if the finding was added in any state during the compare_duration period of time that precedes the read_time. This is the time between (read_time - compare_duration) and read_time. The state_change value is derived based on the presence and state of the finding at the two points in time. Intermediate state changes between the two times don't affect the result. For example, the results aren't affected if the finding is made inactive and then active again. Possible \"state_change\" values when compare_duration is specified: * \"CHANGED\": indicates that the finding was present and matched the given filter at the start of compare_duration, but changed its state at read_time. * \"UNCHANGED\": indicates that the finding was present and matched the given filter at the start of compare_duration and did not change state at read_time. * \"ADDED\": indicates that the finding did not match the given filter or was not present at the start of compare_duration, but was present at read_time. * \"REMOVED\": indicates that the finding was present and matched the filter at the start of compare_duration, but did not match the filter at read_time. If compare_duration is not specified, then the only possible state_change is \"UNUSED\", which will be the state_change set for all findings present at read_time.", - // "format": "google-duration", - // "location": "query", - // "type": "string" - // }, - // "fieldMask": { - // "description": "A field mask to specify the Finding fields to be listed in the response. An empty field mask will list all fields.", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" - // }, - // "filter": { - // "description": "Expression that defines the filter to apply across findings. The expression is a list of one or more restrictions combined via logical operators `AND` and `OR`. Parentheses are supported, and `OR` has higher precedence than `AND`. Restrictions have the form ` ` and may have a `-` character in front of them to indicate negation. Examples include: * name * source_properties.a_property * security_marks.marks.marka The supported operators are: * `=` for all value types. * `\u003e`, `\u003c`, `\u003e=`, `\u003c=` for integer values. * `:`, meaning substring matching, for strings. The supported value types are: * string literals in quotes. * integer literals without quotes. * boolean literals `true` and `false` without quotes. The following field and operator combinations are supported: * name: `=` * parent: `=`, `:` * resource_name: `=`, `:` * state: `=`, `:` * category: `=`, `:` * external_uri: `=`, `:` * event_time: `=`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: `event_time = \"2019-06-10T16:07:18-07:00\"` `event_time = 1560208038000` * severity: `=`, `:` * workflow_state: `=`, `:` * security_marks.marks: `=`, `:` * source_properties: `=`, `:`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` For example, `source_properties.size = 100` is a valid filter string. Use a partial match on the empty string to filter based on a property existing: `source_properties.my_property : \"\"` Use a negated partial match on the empty string to filter based on a property not existing: `-source_properties.my_property : \"\"` * resource: * resource.name: `=`, `:` * resource.parent_name: `=`, `:` * resource.parent_display_name: `=`, `:` * resource.project_name: `=`, `:` * resource.project_display_name: `=`, `:` * resource.type: `=`, `:` * resource.folders.resource_folder: `=`, `:` * resource.display_name: `=`, `:`", - // "location": "query", - // "type": "string" - // }, - // "orderBy": { - // "description": "Expression that defines what fields and order to use for sorting. The string value should follow SQL syntax: comma separated list of fields. For example: \"name,resource_properties.a_property\". The default sorting order is ascending. To specify descending order for a field, a suffix \" desc\" should be appended to the field name. For example: \"name desc,source_properties.a_property\". Redundant space characters in the syntax are insignificant. \"name desc,source_properties.a_property\" and \" name desc , source_properties.a_property \" are equivalent. The following fields are supported: name parent state category resource_name event_time source_properties security_marks.marks", - // "location": "query", - // "type": "string" - // }, - // "pageSize": { - // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The value returned by the last `ListFindingsResponse`; indicates that this is a continuation of a prior `ListFindings` call, and that the system should return the next page of data.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. Name of the source the findings belong to. Its format is \"organizations/[organization_id]/sources/[source_id], folders/[folder_id]/sources/[source_id], or projects/[project_id]/sources/[source_id]\". To list across all sources provide a source_id of `-`. For example: organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or projects/{projects_id}/sources/-", + // "name": { + // "description": "Required. Name of the 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/[^/]+/sources/[^/]+$", + // "pattern": "^folders/[^/]+/securityHealthAnalyticsSettings/effectiveCustomModules/[^/]+$", // "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": "GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -12391,127 +12372,119 @@ func (c *FoldersSourcesFindingsListCall) Do(opts ...googleapi.CallOption) (*List } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *FoldersSourcesFindingsListCall) Pages(ctx context.Context, f func(*ListFindingsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "securitycenter.folders.sources.findings.patch": +// method id "securitycenter.folders.securityHealthAnalyticsSettings.effectiveCustomModules.list": -type FoldersSourcesFindingsPatchCall struct { - s *Service - name string - finding *Finding - 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 } -// Patch: Creates or updates a finding. The corresponding source must -// exist for a finding creation to succeed. +// 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: 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.finding = 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 } -// UpdateMask sets the optional parameter "updateMask": The FieldMask to -// use when updating the finding resource. This field should not be -// specified when creating a finding. When updating a finding, an empty -// mask is treated as updating all mutable fields and replacing -// source_properties. Individual source_properties can be added/updated -// by using "source_properties." in the field mask. -func (c *FoldersSourcesFindingsPatchCall) UpdateMask(updateMask string) *FoldersSourcesFindingsPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return in a single response. Default is 10, minimum is +// 1, maximum is 1000. +func (c *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 *FoldersSourcesFindingsPatchCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsPatchCall { +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 *FoldersSourcesFindingsPatchCall) Context(ctx context.Context) *FoldersSourcesFindingsPatchCall { +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 *FoldersSourcesFindingsPatchCall) Header() http.Header { +func (c *FoldersSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) 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 *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()) - 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}/effectiveCustomModules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.sources.findings.patch" call. -// Exactly one of *Finding or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Finding.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *FoldersSourcesFindingsPatchCall) Do(opts ...googleapi.CallOption) (*Finding, error) { +// Do executes the "securitycenter.folders.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 { @@ -12530,7 +12503,7 @@ func (c *FoldersSourcesFindingsPatchCall) Do(opts ...googleapi.CallOption) (*Fin if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Finding{ + ret := &ListEffectiveSecurityHealthAnalyticsCustomModulesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12542,34 +12515,36 @@ func (c *FoldersSourcesFindingsPatchCall) Do(opts ...googleapi.CallOption) (*Fin } return ret, nil // { - // "description": "Creates or updates a finding. The corresponding source must exist for a finding creation to succeed.", - // "flatPath": "v1/folders/{foldersId}/sources/{sourcesId}/findings/{findingsId}", - // "httpMethod": "PATCH", - // "id": "securitycenter.folders.sources.findings.patch", + // "description": "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": "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" + // "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 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$", + // "required": true, + // "type": "string" // } // }, - // "path": "v1/{+name}", - // "request": { - // "$ref": "Finding" - // }, + // "path": "v1/{+parent}/effectiveCustomModules", // "response": { - // "$ref": "Finding" + // "$ref": "ListEffectiveSecurityHealthAnalyticsCustomModulesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -12578,94 +12553,135 @@ func (c *FoldersSourcesFindingsPatchCall) Do(opts ...googleapi.CallOption) (*Fin } -// method id "securitycenter.folders.sources.findings.setMute": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *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 FoldersSourcesFindingsSetMuteCall struct { - s *Service - name string - setmuterequest *SetMuteRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "securitycenter.folders.sources.list": + +type FoldersSourcesListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// SetMute: Updates the mute state of a finding. +// 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 *FoldersSourcesFindingsService) SetMute(name string, setmuterequest *SetMuteRequest) *FoldersSourcesFindingsSetMuteCall { - c := &FoldersSourcesFindingsSetMuteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.setmuterequest = setmuterequest +// - 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 *FoldersSourcesFindingsSetMuteCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsSetMuteCall { +func (c *FoldersSourcesListCall) Fields(s ...googleapi.Field) *FoldersSourcesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FoldersSourcesListCall) IfNoneMatch(entityTag string) *FoldersSourcesListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersSourcesFindingsSetMuteCall) Context(ctx context.Context) *FoldersSourcesFindingsSetMuteCall { +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 *FoldersSourcesFindingsSetMuteCall) Header() http.Header { +func (c *FoldersSourcesListCall) 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 *FoldersSourcesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmuterequest) - 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}:setMute") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/sources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.sources.findings.setMute" call. -// Exactly one of *Finding or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Finding.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *FoldersSourcesFindingsSetMuteCall) Do(opts ...googleapi.CallOption) (*Finding, error) { +// Do executes the "securitycenter.folders.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 { @@ -12684,7 +12700,7 @@ func (c *FoldersSourcesFindingsSetMuteCall) Do(opts ...googleapi.CallOption) (*F 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, @@ -12696,28 +12712,36 @@ func (c *FoldersSourcesFindingsSetMuteCall) Do(opts ...googleapi.CallOption) (*F } return ret, nil // { - // "description": "Updates the mute state of a finding.", - // "flatPath": "v1/folders/{foldersId}/sources/{sourcesId}/findings/{findingsId}:setMute", - // "httpMethod": "POST", - // "id": "securitycenter.folders.sources.findings.setMute", + // "description": "Lists all sources belonging to an organization.", + // "flatPath": "v1/folders/{foldersId}/sources", + // "httpMethod": "GET", + // "id": "securitycenter.folders.sources.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The [relative resource name](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}\".", + // "pageSize": { + // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value returned by the last `ListSourcesResponse`; indicates that this is a continuation of a prior `ListSources` call, and that the system should return the next page of data.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. Resource name of the parent of sources to list. Its format should be \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", // "location": "path", - // "pattern": "^folders/[^/]+/sources/[^/]+/findings/[^/]+$", + // "pattern": "^folders/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}:setMute", - // "request": { - // "$ref": "SetMuteRequest" - // }, + // "path": "v1/{+parent}/sources", // "response": { - // "$ref": "Finding" + // "$ref": "ListSourcesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -12726,37 +12750,63 @@ 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 *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 FoldersSourcesFindingsSetStateCall struct { - s *Service - name string - setfindingstaterequest *SetFindingStateRequest - urlParams_ gensupport.URLParams - 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 } -// SetState: Updates the state of a finding. +// 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 // -// - 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: Name of the source to groupBy. Its format is +// "organizations/[organization_id]/sources/[source_id]", +// folders/[folder_id]/sources/[source_id], or +// projects/[project_id]/sources/[source_id]. To groupBy across all +// sources provide a source_id of `-`. For example: +// organizations/{organization_id}/sources/-, +// folders/{folder_id}/sources/-, or projects/{project_id}/sources/-. +func (r *FoldersSourcesFindingsService) Group(parent string, groupfindingsrequest *GroupFindingsRequest) *FoldersSourcesFindingsGroupCall { + c := &FoldersSourcesFindingsGroupCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.groupfindingsrequest = groupfindingsrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersSourcesFindingsSetStateCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsSetStateCall { +func (c *FoldersSourcesFindingsGroupCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsGroupCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -12764,21 +12814,21 @@ func (c *FoldersSourcesFindingsSetStateCall) Fields(s ...googleapi.Field) *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 *FoldersSourcesFindingsSetStateCall) Context(ctx context.Context) *FoldersSourcesFindingsSetStateCall { +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 *FoldersSourcesFindingsSetStateCall) Header() http.Header { +func (c *FoldersSourcesFindingsGroupCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSourcesFindingsSetStateCall) doRequest(alt string) (*http.Response, error) { +func (c *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_ { @@ -12786,14 +12836,14 @@ func (c *FoldersSourcesFindingsSetStateCall) doRequest(alt string) (*http.Respon } 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.groupfindingsrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setState") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findings:group") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -12801,23 +12851,23 @@ func (c *FoldersSourcesFindingsSetStateCall) doRequest(alt string) (*http.Respon } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.sources.findings.setState" call. -// Exactly one of *Finding or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Finding.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *FoldersSourcesFindingsSetStateCall) Do(opts ...googleapi.CallOption) (*Finding, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { +// 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 { + if res.Body != nil { res.Body.Close() } return nil, gensupport.WrapError(&googleapi.Error{ @@ -12832,7 +12882,7 @@ func (c *FoldersSourcesFindingsSetStateCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Finding{ + ret := &GroupFindingsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12844,28 +12894,28 @@ func (c *FoldersSourcesFindingsSetStateCall) Do(opts ...googleapi.CallOption) (* } return ret, nil // { - // "description": "Updates the state of a finding.", - // "flatPath": "v1/folders/{foldersId}/sources/{sourcesId}/findings/{findingsId}:setState", + // "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.setState", + // "id": "securitycenter.folders.sources.findings.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. Name of the source to groupBy. Its format is \"organizations/[organization_id]/sources/[source_id]\", folders/[folder_id]/sources/[source_id], or projects/[project_id]/sources/[source_id]. To groupBy across all sources provide a source_id of `-`. For example: organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, or projects/{project_id}/sources/-", // "location": "path", - // "pattern": "^folders/[^/]+/sources/[^/]+/findings/[^/]+$", + // "pattern": "^folders/[^/]+/sources/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}:setState", + // "path": "v1/{+parent}/findings:group", // "request": { - // "$ref": "SetFindingStateRequest" + // "$ref": "GroupFindingsRequest" // }, // "response": { - // "$ref": "Finding" + // "$ref": "GroupFindingsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -12874,112 +12924,238 @@ func (c *FoldersSourcesFindingsSetStateCall) Do(opts ...googleapi.CallOption) (* } -// method id "securitycenter.folders.sources.findings.updateSecurityMarks": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *FoldersSourcesFindingsGroupCall) Pages(ctx context.Context, f func(*GroupFindingsResponse) error) error { + c.ctx_ = ctx + defer func(pt string) { c.groupfindingsrequest.PageToken = pt }(c.groupfindingsrequest.PageToken) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.groupfindingsrequest.PageToken = x.NextPageToken + } +} -type FoldersSourcesFindingsUpdateSecurityMarksCall struct { - s *Service - name string - securitymarks *SecurityMarks - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "securitycenter.folders.sources.findings.list": + +type FoldersSourcesFindingsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// UpdateSecurityMarks: Updates security marks. +// List: Lists an organization or source's findings. To list across all +// sources provide a `-` as the source id. Example: +// /v1/organizations/{organization_id}/sources/-/findings // -// - name: 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 +// - 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 } -// 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) +// 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 } -// 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) +// 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) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsUpdateSecurityMarksCall { +func (c *FoldersSourcesFindingsListCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsListCall { 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 *FoldersSourcesFindingsListCall) IfNoneMatch(entityTag string) *FoldersSourcesFindingsListCall { + 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 *FoldersSourcesFindingsUpdateSecurityMarksCall) Context(ctx context.Context) *FoldersSourcesFindingsUpdateSecurityMarksCall { +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 *FoldersSourcesFindingsUpdateSecurityMarksCall) Header() http.Header { +func (c *FoldersSourcesFindingsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) doRequest(alt string) (*http.Response, error) { +func (c *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_ { 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 + 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}/findings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.folders.sources.findings.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) { +// 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 { @@ -12998,7 +13174,7 @@ func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) Do(opts ...googleapi.Cal if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &SecurityMarks{ + ret := &ListFindingsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13010,40 +13186,64 @@ func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) Do(opts ...googleapi.Cal } return ret, nil // { - // "description": "Updates security marks.", - // "flatPath": "v1/folders/{foldersId}/sources/{sourcesId}/findings/{findingsId}/securityMarks", - // "httpMethod": "PATCH", - // "id": "securitycenter.folders.sources.findings.updateSecurityMarks", + // "description": "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.sources.findings.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "The relative resource name of the SecurityMarks. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Examples: \"organizations/{organization_id}/assets/{asset_id}/securityMarks\" \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks\".", - // "location": "path", - // "pattern": "^folders/[^/]+/sources/[^/]+/findings/[^/]+/securityMarks$", - // "required": true, + // "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" // }, - // "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", + // "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" // }, - // "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", + // "filter": { + // "description": "Expression that defines the filter to apply across findings. The expression is a list of one or more restrictions combined via logical operators `AND` and `OR`. Parentheses are supported, and `OR` has higher precedence than `AND`. Restrictions have the form ` ` and may have a `-` character in front of them to indicate negation. Examples include: * name * source_properties.a_property * security_marks.marks.marka The supported operators are: * `=` for all value types. * `\u003e`, `\u003c`, `\u003e=`, `\u003c=` for integer values. * `:`, meaning substring matching, for strings. The supported value types are: * string literals in quotes. * integer literals without quotes. * boolean literals `true` and `false` without quotes. The following field and operator combinations are supported: * name: `=` * parent: `=`, `:` * resource_name: `=`, `:` * state: `=`, `:` * category: `=`, `:` * external_uri: `=`, `:` * event_time: `=`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: `event_time = \"2019-06-10T16:07:18-07:00\"` `event_time = 1560208038000` * severity: `=`, `:` * workflow_state: `=`, `:` * security_marks.marks: `=`, `:` * source_properties: `=`, `:`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` For example, `source_properties.size = 100` is a valid filter string. Use a partial match on the empty string to filter based on a property existing: `source_properties.my_property : \"\"` Use a negated partial match on the empty string to filter based on a property not existing: `-source_properties.my_property : \"\"` * resource: * resource.name: `=`, `:` * resource.parent_name: `=`, `:` * resource.parent_display_name: `=`, `:` * resource.project_name: `=`, `:` * resource.project_display_name: `=`, `:` * resource.type: `=`, `:` * resource.folders.resource_folder: `=`, `:` * resource.display_name: `=`, `:`", + // "location": "query", + // "type": "string" + // }, + // "orderBy": { + // "description": "Expression that defines what fields and order to use for sorting. The string value should follow SQL syntax: comma separated list of fields. For example: \"name,resource_properties.a_property\". The default sorting order is ascending. To specify descending order for a field, a suffix \" desc\" should be appended to the field name. For example: \"name desc,source_properties.a_property\". Redundant space characters in the syntax are insignificant. \"name desc,source_properties.a_property\" and \" name desc , source_properties.a_property \" are equivalent. The following fields are supported: name parent state category resource_name event_time source_properties security_marks.marks", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value returned by the last `ListFindingsResponse`; indicates that this is a continuation of a prior `ListFindings` call, and that the system should return the next page of data.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. Name of the source the findings belong to. Its format is \"organizations/[organization_id]/sources/[source_id], folders/[folder_id]/sources/[source_id], or projects/[project_id]/sources/[source_id]\". To list across all sources provide a source_id of `-`. For example: organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or projects/{projects_id}/sources/-", + // "location": "path", + // "pattern": "^folders/[^/]+/sources/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "readTime": { + // "description": "Time used as a reference point when filtering findings. The filter is limited to findings existing at the supplied time and their values are those at that specific time. Absence of this field will default to the API's version of NOW.", + // "format": "google-datetime", // "location": "query", // "type": "string" // } // }, - // "path": "v1/{+name}", - // "request": { - // "$ref": "SecurityMarks" - // }, + // "path": "v1/{+parent}/findings", // "response": { - // "$ref": "SecurityMarks" + // "$ref": "ListFindingsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -13052,35 +13252,62 @@ func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) Do(opts ...googleapi.Cal } -// method id "securitycenter.folders.sources.findings.externalSystems.patch": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *FoldersSourcesFindingsListCall) Pages(ctx context.Context, f func(*ListFindingsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type FoldersSourcesFindingsExternalSystemsPatchCall struct { - s *Service - name string - googlecloudsecuritycenterv1externalsystem *GoogleCloudSecuritycenterV1ExternalSystem - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "securitycenter.folders.sources.findings.patch": + +type FoldersSourcesFindingsPatchCall struct { + s *Service + name string + finding *Finding + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates external system. This is for a given finding. +// Patch: Creates or updates a finding. The corresponding source must +// exist for a 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 *FoldersSourcesFindingsExternalSystemsService) Patch(name string, googlecloudsecuritycenterv1externalsystem *GoogleCloudSecuritycenterV1ExternalSystem) *FoldersSourcesFindingsExternalSystemsPatchCall { - c := &FoldersSourcesFindingsExternalSystemsPatchCall{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.googlecloudsecuritycenterv1externalsystem = googlecloudsecuritycenterv1externalsystem + 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 *FoldersSourcesFindingsExternalSystemsPatchCall) UpdateMask(updateMask string) *FoldersSourcesFindingsExternalSystemsPatchCall { +// 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 } @@ -13088,7 +13315,7 @@ func (c *FoldersSourcesFindingsExternalSystemsPatchCall) UpdateMask(updateMask s // 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 { +func (c *FoldersSourcesFindingsPatchCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -13096,21 +13323,21 @@ func (c *FoldersSourcesFindingsExternalSystemsPatchCall) Fields(s ...googleapi.F // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersSourcesFindingsExternalSystemsPatchCall) Context(ctx context.Context) *FoldersSourcesFindingsExternalSystemsPatchCall { +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 *FoldersSourcesFindingsExternalSystemsPatchCall) Header() http.Header { +func (c *FoldersSourcesFindingsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSourcesFindingsExternalSystemsPatchCall) 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_ { @@ -13118,7 +13345,7 @@ func (c *FoldersSourcesFindingsExternalSystemsPatchCall) doRequest(alt string) ( } 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 } @@ -13138,16 +13365,14 @@ func (c *FoldersSourcesFindingsExternalSystemsPatchCall) doRequest(alt string) ( 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) { +// 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 { @@ -13166,7 +13391,7 @@ func (c *FoldersSourcesFindingsExternalSystemsPatchCall) Do(opts ...googleapi.Ca 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, @@ -13178,23 +13403,23 @@ func (c *FoldersSourcesFindingsExternalSystemsPatchCall) Do(opts ...googleapi.Ca } return ret, nil // { - // "description": "Updates external system. This is for a given finding.", - // "flatPath": "v1/folders/{foldersId}/sources/{sourcesId}/findings/{findingsId}/externalSystems/{externalSystemsId}", + // "description": "Creates or updates a finding. The corresponding source must exist for a finding creation to succeed.", + // "flatPath": "v1/folders/{foldersId}/sources/{sourcesId}/findings/{findingsId}", // "httpMethod": "PATCH", - // "id": "securitycenter.folders.sources.findings.externalSystems.patch", + // "id": "securitycenter.folders.sources.findings.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\"", + // "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/[^/]+/sources/[^/]+/findings/[^/]+/externalSystems/[^/]+$", + // "pattern": "^folders/[^/]+/sources/[^/]+/findings/[^/]+$", // "required": true, // "type": "string" // }, // "updateMask": { - // "description": "The FieldMask to use when updating the external system resource. If empty all mutable fields will be updated.", + // "description": "The FieldMask to use when updating the finding resource. This field should not be specified when creating a finding. When updating a finding, an empty mask is treated as updating all mutable fields and replacing source_properties. Individual source_properties can be added/updated by using \"source_properties.\" in the field mask.", // "format": "google-fieldmask", // "location": "query", // "type": "string" @@ -13202,10 +13427,10 @@ func (c *FoldersSourcesFindingsExternalSystemsPatchCall) Do(opts ...googleapi.Ca // }, // "path": "v1/{+name}", // "request": { - // "$ref": "GoogleCloudSecuritycenterV1ExternalSystem" + // "$ref": "Finding" // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1ExternalSystem" + // "$ref": "Finding" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -13214,79 +13439,76 @@ func (c *FoldersSourcesFindingsExternalSystemsPatchCall) Do(opts ...googleapi.Ca } -// method id "securitycenter.organizations.getOrganizationSettings": +// method id "securitycenter.folders.sources.findings.setMute": -type OrganizationsGetOrganizationSettingsCall 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 } -// GetOrganizationSettings: Gets the settings for an organization. +// SetMute: Updates the mute state of a finding. // -// - 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)} +// - 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 *OrganizationsGetOrganizationSettingsCall) Fields(s ...googleapi.Field) *OrganizationsGetOrganizationSettingsCall { +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 *OrganizationsGetOrganizationSettingsCall) IfNoneMatch(entityTag string) *OrganizationsGetOrganizationSettingsCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsGetOrganizationSettingsCall) Context(ctx context.Context) *OrganizationsGetOrganizationSettingsCall { +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 *OrganizationsGetOrganizationSettingsCall) Header() http.Header { +func (c *FoldersSourcesFindingsSetMuteCall) 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 *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 } @@ -13297,14 +13519,14 @@ func (c *OrganizationsGetOrganizationSettingsCall) doRequest(alt string) (*http. 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 -// 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 *OrganizationsGetOrganizationSettingsCall) Do(opts ...googleapi.CallOption) (*OrganizationSettings, 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 { @@ -13323,7 +13545,7 @@ func (c *OrganizationsGetOrganizationSettingsCall) Do(opts ...googleapi.CallOpti if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &OrganizationSettings{ + ret := &Finding{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13335,25 +13557,28 @@ func (c *OrganizationsGetOrganizationSettingsCall) Do(opts ...googleapi.CallOpti } return ret, nil // { - // "description": "Gets the settings for an organization.", - // "flatPath": "v1/organizations/{organizationsId}/organizationSettings", - // "httpMethod": "GET", - // "id": "securitycenter.organizations.getOrganizationSettings", + // "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 organization to get organization settings for. Its format is \"organizations/[organization_id]/organizationSettings\".", + // "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": "^organizations/[^/]+/organizationSettings$", + // "pattern": "^folders/[^/]+/sources/[^/]+/findings/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+name}:setMute", + // "request": { + // "$ref": "SetMuteRequest" + // }, // "response": { - // "$ref": "OrganizationSettings" + // "$ref": "Finding" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -13362,41 +13587,37 @@ func (c *OrganizationsGetOrganizationSettingsCall) Do(opts ...googleapi.CallOpti } -// method id "securitycenter.organizations.updateOrganizationSettings": +// method id "securitycenter.folders.sources.findings.setState": -type OrganizationsUpdateOrganizationSettingsCall struct { - s *Service - name string - organizationsettings *OrganizationSettings - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersSourcesFindingsSetStateCall struct { + s *Service + name string + setfindingstaterequest *SetFindingStateRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// UpdateOrganizationSettings: Updates an organization's settings. +// SetState: Updates the state of a finding. // -// - 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)} +// - 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.organizationsettings = organizationsettings - return c -} - -// UpdateMask sets the optional parameter "updateMask": The FieldMask to -// use when updating the settings resource. If empty all mutable fields -// will be updated. -func (c *OrganizationsUpdateOrganizationSettingsCall) UpdateMask(updateMask string) *OrganizationsUpdateOrganizationSettingsCall { - c.urlParams_.Set("updateMask", updateMask) + 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 *OrganizationsUpdateOrganizationSettingsCall) Fields(s ...googleapi.Field) *OrganizationsUpdateOrganizationSettingsCall { +func (c *FoldersSourcesFindingsSetStateCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsSetStateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -13404,21 +13625,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 *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 *OrganizationsUpdateOrganizationSettingsCall) Header() http.Header { +func (c *FoldersSourcesFindingsSetStateCall) 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 *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_ { @@ -13426,16 +13647,16 @@ 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.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}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setState") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -13446,14 +13667,14 @@ func (c *OrganizationsUpdateOrganizationSettingsCall) doRequest(alt string) (*ht return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.updateOrganizationSettings" call. -// Exactly one of *OrganizationSettings or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *OrganizationSettings.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsUpdateOrganizationSettingsCall) Do(opts ...googleapi.CallOption) (*OrganizationSettings, error) { +// Do executes the "securitycenter.folders.sources.findings.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 { @@ -13472,7 +13693,7 @@ func (c *OrganizationsUpdateOrganizationSettingsCall) Do(opts ...googleapi.CallO if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &OrganizationSettings{ + ret := &Finding{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13484,34 +13705,28 @@ 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", + // "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": "The relative resource name of the settings. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/organizationSettings\".", + // "description": "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": "^organizations/[^/]+/organizationSettings$", + // "pattern": "^folders/[^/]+/sources/[^/]+/findings/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "The FieldMask to use when updating the settings resource. If empty all mutable fields will be updated.", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+name}:setState", // "request": { - // "$ref": "OrganizationSettings" + // "$ref": "SetFindingStateRequest" // }, // "response": { - // "$ref": "OrganizationSettings" + // "$ref": "Finding" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -13520,34 +13735,55 @@ func (c *OrganizationsUpdateOrganizationSettingsCall) Do(opts ...googleapi.CallO } -// method id "securitycenter.organizations.assets.group": +// method id "securitycenter.folders.sources.findings.updateSecurityMarks": -type OrganizationsAssetsGroupCall struct { - s *Service - parent string - groupassetsrequest *GroupAssetsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersSourcesFindingsUpdateSecurityMarksCall 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 *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 *OrganizationsAssetsGroupCall) Fields(s ...googleapi.Field) *OrganizationsAssetsGroupCall { +func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsUpdateSecurityMarksCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -13555,21 +13791,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 *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 *OrganizationsAssetsGroupCall) Header() http.Header { +func (c *FoldersSourcesFindingsUpdateSecurityMarksCall) 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 *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_ { @@ -13577,34 +13813,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.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 *OrganizationsAssetsGroupCall) Do(opts ...googleapi.CallOption) (*GroupAssetsResponse, 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 { @@ -13623,7 +13859,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, @@ -13635,29 +13871,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/folders/{foldersId}/sources/{sourcesId}/findings/{findingsId}/securityMarks", + // "httpMethod": "PATCH", + // "id": "securitycenter.folders.sources.findings.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": "^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/{+parent}/assets:group", + // "path": "v1/{+name}", // "request": { - // "$ref": "GroupAssetsRequest" + // "$ref": "SecurityMarks" // }, // "response": { - // "$ref": "GroupAssetsResponse" + // "$ref": "SecurityMarks" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -13666,178 +13913,1796 @@ 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 +// 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 + 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 *FoldersSourcesFindingsExternalSystemsPatchCall) Fields(s ...googleapi.Field) *FoldersSourcesFindingsExternalSystemsPatchCall { + 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 *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 *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 + return 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 { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsGetOrganizationSettingsCall) IfNoneMatch(entityTag string) *OrganizationsGetOrganizationSettingsCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *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 *OrganizationsGetOrganizationSettingsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsGetOrganizationSettingsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + 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.getOrganizationSettings" call. +// Exactly one of *OrganizationSettings or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *OrganizationSettings.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsGetOrganizationSettingsCall) Do(opts ...googleapi.CallOption) (*OrganizationSettings, 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 := &OrganizationSettings{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the settings for an organization.", + // "flatPath": "v1/organizations/{organizationsId}/organizationSettings", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.getOrganizationSettings", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. Name of the organization to get organization settings for. Its format is \"organizations/[organization_id]/organizationSettings\".", + // "location": "path", + // "pattern": "^organizations/[^/]+/organizationSettings$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "response": { + // "$ref": "OrganizationSettings" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "securitycenter.organizations.updateOrganizationSettings": + +type OrganizationsUpdateOrganizationSettingsCall struct { + s *Service + name string + organizationsettings *OrganizationSettings + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// 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 +} + +// UpdateMask sets the optional parameter "updateMask": The FieldMask to +// use when updating the settings resource. If empty all mutable fields +// will be updated. +func (c *OrganizationsUpdateOrganizationSettingsCall) UpdateMask(updateMask string) *OrganizationsUpdateOrganizationSettingsCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsUpdateOrganizationSettingsCall) Fields(s ...googleapi.Field) *OrganizationsUpdateOrganizationSettingsCall { + 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 *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 *OrganizationsUpdateOrganizationSettingsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +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_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.organizationsettings) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+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.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 { + 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 := &OrganizationSettings{ + 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 an organization's settings.", + // "flatPath": "v1/organizations/{organizationsId}/organizationSettings", + // "httpMethod": "PATCH", + // "id": "securitycenter.organizations.updateOrganizationSettings", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The relative resource name of the settings. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/organizationSettings\".", + // "location": "path", + // "pattern": "^organizations/[^/]+/organizationSettings$", + // "required": true, + // "type": "string" + // }, + // "updateMask": { + // "description": "The FieldMask to use when updating the settings resource. If empty all mutable fields will be updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "request": { + // "$ref": "OrganizationSettings" + // }, + // "response": { + // "$ref": "OrganizationSettings" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "securitycenter.organizations.assets.group": + +type OrganizationsAssetsGroupCall struct { + s *Service + parent string + groupassetsrequest *GroupAssetsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Group: Filters an organization's assets and groups them by their +// specified properties. +// +// - parent: 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 *OrganizationsAssetsGroupCall) Fields(s ...googleapi.Field) *OrganizationsAssetsGroupCall { + 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 *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 *OrganizationsAssetsGroupCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +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_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupassetsrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/assets:group") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "securitycenter.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 { + 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 := &GroupAssetsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "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", + // "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]\".", + // "location": "path", + // "pattern": "^organizations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+parent}/assets:group", + // "request": { + // "$ref": "GroupAssetsRequest" + // }, + // "response": { + // "$ref": "GroupAssetsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *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 err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.groupassetsrequest.PageToken = x.NextPageToken + } +} + +// method id "securitycenter.organizations.assets.list": + +type OrganizationsAssetsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists an organization's assets. +// +// - 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 +} + +// CompareDuration sets the optional parameter "compareDuration": When +// compare_duration is set, the ListAssetsResult's "state_change" +// attribute is updated to indicate whether the asset was added, +// removed, or remained present during the compare_duration period of +// time that precedes the read_time. This is the time between (read_time +// - compare_duration) and read_time. The state_change value is derived +// based on the presence of the asset at the two points in time. +// Intermediate state changes between the two times don't affect the +// result. For example, the results aren't affected if the asset is +// removed and re-created again. Possible "state_change" values when +// compare_duration is specified: * "ADDED": indicates that the asset +// was not present at the start of compare_duration, but present at +// read_time. * "REMOVED": indicates that the asset was present at the +// start of compare_duration, but not present at read_time. * "ACTIVE": +// indicates that the asset was present at both the start and the end of +// the time period defined by compare_duration and read_time. If +// compare_duration is not specified, then the only possible +// state_change is "UNUSED", which will be the state_change set for all +// assets present at read_time. +func (c *OrganizationsAssetsListCall) CompareDuration(compareDuration string) *OrganizationsAssetsListCall { + c.urlParams_.Set("compareDuration", compareDuration) + return c +} + +// FieldMask sets the optional parameter "fieldMask": A field mask to +// specify the ListAssetsResult fields to be listed in the response. An +// empty field mask will list all fields. +func (c *OrganizationsAssetsListCall) FieldMask(fieldMask string) *OrganizationsAssetsListCall { + c.urlParams_.Set("fieldMask", fieldMask) + return c +} + +// Filter sets the optional parameter "filter": Expression that defines +// the filter to apply across assets. The expression is a list of zero +// or more restrictions combined via logical operators `AND` and `OR`. +// Parentheses are supported, and `OR` has higher precedence than `AND`. +// Restrictions have the form ` ` and may have a `-` character in front +// of them to indicate negation. The fields map to those defined in the +// Asset resource. Examples include: * name * +// security_center_properties.resource_name * +// resource_properties.a_property * security_marks.marks.marka The +// supported operators are: * `=` for all value types. * `>`, `<`, `>=`, +// `<=` for integer values. * `:`, meaning substring matching, for +// strings. The supported value types are: * string literals in quotes. +// * integer literals without quotes. * boolean literals `true` and +// `false` without quotes. The following are the allowed field and +// operator combinations: * name: `=` * update_time: `=`, `>`, `<`, +// `>=`, `<=` Usage: This should be milliseconds since epoch or an +// RFC3339 string. Examples: `update_time = "2019-06-10T16:07:18-07:00" +// `update_time = 1560208038000` * create_time: `=`, `>`, `<`, `>=`, +// `<=` Usage: This should be milliseconds since epoch or an RFC3339 +// string. Examples: `create_time = "2019-06-10T16:07:18-07:00" +// `create_time = 1560208038000` * iam_policy.policy_blob: `=`, `:` * +// resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * +// security_marks.marks: `=`, `:` * +// security_center_properties.resource_name: `=`, `:` * +// security_center_properties.resource_display_name: `=`, `:` * +// security_center_properties.resource_type: `=`, `:` * +// security_center_properties.resource_parent: `=`, `:` * +// security_center_properties.resource_parent_display_name: `=`, `:` * +// security_center_properties.resource_project: `=`, `:` * +// security_center_properties.resource_project_display_name: `=`, `:` * +// security_center_properties.resource_owners: `=`, `:` For example, +// `resource_properties.size = 100` is a valid filter string. Use a +// partial match on the empty string to filter based on a property +// existing: `resource_properties.my_property : "" Use a negated +// partial match on the empty string to filter based on a property not +// existing: `-resource_properties.my_property : "" +func (c *OrganizationsAssetsListCall) Filter(filter string) *OrganizationsAssetsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// OrderBy sets the optional parameter "orderBy": Expression that +// defines what fields and order to use for sorting. The string value +// should follow SQL syntax: comma separated list of fields. For +// example: "name,resource_properties.a_property". The default sorting +// order is ascending. To specify descending order for a field, a suffix +// " desc" should be appended to the field name. For example: "name +// desc,resource_properties.a_property". Redundant space characters in +// the syntax are insignificant. "name +// desc,resource_properties.a_property" and " name desc , +// resource_properties.a_property " are equivalent. The following fields +// are supported: name update_time resource_properties +// security_marks.marks security_center_properties.resource_name +// security_center_properties.resource_display_name +// security_center_properties.resource_parent +// security_center_properties.resource_parent_display_name +// security_center_properties.resource_project +// security_center_properties.resource_project_display_name +// security_center_properties.resource_type +func (c *OrganizationsAssetsListCall) OrderBy(orderBy string) *OrganizationsAssetsListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return in a single response. Default is 10, minimum is +// 1, maximum is 1000. +func (c *OrganizationsAssetsListCall) PageSize(pageSize int64) *OrganizationsAssetsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last `ListAssetsResponse`; indicates that this is a +// continuation of a prior `ListAssets` call, and that the system should +// return the next page of data. +func (c *OrganizationsAssetsListCall) PageToken(pageToken string) *OrganizationsAssetsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReadTime sets the optional parameter "readTime": Time used as a +// reference point when filtering assets. The filter is limited to +// assets existing at the supplied time and their values are those at +// that specific time. Absence of this field will default to the API's +// version of NOW. +func (c *OrganizationsAssetsListCall) ReadTime(readTime string) *OrganizationsAssetsListCall { + c.urlParams_.Set("readTime", readTime) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsAssetsListCall) Fields(s ...googleapi.Field) *OrganizationsAssetsListCall { + 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 { + c.ctx_ = 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 { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +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_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/assets") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "securitycenter.organizations.assets.list" call. +// Exactly one of *ListAssetsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListAssetsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAssetsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + 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 := &ListAssetsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "deprecated": true, + // "description": "Lists an organization's assets.", + // "flatPath": "v1/organizations/{organizationsId}/assets", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.assets.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "compareDuration": { + // "description": "When compare_duration is set, the ListAssetsResult's \"state_change\" attribute is updated to indicate whether the asset was added, removed, or remained present during the compare_duration period of time that precedes the read_time. This is the time between (read_time - compare_duration) and read_time. The state_change value is derived based on the presence of the asset at the two points in time. Intermediate state changes between the two times don't affect the result. For example, the results aren't affected if the asset is removed and re-created again. Possible \"state_change\" values when compare_duration is specified: * \"ADDED\": indicates that the asset was not present at the start of compare_duration, but present at read_time. * \"REMOVED\": indicates that the asset was present at the start of compare_duration, but not present at read_time. * \"ACTIVE\": indicates that the asset was present at both the start and the end of the time period defined by compare_duration and read_time. If compare_duration is not specified, then the only possible state_change is \"UNUSED\", which will be the state_change set for all assets present at read_time.", + // "format": "google-duration", + // "location": "query", + // "type": "string" + // }, + // "fieldMask": { + // "description": "A field mask to specify the ListAssetsResult fields to be listed in the response. An empty field mask will list all fields.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // }, + // "filter": { + // "description": "Expression that defines the filter to apply across assets. The expression is a list of zero or more restrictions combined via logical operators `AND` and `OR`. Parentheses are supported, and `OR` has higher precedence than `AND`. Restrictions have the form ` ` and may have a `-` character in front of them to indicate negation. The fields map to those defined in the Asset resource. Examples include: * name * security_center_properties.resource_name * resource_properties.a_property * security_marks.marks.marka The supported operators are: * `=` for all value types. * `\u003e`, `\u003c`, `\u003e=`, `\u003c=` for integer values. * `:`, meaning substring matching, for strings. The supported value types are: * string literals in quotes. * integer literals without quotes. * boolean literals `true` and `false` without quotes. The following are the allowed field and operator combinations: * name: `=` * update_time: `=`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: `update_time = \"2019-06-10T16:07:18-07:00\"` `update_time = 1560208038000` * create_time: `=`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: `create_time = \"2019-06-10T16:07:18-07:00\"` `create_time = 1560208038000` * iam_policy.policy_blob: `=`, `:` * resource_properties: `=`, `:`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` * security_marks.marks: `=`, `:` * security_center_properties.resource_name: `=`, `:` * security_center_properties.resource_display_name: `=`, `:` * security_center_properties.resource_type: `=`, `:` * security_center_properties.resource_parent: `=`, `:` * security_center_properties.resource_parent_display_name: `=`, `:` * security_center_properties.resource_project: `=`, `:` * security_center_properties.resource_project_display_name: `=`, `:` * security_center_properties.resource_owners: `=`, `:` For example, `resource_properties.size = 100` is a valid filter string. Use a partial match on the empty string to filter based on a property existing: `resource_properties.my_property : \"\"` Use a negated partial match on the empty string to filter based on a property not existing: `-resource_properties.my_property : \"\"`", + // "location": "query", + // "type": "string" + // }, + // "orderBy": { + // "description": "Expression that defines what fields and order to use for sorting. The string value should follow SQL syntax: comma separated list of fields. For example: \"name,resource_properties.a_property\". The default sorting order is ascending. To specify descending order for a field, a suffix \" desc\" should be appended to the field name. For example: \"name desc,resource_properties.a_property\". Redundant space characters in the syntax are insignificant. \"name desc,resource_properties.a_property\" and \" name desc , resource_properties.a_property \" are equivalent. The following fields are supported: name update_time resource_properties security_marks.marks security_center_properties.resource_name security_center_properties.resource_display_name security_center_properties.resource_parent security_center_properties.resource_parent_display_name security_center_properties.resource_project security_center_properties.resource_project_display_name security_center_properties.resource_type", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value returned by the last `ListAssetsResponse`; indicates that this is a continuation of a prior `ListAssets` call, and that the system should return the next page of data.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. 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/[^/]+$", + // "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", + // "response": { + // "$ref": "ListAssetsResponse" + // }, + // "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 *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": + +type OrganizationsAssetsRunDiscoveryCall struct { + s *Service + parent string + runassetdiscoveryrequest *RunAssetDiscoveryRequest + 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. +// +// - 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 *OrganizationsAssetsRunDiscoveryCall) Fields(s ...googleapi.Field) *OrganizationsAssetsRunDiscoveryCall { + 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 *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 *OrganizationsAssetsRunDiscoveryCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsAssetsRunDiscoveryCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + 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 += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "securitycenter.organizations.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 { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "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": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. Name of the organization to run asset discovery for. Its format is \"organizations/[organization_id]\".", + // "location": "path", + // "pattern": "^organizations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+parent}/assets:runDiscovery", + // "request": { + // "$ref": "RunAssetDiscoveryRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "securitycenter.organizations.assets.updateSecurityMarks": + +type OrganizationsAssetsUpdateSecurityMarksCall 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 *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 *OrganizationsAssetsUpdateSecurityMarksCall) Fields(s ...googleapi.Field) *OrganizationsAssetsUpdateSecurityMarksCall { + 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 *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 *OrganizationsAssetsUpdateSecurityMarksCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +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_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitymarks) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "securitycenter.organizations.assets.updateSecurityMarks" call. +// Exactly one of *SecurityMarks or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SecurityMarks.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsAssetsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOption) (*SecurityMarks, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + 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/organizations/{organizationsId}/assets/{assetsId}/securityMarks", + // "httpMethod": "PATCH", + // "id": "securitycenter.organizations.assets.updateSecurityMarks", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The relative resource name of the SecurityMarks. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Examples: \"organizations/{organization_id}/assets/{asset_id}/securityMarks\" \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks\".", + // "location": "path", + // "pattern": "^organizations/[^/]+/assets/[^/]+/securityMarks$", + // "required": true, + // "type": "string" + // }, + // "startTime": { + // "description": "The time at which the updated SecurityMarks take effect. If not set uses current server time. Updates will be applied to the SecurityMarks that are active immediately preceding this time. Must be earlier or equal to the server time.", + // "format": "google-datetime", + // "location": "query", + // "type": "string" + // }, + // "updateMask": { + // "description": "The FieldMask to use when updating the security marks resource. The field mask must not contain duplicate fields. If empty or set to \"marks\", all marks will be replaced. Individual marks can be updated using \"marks.\".", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "request": { + // "$ref": "SecurityMarks" + // }, + // "response": { + // "$ref": "SecurityMarks" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "securitycenter.organizations.bigQueryExports.create": + +type OrganizationsBigQueryExportsCreateCall struct { + s *Service + parent string + googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a BigQuery export. +// +// - 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 +} + +// 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 *OrganizationsBigQueryExportsCreateCall) Fields(s ...googleapi.Field) *OrganizationsBigQueryExportsCreateCall { + 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 *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 *OrganizationsBigQueryExportsCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +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()) + 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}/bigQueryExports") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "securitycenter.organizations.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 { + if res.Body != nil { + res.Body.Close() } - if x.NextPageToken == "" { - return nil + 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 := &GoogleCloudSecuritycenterV1BigQueryExport{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a BigQuery export.", + // "flatPath": "v1/organizations/{organizationsId}/bigQueryExports", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.bigQueryExports.create", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "bigQueryExportId": { + // "description": "Required. Unique identifier provided by the client within the parent scope. It must consist of 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]\".", + // "location": "path", + // "pattern": "^organizations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+parent}/bigQueryExports", + // "request": { + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // }, + // "response": { + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "securitycenter.organizations.bigQueryExports.delete": + +type OrganizationsBigQueryExportsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes an existing 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)} + 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 *OrganizationsBigQueryExportsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsBigQueryExportsDeleteCall { + 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 *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 *OrganizationsBigQueryExportsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +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_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "securitycenter.organizations.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 { + if res.Body != nil { + res.Body.Close() } - c.groupassetsrequest.PageToken = x.NextPageToken + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes an existing BigQuery export.", + // "flatPath": "v1/organizations/{organizationsId}/bigQueryExports/{bigQueryExportsId}", + // "httpMethod": "DELETE", + // "id": "securitycenter.organizations.bigQueryExports.delete", + // "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}", + // "location": "path", + // "pattern": "^organizations/[^/]+/bigQueryExports/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + } -// method id "securitycenter.organizations.assets.list": +// method id "securitycenter.organizations.bigQueryExports.get": -type OrganizationsAssetsListCall struct { +type OrganizationsBigQueryExportsGetCall struct { s *Service - parent string + name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists an organization's assets. +// Get: Gets 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)} - c.parent = parent +// - 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 return c } -// CompareDuration sets the optional parameter "compareDuration": When -// compare_duration is set, the ListAssetsResult's "state_change" -// attribute is updated to indicate whether the asset was added, -// removed, or remained present during the compare_duration period of -// time that precedes the read_time. This is the time between (read_time -// - compare_duration) and read_time. The state_change value is derived -// based on the presence of the asset at the two points in time. -// Intermediate state changes between the two times don't affect the -// result. For example, the results aren't affected if the asset is -// removed and re-created again. Possible "state_change" values when -// compare_duration is specified: * "ADDED": indicates that the asset -// was not present at the start of compare_duration, but present at -// read_time. * "REMOVED": indicates that the asset was present at the -// start of compare_duration, but not present at read_time. * "ACTIVE": -// indicates that the asset was present at both the start and the end of -// the time period defined by compare_duration and read_time. If -// compare_duration is not specified, then the only possible -// state_change is "UNUSED", which will be the state_change set for all -// assets present at read_time. -func (c *OrganizationsAssetsListCall) CompareDuration(compareDuration string) *OrganizationsAssetsListCall { - c.urlParams_.Set("compareDuration", compareDuration) +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsBigQueryExportsGetCall) Fields(s ...googleapi.Field) *OrganizationsBigQueryExportsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// FieldMask sets the optional parameter "fieldMask": A field mask to -// specify the ListAssetsResult fields to be listed in the response. An -// empty field mask will list all fields. -func (c *OrganizationsAssetsListCall) FieldMask(fieldMask string) *OrganizationsAssetsListCall { - c.urlParams_.Set("fieldMask", fieldMask) +// 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 } -// 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) +// Context sets the context 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 { + 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,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) +// 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 { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +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()) + 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.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 { + 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 := &GoogleCloudSecuritycenterV1BigQueryExport{ + 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 BigQuery export.", + // "flatPath": "v1/organizations/{organizationsId}/bigQueryExports/{bigQueryExportsId}", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.bigQueryExports.get", + // "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}", + // "location": "path", + // "pattern": "^organizations/[^/]+/bigQueryExports/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "response": { + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "securitycenter.organizations.bigQueryExports.list": + +type OrganizationsBigQueryExportsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists BigQuery exports. Note that when requesting BigQuery +// exports at a given level all exports under that level are also +// returned e.g. if requesting BigQuery exports under a folder, then all +// BigQuery exports immediately under the folder plus the ones created +// under the projects within the folder are returned. +// +// - parent: The parent, which owns the collection of BigQuery exports. +// Its format is "organizations/[organization_id]", +// "folders/[folder_id]", "projects/[project_id]". +func (r *OrganizationsBigQueryExportsService) List(parent string) *OrganizationsBigQueryExportsListCall { + c := &OrganizationsBigQueryExportsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent return c } // 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 { +// 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": 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 { +// 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 } -// 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 *OrganizationsAssetsListCall) Fields(s ...googleapi.Field) *OrganizationsAssetsListCall { +func (c *OrganizationsBigQueryExportsListCall) Fields(s ...googleapi.Field) *OrganizationsBigQueryExportsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -13847,7 +15712,7 @@ func (c *OrganizationsAssetsListCall) 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 *OrganizationsAssetsListCall) IfNoneMatch(entityTag string) *OrganizationsAssetsListCall { +func (c *OrganizationsBigQueryExportsListCall) IfNoneMatch(entityTag string) *OrganizationsBigQueryExportsListCall { c.ifNoneMatch_ = entityTag return c } @@ -13855,21 +15720,21 @@ func (c *OrganizationsAssetsListCall) 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 *OrganizationsAssetsListCall) Context(ctx context.Context) *OrganizationsAssetsListCall { +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 *OrganizationsAssetsListCall) Header() http.Header { +func (c *OrganizationsBigQueryExportsListCall) 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 *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_ { @@ -13882,7 +15747,7 @@ func (c *OrganizationsAssetsListCall) doRequest(alt string) (*http.Response, err var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/assets") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/bigQueryExports") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -13895,14 +15760,14 @@ 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 +// 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 *OrganizationsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAssetsResponse, error) { +func (c *OrganizationsBigQueryExportsListCall) Do(opts ...googleapi.CallOption) (*ListBigQueryExportsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13921,7 +15786,7 @@ func (c *OrganizationsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAss if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListAssetsResponse{ + ret := &ListBigQueryExportsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13933,65 +15798,36 @@ func (c *OrganizationsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAss } return ret, nil // { - // "deprecated": true, - // "description": "Lists an organization's assets.", - // "flatPath": "v1/organizations/{organizationsId}/assets", + // "description": "Lists BigQuery exports. Note that when requesting BigQuery exports at a given level all exports under that level are also returned e.g. if requesting BigQuery exports under a folder, then all BigQuery exports immediately under the folder plus the ones created under the projects within the folder are returned.", + // "flatPath": "v1/organizations/{organizationsId}/bigQueryExports", // "httpMethod": "GET", - // "id": "securitycenter.organizations.assets.list", + // "id": "securitycenter.organizations.bigQueryExports.list", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "compareDuration": { - // "description": "When compare_duration is set, the ListAssetsResult's \"state_change\" attribute is updated to indicate whether the asset was added, removed, or remained present during the compare_duration period of time that precedes the read_time. This is the time between (read_time - compare_duration) and read_time. The state_change value is derived based on the presence of the asset at the two points in time. Intermediate state changes between the two times don't affect the result. For example, the results aren't affected if the asset is removed and re-created again. Possible \"state_change\" values when compare_duration is specified: * \"ADDED\": indicates that the asset was not present at the start of compare_duration, but present at read_time. * \"REMOVED\": indicates that the asset was present at the start of compare_duration, but not present at read_time. * \"ACTIVE\": indicates that the asset was present at both the start and the end of the time period defined by compare_duration and read_time. If compare_duration is not specified, then the only possible state_change is \"UNUSED\", which will be the state_change set for all assets present at read_time.", - // "format": "google-duration", - // "location": "query", - // "type": "string" - // }, - // "fieldMask": { - // "description": "A field mask to specify the ListAssetsResult fields to be listed in the response. An empty field mask will list all fields.", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" - // }, - // "filter": { - // "description": "Expression that defines the filter to apply across assets. The expression is a list of zero or more restrictions combined via logical operators `AND` and `OR`. Parentheses are supported, and `OR` has higher precedence than `AND`. Restrictions have the form ` ` and may have a `-` character in front of them to indicate negation. The fields map to those defined in the Asset resource. Examples include: * name * security_center_properties.resource_name * resource_properties.a_property * security_marks.marks.marka The supported operators are: * `=` for all value types. * `\u003e`, `\u003c`, `\u003e=`, `\u003c=` for integer values. * `:`, meaning substring matching, for strings. The supported value types are: * string literals in quotes. * integer literals without quotes. * boolean literals `true` and `false` without quotes. The following are the allowed field and operator combinations: * name: `=` * update_time: `=`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: `update_time = \"2019-06-10T16:07:18-07:00\"` `update_time = 1560208038000` * create_time: `=`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: `create_time = \"2019-06-10T16:07:18-07:00\"` `create_time = 1560208038000` * iam_policy.policy_blob: `=`, `:` * resource_properties: `=`, `:`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` * security_marks.marks: `=`, `:` * security_center_properties.resource_name: `=`, `:` * security_center_properties.resource_display_name: `=`, `:` * security_center_properties.resource_type: `=`, `:` * security_center_properties.resource_parent: `=`, `:` * security_center_properties.resource_parent_display_name: `=`, `:` * security_center_properties.resource_project: `=`, `:` * security_center_properties.resource_project_display_name: `=`, `:` * security_center_properties.resource_owners: `=`, `:` For example, `resource_properties.size = 100` is a valid filter string. Use a partial match on the empty string to filter based on a property existing: `resource_properties.my_property : \"\"` Use a negated partial match on the empty string to filter based on a property not existing: `-resource_properties.my_property : \"\"`", - // "location": "query", - // "type": "string" - // }, - // "orderBy": { - // "description": "Expression that defines what fields and order to use for sorting. The string value should follow SQL syntax: comma separated list of fields. For example: \"name,resource_properties.a_property\". The default sorting order is ascending. To specify descending order for a field, a suffix \" desc\" should be appended to the field name. For example: \"name desc,resource_properties.a_property\". Redundant space characters in the syntax are insignificant. \"name desc,resource_properties.a_property\" and \" name desc , resource_properties.a_property \" are equivalent. The following fields are supported: name update_time resource_properties security_marks.marks security_center_properties.resource_name security_center_properties.resource_display_name security_center_properties.resource_parent security_center_properties.resource_parent_display_name security_center_properties.resource_project security_center_properties.resource_project_display_name security_center_properties.resource_type", - // "location": "query", - // "type": "string" - // }, // "pageSize": { - // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", + // "description": "The maximum number of configs to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "The value returned by the last `ListAssetsResponse`; indicates that this is a continuation of a prior `ListAssets` call, and that the system should return the next page of data.", + // "description": "A page token, received from a previous `ListBigQueryExports` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListBigQueryExports` must match the call that provided the page token.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. 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 parent, which owns the collection of BigQuery exports. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", \"projects/[project_id]\".", // "location": "path", // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" - // }, - // "readTime": { - // "description": "Time used as a reference point when filtering assets. The filter is limited to assets existing at the supplied time and their values are those at that specific time. Absence of this field will default to the API's version of NOW.", - // "format": "google-datetime", - // "location": "query", - // "type": "string" // } // }, - // "path": "v1/{+parent}/assets", + // "path": "v1/{+parent}/bigQueryExports", // "response": { - // "$ref": "ListAssetsResponse" + // "$ref": "ListBigQueryExportsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -14003,7 +15839,7 @@ 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 { +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 { @@ -14021,35 +15857,45 @@ func (c *OrganizationsAssetsListCall) Pages(ctx context.Context, f func(*ListAss } } -// method id "securitycenter.organizations.assets.runDiscovery": +// method id "securitycenter.organizations.bigQueryExports.patch": -type OrganizationsAssetsRunDiscoveryCall struct { - s *Service - parent string - runassetdiscoveryrequest *RunAssetDiscoveryRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsBigQueryExportsPatchCall struct { + s *Service + name string + googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// RunDiscovery: Runs asset discovery. The discovery is tracked with a -// long-running operation. This API can only be called with limited -// frequency for an organization. If it is called too frequently the -// caller will receive a TOO_MANY_REQUESTS error. +// Patch: Updates a 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 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 *OrganizationsAssetsRunDiscoveryCall) Fields(s ...googleapi.Field) *OrganizationsAssetsRunDiscoveryCall { +func (c *OrganizationsBigQueryExportsPatchCall) Fields(s ...googleapi.Field) *OrganizationsBigQueryExportsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -14057,21 +15903,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 *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 *OrganizationsAssetsRunDiscoveryCall) Header() http.Header { +func (c *OrganizationsBigQueryExportsPatchCall) 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 *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_ { @@ -14079,34 +15925,36 @@ func (c *OrganizationsAssetsRunDiscoveryCall) doRequest(alt string) (*http.Respo } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.runassetdiscoveryrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.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:runDiscovery") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.assets.runDiscovery" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *OrganizationsAssetsRunDiscoveryCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// Do executes the "securitycenter.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 { @@ -14125,7 +15973,7 @@ func (c *OrganizationsAssetsRunDiscoveryCall) Do(opts ...googleapi.CallOption) ( if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &GoogleCloudSecuritycenterV1BigQueryExport{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14137,29 +15985,34 @@ 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": "Updates a BigQuery export.", + // "flatPath": "v1/organizations/{organizationsId}/bigQueryExports/{bigQueryExportsId}", + // "httpMethod": "PATCH", + // "id": "securitycenter.organizations.bigQueryExports.patch", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. Name of the organization to run asset discovery for. Its format is \"organizations/[organization_id]\".", + // "name": { + // "description": "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/[^/]+$", + // "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/{+parent}/assets:runDiscovery", + // "path": "v1/{+name}", // "request": { - // "$ref": "RunAssetDiscoveryRequest" + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" // }, // "response": { - // "$ref": "Operation" + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -14168,55 +16021,34 @@ func (c *OrganizationsAssetsRunDiscoveryCall) Do(opts ...googleapi.CallOption) ( } -// method id "securitycenter.organizations.assets.updateSecurityMarks": +// method id "securitycenter.organizations.eventThreatDetectionSettings.validateCustomModule": -type OrganizationsAssetsUpdateSecurityMarksCall struct { - s *Service - name string - securitymarks *SecurityMarks - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall struct { + s *Service + parent string + validateeventthreatdetectioncustommodulerequest *ValidateEventThreatDetectionCustomModuleRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// UpdateSecurityMarks: Updates security marks. +// ValidateCustomModule: Validates the given Event Threat Detection +// custom module. // -// - 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) +// - 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 *OrganizationsAssetsUpdateSecurityMarksCall) Fields(s ...googleapi.Field) *OrganizationsAssetsUpdateSecurityMarksCall { +func (c *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -14224,21 +16056,21 @@ func (c *OrganizationsAssetsUpdateSecurityMarksCall) 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 *OrganizationsAssetsUpdateSecurityMarksCall) Context(ctx context.Context) *OrganizationsAssetsUpdateSecurityMarksCall { +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 *OrganizationsAssetsUpdateSecurityMarksCall) Header() http.Header { +func (c *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) 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 *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_ { @@ -14246,34 +16078,36 @@ func (c *OrganizationsAssetsUpdateSecurityMarksCall) doRequest(alt string) (*htt } 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.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("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.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.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) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14292,7 +16126,7 @@ func (c *OrganizationsAssetsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOp if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &SecurityMarks{ + ret := &ValidateEventThreatDetectionCustomModuleResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14304,40 +16138,28 @@ 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": "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": "The relative resource name of the SecurityMarks. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Examples: \"organizations/{organization_id}/assets/{asset_id}/securityMarks\" \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks\".", + // "parent": { + // "description": "Required. Resource name of the parent to validate the Custom Module under. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\".", // "location": "path", - // "pattern": "^organizations/[^/]+/assets/[^/]+/securityMarks$", + // "pattern": "^organizations/[^/]+/eventThreatDetectionSettings$", // "required": true, // "type": "string" - // }, - // "startTime": { - // "description": "The time at which the updated SecurityMarks take effect. If not set uses current server time. Updates will be applied to the SecurityMarks that are active immediately preceding this time. Must be earlier or equal to the server time.", - // "format": "google-datetime", - // "location": "query", - // "type": "string" - // }, - // "updateMask": { - // "description": "The FieldMask to use when updating the security marks resource. The field mask must not contain duplicate fields. If empty or set to \"marks\", all marks will be replaced. Individual marks can be updated using \"marks.\".", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}:validateCustomModule", // "request": { - // "$ref": "SecurityMarks" + // "$ref": "ValidateEventThreatDetectionCustomModuleRequest" // }, // "response": { - // "$ref": "SecurityMarks" + // "$ref": "ValidateEventThreatDetectionCustomModuleResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -14346,43 +16168,32 @@ func (c *OrganizationsAssetsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOp } -// method id "securitycenter.organizations.bigQueryExports.create": +// method id "securitycenter.organizations.eventThreatDetectionSettings.customModules.create": -type OrganizationsBigQueryExportsCreateCall struct { - s *Service - parent string - googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall struct { + s *Service + parent string + eventthreatdetectioncustommodule *EventThreatDetectionCustomModule + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates a BigQuery export. +// Create: Creates an Event Threat Detection custom module. // -// - 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)} +// - 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 - 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) + 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 *OrganizationsBigQueryExportsCreateCall) Fields(s ...googleapi.Field) *OrganizationsBigQueryExportsCreateCall { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -14390,21 +16201,21 @@ func (c *OrganizationsBigQueryExportsCreateCall) Fields(s ...googleapi.Field) *O // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsBigQueryExportsCreateCall) Context(ctx context.Context) *OrganizationsBigQueryExportsCreateCall { +func (c *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 *OrganizationsBigQueryExportsCreateCall) Header() http.Header { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) 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 *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_ { @@ -14412,14 +16223,14 @@ func (c *OrganizationsBigQueryExportsCreateCall) doRequest(alt string) (*http.Re } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1bigqueryexport) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.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("POST", urls, body) if err != nil { @@ -14432,16 +16243,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.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) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14460,7 +16269,7 @@ func (c *OrganizationsBigQueryExportsCreateCall) Do(opts ...googleapi.CallOption if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1BigQueryExport{ + ret := &EventThreatDetectionCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14472,33 +16281,28 @@ func (c *OrganizationsBigQueryExportsCreateCall) Do(opts ...googleapi.CallOption } return ret, nil // { - // "description": "Creates a BigQuery export.", - // "flatPath": "v1/organizations/{organizationsId}/bigQueryExports", + // "description": "Creates an Event Threat Detection custom module.", + // "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules", // "httpMethod": "POST", - // "id": "securitycenter.organizations.bigQueryExports.create", + // "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.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 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 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": "GoogleCloudSecuritycenterV1BigQueryExport" + // "$ref": "EventThreatDetectionCustomModule" // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // "$ref": "EventThreatDetectionCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -14507,9 +16311,9 @@ func (c *OrganizationsBigQueryExportsCreateCall) Do(opts ...googleapi.CallOption } -// method id "securitycenter.organizations.bigQueryExports.delete": +// method id "securitycenter.organizations.eventThreatDetectionSettings.customModules.delete": -type OrganizationsBigQueryExportsDeleteCall struct { +type OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -14517,14 +16321,13 @@ type OrganizationsBigQueryExportsDeleteCall struct { header_ http.Header } -// Delete: Deletes an existing BigQuery export. +// Delete: Deletes an Event Threat Detection custom module. // -// - 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: 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 return c } @@ -14532,7 +16335,7 @@ func (r *OrganizationsBigQueryExportsService) Delete(name string) *Organizations // 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 *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -14540,21 +16343,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 *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 *OrganizationsBigQueryExportsDeleteCall) Header() http.Header { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) 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 *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_ { @@ -14577,14 +16380,14 @@ 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. +// 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 *OrganizationsBigQueryExportsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +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 { @@ -14615,18 +16418,18 @@ func (c *OrganizationsBigQueryExportsDeleteCall) Do(opts ...googleapi.CallOption } return ret, nil // { - // "description": "Deletes an existing BigQuery export.", - // "flatPath": "v1/organizations/{organizationsId}/bigQueryExports/{bigQueryExportsId}", + // "description": "Deletes an Event Threat Detection custom module.", + // "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules/{customModulesId}", // "httpMethod": "DELETE", - // "id": "securitycenter.organizations.bigQueryExports.delete", + // "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.delete", // "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": "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" // } @@ -14642,9 +16445,9 @@ func (c *OrganizationsBigQueryExportsDeleteCall) Do(opts ...googleapi.CallOption } -// method id "securitycenter.organizations.bigQueryExports.get": +// method id "securitycenter.organizations.eventThreatDetectionSettings.customModules.get": -type OrganizationsBigQueryExportsGetCall struct { +type OrganizationsEventThreatDetectionSettingsCustomModulesGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -14653,14 +16456,13 @@ type OrganizationsBigQueryExportsGetCall struct { header_ http.Header } -// Get: Gets a BigQuery export. +// Get: Gets an 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)} +// - 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 } @@ -14668,7 +16470,7 @@ func (r *OrganizationsBigQueryExportsService) Get(name string) *OrganizationsBig // 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 *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -14678,7 +16480,7 @@ func (c *OrganizationsBigQueryExportsGetCall) Fields(s ...googleapi.Field) *Orga // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsBigQueryExportsGetCall) IfNoneMatch(entityTag string) *OrganizationsBigQueryExportsGetCall { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) IfNoneMatch(entityTag string) *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall { c.ifNoneMatch_ = entityTag return c } @@ -14686,21 +16488,21 @@ func (c *OrganizationsBigQueryExportsGetCall) IfNoneMatch(entityTag string) *Org // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsBigQueryExportsGetCall) Context(ctx context.Context) *OrganizationsBigQueryExportsGetCall { +func (c *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 *OrganizationsBigQueryExportsGetCall) Header() http.Header { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) 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 *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_ { @@ -14726,16 +16528,14 @@ func (c *OrganizationsBigQueryExportsGetCall) doRequest(alt string) (*http.Respo return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.bigQueryExports.get" call. -// Exactly one of *GoogleCloudSecuritycenterV1BigQueryExport or error -// will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudSecuritycenterV1BigQueryExport.ServerResponse.Header or -// (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *OrganizationsBigQueryExportsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1BigQueryExport, error) { +// Do executes the "securitycenter.organizations.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 { @@ -14754,7 +16554,7 @@ func (c *OrganizationsBigQueryExportsGetCall) Do(opts ...googleapi.CallOption) ( if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1BigQueryExport{ + ret := &EventThreatDetectionCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14766,25 +16566,25 @@ func (c *OrganizationsBigQueryExportsGetCall) Do(opts ...googleapi.CallOption) ( } return ret, nil // { - // "description": "Gets a BigQuery export.", - // "flatPath": "v1/organizations/{organizationsId}/bigQueryExports/{bigQueryExportsId}", + // "description": "Gets an Event Threat Detection custom module.", + // "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules/{customModulesId}", // "httpMethod": "GET", - // "id": "securitycenter.organizations.bigQueryExports.get", + // "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.get", // "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": "Required. Name of the custom module to get. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings/customModules/{module}\".", // "location": "path", - // "pattern": "^organizations/[^/]+/bigQueryExports/[^/]+$", + // "pattern": "^organizations/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1/{+name}", // "response": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // "$ref": "EventThreatDetectionCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -14793,9 +16593,9 @@ func (c *OrganizationsBigQueryExportsGetCall) Do(opts ...googleapi.CallOption) ( } -// method id "securitycenter.organizations.bigQueryExports.list": +// method id "securitycenter.organizations.eventThreatDetectionSettings.customModules.list": -type OrganizationsBigQueryExportsListCall struct { +type OrganizationsEventThreatDetectionSettingsCustomModulesListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -14804,36 +16604,32 @@ type OrganizationsBigQueryExportsListCall struct { 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. +// List: Lists Event Threat Detection custom modules. // -// - 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: 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 configs to return. The service may return fewer than this value. +// 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 *OrganizationsBigQueryExportsListCall) PageSize(pageSize int64) *OrganizationsBigQueryExportsListCall { +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 `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 { +// 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 } @@ -14841,7 +16637,7 @@ func (c *OrganizationsBigQueryExportsListCall) PageToken(pageToken string) *Orga // 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 *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsCustomModulesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -14851,7 +16647,7 @@ func (c *OrganizationsBigQueryExportsListCall) Fields(s ...googleapi.Field) *Org // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsBigQueryExportsListCall) IfNoneMatch(entityTag string) *OrganizationsBigQueryExportsListCall { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) IfNoneMatch(entityTag string) *OrganizationsEventThreatDetectionSettingsCustomModulesListCall { c.ifNoneMatch_ = entityTag return c } @@ -14859,21 +16655,21 @@ func (c *OrganizationsBigQueryExportsListCall) IfNoneMatch(entityTag string) *Or // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsBigQueryExportsListCall) Context(ctx context.Context) *OrganizationsBigQueryExportsListCall { +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 *OrganizationsBigQueryExportsListCall) Header() http.Header { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) 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 *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_ { @@ -14886,7 +16682,7 @@ func (c *OrganizationsBigQueryExportsListCall) doRequest(alt string) (*http.Resp var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/bigQueryExports") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customModules") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -14899,14 +16695,16 @@ func (c *OrganizationsBigQueryExportsListCall) doRequest(alt string) (*http.Resp return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.bigQueryExports.list" call. -// Exactly one of *ListBigQueryExportsResponse or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *ListBigQueryExportsResponse.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsBigQueryExportsListCall) Do(opts ...googleapi.CallOption) (*ListBigQueryExportsResponse, error) { +// Do executes the "securitycenter.organizations.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 { @@ -14925,7 +16723,7 @@ func (c *OrganizationsBigQueryExportsListCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListBigQueryExportsResponse{ + ret := &ListEventThreatDetectionCustomModulesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14937,36 +16735,36 @@ 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", + // "description": "Lists Event Threat Detection custom modules.", + // "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules", // "httpMethod": "GET", - // "id": "securitycenter.organizations.bigQueryExports.list", + // "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.list", // "parameterOrder": [ // "parent" // ], // "parameters": { // "pageSize": { - // "description": "The maximum number of configs to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + // "description": "The maximum number of 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 `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.", + // "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 parent, which owns the collection of BigQuery exports. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", \"projects/[project_id]\".", + // "description": "Required. Name of the parent to list custom modules under. 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", // "response": { - // "$ref": "ListBigQueryExportsResponse" + // "$ref": "ListEventThreatDetectionCustomModulesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -14978,7 +16776,7 @@ 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 { +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 { @@ -14996,37 +16794,37 @@ func (c *OrganizationsBigQueryExportsListCall) Pages(ctx context.Context, f func } } -// method id "securitycenter.organizations.bigQueryExports.patch": +// method id "securitycenter.organizations.eventThreatDetectionSettings.customModules.patch": -type OrganizationsBigQueryExportsPatchCall struct { - s *Service - name string - googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall struct { + s *Service + name string + eventthreatdetectioncustommodule *EventThreatDetectionCustomModule + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates a BigQuery export. +// Patch: Updates 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: 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)} c.name = name - c.googlecloudsecuritycenterv1bigqueryexport = googlecloudsecuritycenterv1bigqueryexport + 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 *OrganizationsBigQueryExportsPatchCall) UpdateMask(updateMask string) *OrganizationsBigQueryExportsPatchCall { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) UpdateMask(updateMask string) *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall { c.urlParams_.Set("updateMask", updateMask) return c } @@ -15034,7 +16832,7 @@ func (c *OrganizationsBigQueryExportsPatchCall) UpdateMask(updateMask string) *O // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsBigQueryExportsPatchCall) Fields(s ...googleapi.Field) *OrganizationsBigQueryExportsPatchCall { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -15042,21 +16840,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 *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 *OrganizationsBigQueryExportsPatchCall) Header() http.Header { +func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) 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 *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_ { @@ -15064,7 +16862,7 @@ func (c *OrganizationsBigQueryExportsPatchCall) doRequest(alt string) (*http.Res } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1bigqueryexport) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventthreatdetectioncustommodule) if err != nil { return nil, err } @@ -15084,16 +16882,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.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 { @@ -15112,7 +16908,7 @@ func (c *OrganizationsBigQueryExportsPatchCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1BigQueryExport{ + ret := &EventThreatDetectionCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -15124,18 +16920,18 @@ func (c *OrganizationsBigQueryExportsPatchCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Updates a BigQuery export.", - // "flatPath": "v1/organizations/{organizationsId}/bigQueryExports/{bigQueryExportsId}", + // "description": "Updates an Event Threat Detection custom module.", + // "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules/{customModulesId}", // "httpMethod": "PATCH", - // "id": "securitycenter.organizations.bigQueryExports.patch", + // "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.patch", // "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": "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/[^/]+/bigQueryExports/[^/]+$", + // "pattern": "^organizations/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", // "required": true, // "type": "string" // }, @@ -15148,10 +16944,10 @@ func (c *OrganizationsBigQueryExportsPatchCall) Do(opts ...googleapi.CallOption) // }, // "path": "v1/{+name}", // "request": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // "$ref": "EventThreatDetectionCustomModule" // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // "$ref": "EventThreatDetectionCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -15160,34 +16956,36 @@ func (c *OrganizationsBigQueryExportsPatchCall) Do(opts ...googleapi.CallOption) } -// method id "securitycenter.organizations.eventThreatDetectionSettings.validateCustomModule": +// method id "securitycenter.organizations.findings.bulkMute": -type OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall struct { - s *Service - parent string - validateeventthreatdetectioncustommodulerequest *ValidateEventThreatDetectionCustomModuleRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsFindingsBulkMuteCall struct { + s *Service + parent string + bulkmutefindingsrequest *BulkMuteFindingsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } - -// 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". -func (r *OrganizationsEventThreatDetectionSettingsService) ValidateCustomModule(parent string, validateeventthreatdetectioncustommodulerequest *ValidateEventThreatDetectionCustomModuleRequest) *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall { - c := &OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall{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 *OrganizationsFindingsService) BulkMute(parent string, bulkmutefindingsrequest *BulkMuteFindingsRequest) *OrganizationsFindingsBulkMuteCall { + c := &OrganizationsFindingsBulkMuteCall{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 *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall { +func (c *OrganizationsFindingsBulkMuteCall) Fields(s ...googleapi.Field) *OrganizationsFindingsBulkMuteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -15195,21 +16993,21 @@ func (c *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) 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 *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) Context(ctx context.Context) *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall { +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 *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) Header() http.Header { +func (c *OrganizationsFindingsBulkMuteCall) 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 *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_ { @@ -15217,14 +17015,14 @@ func (c *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) doRe } 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 { @@ -15237,16 +17035,14 @@ func (c *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) doRe 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.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 { @@ -15265,7 +17061,7 @@ func (c *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) Do(o 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, @@ -15277,28 +17073,28 @@ func (c *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) Do(o } return ret, nil // { - // "description": "Validates the given Event Threat Detection custom module.", - // "flatPath": "v1/organizations/{organizationsId}/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/organizations/{organizationsId}/findings:bulkMute", // "httpMethod": "POST", - // "id": "securitycenter.organizations.eventThreatDetectionSettings.validateCustomModule", + // "id": "securitycenter.organizations.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\".", + // "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$", + // "pattern": "^organizations/[^/]+$", // "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" @@ -15307,32 +17103,35 @@ func (c *OrganizationsEventThreatDetectionSettingsValidateCustomModuleCall) Do(o } -// method id "securitycenter.organizations.eventThreatDetectionSettings.customModules.create": +// method id "securitycenter.organizations.locations.muteConfigs.delete": -type OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall struct { - s *Service - parent string - eventthreatdetectioncustommodule *EventThreatDetectionCustomModule - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsLocationsMuteConfigsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates an Event Threat Detection custom module. +// Delete: Deletes an existing mute config. // -// - 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 - c.eventthreatdetectioncustommodule = eventthreatdetectioncustommodule +// - name: Name of the mute config to delete. Its format is +// organizations/{organization}/muteConfigs/{config_id}, +// folders/{folder}/muteConfigs/{config_id}, +// projects/{project}/muteConfigs/{config_id}, +// organizations/{organization}/locations/global/muteConfigs/{config_id +// }, folders/{folder}/locations/global/muteConfigs/{config_id}, or +// projects/{project}/locations/global/muteConfigs/{config_id}. +func (r *OrganizationsLocationsMuteConfigsService) Delete(name string) *OrganizationsLocationsMuteConfigsDeleteCall { + c := &OrganizationsLocationsMuteConfigsDeleteCall{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 *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall { +func (c *OrganizationsLocationsMuteConfigsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsMuteConfigsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -15340,21 +17139,21 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) 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 *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) Context(ctx context.Context) *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall { +func (c *OrganizationsLocationsMuteConfigsDeleteCall) Context(ctx context.Context) *OrganizationsLocationsMuteConfigsDeleteCall { c.ctx_ = 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 *OrganizationsLocationsMuteConfigsDeleteCall) 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 *OrganizationsLocationsMuteConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -15362,34 +17161,29 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) 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/{+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("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.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.locations.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 *OrganizationsLocationsMuteConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15408,7 +17202,7 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) Do(op 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, @@ -15420,28 +17214,25 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) Do(op } return ret, nil // { - // "description": "Creates an Event Threat Detection custom module.", - // "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules", - // "httpMethod": "POST", - // "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.create", + // "description": "Deletes an existing mute config.", + // "flatPath": "v1/organizations/{organizationsId}/locations/{locationsId}/muteConfigs/{muteConfigsId}", + // "httpMethod": "DELETE", + // "id": "securitycenter.organizations.locations.muteConfigs.delete", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. The new custom module's parent. Its format is: * \"organizations/{organization}/eventThreatDetectionSettings\".", + // "name": { + // "description": "Required. Name of the mute config to delete. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", // "location": "path", - // "pattern": "^organizations/[^/]+/eventThreatDetectionSettings$", + // "pattern": "^organizations/[^/]+/locations/[^/]+/muteConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/customModules", - // "request": { - // "$ref": "EventThreatDetectionCustomModule" - // }, + // "path": "v1/{+name}", // "response": { - // "$ref": "EventThreatDetectionCustomModule" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -15450,23 +17241,28 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesCreateCall) Do(op } -// method id "securitycenter.organizations.eventThreatDetectionSettings.customModules.delete": +// method id "securitycenter.organizations.locations.muteConfigs.get": -type OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsLocationsMuteConfigsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes an Event Threat Detection custom module. +// Get: Gets a mute config. // -// - 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)} +// - name: Name of the mute config to retrieve. Its format is +// organizations/{organization}/muteConfigs/{config_id}, +// folders/{folder}/muteConfigs/{config_id}, +// projects/{project}/muteConfigs/{config_id}, +// organizations/{organization}/locations/global/muteConfigs/{config_id +// }, folders/{folder}/locations/global/muteConfigs/{config_id}, or +// projects/{project}/locations/global/muteConfigs/{config_id}. +func (r *OrganizationsLocationsMuteConfigsService) Get(name string) *OrganizationsLocationsMuteConfigsGetCall { + c := &OrganizationsLocationsMuteConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -15474,41 +17270,54 @@ func (r *OrganizationsEventThreatDetectionSettingsCustomModulesService) Delete(n // 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 *OrganizationsLocationsMuteConfigsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsMuteConfigsGetCall { 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 *OrganizationsLocationsMuteConfigsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsMuteConfigsGetCall { + 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 *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) Context(ctx context.Context) *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall { +func (c *OrganizationsLocationsMuteConfigsGetCall) Context(ctx context.Context) *OrganizationsLocationsMuteConfigsGetCall { c.ctx_ = 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 *OrganizationsLocationsMuteConfigsGetCall) 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 *OrganizationsLocationsMuteConfigsGetCall) doRequest(alt string) (*http.Response, 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 } @@ -15519,14 +17328,15 @@ 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.locations.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 *OrganizationsLocationsMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15545,7 +17355,7 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) Do(op 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, @@ -15557,25 +17367,25 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) Do(op } return ret, nil // { - // "description": "Deletes an Event Threat Detection custom module.", - // "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules/{customModulesId}", - // "httpMethod": "DELETE", - // "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.delete", + // "description": "Gets a mute config.", + // "flatPath": "v1/organizations/{organizationsId}/locations/{locationsId}/muteConfigs/{muteConfigsId}", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.locations.muteConfigs.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the custom module to delete. Its format is: * \"organizations/{organization}/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}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", // "location": "path", - // "pattern": "^organizations/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", + // "pattern": "^organizations/[^/]+/locations/[^/]+/muteConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1/{+name}", // "response": { - // "$ref": "Empty" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -15584,79 +17394,83 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesDeleteCall) Do(op } -// method id "securitycenter.organizations.eventThreatDetectionSettings.customModules.get": +// method id "securitycenter.organizations.locations.muteConfigs.patch": -type OrganizationsEventThreatDetectionSettingsCustomModulesGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsLocationsMuteConfigsPatchCall struct { + s *Service + name string + googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets an Event Threat Detection custom module. +// Patch: Updates a mute config. // -// - 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)} +// - 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}" +// "organizations/{organization}/locations/global/muteConfigs/{mute_con +// fig}" "folders/{folder}/locations/global/muteConfigs/{mute_config}" +// "projects/{project}/locations/global/muteConfigs/{mute_config}". +func (r *OrganizationsLocationsMuteConfigsService) Patch(name string, googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig) *OrganizationsLocationsMuteConfigsPatchCall { + c := &OrganizationsLocationsMuteConfigsPatchCall{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 *OrganizationsLocationsMuteConfigsPatchCall) UpdateMask(updateMask string) *OrganizationsLocationsMuteConfigsPatchCall { + 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 *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) Fields(s ...googleapi.Field) *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall { +func (c *OrganizationsLocationsMuteConfigsPatchCall) Fields(s ...googleapi.Field) *OrganizationsLocationsMuteConfigsPatchCall { 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 *OrganizationsLocationsMuteConfigsPatchCall) Context(ctx context.Context) *OrganizationsLocationsMuteConfigsPatchCall { c.ctx_ = 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 *OrganizationsLocationsMuteConfigsPatchCall) 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 *OrganizationsLocationsMuteConfigsPatchCall) doRequest(alt string) (*http.Response, 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 } - var body io.Reader = nil + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "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 } @@ -15667,14 +17481,15 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) doReques 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 +// Do executes the "securitycenter.organizations.locations.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 *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) Do(opts ...googleapi.CallOption) (*EventThreatDetectionCustomModule, error) { +func (c *OrganizationsLocationsMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15693,7 +17508,7 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) 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, @@ -15705,25 +17520,34 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesGetCall) Do(opts } return ret, nil // { - // "description": "Gets an Event Threat Detection custom module.", - // "flatPath": "v1/organizations/{organizationsId}/eventThreatDetectionSettings/customModules/{customModulesId}", - // "httpMethod": "GET", - // "id": "securitycenter.organizations.eventThreatDetectionSettings.customModules.get", + // "description": "Updates a mute config.", + // "flatPath": "v1/organizations/{organizationsId}/locations/{locationsId}/muteConfigs/{muteConfigsId}", + // "httpMethod": "PATCH", + // "id": "securitycenter.organizations.locations.muteConfigs.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the custom module to get. Its format is: * \"organizations/{organization}/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}\" \"organizations/{organization}/locations/global/muteConfigs/{mute_config}\" \"folders/{folder}/locations/global/muteConfigs/{mute_config}\" \"projects/{project}/locations/global/muteConfigs/{mute_config}\"", // "location": "path", - // "pattern": "^organizations/[^/]+/eventThreatDetectionSettings/customModules/[^/]+$", + // "pattern": "^organizations/[^/]+/locations/[^/]+/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": "EventThreatDetectionCustomModule" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -15732,98 +17556,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 Event Threat Detection custom modules. +// Create: Creates a mute config. // -// - 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)} +// - 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 } @@ -15834,16 +17642,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 { @@ -15862,7 +17669,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, @@ -15874,36 +17681,33 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesListCall) Do(opts } return ret, nil // { - // "description": "Lists Event Threat Detection custom modules.", - // "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 under. Its format is: * \"organizations/{organization}/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" @@ -15912,66 +17716,35 @@ 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 Event Threat Detection custom 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}, +// projects/{project}/muteConfigs/{config_id}, +// organizations/{organization}/locations/global/muteConfigs/{config_id +// }, folders/{folder}/locations/global/muteConfigs/{config_id}, or +// projects/{project}/locations/global/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 } @@ -15979,21 +17752,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_ { @@ -16001,16 +17774,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 } @@ -16021,14 +17789,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 { @@ -16047,7 +17815,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, @@ -16059,34 +17827,25 @@ func (c *OrganizationsEventThreatDetectionSettingsCustomModulesPatchCall) Do(opt } return ret, nil // { - // "description": "Updates an Event Threat Detection custom 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}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/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" @@ -16095,93 +17854,102 @@ 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}, +// projects/{project}/muteConfigs/{config_id}, +// organizations/{organization}/locations/global/muteConfigs/{config_id +// }, folders/{folder}/locations/global/muteConfigs/{config_id}, or +// projects/{project}/locations/global/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 { @@ -16200,7 +17968,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, @@ -16212,28 +17980,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}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/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" @@ -16242,82 +18007,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 } @@ -16328,15 +18109,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 { @@ -16355,7 +18135,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, @@ -16367,21 +18147,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, @@ -16389,11 +18175,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" @@ -16402,32 +18185,65 @@ 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}" +// "organizations/{organization}/locations/global/muteConfigs/{mute_con +// fig}" "folders/{folder}/locations/global/muteConfigs/{mute_config}" +// "projects/{project}/locations/global/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 } @@ -16435,21 +18251,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_ { @@ -16457,11 +18273,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 } @@ -16472,14 +18293,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 { @@ -16498,7 +18320,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, @@ -16510,25 +18332,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}\" \"organizations/{organization}/locations/global/muteConfigs/{mute_config}\" \"folders/{folder}/locations/global/muteConfigs/{mute_config}\" \"projects/{project}/locations/global/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" @@ -16537,99 +18368,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 { @@ -16648,7 +18479,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, @@ -16660,25 +18491,33 @@ 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" @@ -16687,116 +18526,84 @@ func (c *OrganizationsMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*Goo } -// 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 -} +// method id "securitycenter.organizations.notificationConfigs.delete": -// 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) +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 { @@ -16815,7 +18622,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, @@ -16827,36 +18634,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" @@ -16865,101 +18661,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 } @@ -16970,15 +18745,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 { @@ -16997,7 +18771,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, @@ -17009,34 +18783,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" @@ -17045,81 +18810,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 } -// Create: Creates a notification config. +// List: Lists notification configs. // -// - 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)} +// - 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 - 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) +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return in a single response. Default is 10, minimum is +// 1, maximum is 1000. +func (c *OrganizationsNotificationConfigsListCall) PageSize(pageSize int64) *OrganizationsNotificationConfigsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last `ListNotificationConfigsResponse`; indicates that this is +// a continuation of a prior `ListNotificationConfigs` call, and that +// the system should return the next page of data. +func (c *OrganizationsNotificationConfigsListCall) PageToken(pageToken string) *OrganizationsNotificationConfigsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *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 } @@ -17130,14 +18910,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 { @@ -17156,7 +18936,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, @@ -17168,21 +18948,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, @@ -17190,11 +18976,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" @@ -17203,32 +18986,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 } @@ -17236,21 +19054,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_ { @@ -17258,11 +19076,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 } @@ -17273,14 +19096,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 { @@ -17299,7 +19122,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, @@ -17311,25 +19134,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" @@ -17338,25 +19170,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 } @@ -17364,54 +19201,41 @@ func (r *OrganizationsNotificationConfigsService) Get(name string) *Organization // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsNotificationConfigsGetCall) Fields(s ...googleapi.Field) *OrganizationsNotificationConfigsGetCall { +func (c *OrganizationsOperationsCancelCall) Fields(s ...googleapi.Field) *OrganizationsOperationsCancelCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *OrganizationsNotificationConfigsGetCall) IfNoneMatch(entityTag string) *OrganizationsNotificationConfigsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsNotificationConfigsGetCall) Context(ctx context.Context) *OrganizationsNotificationConfigsGetCall { +func (c *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 } @@ -17422,14 +19246,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 { @@ -17448,7 +19272,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, @@ -17460,25 +19284,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" @@ -17487,114 +19311,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 { @@ -17613,7 +19407,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, @@ -17625,36 +19419,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" @@ -17663,106 +19446,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()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationconfig) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -17773,14 +19529,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 { @@ -17799,7 +19555,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, @@ -17811,34 +19567,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" @@ -17847,72 +19594,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 } @@ -17923,14 +19698,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 { @@ -17949,7 +19724,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, @@ -17961,25 +19736,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" @@ -17988,32 +19779,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 } @@ -18021,21 +19836,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_ { @@ -18043,29 +19858,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 { @@ -18084,7 +19905,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, @@ -18096,25 +19917,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" @@ -18123,24 +19947,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 } @@ -18148,54 +19969,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 } @@ -18206,14 +20014,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 { @@ -18232,7 +20040,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, @@ -18244,25 +20052,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" @@ -18271,9 +20079,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 @@ -18282,42 +20090,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 } @@ -18327,7 +20113,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 } @@ -18335,21 +20121,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_ { @@ -18375,14 +20161,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 { @@ -18401,7 +20189,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, @@ -18413,41 +20201,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" @@ -18456,95 +20228,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.resourceValueConfigs.batchCreate": +// method id "securitycenter.organizations.resourceValueConfigs.list": -type OrganizationsResourceValueConfigsBatchCreateCall struct { - s *Service - parent string - batchcreateresourcevalueconfigsrequest *BatchCreateResourceValueConfigsRequest - 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 } -// BatchCreate: Creates a ResourceValueConfig for an organization. Maps -// user's tags to difference resource values for use by the attack path -// simulation. +// List: Lists all ResourceValueConfigs. // -// - 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)} +// - 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.batchcreateresourcevalueconfigsrequest = batchcreateresourcevalueconfigsrequest + 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 *OrganizationsResourceValueConfigsBatchCreateCall) Fields(s ...googleapi.Field) *OrganizationsResourceValueConfigsBatchCreateCall { +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 *OrganizationsResourceValueConfigsBatchCreateCall) Context(ctx context.Context) *OrganizationsResourceValueConfigsBatchCreateCall { +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 *OrganizationsResourceValueConfigsBatchCreateCall) Header() http.Header { +func (c *OrganizationsResourceValueConfigsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsResourceValueConfigsBatchCreateCall) 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.batchcreateresourcevalueconfigsrequest) - 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}/resourceValueConfigs:batchCreate") + 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 } @@ -18555,15 +20330,14 @@ func (c *OrganizationsResourceValueConfigsBatchCreateCall) doRequest(alt string) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// 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 +// 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 *OrganizationsResourceValueConfigsBatchCreateCall) Do(opts ...googleapi.CallOption) (*BatchCreateResourceValueConfigsResponse, error) { +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 { @@ -18582,7 +20356,7 @@ func (c *OrganizationsResourceValueConfigsBatchCreateCall) Do(opts ...googleapi. if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &BatchCreateResourceValueConfigsResponse{ + ret := &ListResourceValueConfigsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -18594,28 +20368,36 @@ func (c *OrganizationsResourceValueConfigsBatchCreateCall) Do(opts ...googleapi. } return ret, nil // { - // "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", + // "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 ResourceValueConfig's parent. The parent field in the CreateResourceValueConfigRequest messages must either be empty or match this field.", + // "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:batchCreate", - // "request": { - // "$ref": "BatchCreateResourceValueConfigsRequest" - // }, + // "path": "v1/{+parent}/resourceValueConfigs", // "response": { - // "$ref": "BatchCreateResourceValueConfigsResponse" + // "$ref": "ListResourceValueConfigsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -18624,29 +20406,59 @@ func (c *OrganizationsResourceValueConfigsBatchCreateCall) Do(opts ...googleapi. } -// method id "securitycenter.organizations.resourceValueConfigs.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) + } +} -type OrganizationsResourceValueConfigsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "securitycenter.organizations.resourceValueConfigs.patch": + +type OrganizationsResourceValueConfigsPatchCall struct { + s *Service + name string + googlecloudsecuritycenterv1resourcevalueconfig *GoogleCloudSecuritycenterV1ResourceValueConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a ResourceValueConfig. +// Patch: Updates an existing ResourceValueConfigs with new rules. // -// - name: Name of the ResourceValueConfig to delete. -func (r *OrganizationsResourceValueConfigsService) Delete(name string) *OrganizationsResourceValueConfigsDeleteCall { - c := &OrganizationsResourceValueConfigsDeleteCall{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 *OrganizationsResourceValueConfigsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsResourceValueConfigsDeleteCall { +func (c *OrganizationsResourceValueConfigsPatchCall) Fields(s ...googleapi.Field) *OrganizationsResourceValueConfigsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -18654,21 +20466,21 @@ func (c *OrganizationsResourceValueConfigsDeleteCall) 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 *OrganizationsResourceValueConfigsDeleteCall) Context(ctx context.Context) *OrganizationsResourceValueConfigsDeleteCall { +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 *OrganizationsResourceValueConfigsDeleteCall) Header() http.Header { +func (c *OrganizationsResourceValueConfigsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsResourceValueConfigsDeleteCall) 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_ { @@ -18676,11 +20488,16 @@ func (c *OrganizationsResourceValueConfigsDeleteCall) doRequest(alt string) (*ht } 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 } @@ -18691,14 +20508,16 @@ func (c *OrganizationsResourceValueConfigsDeleteCall) doRequest(alt string) (*ht return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// 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) { +// 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 { @@ -18717,7 +20536,7 @@ func (c *OrganizationsResourceValueConfigsDeleteCall) Do(opts ...googleapi.CallO 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, @@ -18729,25 +20548,34 @@ func (c *OrganizationsResourceValueConfigsDeleteCall) Do(opts ...googleapi.CallO } return ret, nil // { - // "description": "Deletes a ResourceValueConfig.", + // "description": "Updates an existing ResourceValueConfigs with new rules.", // "flatPath": "v1/organizations/{organizationsId}/resourceValueConfigs/{resourceValueConfigsId}", - // "httpMethod": "DELETE", - // "id": "securitycenter.organizations.resourceValueConfigs.delete", + // "httpMethod": "PATCH", + // "id": "securitycenter.organizations.resourceValueConfigs.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Name of the ResourceValueConfig to delete", + // "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": "Empty" + // "$ref": "GoogleCloudSecuritycenterV1ResourceValueConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -18756,98 +20584,97 @@ func (c *OrganizationsResourceValueConfigsDeleteCall) Do(opts ...googleapi.CallO } -// method id "securitycenter.organizations.resourceValueConfigs.get": +// method id "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.create": -type OrganizationsResourceValueConfigsGetCall 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: Gets a ResourceValueConfig. +// 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 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 +// - 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 *OrganizationsResourceValueConfigsGetCall) Fields(s ...googleapi.Field) *OrganizationsResourceValueConfigsGetCall { +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 *OrganizationsResourceValueConfigsGetCall) IfNoneMatch(entityTag string) *OrganizationsResourceValueConfigsGetCall { - 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 *OrganizationsResourceValueConfigsGetCall) Context(ctx context.Context) *OrganizationsResourceValueConfigsGetCall { +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 *OrganizationsResourceValueConfigsGetCall) Header() http.Header { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsResourceValueConfigsGetCall) 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.resourceValueConfigs.get" call. -// Exactly one of *GoogleCloudSecuritycenterV1ResourceValueConfig or +// 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 -// *GoogleCloudSecuritycenterV1ResourceValueConfig.ServerResponse.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 *OrganizationsResourceValueConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1ResourceValueConfig, 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 { @@ -18866,7 +20693,7 @@ func (c *OrganizationsResourceValueConfigsGetCall) Do(opts ...googleapi.CallOpti if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1ResourceValueConfig{ + ret := &GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -18878,25 +20705,28 @@ func (c *OrganizationsResourceValueConfigsGetCall) Do(opts ...googleapi.CallOpti } return ret, nil // { - // "description": "Gets a ResourceValueConfig.", - // "flatPath": "v1/organizations/{organizationsId}/resourceValueConfigs/{resourceValueConfigsId}", - // "httpMethod": "GET", - // "id": "securitycenter.organizations.resourceValueConfigs.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 resource value config to retrieve. Its format is organizations/{organization}/resourceValueConfigs/{config_id}.", + // "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/[^/]+/resourceValueConfigs/[^/]+$", + // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/customModules", + // "request": { + // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" + // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1ResourceValueConfig" + // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -18905,116 +20735,89 @@ func (c *OrganizationsResourceValueConfigsGetCall) Do(opts ...googleapi.CallOpti } -// method id "securitycenter.organizations.resourceValueConfigs.list": +// method id "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.delete": -type OrganizationsResourceValueConfigsListCall 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: Lists all ResourceValueConfigs. +// Delete: Deletes the specified SecurityHealthAnalyticsCustomModule and +// all of its descendants in the CRM hierarchy. This method is only +// supported for resident custom modules. // -// - 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 - 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) +// - 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 *OrganizationsResourceValueConfigsListCall) Fields(s ...googleapi.Field) *OrganizationsResourceValueConfigsListCall { +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 *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 *OrganizationsResourceValueConfigsListCall) Context(ctx context.Context) *OrganizationsResourceValueConfigsListCall { +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 *OrganizationsResourceValueConfigsListCall) Header() http.Header { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsResourceValueConfigsListCall) 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}/resourceValueConfigs") + 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.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) { +// 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 { @@ -19033,7 +20836,7 @@ func (c *OrganizationsResourceValueConfigsListCall) Do(opts ...googleapi.CallOpt if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListResourceValueConfigsResponse{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -19045,36 +20848,25 @@ func (c *OrganizationsResourceValueConfigsListCall) Do(opts ...googleapi.CallOpt } return ret, nil // { - // "description": "Lists all ResourceValueConfigs.", - // "flatPath": "v1/organizations/{organizationsId}/resourceValueConfigs", - // "httpMethod": "GET", - // "id": "securitycenter.organizations.resourceValueConfigs.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 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]\"", + // "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/[^/]+$", + // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/resourceValueConfigs", + // "path": "v1/{+name}", // "response": { - // "$ref": "ListResourceValueConfigsResponse" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -19083,98 +20875,83 @@ func (c *OrganizationsResourceValueConfigsListCall) Do(opts ...googleapi.CallOpt } -// 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": +// method id "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.get": -type OrganizationsResourceValueConfigsPatchCall struct { - s *Service - name string - googlecloudsecuritycenterv1resourcevalueconfig *GoogleCloudSecuritycenterV1ResourceValueConfig - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Patch: Updates an existing ResourceValueConfigs with new rules. +// Get: Retrieves a SecurityHealthAnalyticsCustomModule. // -// - 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)} +// - 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 - 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 *OrganizationsResourceValueConfigsPatchCall) Fields(s ...googleapi.Field) *OrganizationsResourceValueConfigsPatchCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall { 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 *OrganizationsResourceValueConfigsPatchCall) Context(ctx context.Context) *OrganizationsResourceValueConfigsPatchCall { +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 *OrganizationsResourceValueConfigsPatchCall) Header() http.Header { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsResourceValueConfigsPatchCall) 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_ { reqHeaders[k] = v } 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 + 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 } @@ -19185,16 +20962,17 @@ func (c *OrganizationsResourceValueConfigsPatchCall) doRequest(alt string) (*htt return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.resourceValueConfigs.patch" call. -// Exactly one of *GoogleCloudSecuritycenterV1ResourceValueConfig or +// Do executes the "securitycenter.organizations.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 -// *GoogleCloudSecuritycenterV1ResourceValueConfig.ServerResponse.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 *OrganizationsResourceValueConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1ResourceValueConfig, 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 { @@ -19213,7 +20991,7 @@ func (c *OrganizationsResourceValueConfigsPatchCall) Do(opts ...googleapi.CallOp if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1ResourceValueConfig{ + ret := &GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -19225,34 +21003,25 @@ func (c *OrganizationsResourceValueConfigsPatchCall) Do(opts ...googleapi.CallOp } return ret, nil // { - // "description": "Updates an existing ResourceValueConfigs with new rules.", - // "flatPath": "v1/organizations/{organizationsId}/resourceValueConfigs/{resourceValueConfigsId}", - // "httpMethod": "PATCH", - // "id": "securitycenter.organizations.resourceValueConfigs.patch", + // "description": "Retrieves a SecurityHealthAnalyticsCustomModule.", + // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules/{customModulesId}", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Name for the resource value config", + // "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/[^/]+/resourceValueConfigs/[^/]+$", + // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings/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": "GoogleCloudSecuritycenterV1ResourceValueConfig" - // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1ResourceValueConfig" + // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -19261,76 +21030,97 @@ func (c *OrganizationsResourceValueConfigsPatchCall) Do(opts ...googleapi.CallOp } -// method id "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.create": +// method id "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.list": -type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall struct { - s *Service - parent 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 } -// 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: 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. // -// - parent: Resource name of the new custom module's parent. Its format -// is "organizations/{organization}/securityHealthAnalyticsSettings", +// - parent: Name of parent to list custom modules. 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)} +func (r *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesService) List(parent string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall { + c := &OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.googlecloudsecuritycenterv1securityhealthanalyticscustommodule = googlecloudsecuritycenterv1securityhealthanalyticscustommodule + 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) return 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 *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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall { +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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Header() http.Header { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) 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 *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/{+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 } @@ -19341,17 +21131,16 @@ 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 +// 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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) 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 { @@ -19370,7 +21159,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) 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, @@ -19382,16 +21171,27 @@ 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.", + // "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": "POST", - // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.create", + // "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" + // }, // "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. 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, @@ -19399,11 +21199,8 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesCreateCall) Do // } // }, // "path": "v1/{+parent}/customModules", - // "request": { - // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" - // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" + // "$ref": "ListSecurityHealthAnalyticsCustomModulesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -19412,89 +21209,140 @@ 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 *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 OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.listDescendant": + +type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall 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. +// 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 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 +// - 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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { 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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) IfNoneMatch(entityTag string) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { + 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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall { +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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Header() http.Header { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) 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 *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_ { 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}/customModules:listDescendant") 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.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.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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Do(opts ...googleapi.CallOption) (*ListDescendantSecurityHealthAnalyticsCustomModulesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -19513,7 +21361,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Do if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &ListDescendantSecurityHealthAnalyticsCustomModulesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -19525,25 +21373,36 @@ 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": "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.customModules.listDescendant", // "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 descendant custom modules. 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:listDescendant", // "response": { - // "$ref": "Empty" + // "$ref": "ListDescendantSecurityHealthAnalyticsCustomModulesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -19552,83 +21411,111 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesDeleteCall) Do } -// method id "securitycenter.organizations.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 *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) + } +} -type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// 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 } -// Get: Retrieves a SecurityHealthAnalyticsCustomModule. +// 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: Name of the custom module to get. Its format is +// - name: Immutable. The resource name of the custom module. Its format +// is // "organizations/{organization}/securityHealthAnalyticsSettings/custom -// Modules/{customModule}", +// Modules/{customModule}", or // "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)} +// 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 +} + +// 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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall { +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 *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 *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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) Header() http.Header { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) 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 *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/{+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 } @@ -19639,7 +21526,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) doReq 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.patch" call. // Exactly one of // *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule or // error will be non-nil. Any non-2xx status code is an error. Response @@ -19649,7 +21536,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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -19680,23 +21567,32 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) Do(op } return ret, nil // { - // "description": "Retrieves a SecurityHealthAnalyticsCustomModule.", + // "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": "GET", - // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.get", + // "httpMethod": "PATCH", + // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.patch", // "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}\"", + // "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" + // }, + // "updateMask": { + // "description": "The list of fields to update.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, // "path": "v1/{+name}", + // "request": { + // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" + // }, // "response": { // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" // }, @@ -19707,97 +21603,74 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesGetCall) Do(op } -// method id "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.list": +// method id "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.simulate": -type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall struct { + s *Service + parent string + simulatesecurityhealthanalyticscustommodulerequest *SimulateSecurityHealthAnalyticsCustomModuleRequest + 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. +// Simulate: Simulates a given SecurityHealthAnalyticsCustomModule and +// Resource. // -// - 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)} +// - parent: The relative resource name of the organization, project, or +// folder. See: +// https://cloud.google.com/apis/design/resource_names#relative_resource_name +// An example is: "organizations/{organization_id}". +func (r *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesService) Simulate(parent string, simulatesecurityhealthanalyticscustommodulerequest *SimulateSecurityHealthAnalyticsCustomModuleRequest) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall { + c := &OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall{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) + c.simulatesecurityhealthanalyticscustommodulerequest = simulatesecurityhealthanalyticscustommodulerequest return 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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall { 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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall { c.ctx_ = 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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) 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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) doRequest(alt string) (*http.Response, 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.simulatesecurityhealthanalyticscustommodulerequest) + 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}/customModules:simulate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -19808,16 +21681,16 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) doRe 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 +// Do executes the "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.simulate" call. +// Exactly one of *SimulateSecurityHealthAnalyticsCustomModuleResponse +// or error will be non-nil. Any non-2xx status code is an error. +// Response headers are in either +// *SimulateSecurityHealthAnalyticsCustomModuleResponse.ServerResponse.He +// ader or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was // returned. -func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) Do(opts ...googleapi.CallOption) (*ListSecurityHealthAnalyticsCustomModulesResponse, error) { +func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) Do(opts ...googleapi.CallOption) (*SimulateSecurityHealthAnalyticsCustomModuleResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -19836,7 +21709,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListCall) Do(o if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListSecurityHealthAnalyticsCustomModulesResponse{ + ret := &SimulateSecurityHealthAnalyticsCustomModuleResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -19848,110 +21721,66 @@ 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": "Simulates a given SecurityHealthAnalyticsCustomModule and Resource.", + // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/customModules:simulate", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.simulate", // "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. The relative resource name of the organization, project, or folder. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name An example is: \"organizations/{organization_id}\".", // "location": "path", // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/customModules", + // "path": "v1/{+parent}/customModules:simulate", + // "request": { + // "$ref": "SimulateSecurityHealthAnalyticsCustomModuleRequest" + // }, // "response": { - // "$ref": "ListSecurityHealthAnalyticsCustomModulesResponse" + // "$ref": "SimulateSecurityHealthAnalyticsCustomModuleResponse" // }, // "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 *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.effectiveCustomModules.get": -type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall struct { +type OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall 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 an EffectiveSecurityHealthAnalyticsCustomModule. // -// - 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 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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -19961,7 +21790,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 *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) IfNoneMatch(entityTag string) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall { c.ifNoneMatch_ = entityTag return c } @@ -19969,21 +21798,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 *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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Header() http.Header { +func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) 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 *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_ { @@ -19996,7 +21825,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 { @@ -20004,22 +21833,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.effectiveCustomModules.get" 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 +// *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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendantCall) Do(opts ...googleapi.CallOption) (*ListDescendantSecurityHealthAnalyticsCustomModulesResponse, error) { +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 { @@ -20038,7 +21867,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesListDescendant if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListDescendantSecurityHealthAnalyticsCustomModulesResponse{ + ret := &GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -20050,36 +21879,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 an EffectiveSecurityHealthAnalyticsCustomModule.", + // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/effectiveCustomModules/{effectiveCustomModulesId}", // "httpMethod": "GET", - // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.customModules.listDescendant", + // "id": "securitycenter.organizations.securityHealthAnalyticsSettings.effectiveCustomModules.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 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/[^/]+/securityHealthAnalyticsSettings$", + // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings/effectiveCustomModules/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/customModules:listDescendant", + // "path": "v1/{+name}", // "response": { - // "$ref": "ListDescendantSecurityHealthAnalyticsCustomModulesResponse" + // "$ref": "GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModule" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -20088,132 +21906,119 @@ 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.effectiveCustomModules.list": -type OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall struct { - s *Service - name string - googlecloudsecuritycenterv1securityhealthanalyticscustommodule *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall 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 +// EffectiveSecurityHealthAnalyticsCustomModules 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 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 } -// 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 *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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall { +func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Fields(s ...googleapi.Field) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { 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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Context(ctx context.Context) *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall { +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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Header() http.Header { +func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) 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 *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_ { 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}/effectiveCustomModules") 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. +// Do executes the "securitycenter.organizations.securityHealthAnalyticsSettings.effectiveCustomModules.list" call. // Exactly one of -// *GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule or -// error will be non-nil. Any non-2xx status code is an error. Response +// *ListEffectiveSecurityHealthAnalyticsCustomModulesResponse 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 +// *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 *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule, error) { +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 { @@ -20232,7 +22037,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Do( if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule{ + ret := &ListEffectiveSecurityHealthAnalyticsCustomModulesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -20244,34 +22049,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 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", // "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, + // "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" // }, - // "updateMask": { - // "description": "The list of fields to update.", - // "format": "google-fieldmask", - // "location": "query", + // "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/[^/]+/securityHealthAnalyticsSettings$", + // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", - // "request": { - // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" - // }, + // "path": "v1/{+parent}/effectiveCustomModules", // "response": { - // "$ref": "GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule" + // "$ref": "ListEffectiveSecurityHealthAnalyticsCustomModulesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -20280,9 +22087,30 @@ 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 *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 OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall struct { +// method id "securitycenter.organizations.simulations.get": + +type OrganizationsSimulationsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -20291,17 +22119,14 @@ type OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall s header_ http.Header } -// Get: Retrieves an EffectiveSecurityHealthAnalyticsCustomModule. +// Get: Get the simulation by name or the latest simulation for the +// given organization. // -// - 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)} +// - 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 } @@ -20309,7 +22134,7 @@ func (r *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesServi // 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 *OrganizationsSimulationsGetCall) Fields(s ...googleapi.Field) *OrganizationsSimulationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -20319,7 +22144,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 *OrganizationsSimulationsGetCall) IfNoneMatch(entityTag string) *OrganizationsSimulationsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -20327,21 +22152,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 *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 *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall) Header() http.Header { +func (c *OrganizationsSimulationsGetCall) 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 *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_ { @@ -20367,17 +22192,14 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCa return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// 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) { +// 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 { @@ -20396,7 +22218,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCa if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModule{ + ret := &Simulation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -20408,25 +22230,25 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCa } return ret, nil // { - // "description": "Retrieves an EffectiveSecurityHealthAnalyticsCustomModule.", - // "flatPath": "v1/organizations/{organizationsId}/securityHealthAnalyticsSettings/effectiveCustomModules/{effectiveCustomModulesId}", + // "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.securityHealthAnalyticsSettings.effectiveCustomModules.get", + // "id": "securitycenter.organizations.simulations.get", // "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 organization name or simulation name of this simulation Valid format: \"organizations/{organization}/simulations/latest\" \"organizations/{organization}/simulations/{simulation}\"", // "location": "path", - // "pattern": "^organizations/[^/]+/securityHealthAnalyticsSettings/effectiveCustomModules/[^/]+$", + // "pattern": "^organizations/[^/]+/simulations/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1/{+name}", // "response": { - // "$ref": "GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModule" + // "$ref": "Simulation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -20435,9 +22257,9 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCa } -// method id "securitycenter.organizations.securityHealthAnalyticsSettings.effectiveCustomModules.list": +// method id "securitycenter.organizations.simulations.attackExposureResults.attackPaths.list": -type OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall struct { +type OrganizationsSimulationsAttackExposureResultsAttackPathsListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -20446,32 +22268,43 @@ type OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall 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. +// List: Lists the attack paths for a set of simulation results or +// valued resources and filter. // -// - 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)} +// - 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 *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) PageSize(pageSize int64) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { +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 call indicating a continuation -func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) PageToken(pageToken string) *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall { +// 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 *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) PageToken(pageToken string) *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -20479,7 +22312,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListC // 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 *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) Fields(s ...googleapi.Field) *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -20489,7 +22322,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListC // 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 { +func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) IfNoneMatch(entityTag string) *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall { c.ifNoneMatch_ = entityTag return c } @@ -20497,21 +22330,21 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListC // Context sets the context 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 *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 *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListCall) Header() http.Header { +func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) 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 *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_ { @@ -20524,7 +22357,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListC var body io.Reader = nil 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/{+parent}/attackPaths") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -20537,17 +22370,14 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListC return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// 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) { +// 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 +// *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 *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) Do(opts ...googleapi.CallOption) (*ListAttackPathsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -20566,7 +22396,7 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListC if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListEffectiveSecurityHealthAnalyticsCustomModulesResponse{ + ret := &ListAttackPathsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -20578,14 +22408,19 @@ 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", + // "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.securityHealthAnalyticsSettings.effectiveCustomModules.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", @@ -20593,21 +22428,21 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListC // "type": "integer" // }, // "pageToken": { - // "description": "The value returned by the last call indicating a continuation", + // "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 effective custom modules. Its format is \"organizations/{organization}/securityHealthAnalyticsSettings\", \"folders/{folder}/securityHealthAnalyticsSettings\", or \"projects/{project}/securityHealthAnalyticsSettings\"", + // "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/[^/]+/securityHealthAnalyticsSettings$", + // "pattern": "^organizations/[^/]+/simulations/[^/]+/attackExposureResults/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/effectiveCustomModules", + // "path": "v1/{+parent}/attackPaths", // "response": { - // "$ref": "ListEffectiveSecurityHealthAnalyticsCustomModulesResponse" + // "$ref": "ListAttackPathsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -20619,7 +22454,7 @@ 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 { +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 { @@ -20637,33 +22472,60 @@ func (c *OrganizationsSecurityHealthAnalyticsSettingsEffectiveCustomModulesListC } } -// method id "securitycenter.organizations.simulations.get": +// method id "securitycenter.organizations.simulations.attackExposureResults.valuedResources.list": -type OrganizationsSimulationsGetCall struct { +type OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall struct { s *Service - name string + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Get the simulation by name or the latest simulation for the -// given organization. +// List: Lists the valued resources for a set of simulation results and +// filter. // -// - 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 +// - 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 +} + +// 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 *OrganizationsSimulationsGetCall) Fields(s ...googleapi.Field) *OrganizationsSimulationsGetCall { +func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) Fields(s ...googleapi.Field) *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -20673,7 +22535,7 @@ func (c *OrganizationsSimulationsGetCall) 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 *OrganizationsSimulationsGetCall) IfNoneMatch(entityTag string) *OrganizationsSimulationsGetCall { +func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) IfNoneMatch(entityTag string) *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall { c.ifNoneMatch_ = entityTag return c } @@ -20681,21 +22543,21 @@ func (c *OrganizationsSimulationsGetCall) 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 *OrganizationsSimulationsGetCall) Context(ctx context.Context) *OrganizationsSimulationsGetCall { +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 *OrganizationsSimulationsGetCall) Header() http.Header { +func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSimulationsGetCall) 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_ { @@ -20708,7 +22570,7 @@ func (c *OrganizationsSimulationsGetCall) 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/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/valuedResources") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -20716,19 +22578,19 @@ func (c *OrganizationsSimulationsGetCall) doRequest(alt string) (*http.Response, } 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.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) { +// 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 { @@ -20747,7 +22609,7 @@ func (c *OrganizationsSimulationsGetCall) Do(opts ...googleapi.CallOption) (*Sim if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Simulation{ + ret := &ListValuedResourcesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -20759,25 +22621,41 @@ func (c *OrganizationsSimulationsGetCall) Do(opts ...googleapi.CallOption) (*Sim } return ret, nil // { - // "description": "Get the simulation by name or the latest simulation for the given organization.", - // "flatPath": "v1/organizations/{organizationsId}/simulations/{simulationsId}", + // "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.get", + // "id": "securitycenter.organizations.simulations.attackExposureResults.valuedResources.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The organization name or simulation name of this simulation Valid format: \"organizations/{organization}/simulations/latest\" \"organizations/{organization}/simulations/{simulation}\"", + // "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/[^/]+$", + // "pattern": "^organizations/[^/]+/simulations/[^/]+/attackExposureResults/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/valuedResources", // "response": { - // "$ref": "Simulation" + // "$ref": "ListValuedResourcesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -20786,9 +22664,30 @@ func (c *OrganizationsSimulationsGetCall) Do(opts ...googleapi.CallOption) (*Sim } -// method id "securitycenter.organizations.simulations.attackExposureResults.attackPaths.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 *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 OrganizationsSimulationsAttackExposureResultsAttackPathsListCall struct { +// method id "securitycenter.organizations.simulations.attackPaths.list": + +type OrganizationsSimulationsAttackPathsListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -20807,8 +22706,8 @@ type OrganizationsSimulationsAttackExposureResultsAttackPathsListCall struct { // 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)} +func (r *OrganizationsSimulationsAttackPathsService) List(parent string) *OrganizationsSimulationsAttackPathsListCall { + c := &OrganizationsSimulationsAttackPathsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } @@ -20816,7 +22715,7 @@ func (r *OrganizationsSimulationsAttackExposureResultsAttackPathsService) List(p // 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 { +func (c *OrganizationsSimulationsAttackPathsListCall) Filter(filter string) *OrganizationsSimulationsAttackPathsListCall { c.urlParams_.Set("filter", filter) return c } @@ -20824,7 +22723,7 @@ func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) Filte // 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 *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) PageSize(pageSize int64) *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall { +func (c *OrganizationsSimulationsAttackPathsListCall) PageSize(pageSize int64) *OrganizationsSimulationsAttackPathsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } @@ -20833,7 +22732,7 @@ func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) PageS // 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 *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) PageToken(pageToken string) *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall { +func (c *OrganizationsSimulationsAttackPathsListCall) PageToken(pageToken string) *OrganizationsSimulationsAttackPathsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -20841,7 +22740,7 @@ func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) PageT // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) Fields(s ...googleapi.Field) *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall { +func (c *OrganizationsSimulationsAttackPathsListCall) Fields(s ...googleapi.Field) *OrganizationsSimulationsAttackPathsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -20851,7 +22750,7 @@ func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) 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 *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) IfNoneMatch(entityTag string) *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall { +func (c *OrganizationsSimulationsAttackPathsListCall) IfNoneMatch(entityTag string) *OrganizationsSimulationsAttackPathsListCall { c.ifNoneMatch_ = entityTag return c } @@ -20859,21 +22758,21 @@ func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) IfNon // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) Context(ctx context.Context) *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall { +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 *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) Header() http.Header { +func (c *OrganizationsSimulationsAttackPathsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) 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_ { @@ -20899,14 +22798,14 @@ func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) doReq return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.simulations.attackExposureResults.attackPaths.list" call. +// 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 *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) Do(opts ...googleapi.CallOption) (*ListAttackPathsResponse, error) { +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 { @@ -20938,9 +22837,9 @@ func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) Do(op return ret, nil // { // "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", + // "flatPath": "v1/organizations/{organizationsId}/simulations/{simulationsId}/attackPaths", // "httpMethod": "GET", - // "id": "securitycenter.organizations.simulations.attackExposureResults.attackPaths.list", + // "id": "securitycenter.organizations.simulations.attackPaths.list", // "parameterOrder": [ // "parent" // ], @@ -20964,7 +22863,7 @@ func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) Do(op // "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/[^/]+$", + // "pattern": "^organizations/[^/]+/simulations/[^/]+$", // "required": true, // "type": "string" // } @@ -20983,7 +22882,7 @@ func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) Do(op // 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 *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) Pages(ctx context.Context, f func(*ListAttackPathsResponse) error) error { +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 { @@ -21001,9 +22900,9 @@ func (c *OrganizationsSimulationsAttackExposureResultsAttackPathsListCall) Pages } } -// method id "securitycenter.organizations.simulations.attackExposureResults.valuedResources.list": +// method id "securitycenter.organizations.simulations.valuedResources.list": -type OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall struct { +type OrganizationsSimulationsValuedResourcesListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -21020,8 +22919,8 @@ type OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall struct // "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)} +func (r *OrganizationsSimulationsValuedResourcesService) List(parent string) *OrganizationsSimulationsValuedResourcesListCall { + c := &OrganizationsSimulationsValuedResourcesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } @@ -21029,7 +22928,7 @@ func (r *OrganizationsSimulationsAttackExposureResultsValuedResourcesService) Li // 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 { +func (c *OrganizationsSimulationsValuedResourcesListCall) Filter(filter string) *OrganizationsSimulationsValuedResourcesListCall { c.urlParams_.Set("filter", filter) return c } @@ -21037,7 +22936,7 @@ func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) F // 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 { +func (c *OrganizationsSimulationsValuedResourcesListCall) PageSize(pageSize int64) *OrganizationsSimulationsValuedResourcesListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } @@ -21046,7 +22945,7 @@ func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) P // 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 { +func (c *OrganizationsSimulationsValuedResourcesListCall) PageToken(pageToken string) *OrganizationsSimulationsValuedResourcesListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -21054,7 +22953,7 @@ func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) P // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) Fields(s ...googleapi.Field) *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall { +func (c *OrganizationsSimulationsValuedResourcesListCall) Fields(s ...googleapi.Field) *OrganizationsSimulationsValuedResourcesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -21064,7 +22963,7 @@ func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) F // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) IfNoneMatch(entityTag string) *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall { +func (c *OrganizationsSimulationsValuedResourcesListCall) IfNoneMatch(entityTag string) *OrganizationsSimulationsValuedResourcesListCall { c.ifNoneMatch_ = entityTag return c } @@ -21072,21 +22971,21 @@ func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) I // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) Context(ctx context.Context) *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall { +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 *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) Header() http.Header { +func (c *OrganizationsSimulationsValuedResourcesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) 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_ { @@ -21112,14 +23011,14 @@ func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) d return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.simulations.attackExposureResults.valuedResources.list" call. +// 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 // *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) { +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 { @@ -21151,9 +23050,9 @@ func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) D return ret, nil // { // "description": "Lists the valued resources for a set of simulation results and filter.", - // "flatPath": "v1/organizations/{organizationsId}/simulations/{simulationsId}/attackExposureResults/{attackExposureResultsId}/valuedResources", + // "flatPath": "v1/organizations/{organizationsId}/simulations/{simulationsId}/valuedResources", // "httpMethod": "GET", - // "id": "securitycenter.organizations.simulations.attackExposureResults.valuedResources.list", + // "id": "securitycenter.organizations.simulations.valuedResources.list", // "parameterOrder": [ // "parent" // ], @@ -21177,7 +23076,7 @@ func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) D // "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/[^/]+$", + // "pattern": "^organizations/[^/]+/simulations/[^/]+$", // "required": true, // "type": "string" // } @@ -21196,7 +23095,7 @@ func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) 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 *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) Pages(ctx context.Context, f func(*ListValuedResourcesResponse) error) error { +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 { @@ -21214,9 +23113,9 @@ func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) P } } -// method id "securitycenter.organizations.simulations.attackPaths.list": +// method id "securitycenter.organizations.simulations.valuedResources.attackPaths.list": -type OrganizationsSimulationsAttackPathsListCall struct { +type OrganizationsSimulationsValuedResourcesAttackPathsListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -21235,8 +23134,8 @@ type OrganizationsSimulationsAttackPathsListCall struct { // 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)} +func (r *OrganizationsSimulationsValuedResourcesAttackPathsService) List(parent string) *OrganizationsSimulationsValuedResourcesAttackPathsListCall { + c := &OrganizationsSimulationsValuedResourcesAttackPathsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } @@ -21244,7 +23143,7 @@ func (r *OrganizationsSimulationsAttackPathsService) List(parent string) *Organi // 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 { +func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) Filter(filter string) *OrganizationsSimulationsValuedResourcesAttackPathsListCall { c.urlParams_.Set("filter", filter) return c } @@ -21252,7 +23151,7 @@ func (c *OrganizationsSimulationsAttackPathsListCall) Filter(filter string) *Org // 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 { +func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) PageSize(pageSize int64) *OrganizationsSimulationsValuedResourcesAttackPathsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } @@ -21261,7 +23160,7 @@ func (c *OrganizationsSimulationsAttackPathsListCall) PageSize(pageSize int64) * // 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 { +func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) PageToken(pageToken string) *OrganizationsSimulationsValuedResourcesAttackPathsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -21269,7 +23168,7 @@ func (c *OrganizationsSimulationsAttackPathsListCall) PageToken(pageToken string // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSimulationsAttackPathsListCall) Fields(s ...googleapi.Field) *OrganizationsSimulationsAttackPathsListCall { +func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) Fields(s ...googleapi.Field) *OrganizationsSimulationsValuedResourcesAttackPathsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -21279,7 +23178,7 @@ func (c *OrganizationsSimulationsAttackPathsListCall) Fields(s ...googleapi.Fiel // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsSimulationsAttackPathsListCall) IfNoneMatch(entityTag string) *OrganizationsSimulationsAttackPathsListCall { +func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) IfNoneMatch(entityTag string) *OrganizationsSimulationsValuedResourcesAttackPathsListCall { c.ifNoneMatch_ = entityTag return c } @@ -21287,21 +23186,21 @@ func (c *OrganizationsSimulationsAttackPathsListCall) IfNoneMatch(entityTag stri // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSimulationsAttackPathsListCall) Context(ctx context.Context) *OrganizationsSimulationsAttackPathsListCall { +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 *OrganizationsSimulationsAttackPathsListCall) Header() http.Header { +func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSimulationsAttackPathsListCall) 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_ { @@ -21327,14 +23226,14 @@ func (c *OrganizationsSimulationsAttackPathsListCall) doRequest(alt string) (*ht return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.simulations.attackPaths.list" call. +// 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 *OrganizationsSimulationsAttackPathsListCall) Do(opts ...googleapi.CallOption) (*ListAttackPathsResponse, error) { +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 { @@ -21366,9 +23265,9 @@ func (c *OrganizationsSimulationsAttackPathsListCall) Do(opts ...googleapi.CallO return ret, nil // { // "description": "Lists the attack paths for a set of simulation results or valued resources and filter.", - // "flatPath": "v1/organizations/{organizationsId}/simulations/{simulationsId}/attackPaths", + // "flatPath": "v1/organizations/{organizationsId}/simulations/{simulationsId}/valuedResources/{valuedResourcesId}/attackPaths", // "httpMethod": "GET", - // "id": "securitycenter.organizations.simulations.attackPaths.list", + // "id": "securitycenter.organizations.simulations.valuedResources.attackPaths.list", // "parameterOrder": [ // "parent" // ], @@ -21392,7 +23291,7 @@ func (c *OrganizationsSimulationsAttackPathsListCall) Do(opts ...googleapi.CallO // "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/[^/]+$", + // "pattern": "^organizations/[^/]+/simulations/[^/]+/valuedResources/[^/]+$", // "required": true, // "type": "string" // } @@ -21411,7 +23310,7 @@ func (c *OrganizationsSimulationsAttackPathsListCall) Do(opts ...googleapi.CallO // 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 { +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 { @@ -21429,107 +23328,71 @@ func (c *OrganizationsSimulationsAttackPathsListCall) Pages(ctx context.Context, } } -// method id "securitycenter.organizations.simulations.valuedResources.list": +// method id "securitycenter.organizations.sources.create": -type OrganizationsSimulationsValuedResourcesListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsSourcesCreateCall struct { + s *Service + parent string + source *Source + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists the valued resources for a set of simulation results and -// filter. +// Create: Creates a 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 *OrganizationsSimulationsValuedResourcesService) List(parent string) *OrganizationsSimulationsValuedResourcesListCall { - c := &OrganizationsSimulationsValuedResourcesListCall{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 - 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 -} - -// 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 -} - -// 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) + 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 *OrganizationsSimulationsValuedResourcesListCall) Fields(s ...googleapi.Field) *OrganizationsSimulationsValuedResourcesListCall { +func (c *OrganizationsSourcesCreateCall) Fields(s ...googleapi.Field) *OrganizationsSourcesCreateCall { 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 *OrganizationsSimulationsValuedResourcesListCall) Context(ctx context.Context) *OrganizationsSimulationsValuedResourcesListCall { +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 *OrganizationsSimulationsValuedResourcesListCall) Header() http.Header { +func (c *OrganizationsSourcesCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSimulationsValuedResourcesListCall) 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_ { 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.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}/valuedResources") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/sources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -21540,14 +23403,14 @@ func (c *OrganizationsSimulationsValuedResourcesListCall) doRequest(alt string) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// 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 -// *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 *OrganizationsSimulationsValuedResourcesListCall) Do(opts ...googleapi.CallOption) (*ListValuedResourcesResponse, 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 { @@ -21566,7 +23429,7 @@ func (c *OrganizationsSimulationsValuedResourcesListCall) Do(opts ...googleapi.C if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListValuedResourcesResponse{ + ret := &Source{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -21578,41 +23441,28 @@ func (c *OrganizationsSimulationsValuedResourcesListCall) Do(opts ...googleapi.C } return ret, nil // { - // "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", + // "description": "Creates a source.", + // "flatPath": "v1/organizations/{organizationsId}/sources", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.sources.create", // "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}\"", + // "description": "Required. Resource name of the new source's parent. Its format should be \"organizations/[organization_id]\".", // "location": "path", - // "pattern": "^organizations/[^/]+/simulations/[^/]+$", + // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/valuedResources", + // "path": "v1/{+parent}/sources", + // "request": { + // "$ref": "Source" + // }, // "response": { - // "$ref": "ListValuedResourcesResponse" + // "$ref": "Source" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -21621,83 +23471,31 @@ func (c *OrganizationsSimulationsValuedResourcesListCall) Do(opts ...googleapi.C } -// 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) - } -} - -// method id "securitycenter.organizations.simulations.valuedResources.attackPaths.list": +// method id "securitycenter.organizations.sources.get": -type OrganizationsSimulationsValuedResourcesAttackPathsListCall struct { +type OrganizationsSourcesGetCall struct { s *Service - parent string + name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists the attack paths for a set of simulation results or -// valued resources and filter. +// Get: Gets a source. // -// - 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 - 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 *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) +// - name: Relative resource name of the source. Its format is +// "organizations/[organization_id]/source/[source_id]". +func (r *OrganizationsSourcesService) Get(name string) *OrganizationsSourcesGetCall { + c := &OrganizationsSourcesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) Fields(s ...googleapi.Field) *OrganizationsSimulationsValuedResourcesAttackPathsListCall { +func (c *OrganizationsSourcesGetCall) Fields(s ...googleapi.Field) *OrganizationsSourcesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -21707,7 +23505,7 @@ func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) 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 *OrganizationsSimulationsValuedResourcesAttackPathsListCall) IfNoneMatch(entityTag string) *OrganizationsSimulationsValuedResourcesAttackPathsListCall { +func (c *OrganizationsSourcesGetCall) IfNoneMatch(entityTag string) *OrganizationsSourcesGetCall { c.ifNoneMatch_ = entityTag return c } @@ -21715,21 +23513,21 @@ func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) 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 *OrganizationsSimulationsValuedResourcesAttackPathsListCall) Context(ctx context.Context) *OrganizationsSimulationsValuedResourcesAttackPathsListCall { +func (c *OrganizationsSourcesGetCall) Context(ctx context.Context) *OrganizationsSourcesGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) Header() http.Header { +func (c *OrganizationsSourcesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSourcesGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -21742,7 +23540,7 @@ func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) doRequest(a var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/attackPaths") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -21750,19 +23548,19 @@ func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) doRequest(a } 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.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) { +// 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 { @@ -21781,7 +23579,7 @@ func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) Do(opts ... if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListAttackPathsResponse{ + ret := &Source{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -21793,41 +23591,25 @@ func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) Do(opts ... } return ret, nil // { - // "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", + // "description": "Gets a source.", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}", // "httpMethod": "GET", - // "id": "securitycenter.organizations.simulations.valuedResources.attackPaths.list", + // "id": "securitycenter.organizations.sources.get", // "parameterOrder": [ - // "parent" + // "name" // ], // "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}\"", + // "name": { + // "description": "Required. Relative resource name of the source. Its format is \"organizations/[organization_id]/source/[source_id]\".", // "location": "path", - // "pattern": "^organizations/[^/]+/simulations/[^/]+/valuedResources/[^/]+$", + // "pattern": "^organizations/[^/]+/sources/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/attackPaths", + // "path": "v1/{+name}", // "response": { - // "$ref": "ListAttackPathsResponse" + // "$ref": "Source" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -21836,53 +23618,34 @@ func (c *OrganizationsSimulationsValuedResourcesAttackPathsListCall) 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 *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) - } -} - -// method id "securitycenter.organizations.sources.create": +// method id "securitycenter.organizations.sources.getIamPolicy": -type OrganizationsSourcesCreateCall struct { - s *Service - parent string - source *Source - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsSourcesGetIamPolicyCall struct { + s *Service + resource string + getiampolicyrequest *GetIamPolicyRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates a source. +// GetIamPolicy: Gets the access control policy on the specified Source. // -// - 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 +// - 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 *OrganizationsSourcesCreateCall) Fields(s ...googleapi.Field) *OrganizationsSourcesCreateCall { +func (c *OrganizationsSourcesGetIamPolicyCall) Fields(s ...googleapi.Field) *OrganizationsSourcesGetIamPolicyCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -21890,21 +23653,21 @@ func (c *OrganizationsSourcesCreateCall) Fields(s ...googleapi.Field) *Organizat // Context sets the context 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 *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 *OrganizationsSourcesCreateCall) Header() http.Header { +func (c *OrganizationsSourcesGetIamPolicyCall) 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 *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_ { @@ -21912,14 +23675,14 @@ func (c *OrganizationsSourcesCreateCall) doRequest(alt string) (*http.Response, } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.source) + 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}/sources") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -21927,19 +23690,19 @@ func (c *OrganizationsSourcesCreateCall) doRequest(alt string) (*http.Response, } 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.create" call. -// Exactly one of *Source or error will be non-nil. Any non-2xx status +// 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 -// *Source.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 *OrganizationsSourcesCreateCall) Do(opts ...googleapi.CallOption) (*Source, error) { +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 { @@ -21958,7 +23721,7 @@ func (c *OrganizationsSourcesCreateCall) Do(opts ...googleapi.CallOption) (*Sour if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Source{ + ret := &Policy{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -21970,28 +23733,28 @@ func (c *OrganizationsSourcesCreateCall) Do(opts ...googleapi.CallOption) (*Sour } return ret, nil // { - // "description": "Creates a source.", - // "flatPath": "v1/organizations/{organizationsId}/sources", + // "description": "Gets the access control policy on the specified Source.", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}:getIamPolicy", // "httpMethod": "POST", - // "id": "securitycenter.organizations.sources.create", + // "id": "securitycenter.organizations.sources.getIamPolicy", // "parameterOrder": [ - // "parent" + // "resource" // ], // "parameters": { - // "parent": { - // "description": "Required. Resource name of the new source's parent. Its format should be \"organizations/[organization_id]\".", + // "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/[^/]+$", + // "pattern": "^organizations/[^/]+/sources/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/sources", + // "path": "v1/{+resource}:getIamPolicy", // "request": { - // "$ref": "Source" + // "$ref": "GetIamPolicyRequest" // }, // "response": { - // "$ref": "Source" + // "$ref": "Policy" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -22000,31 +23763,49 @@ func (c *OrganizationsSourcesCreateCall) Do(opts ...googleapi.CallOption) (*Sour } -// method id "securitycenter.organizations.sources.get": +// method id "securitycenter.organizations.sources.list": -type OrganizationsSourcesGetCall struct { +type OrganizationsSourcesListCall struct { s *Service - name string + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Gets a source. +// List: Lists all sources belonging to an organization. // -// - 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: Resource name of the parent of sources to list. Its format +// should be "organizations/[organization_id]", "folders/[folder_id]", +// or "projects/[project_id]". +func (r *OrganizationsSourcesService) List(parent string) *OrganizationsSourcesListCall { + c := &OrganizationsSourcesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return in a single response. Default is 10, minimum is +// 1, maximum is 1000. +func (c *OrganizationsSourcesListCall) PageSize(pageSize int64) *OrganizationsSourcesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last `ListSourcesResponse`; indicates that this is a +// continuation of a prior `ListSources` call, and that the system +// should return the next page of data. +func (c *OrganizationsSourcesListCall) PageToken(pageToken string) *OrganizationsSourcesListCall { + c.urlParams_.Set("pageToken", pageToken) return 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 *OrganizationsSourcesListCall) Fields(s ...googleapi.Field) *OrganizationsSourcesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -22034,7 +23815,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 *OrganizationsSourcesListCall) IfNoneMatch(entityTag string) *OrganizationsSourcesListCall { c.ifNoneMatch_ = entityTag return c } @@ -22042,21 +23823,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 *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 *OrganizationsSourcesGetCall) Header() http.Header { +func (c *OrganizationsSourcesListCall) 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 *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_ { @@ -22069,7 +23850,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}/sources") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -22077,19 +23858,19 @@ 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.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 { @@ -22108,7 +23889,7 @@ func (c *OrganizationsSourcesGetCall) Do(opts ...googleapi.CallOption) (*Source, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Source{ + ret := &ListSourcesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -22120,25 +23901,36 @@ func (c *OrganizationsSourcesGetCall) Do(opts ...googleapi.CallOption) (*Source, } return ret, nil // { - // "description": "Gets a source.", - // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}", + // "description": "Lists all sources belonging to an organization.", + // "flatPath": "v1/organizations/{organizationsId}/sources", // "httpMethod": "GET", - // "id": "securitycenter.organizations.sources.get", + // "id": "securitycenter.organizations.sources.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 `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/[^/]+/sources/[^/]+$", + // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/sources", // "response": { - // "$ref": "Source" + // "$ref": "ListSourcesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -22147,34 +23939,62 @@ 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 *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 OrganizationsSourcesGetIamPolicyCall struct { - s *Service - resource string - getiampolicyrequest *GetIamPolicyRequest - 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 } -// GetIamPolicy: Gets the access control policy on the specified Source. +// Patch: Updates a 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 +// - 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 + 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 *OrganizationsSourcesGetIamPolicyCall) Fields(s ...googleapi.Field) *OrganizationsSourcesGetIamPolicyCall { +func (c *OrganizationsSourcesPatchCall) Fields(s ...googleapi.Field) *OrganizationsSourcesPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -22182,21 +24002,21 @@ func (c *OrganizationsSourcesGetIamPolicyCall) Fields(s ...googleapi.Field) *Org // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSourcesGetIamPolicyCall) Context(ctx context.Context) *OrganizationsSourcesGetIamPolicyCall { +func (c *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 *OrganizationsSourcesGetIamPolicyCall) Header() http.Header { +func (c *OrganizationsSourcesPatchCall) 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 *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_ { @@ -22204,34 +24024,34 @@ func (c *OrganizationsSourcesGetIamPolicyCall) doRequest(alt string) (*http.Resp } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.source) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") + 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{ - "resource": c.resource, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.sources.getIamPolicy" call. -// Exactly one of *Policy or error will be non-nil. Any non-2xx status +// Do executes the "securitycenter.organizations.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 -// *Policy.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 *OrganizationsSourcesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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 { @@ -22250,7 +24070,7 @@ func (c *OrganizationsSourcesGetIamPolicyCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Policy{ + ret := &Source{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -22262,28 +24082,34 @@ 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": "Updates a source.", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}", + // "httpMethod": "PATCH", + // "id": "securitycenter.organizations.sources.patch", // "parameterOrder": [ - // "resource" + // "name" // ], // "parameters": { - // "resource": { - // "description": "REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", + // "name": { + // "description": "The 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, // "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/{+resource}:getIamPolicy", + // "path": "v1/{+name}", // "request": { - // "$ref": "GetIamPolicyRequest" + // "$ref": "Source" // }, // "response": { - // "$ref": "Policy" + // "$ref": "Source" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -22292,114 +24118,91 @@ func (c *OrganizationsSourcesGetIamPolicyCall) Do(opts ...googleapi.CallOption) } -// method id "securitycenter.organizations.sources.list": +// method id "securitycenter.organizations.sources.setIamPolicy": -type OrganizationsSourcesListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsSourcesSetIamPolicyCall struct { + s *Service + resource string + setiampolicyrequest *SetIamPolicyRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists all sources belonging to an organization. +// SetIamPolicy: Sets the access control policy on the specified Source. // -// - parent: Resource name of the parent of sources to list. Its format -// should be "organizations/[organization_id]", "folders/[folder_id]", -// or "projects/[project_id]". -func (r *OrganizationsSourcesService) List(parent string) *OrganizationsSourcesListCall { - c := &OrganizationsSourcesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return in a single response. Default is 10, minimum is -// 1, maximum is 1000. -func (c *OrganizationsSourcesListCall) PageSize(pageSize int64) *OrganizationsSourcesListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The value returned -// by the last `ListSourcesResponse`; indicates that this is a -// continuation of a prior `ListSources` call, and that the system -// should return the next page of data. -func (c *OrganizationsSourcesListCall) PageToken(pageToken string) *OrganizationsSourcesListCall { - c.urlParams_.Set("pageToken", pageToken) +// - 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 *OrganizationsSourcesListCall) Fields(s ...googleapi.Field) *OrganizationsSourcesListCall { +func (c *OrganizationsSourcesSetIamPolicyCall) Fields(s ...googleapi.Field) *OrganizationsSourcesSetIamPolicyCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *OrganizationsSourcesListCall) IfNoneMatch(entityTag string) *OrganizationsSourcesListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSourcesListCall) Context(ctx context.Context) *OrganizationsSourcesListCall { +func (c *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 *OrganizationsSourcesListCall) Header() http.Header { +func (c *OrganizationsSourcesSetIamPolicyCall) 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 *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_ { 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.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/{+parent}/sources") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy") 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.list" call. -// Exactly one of *ListSourcesResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListSourcesResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsSourcesListCall) Do(opts ...googleapi.CallOption) (*ListSourcesResponse, error) { +// Do executes the "securitycenter.organizations.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) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -22418,7 +24221,7 @@ func (c *OrganizationsSourcesListCall) Do(opts ...googleapi.CallOption) (*ListSo if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListSourcesResponse{ + ret := &Policy{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -22430,36 +24233,28 @@ func (c *OrganizationsSourcesListCall) Do(opts ...googleapi.CallOption) (*ListSo } return ret, nil // { - // "description": "Lists all sources belonging to an organization.", - // "flatPath": "v1/organizations/{organizationsId}/sources", - // "httpMethod": "GET", - // "id": "securitycenter.organizations.sources.list", + // "description": "Sets the access control policy on the specified Source.", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}:setIamPolicy", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.sources.setIamPolicy", // "parameterOrder": [ - // "parent" + // "resource" // ], // "parameters": { - // "pageSize": { - // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The value returned by the last `ListSourcesResponse`; indicates that this is a continuation of a prior `ListSources` call, and that the system should return the next page of data.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. Resource name of the parent of sources to list. Its format should be \"organizations/[organization_id]\", \"folders/[folder_id]\", or \"projects/[project_id]\".", + // "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/[^/]+$", + // "pattern": "^organizations/[^/]+/sources/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/sources", + // "path": "v1/{+resource}:setIamPolicy", + // "request": { + // "$ref": "SetIamPolicyRequest" + // }, // "response": { - // "$ref": "ListSourcesResponse" + // "$ref": "Policy" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -22468,62 +24263,35 @@ func (c *OrganizationsSourcesListCall) Do(opts ...googleapi.CallOption) (*ListSo } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *OrganizationsSourcesListCall) Pages(ctx context.Context, f func(*ListSourcesResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "securitycenter.organizations.sources.patch": +// method id "securitycenter.organizations.sources.testIamPermissions": -type OrganizationsSourcesPatchCall struct { - s *Service - name string - source *Source - 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 } -// Patch: Updates a source. +// TestIamPermissions: Returns the permissions that a caller has on the +// specified source. // -// - 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 - 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) +// - 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 *OrganizationsSourcesPatchCall) Fields(s ...googleapi.Field) *OrganizationsSourcesPatchCall { +func (c *OrganizationsSourcesTestIamPermissionsCall) Fields(s ...googleapi.Field) *OrganizationsSourcesTestIamPermissionsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -22531,21 +24299,21 @@ func (c *OrganizationsSourcesPatchCall) Fields(s ...googleapi.Field) *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 *OrganizationsSourcesPatchCall) Context(ctx context.Context) *OrganizationsSourcesPatchCall { +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 *OrganizationsSourcesPatchCall) Header() http.Header { +func (c *OrganizationsSourcesTestIamPermissionsCall) 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 *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_ { @@ -22553,34 +24321,34 @@ func (c *OrganizationsSourcesPatchCall) doRequest(alt string) (*http.Response, e } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.source) + 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.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.sources.testIamPermissions" call. +// Exactly one of *TestIamPermissionsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *TestIamPermissionsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsSourcesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -22599,7 +24367,7 @@ func (c *OrganizationsSourcesPatchCall) Do(opts ...googleapi.CallOption) (*Sourc if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Source{ + ret := &TestIamPermissionsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -22611,34 +24379,28 @@ 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": "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 this source. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: \"organizations/{organization_id}/sources/{source_id}\"", + // "resource": { + // "description": "REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", // "location": "path", // "pattern": "^organizations/[^/]+/sources/[^/]+$", // "required": true, // "type": "string" - // }, - // "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}", + // "path": "v1/{+resource}:testIamPermissions", // "request": { - // "$ref": "Source" + // "$ref": "TestIamPermissionsRequest" // }, // "response": { - // "$ref": "Source" + // "$ref": "TestIamPermissionsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -22647,34 +24409,42 @@ func (c *OrganizationsSourcesPatchCall) Do(opts ...googleapi.CallOption) (*Sourc } -// method id "securitycenter.organizations.sources.setIamPolicy": +// method id "securitycenter.organizations.sources.findings.create": -type OrganizationsSourcesSetIamPolicyCall struct { - s *Service - resource string - setiampolicyrequest *SetIamPolicyRequest - 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 } -// SetIamPolicy: Sets the access control policy on the specified Source. +// Create: Creates a finding. The corresponding source must exist for +// finding creation to succeed. // -// - 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: Resource name of the new finding's parent. Its format +// should be "organizations/[organization_id]/sources/[source_id]". +func (r *OrganizationsSourcesFindingsService) Create(parent string, finding *Finding) *OrganizationsSourcesFindingsCreateCall { + c := &OrganizationsSourcesFindingsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.finding = finding + return c +} + +// FindingId sets the optional parameter "findingId": Required. Unique +// identifier provided by the client within the parent scope. It must be +// alphanumeric and less than or equal to 32 characters and greater than +// 0 characters in length. +func (c *OrganizationsSourcesFindingsCreateCall) FindingId(findingId string) *OrganizationsSourcesFindingsCreateCall { + c.urlParams_.Set("findingId", findingId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSourcesSetIamPolicyCall) Fields(s ...googleapi.Field) *OrganizationsSourcesSetIamPolicyCall { +func (c *OrganizationsSourcesFindingsCreateCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -22682,21 +24452,21 @@ func (c *OrganizationsSourcesSetIamPolicyCall) Fields(s ...googleapi.Field) *Org // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSourcesSetIamPolicyCall) Context(ctx context.Context) *OrganizationsSourcesSetIamPolicyCall { +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 *OrganizationsSourcesSetIamPolicyCall) Header() http.Header { +func (c *OrganizationsSourcesFindingsCreateCall) 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 *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_ { @@ -22704,14 +24474,14 @@ func (c *OrganizationsSourcesSetIamPolicyCall) doRequest(alt string) (*http.Resp } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + 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/{+resource}:setIamPolicy") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findings") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -22719,19 +24489,19 @@ func (c *OrganizationsSourcesSetIamPolicyCall) doRequest(alt string) (*http.Resp } 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 +// 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 -// *Policy.ServerResponse.Header or (if a response was returned at all) +// *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 *OrganizationsSourcesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { +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 { @@ -22750,7 +24520,7 @@ func (c *OrganizationsSourcesSetIamPolicyCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Policy{ + ret := &Finding{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -22762,28 +24532,33 @@ 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", + // "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.setIamPolicy", + // "id": "securitycenter.organizations.sources.findings.create", // "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.", + // "findingId": { + // "description": "Required. Unique identifier provided by the client within the parent scope. It must be alphanumeric and less than or equal to 32 characters and greater than 0 characters in length.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. Resource name of the new finding's parent. Its format should be \"organizations/[organization_id]/sources/[source_id]\".", // "location": "path", // "pattern": "^organizations/[^/]+/sources/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+resource}:setIamPolicy", + // "path": "v1/{+parent}/findings", // "request": { - // "$ref": "SetIamPolicyRequest" + // "$ref": "Finding" // }, // "response": { - // "$ref": "Policy" + // "$ref": "Finding" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -22792,35 +24567,42 @@ func (c *OrganizationsSourcesSetIamPolicyCall) Do(opts ...googleapi.CallOption) } -// method id "securitycenter.organizations.sources.testIamPermissions": +// method id "securitycenter.organizations.sources.findings.group": -type OrganizationsSourcesTestIamPermissionsCall struct { - s *Service - resource string - testiampermissionsrequest *TestIamPermissionsRequest - 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 } -// TestIamPermissions: Returns the permissions that a caller has on the -// specified source. +// 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 // -// - resource: REQUIRED: The resource for which the policy detail is -// being requested. See Resource names -// (https://cloud.google.com/apis/design/resource_names) for the -// appropriate value for this field. -func (r *OrganizationsSourcesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *OrganizationsSourcesTestIamPermissionsCall { - c := &OrganizationsSourcesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.resource = resource - c.testiampermissionsrequest = testiampermissionsrequest +// - parent: Name of the source to groupBy. Its format is +// "organizations/[organization_id]/sources/[source_id]", +// folders/[folder_id]/sources/[source_id], or +// projects/[project_id]/sources/[source_id]. To groupBy across all +// sources provide a source_id of `-`. For example: +// organizations/{organization_id}/sources/-, +// folders/{folder_id}/sources/-, or projects/{project_id}/sources/-. +func (r *OrganizationsSourcesFindingsService) Group(parent string, groupfindingsrequest *GroupFindingsRequest) *OrganizationsSourcesFindingsGroupCall { + c := &OrganizationsSourcesFindingsGroupCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.groupfindingsrequest = groupfindingsrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSourcesTestIamPermissionsCall) Fields(s ...googleapi.Field) *OrganizationsSourcesTestIamPermissionsCall { +func (c *OrganizationsSourcesFindingsGroupCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsGroupCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -22828,21 +24610,21 @@ func (c *OrganizationsSourcesTestIamPermissionsCall) Fields(s ...googleapi.Field // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSourcesTestIamPermissionsCall) Context(ctx context.Context) *OrganizationsSourcesTestIamPermissionsCall { +func (c *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 *OrganizationsSourcesTestIamPermissionsCall) Header() http.Header { +func (c *OrganizationsSourcesFindingsGroupCall) 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 *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_ { @@ -22850,14 +24632,14 @@ func (c *OrganizationsSourcesTestIamPermissionsCall) doRequest(alt string) (*htt } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.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/{+resource}:testIamPermissions") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findings:group") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -22865,19 +24647,19 @@ func (c *OrganizationsSourcesTestIamPermissionsCall) doRequest(alt string) (*htt } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "resource": c.resource, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.sources.testIamPermissions" call. -// Exactly one of *TestIamPermissionsResponse or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *TestIamPermissionsResponse.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use +// 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 *OrganizationsSourcesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, 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 { @@ -22896,7 +24678,7 @@ func (c *OrganizationsSourcesTestIamPermissionsCall) Do(opts ...googleapi.CallOp if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &TestIamPermissionsResponse{ + ret := &GroupFindingsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -22908,28 +24690,28 @@ func (c *OrganizationsSourcesTestIamPermissionsCall) Do(opts ...googleapi.CallOp } return ret, nil // { - // "description": "Returns the permissions that a caller has on the specified source.", - // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}:testIamPermissions", + // "description": "Filters an organization or source's findings and groups them by their specified properties. To group across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings, /v1/folders/{folder_id}/sources/-/findings, /v1/projects/{project_id}/sources/-/findings", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings:group", // "httpMethod": "POST", - // "id": "securitycenter.organizations.sources.testIamPermissions", + // "id": "securitycenter.organizations.sources.findings.group", // "parameterOrder": [ - // "resource" + // "parent" // ], // "parameters": { - // "resource": { - // "description": "REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", + // "parent": { + // "description": "Required. Name of the source to groupBy. Its format is \"organizations/[organization_id]/sources/[source_id]\", folders/[folder_id]/sources/[source_id], or projects/[project_id]/sources/[source_id]. To groupBy across all sources provide a source_id of `-`. For example: organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, or projects/{project_id}/sources/-", // "location": "path", // "pattern": "^organizations/[^/]+/sources/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+resource}:testIamPermissions", + // "path": "v1/{+parent}/findings:group", // "request": { - // "$ref": "TestIamPermissionsRequest" + // "$ref": "GroupFindingsRequest" // }, // "response": { - // "$ref": "TestIamPermissionsResponse" + // "$ref": "GroupFindingsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -22938,81 +24720,220 @@ 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 *OrganizationsSourcesFindingsGroupCall) Pages(ctx context.Context, f func(*GroupFindingsResponse) error) error { + c.ctx_ = ctx + defer func(pt string) { c.groupfindingsrequest.PageToken = pt }(c.groupfindingsrequest.PageToken) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.groupfindingsrequest.PageToken = x.NextPageToken + } +} + +// method id "securitycenter.organizations.sources.findings.list": + +type OrganizationsSourcesFindingsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists an organization or source's findings. To list across all +// sources provide a `-` as the source id. Example: +// /v1/organizations/{organization_id}/sources/-/findings +// +// - parent: Name of the source the findings belong to. Its format is +// "organizations/[organization_id]/sources/[source_id], +// folders/[folder_id]/sources/[source_id], or +// projects/[project_id]/sources/[source_id]". To list across all +// sources provide a source_id of `-`. For example: +// organizations/{organization_id}/sources/-, +// folders/{folder_id}/sources/- or projects/{projects_id}/sources/-. +func (r *OrganizationsSourcesFindingsService) List(parent string) *OrganizationsSourcesFindingsListCall { + c := &OrganizationsSourcesFindingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// CompareDuration sets the optional parameter "compareDuration": When +// compare_duration is set, the ListFindingsResult's "state_change" +// attribute is updated to indicate whether the finding had its state +// changed, the finding's state remained unchanged, or if the finding +// was added in any state during the compare_duration period of time +// that precedes the read_time. This is the time between (read_time - +// compare_duration) and read_time. The state_change value is derived +// based on the presence and state of the finding at the two points in +// time. Intermediate state changes between the two times don't affect +// the result. For example, the results aren't affected if the finding +// is made inactive and then active again. Possible "state_change" +// values when compare_duration is specified: * "CHANGED": indicates +// that the finding was present and matched the given filter at the +// start of compare_duration, but changed its state at read_time. * +// "UNCHANGED": indicates that the finding was present and matched the +// given filter at the start of compare_duration and did not change +// state at read_time. * "ADDED": indicates that the finding did not +// match the given filter or was not present at the start of +// compare_duration, but was present at read_time. * "REMOVED": +// indicates that the finding was present and matched the filter at the +// start of compare_duration, but did not match the filter at read_time. +// If compare_duration is not specified, then the only possible +// state_change is "UNUSED", which will be the state_change set for all +// findings present at read_time. +func (c *OrganizationsSourcesFindingsListCall) CompareDuration(compareDuration string) *OrganizationsSourcesFindingsListCall { + c.urlParams_.Set("compareDuration", compareDuration) + return c +} + +// FieldMask sets the optional parameter "fieldMask": A field mask to +// specify the Finding fields to be listed in the response. An empty +// field mask will list all fields. +func (c *OrganizationsSourcesFindingsListCall) FieldMask(fieldMask string) *OrganizationsSourcesFindingsListCall { + c.urlParams_.Set("fieldMask", fieldMask) + return c +} + +// Filter sets the optional parameter "filter": Expression that defines +// the filter to apply across findings. The expression is a list of one +// or more restrictions combined via logical operators `AND` and `OR`. +// Parentheses are supported, and `OR` has higher precedence than `AND`. +// Restrictions have the form ` ` and may have a `-` character in front +// of them to indicate negation. Examples include: * name * +// source_properties.a_property * security_marks.marks.marka The +// supported operators are: * `=` for all value types. * `>`, `<`, `>=`, +// `<=` for integer values. * `:`, meaning substring matching, for +// strings. The supported value types are: * string literals in quotes. +// * integer literals without quotes. * boolean literals `true` and +// `false` without quotes. The following field and operator combinations +// are supported: * name: `=` * parent: `=`, `:` * resource_name: `=`, +// `:` * state: `=`, `:` * category: `=`, `:` * external_uri: `=`, `:` * +// event_time: `=`, `>`, `<`, `>=`, `<=` Usage: This should be +// milliseconds since epoch or an RFC3339 string. Examples: `event_time +// = "2019-06-10T16:07:18-07:00" `event_time = 1560208038000` * +// severity: `=`, `:` * workflow_state: `=`, `:` * security_marks.marks: +// `=`, `:` * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` For +// example, `source_properties.size = 100` is a valid filter string. Use +// a partial match on the empty string to filter based on a property +// existing: `source_properties.my_property : "" Use a negated partial +// match on the empty string to filter based on a property not existing: +// `-source_properties.my_property : "" * resource: * resource.name: +// `=`, `:` * resource.parent_name: `=`, `:` * +// resource.parent_display_name: `=`, `:` * resource.project_name: `=`, +// `:` * resource.project_display_name: `=`, `:` * resource.type: `=`, +// `:` * resource.folders.resource_folder: `=`, `:` * +// resource.display_name: `=`, `:` +func (c *OrganizationsSourcesFindingsListCall) Filter(filter string) *OrganizationsSourcesFindingsListCall { + c.urlParams_.Set("filter", filter) + return c +} -type OrganizationsSourcesFindingsCreateCall struct { - s *Service - parent string - finding *Finding - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// OrderBy sets the optional parameter "orderBy": Expression that +// defines what fields and order to use for sorting. The string value +// should follow SQL syntax: comma separated list of fields. For +// example: "name,resource_properties.a_property". The default sorting +// order is ascending. To specify descending order for a field, a suffix +// " desc" should be appended to the field name. For example: "name +// desc,source_properties.a_property". Redundant space characters in the +// syntax are insignificant. "name desc,source_properties.a_property" +// and " name desc , source_properties.a_property " are equivalent. The +// following fields are supported: name parent state category +// resource_name event_time source_properties security_marks.marks +func (c *OrganizationsSourcesFindingsListCall) OrderBy(orderBy string) *OrganizationsSourcesFindingsListCall { + c.urlParams_.Set("orderBy", orderBy) + return c } -// Create: Creates a finding. The corresponding source must exist for -// finding creation to succeed. -// -// - parent: Resource name of the new finding's parent. Its format -// should be "organizations/[organization_id]/sources/[source_id]". -func (r *OrganizationsSourcesFindingsService) Create(parent string, finding *Finding) *OrganizationsSourcesFindingsCreateCall { - c := &OrganizationsSourcesFindingsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.finding = finding +// 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 } -// 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) +// PageToken sets the optional parameter "pageToken": The value returned +// by the last `ListFindingsResponse`; indicates that this is a +// continuation of a prior `ListFindings` call, and that the system +// should return the next page of data. +func (c *OrganizationsSourcesFindingsListCall) PageToken(pageToken string) *OrganizationsSourcesFindingsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReadTime sets the optional parameter "readTime": Time used as a +// reference point when filtering findings. The filter is limited to +// findings existing at the supplied time and their values are those at +// that specific time. Absence of this field will default to the API's +// version of NOW. +func (c *OrganizationsSourcesFindingsListCall) ReadTime(readTime string) *OrganizationsSourcesFindingsListCall { + c.urlParams_.Set("readTime", readTime) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSourcesFindingsCreateCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsCreateCall { +func (c *OrganizationsSourcesFindingsListCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsSourcesFindingsListCall) IfNoneMatch(entityTag string) *OrganizationsSourcesFindingsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSourcesFindingsCreateCall) Context(ctx context.Context) *OrganizationsSourcesFindingsCreateCall { +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 *OrganizationsSourcesFindingsCreateCall) Header() http.Header { +func (c *OrganizationsSourcesFindingsListCall) 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 *OrganizationsSourcesFindingsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - 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 += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -23023,14 +24944,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.sources.findings.list" call. +// Exactly one of *ListFindingsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListFindingsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsSourcesFindingsListCall) Do(opts ...googleapi.CallOption) (*ListFindingsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -23049,7 +24970,7 @@ func (c *OrganizationsSourcesFindingsCreateCall) Do(opts ...googleapi.CallOption if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Finding{ + ret := &ListFindingsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -23061,33 +24982,64 @@ func (c *OrganizationsSourcesFindingsCreateCall) Do(opts ...googleapi.CallOption } return ret, nil // { - // "description": "Creates a finding. The corresponding source must exist for finding creation to succeed.", + // "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": "POST", - // "id": "securitycenter.organizations.sources.findings.create", + // "httpMethod": "GET", + // "id": "securitycenter.organizations.sources.findings.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.", + // "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. Resource name of the new finding's parent. Its format should be \"organizations/[organization_id]/sources/[source_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": "^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", - // "request": { - // "$ref": "Finding" - // }, // "response": { - // "$ref": "Finding" + // "$ref": "ListFindingsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -23096,42 +25048,70 @@ 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 *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) + } +} -type OrganizationsSourcesFindingsGroupCall struct { - s *Service - parent string - groupfindingsrequest *GroupFindingsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// 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 } -// 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: Creates or updates a finding. The corresponding source must +// exist for a finding creation to succeed. // -// - parent: Name of the source to groupBy. Its format is -// "organizations/[organization_id]/sources/[source_id]", -// folders/[folder_id]/sources/[source_id], or -// projects/[project_id]/sources/[source_id]. To groupBy across all -// sources provide a source_id of `-`. For example: -// organizations/{organization_id}/sources/-, -// folders/{folder_id}/sources/-, or projects/{project_id}/sources/-. -func (r *OrganizationsSourcesFindingsService) Group(parent string, groupfindingsrequest *GroupFindingsRequest) *OrganizationsSourcesFindingsGroupCall { - c := &OrganizationsSourcesFindingsGroupCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.groupfindingsrequest = groupfindingsrequest +// - 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 *OrganizationsSourcesFindingsGroupCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsGroupCall { +func (c *OrganizationsSourcesFindingsPatchCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -23139,21 +25119,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 *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 *OrganizationsSourcesFindingsGroupCall) Header() http.Header { +func (c *OrganizationsSourcesFindingsPatchCall) 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 *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_ { @@ -23161,34 +25141,34 @@ 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.finding) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findings: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.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.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 { @@ -23207,7 +25187,7 @@ func (c *OrganizationsSourcesFindingsGroupCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GroupFindingsResponse{ + ret := &Finding{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -23219,28 +25199,34 @@ 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", - // "httpMethod": "POST", - // "id": "securitycenter.organizations.sources.findings.group", + // "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": [ - // "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": "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/[^/]+$", + // "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/{+parent}/findings:group", + // "path": "v1/{+name}", // "request": { - // "$ref": "GroupFindingsRequest" + // "$ref": "Finding" // }, // "response": { - // "$ref": "GroupFindingsResponse" + // "$ref": "Finding" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -23249,238 +25235,94 @@ 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.findings.setMute": -type OrganizationsSourcesFindingsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsSourcesFindingsSetMuteCall struct { + s *Service + name string + setmuterequest *SetMuteRequest + urlParams_ gensupport.URLParams + 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 +// SetMute: Updates the mute state of a finding. // -// - parent: Name of the source the findings belong to. Its format is -// "organizations/[organization_id]/sources/[source_id], -// folders/[folder_id]/sources/[source_id], or -// projects/[project_id]/sources/[source_id]". To list across all -// sources provide a source_id of `-`. For example: -// organizations/{organization_id}/sources/-, -// folders/{folder_id}/sources/- or projects/{projects_id}/sources/-. -func (r *OrganizationsSourcesFindingsService) List(parent string) *OrganizationsSourcesFindingsListCall { - c := &OrganizationsSourcesFindingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// CompareDuration sets the optional parameter "compareDuration": When -// compare_duration is set, the ListFindingsResult's "state_change" -// attribute is updated to indicate whether the finding had its state -// changed, the finding's state remained unchanged, or if the finding -// was added in any state during the compare_duration period of time -// that precedes the read_time. This is the time between (read_time - -// compare_duration) and read_time. The state_change value is derived -// based on the presence and state of the finding at the two points in -// time. Intermediate state changes between the two times don't affect -// the result. For example, the results aren't affected if the finding -// is made inactive and then active again. Possible "state_change" -// values when compare_duration is specified: * "CHANGED": indicates -// that the finding was present and matched the given filter at the -// start of compare_duration, but changed its state at read_time. * -// "UNCHANGED": indicates that the finding was present and matched the -// given filter at the start of compare_duration and did not change -// state at read_time. * "ADDED": indicates that the finding did not -// match the given filter or was not present at the start of -// compare_duration, but was present at read_time. * "REMOVED": -// indicates that the finding was present and matched the filter at the -// start of compare_duration, but did not match the filter at read_time. -// If compare_duration is not specified, then the only possible -// state_change is "UNUSED", which will be the state_change set for all -// findings present at read_time. -func (c *OrganizationsSourcesFindingsListCall) CompareDuration(compareDuration string) *OrganizationsSourcesFindingsListCall { - c.urlParams_.Set("compareDuration", compareDuration) - return c -} - -// FieldMask sets the optional parameter "fieldMask": A field mask to -// specify the Finding fields to be listed in the response. An empty -// field mask will list all fields. -func (c *OrganizationsSourcesFindingsListCall) FieldMask(fieldMask string) *OrganizationsSourcesFindingsListCall { - c.urlParams_.Set("fieldMask", fieldMask) - return c -} - -// Filter sets the optional parameter "filter": Expression that defines -// the filter to apply across findings. The expression is a list of one -// or more restrictions combined via logical operators `AND` and `OR`. -// Parentheses are supported, and `OR` has higher precedence than `AND`. -// Restrictions have the form ` ` and may have a `-` character in front -// of them to indicate negation. Examples include: * name * -// source_properties.a_property * security_marks.marks.marka The -// supported operators are: * `=` for all value types. * `>`, `<`, `>=`, -// `<=` for integer values. * `:`, meaning substring matching, for -// strings. The supported value types are: * string literals in quotes. -// * integer literals without quotes. * boolean literals `true` and -// `false` without quotes. The following field and operator combinations -// are supported: * name: `=` * parent: `=`, `:` * resource_name: `=`, -// `:` * state: `=`, `:` * category: `=`, `:` * external_uri: `=`, `:` * -// event_time: `=`, `>`, `<`, `>=`, `<=` Usage: This should be -// milliseconds since epoch or an RFC3339 string. Examples: `event_time -// = "2019-06-10T16:07:18-07:00" `event_time = 1560208038000` * -// severity: `=`, `:` * workflow_state: `=`, `:` * security_marks.marks: -// `=`, `:` * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` For -// example, `source_properties.size = 100` is a valid filter string. Use -// a partial match on the empty string to filter based on a property -// existing: `source_properties.my_property : "" Use a negated partial -// match on the empty string to filter based on a property not existing: -// `-source_properties.my_property : "" * resource: * resource.name: -// `=`, `:` * resource.parent_name: `=`, `:` * -// resource.parent_display_name: `=`, `:` * resource.project_name: `=`, -// `:` * resource.project_display_name: `=`, `:` * resource.type: `=`, -// `:` * resource.folders.resource_folder: `=`, `:` * -// resource.display_name: `=`, `:` -func (c *OrganizationsSourcesFindingsListCall) Filter(filter string) *OrganizationsSourcesFindingsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// OrderBy sets the optional parameter "orderBy": Expression that -// defines what fields and order to use for sorting. The string value -// should follow SQL syntax: comma separated list of fields. For -// example: "name,resource_properties.a_property". The default sorting -// order is ascending. To specify descending order for a field, a suffix -// " desc" should be appended to the field name. For example: "name -// desc,source_properties.a_property". Redundant space characters in the -// syntax are insignificant. "name desc,source_properties.a_property" -// and " name desc , source_properties.a_property " are equivalent. The -// following fields are supported: name parent state category -// resource_name event_time source_properties security_marks.marks -func (c *OrganizationsSourcesFindingsListCall) OrderBy(orderBy string) *OrganizationsSourcesFindingsListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return in a single response. Default is 10, minimum is -// 1, maximum is 1000. -func (c *OrganizationsSourcesFindingsListCall) PageSize(pageSize int64) *OrganizationsSourcesFindingsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The value returned -// by the last `ListFindingsResponse`; indicates that this is a -// continuation of a prior `ListFindings` call, and that the system -// should return the next page of data. -func (c *OrganizationsSourcesFindingsListCall) PageToken(pageToken string) *OrganizationsSourcesFindingsListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// ReadTime sets the optional parameter "readTime": Time used as a -// reference point when filtering findings. The filter is limited to -// findings existing at the supplied time and their values are those at -// that specific time. Absence of this field will default to the API's -// version of NOW. -func (c *OrganizationsSourcesFindingsListCall) ReadTime(readTime string) *OrganizationsSourcesFindingsListCall { - c.urlParams_.Set("readTime", readTime) +// - 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)} + 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 *OrganizationsSourcesFindingsListCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsListCall { +func (c *OrganizationsSourcesFindingsSetMuteCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsSetMuteCall { 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 *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 *OrganizationsSourcesFindingsListCall) Header() http.Header { +func (c *OrganizationsSourcesFindingsSetMuteCall) 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 *OrganizationsSourcesFindingsSetMuteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - 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/{+parent}/findings") + 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 } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.sources.findings.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.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 { @@ -23499,7 +25341,7 @@ func (c *OrganizationsSourcesFindingsListCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListFindingsResponse{ + ret := &Finding{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -23511,64 +25353,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": "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": [ - // "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. 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/[^/]+$", + // "pattern": "^organizations/[^/]+/sources/[^/]+/findings/[^/]+$", // "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}:setMute", + // "request": { + // "$ref": "SetMuteRequest" + // }, // "response": { - // "$ref": "ListFindingsResponse" + // "$ref": "Finding" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -23577,62 +25383,195 @@ 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 { +// method id "securitycenter.organizations.sources.findings.setState": + +type OrganizationsSourcesFindingsSetStateCall struct { + s *Service + name string + setfindingstaterequest *SetFindingStateRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// SetState: Updates the state of a finding. +// +// - name: The relative resource name +// (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 *OrganizationsSourcesFindingsSetStateCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsSetStateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *OrganizationsSourcesFindingsSetStateCall) Context(ctx context.Context) *OrganizationsSourcesFindingsSetStateCall { c.ctx_ = ctx - 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 + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsSourcesFindingsSetStateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsSourcesFindingsSetStateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.setfindingstaterequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setState") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "securitycenter.organizations.sources.findings.setState" call. +// Exactly one of *Finding or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Finding.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrganizationsSourcesFindingsSetStateCall) Do(opts ...googleapi.CallOption) (*Finding, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() } - c.PageToken(x.NextPageToken) + 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/organizations/{organizationsId}/sources/{sourcesId}/findings/{findingsId}:setState", + // "httpMethod": "POST", + // "id": "securitycenter.organizations.sources.findings.setState", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The [relative resource name](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" + // } + // }, + // "path": "v1/{+name}:setState", + // "request": { + // "$ref": "SetFindingStateRequest" + // }, + // "response": { + // "$ref": "Finding" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + } -// method id "securitycenter.organizations.sources.findings.patch": +// method id "securitycenter.organizations.sources.findings.updateSecurityMarks": -type OrganizationsSourcesFindingsPatchCall struct { - s *Service - name string - finding *Finding - 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 } -// Patch: Creates or updates a finding. The corresponding source must -// exist for a finding creation to succeed. +// UpdateSecurityMarks: Updates security marks. // -// - name: The relative resource name -// (https://cloud.google.com/apis/design/resource_names#relative_resource_name) -// of the finding. Example: +// - 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}", -// "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)} +// 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.finding = finding + 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 finding resource. This field should not be -// specified when creating a finding. When updating a finding, an empty -// mask is treated as updating all mutable fields and replacing -// source_properties. Individual source_properties can be added/updated -// by using "source_properties." in the field mask. -func (c *OrganizationsSourcesFindingsPatchCall) UpdateMask(updateMask string) *OrganizationsSourcesFindingsPatchCall { +// use when updating the 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 } @@ -23640,7 +25579,7 @@ func (c *OrganizationsSourcesFindingsPatchCall) UpdateMask(updateMask string) *O // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSourcesFindingsPatchCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsPatchCall { +func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsUpdateSecurityMarksCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -23648,21 +25587,21 @@ func (c *OrganizationsSourcesFindingsPatchCall) Fields(s ...googleapi.Field) *Or // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSourcesFindingsPatchCall) Context(ctx context.Context) *OrganizationsSourcesFindingsPatchCall { +func (c *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 *OrganizationsSourcesFindingsPatchCall) Header() http.Header { +func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) 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 *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_ { @@ -23670,7 +25609,7 @@ func (c *OrganizationsSourcesFindingsPatchCall) doRequest(alt string) (*http.Res } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.finding) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitymarks) if err != nil { return nil, err } @@ -23690,14 +25629,14 @@ func (c *OrganizationsSourcesFindingsPatchCall) doRequest(alt string) (*http.Res return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.sources.findings.patch" call. -// Exactly one of *Finding or error will be non-nil. Any non-2xx status -// 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.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 { @@ -23716,7 +25655,7 @@ func (c *OrganizationsSourcesFindingsPatchCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Finding{ + ret := &SecurityMarks{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -23728,23 +25667,29 @@ func (c *OrganizationsSourcesFindingsPatchCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Creates or updates a finding. The corresponding source must exist for a finding creation to succeed.", - // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings/{findingsId}", + // "description": "Updates security marks.", + // "flatPath": "v1/organizations/{organizationsId}/sources/{sourcesId}/findings/{findingsId}/securityMarks", // "httpMethod": "PATCH", - // "id": "securitycenter.organizations.sources.findings.patch", + // "id": "securitycenter.organizations.sources.findings.updateSecurityMarks", // "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 SecurityMarks. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Examples: \"organizations/{organization_id}/assets/{asset_id}/securityMarks\" \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks\".", // "location": "path", - // "pattern": "^organizations/[^/]+/sources/[^/]+/findings/[^/]+$", + // "pattern": "^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 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 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" @@ -23752,10 +25697,10 @@ func (c *OrganizationsSourcesFindingsPatchCall) Do(opts ...googleapi.CallOption) // }, // "path": "v1/{+name}", // "request": { - // "$ref": "Finding" + // "$ref": "SecurityMarks" // }, // "response": { - // "$ref": "Finding" + // "$ref": "SecurityMarks" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -23764,37 +25709,43 @@ func (c *OrganizationsSourcesFindingsPatchCall) Do(opts ...googleapi.CallOption) } -// method id "securitycenter.organizations.sources.findings.setMute": +// method id "securitycenter.organizations.sources.findings.externalSystems.patch": -type OrganizationsSourcesFindingsSetMuteCall struct { - s *Service - name string - setmuterequest *SetMuteRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsSourcesFindingsExternalSystemsPatchCall struct { + s *Service + name string + googlecloudsecuritycenterv1externalsystem *GoogleCloudSecuritycenterV1ExternalSystem + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// SetMute: Updates the mute state of a finding. +// Patch: Updates external system. This is for a given 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) SetMute(name string, setmuterequest *SetMuteRequest) *OrganizationsSourcesFindingsSetMuteCall { - c := &OrganizationsSourcesFindingsSetMuteCall{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.setmuterequest = setmuterequest + 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 *OrganizationsSourcesFindingsSetMuteCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsSetMuteCall { +func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsExternalSystemsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -23802,21 +25753,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 *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 *OrganizationsSourcesFindingsSetMuteCall) Header() http.Header { +func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) 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 *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_ { @@ -23824,16 +25775,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.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}: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 } @@ -23844,14 +25795,16 @@ 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 -// 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) { +// Do executes the "securitycenter.organizations.sources.findings.externalSystems.patch" call. +// Exactly one of *GoogleCloudSecuritycenterV1ExternalSystem or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudSecuritycenterV1ExternalSystem.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1ExternalSystem, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -23870,7 +25823,7 @@ func (c *OrganizationsSourcesFindingsSetMuteCall) Do(opts ...googleapi.CallOptio if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Finding{ + ret := &GoogleCloudSecuritycenterV1ExternalSystem{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -23882,28 +25835,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 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. 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": "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/[^/]+$", + // "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}:setMute", + // "path": "v1/{+name}", // "request": { - // "$ref": "SetMuteRequest" + // "$ref": "GoogleCloudSecuritycenterV1ExternalSystem" // }, // "response": { - // "$ref": "Finding" + // "$ref": "GoogleCloudSecuritycenterV1ExternalSystem" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -23912,37 +25871,34 @@ func (c *OrganizationsSourcesFindingsSetMuteCall) Do(opts ...googleapi.CallOptio } -// method id "securitycenter.organizations.sources.findings.setState": +// method id "securitycenter.projects.assets.group": -type OrganizationsSourcesFindingsSetStateCall struct { - s *Service - name string - setfindingstaterequest *SetFindingStateRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsAssetsGroupCall struct { + s *Service + parent string + groupassetsrequest *GroupAssetsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// SetState: Updates the 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 *OrganizationsSourcesFindingsService) SetState(name string, setfindingstaterequest *SetFindingStateRequest) *OrganizationsSourcesFindingsSetStateCall { - c := &OrganizationsSourcesFindingsSetStateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.setfindingstaterequest = setfindingstaterequest +// - 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 + 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 *OrganizationsSourcesFindingsSetStateCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsSetStateCall { +func (c *ProjectsAssetsGroupCall) Fields(s ...googleapi.Field) *ProjectsAssetsGroupCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -23950,21 +25906,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 *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 *OrganizationsSourcesFindingsSetStateCall) Header() http.Header { +func (c *ProjectsAssetsGroupCall) 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 *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_ { @@ -23972,14 +25928,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.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}:setState") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/assets:group") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -23987,19 +25943,19 @@ func (c *OrganizationsSourcesFindingsSetStateCall) 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.sources.findings.setState" call. -// Exactly one of *Finding or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Finding.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *OrganizationsSourcesFindingsSetStateCall) Do(opts ...googleapi.CallOption) (*Finding, error) { +// Do executes the "securitycenter.projects.assets.group" call. +// Exactly one of *GroupAssetsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GroupAssetsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsAssetsGroupCall) Do(opts ...googleapi.CallOption) (*GroupAssetsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -24018,7 +25974,7 @@ func (c *OrganizationsSourcesFindingsSetStateCall) Do(opts ...googleapi.CallOpti 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, @@ -24030,28 +25986,29 @@ 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", + // "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.organizations.sources.findings.setState", + // "id": "securitycenter.projects.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": "^organizations/[^/]+/sources/[^/]+/findings/[^/]+$", + // "pattern": "^projects/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}:setState", + // "path": "v1/{+parent}/assets:group", // "request": { - // "$ref": "SetFindingStateRequest" + // "$ref": "GroupAssetsRequest" // }, // "response": { - // "$ref": "Finding" + // "$ref": "GroupAssetsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -24060,112 +26017,243 @@ func (c *OrganizationsSourcesFindingsSetStateCall) Do(opts ...googleapi.CallOpti } -// method id "securitycenter.organizations.sources.findings.updateSecurityMarks": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsAssetsGroupCall) Pages(ctx context.Context, f func(*GroupAssetsResponse) error) error { + c.ctx_ = ctx + defer func(pt string) { c.groupassetsrequest.PageToken = pt }(c.groupassetsrequest.PageToken) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.groupassetsrequest.PageToken = x.NextPageToken + } +} -type OrganizationsSourcesFindingsUpdateSecurityMarksCall struct { - s *Service - name string - securitymarks *SecurityMarks - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "securitycenter.projects.assets.list": + +type ProjectsAssetsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// UpdateSecurityMarks: Updates security marks. +// List: Lists an organization's assets. // -// - 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 +// - 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 } -// 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) +// 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 } -// 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) +// 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 *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Fields(s ...googleapi.Field) *OrganizationsSourcesFindingsUpdateSecurityMarksCall { +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 *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Context(ctx context.Context) *OrganizationsSourcesFindingsUpdateSecurityMarksCall { +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 *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Header() http.Header { +func (c *ProjectsAssetsListCall) 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 *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.securitymarks) - 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.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.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 *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOption) (*SecurityMarks, error) { +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 { @@ -24184,7 +26272,7 @@ func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Do(opts ...googlea if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &SecurityMarks{ + ret := &ListAssetsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -24196,40 +26284,65 @@ 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", + // "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 the SecurityMarks. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Examples: \"organizations/{organization_id}/assets/{asset_id}/securityMarks\" \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks\".", - // "location": "path", - // "pattern": "^organizations/[^/]+/sources/[^/]+/findings/[^/]+/securityMarks$", - // "required": true, + // "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" // }, - // "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", + // "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" // }, - // "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", + // "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/[^/]+$", + // "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}", - // "request": { - // "$ref": "SecurityMarks" - // }, + // "path": "v1/{+parent}/assets", // "response": { - // "$ref": "SecurityMarks" + // "$ref": "ListAssetsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -24238,35 +26351,68 @@ func (c *OrganizationsSourcesFindingsUpdateSecurityMarksCall) Do(opts ...googlea } -// method id "securitycenter.organizations.sources.findings.externalSystems.patch": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *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 OrganizationsSourcesFindingsExternalSystemsPatchCall struct { - s *Service - name string - googlecloudsecuritycenterv1externalsystem *GoogleCloudSecuritycenterV1ExternalSystem - 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 } -// Patch: Updates external system. This is for a given finding. +// UpdateSecurityMarks: Updates security marks. // -// - 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)} +// - 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.googlecloudsecuritycenterv1externalsystem = googlecloudsecuritycenterv1externalsystem + 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 external system resource. If empty all mutable -// fields will be updated. -func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) UpdateMask(updateMask string) *OrganizationsSourcesFindingsExternalSystemsPatchCall { +// 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 } @@ -24274,7 +26420,7 @@ func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) UpdateMask(update // 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 *ProjectsAssetsUpdateSecurityMarksCall) Fields(s ...googleapi.Field) *ProjectsAssetsUpdateSecurityMarksCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -24282,21 +26428,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 *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 *OrganizationsSourcesFindingsExternalSystemsPatchCall) Header() http.Header { +func (c *ProjectsAssetsUpdateSecurityMarksCall) 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 *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_ { @@ -24304,7 +26450,7 @@ 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.securitymarks) if err != nil { return nil, err } @@ -24324,16 +26470,14 @@ func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) doRequest(alt str return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.organizations.sources.findings.externalSystems.patch" call. -// Exactly one of *GoogleCloudSecuritycenterV1ExternalSystem or error -// will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudSecuritycenterV1ExternalSystem.ServerResponse.Header or -// (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1ExternalSystem, error) { +// Do executes the "securitycenter.projects.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 { @@ -24352,7 +26496,7 @@ func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) Do(opts ...google if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1ExternalSystem{ + ret := &SecurityMarks{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -24364,23 +26508,29 @@ 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}", + // "description": "Updates security marks.", + // "flatPath": "v1/projects/{projectsId}/assets/{assetsId}/securityMarks", // "httpMethod": "PATCH", - // "id": "securitycenter.organizations.sources.findings.externalSystems.patch", + // "id": "securitycenter.projects.assets.updateSecurityMarks", // "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\"", + // "description": "The relative resource name of the SecurityMarks. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Examples: \"organizations/{organization_id}/assets/{asset_id}/securityMarks\" \"organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks\".", // "location": "path", - // "pattern": "^organizations/[^/]+/sources/[^/]+/findings/[^/]+/externalSystems/[^/]+$", + // "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 external system resource. If empty all mutable fields will be updated.", + // "description": "The FieldMask to use when updating the security marks resource. The field mask must not contain duplicate fields. If empty or set to \"marks\", all marks will be replaced. Individual marks can be updated using \"marks.\".", // "format": "google-fieldmask", // "location": "query", // "type": "string" @@ -24388,10 +26538,10 @@ func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) Do(opts ...google // }, // "path": "v1/{+name}", // "request": { - // "$ref": "GoogleCloudSecuritycenterV1ExternalSystem" + // "$ref": "SecurityMarks" // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1ExternalSystem" + // "$ref": "SecurityMarks" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -24400,34 +26550,43 @@ func (c *OrganizationsSourcesFindingsExternalSystemsPatchCall) Do(opts ...google } -// method id "securitycenter.projects.assets.group": +// method id "securitycenter.projects.bigQueryExports.create": -type ProjectsAssetsGroupCall struct { - s *Service - parent string - groupassetsrequest *GroupAssetsRequest - 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 } -// Group: Filters an organization's assets and groups them by their -// specified properties. +// Create: Creates a BigQuery export. // -// - 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: 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.groupassetsrequest = groupassetsrequest + 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 *ProjectsAssetsGroupCall) Fields(s ...googleapi.Field) *ProjectsAssetsGroupCall { +func (c *ProjectsBigQueryExportsCreateCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -24435,21 +26594,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 *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 *ProjectsAssetsGroupCall) Header() http.Header { +func (c *ProjectsBigQueryExportsCreateCall) 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 *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_ { @@ -24457,14 +26616,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.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:group") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/bigQueryExports") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -24477,14 +26636,16 @@ 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 -// non-2xx status code is an error. Response headers are in either -// *GroupAssetsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsAssetsGroupCall) Do(opts ...googleapi.CallOption) (*GroupAssetsResponse, error) { +// Do executes the "securitycenter.projects.bigQueryExports.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 { @@ -24503,7 +26664,7 @@ func (c *ProjectsAssetsGroupCall) Do(opts ...googleapi.CallOption) (*GroupAssets if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GroupAssetsResponse{ + ret := &GoogleCloudSecuritycenterV1BigQueryExport{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -24515,29 +26676,33 @@ 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": "Creates a BigQuery export.", + // "flatPath": "v1/projects/{projectsId}/bigQueryExports", // "httpMethod": "POST", - // "id": "securitycenter.projects.assets.group", + // "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 name of the parent to group the assets by. Its format is \"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": "^projects/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/assets:group", + // "path": "v1/{+parent}/bigQueryExports", // "request": { - // "$ref": "GroupAssetsRequest" + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" // }, // "response": { - // "$ref": "GroupAssetsResponse" + // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -24546,243 +26711,84 @@ 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 { - c.ctx_ = ctx - defer func(pt string) { c.groupassetsrequest.PageToken = pt }(c.groupassetsrequest.PageToken) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.groupassetsrequest.PageToken = x.NextPageToken - } -} - -// method id "securitycenter.projects.assets.list": +// method id "securitycenter.projects.bigQueryExports.delete": -type ProjectsAssetsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsBigQueryExportsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists an organization's assets. +// Delete: Deletes an existing 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 *ProjectsAssetsService) List(parent string) *ProjectsAssetsListCall { - c := &ProjectsAssetsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// CompareDuration sets the optional parameter "compareDuration": When -// compare_duration is set, the ListAssetsResult's "state_change" -// attribute is updated to indicate whether the asset was added, -// removed, or remained present during the compare_duration period of -// time that precedes the read_time. This is the time between (read_time -// - compare_duration) and read_time. The state_change value is derived -// based on the presence of the asset at the two points in time. -// Intermediate state changes between the two times don't affect the -// result. For example, the results aren't affected if the asset is -// removed and re-created again. Possible "state_change" values when -// compare_duration is specified: * "ADDED": indicates that the asset -// was not present at the start of compare_duration, but present at -// read_time. * "REMOVED": indicates that the asset was present at the -// start of compare_duration, but not present at read_time. * "ACTIVE": -// indicates that the asset was present at both the start and the end of -// the time period defined by compare_duration and read_time. If -// compare_duration is not specified, then the only possible -// state_change is "UNUSED", which will be the state_change set for all -// assets present at read_time. -func (c *ProjectsAssetsListCall) CompareDuration(compareDuration string) *ProjectsAssetsListCall { - c.urlParams_.Set("compareDuration", compareDuration) - return c -} - -// FieldMask sets the optional parameter "fieldMask": A field mask to -// specify the ListAssetsResult fields to be listed in the response. An -// empty field mask will list all fields. -func (c *ProjectsAssetsListCall) FieldMask(fieldMask string) *ProjectsAssetsListCall { - c.urlParams_.Set("fieldMask", fieldMask) - return c -} - -// Filter sets the optional parameter "filter": Expression that defines -// the filter to apply across assets. The expression is a list of zero -// or more restrictions combined via logical operators `AND` and `OR`. -// Parentheses are supported, and `OR` has higher precedence than `AND`. -// Restrictions have the form ` ` and may have a `-` character in front -// of them to indicate negation. The fields map to those defined in the -// Asset resource. Examples include: * name * -// security_center_properties.resource_name * -// resource_properties.a_property * security_marks.marks.marka The -// supported operators are: * `=` for all value types. * `>`, `<`, `>=`, -// `<=` for integer values. * `:`, meaning substring matching, for -// strings. The supported value types are: * string literals in quotes. -// * integer literals without quotes. * boolean literals `true` and -// `false` without quotes. The following are the allowed field and -// operator combinations: * name: `=` * update_time: `=`, `>`, `<`, -// `>=`, `<=` Usage: This should be milliseconds since epoch or an -// RFC3339 string. Examples: `update_time = "2019-06-10T16:07:18-07:00" -// `update_time = 1560208038000` * create_time: `=`, `>`, `<`, `>=`, -// `<=` Usage: This should be milliseconds since epoch or an RFC3339 -// string. Examples: `create_time = "2019-06-10T16:07:18-07:00" -// `create_time = 1560208038000` * iam_policy.policy_blob: `=`, `:` * -// resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * -// security_marks.marks: `=`, `:` * -// security_center_properties.resource_name: `=`, `:` * -// security_center_properties.resource_display_name: `=`, `:` * -// security_center_properties.resource_type: `=`, `:` * -// security_center_properties.resource_parent: `=`, `:` * -// security_center_properties.resource_parent_display_name: `=`, `:` * -// security_center_properties.resource_project: `=`, `:` * -// security_center_properties.resource_project_display_name: `=`, `:` * -// security_center_properties.resource_owners: `=`, `:` For example, -// `resource_properties.size = 100` is a valid filter string. Use a -// partial match on the empty string to filter based on a property -// existing: `resource_properties.my_property : "" Use a negated -// partial match on the empty string to filter based on a property not -// existing: `-resource_properties.my_property : "" -func (c *ProjectsAssetsListCall) Filter(filter string) *ProjectsAssetsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// OrderBy sets the optional parameter "orderBy": Expression that -// defines what fields and order to use for sorting. The string value -// should follow SQL syntax: comma separated list of fields. For -// example: "name,resource_properties.a_property". The default sorting -// order is ascending. To specify descending order for a field, a suffix -// " desc" should be appended to the field name. For example: "name -// desc,resource_properties.a_property". Redundant space characters in -// the syntax are insignificant. "name -// desc,resource_properties.a_property" and " name desc , -// resource_properties.a_property " are equivalent. The following fields -// are supported: name update_time resource_properties -// security_marks.marks security_center_properties.resource_name -// security_center_properties.resource_display_name -// security_center_properties.resource_parent -// security_center_properties.resource_parent_display_name -// security_center_properties.resource_project -// security_center_properties.resource_project_display_name -// security_center_properties.resource_type -func (c *ProjectsAssetsListCall) OrderBy(orderBy string) *ProjectsAssetsListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return in a single response. Default is 10, minimum is -// 1, maximum is 1000. -func (c *ProjectsAssetsListCall) PageSize(pageSize int64) *ProjectsAssetsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The value returned -// by the last `ListAssetsResponse`; indicates that this is a -// continuation of a prior `ListAssets` call, and that the system should -// return the next page of data. -func (c *ProjectsAssetsListCall) PageToken(pageToken string) *ProjectsAssetsListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// ReadTime sets the optional parameter "readTime": Time used as a -// reference point when filtering assets. The filter is limited to -// assets existing at the supplied time and their values are those at -// that specific time. Absence of this field will default to the API's -// version of NOW. -func (c *ProjectsAssetsListCall) ReadTime(readTime string) *ProjectsAssetsListCall { - c.urlParams_.Set("readTime", readTime) +// - 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 } // 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 *ProjectsBigQueryExportsDeleteCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsAssetsListCall) IfNoneMatch(entityTag string) *ProjectsAssetsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsAssetsListCall) Context(ctx context.Context) *ProjectsAssetsListCall { +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 *ProjectsAssetsListCall) Header() http.Header { +func (c *ProjectsBigQueryExportsDeleteCall) 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 *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_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/assets") + urls := 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.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) { +// Do executes the "securitycenter.projects.bigQueryExports.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsBigQueryExportsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -24801,7 +26807,7 @@ func (c *ProjectsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAssetsRe if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListAssetsResponse{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -24813,65 +26819,25 @@ func (c *ProjectsAssetsListCall) Do(opts ...googleapi.CallOption) (*ListAssetsRe } return ret, nil // { - // "deprecated": true, - // "description": "Lists an organization's assets.", - // "flatPath": "v1/projects/{projectsId}/assets", - // "httpMethod": "GET", - // "id": "securitycenter.projects.assets.list", + // "description": "Deletes an existing BigQuery export.", + // "flatPath": "v1/projects/{projectsId}/bigQueryExports/{bigQueryExportsId}", + // "httpMethod": "DELETE", + // "id": "securitycenter.projects.bigQueryExports.delete", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "compareDuration": { - // "description": "When compare_duration is set, the ListAssetsResult's \"state_change\" attribute is updated to indicate whether the asset was added, removed, or remained present during the compare_duration period of time that precedes the read_time. This is the time between (read_time - compare_duration) and read_time. The state_change value is derived based on the presence of the asset at the two points in time. Intermediate state changes between the two times don't affect the result. For example, the results aren't affected if the asset is removed and re-created again. Possible \"state_change\" values when compare_duration is specified: * \"ADDED\": indicates that the asset was not present at the start of compare_duration, but present at read_time. * \"REMOVED\": indicates that the asset was present at the start of compare_duration, but not present at read_time. * \"ACTIVE\": indicates that the asset was present at both the start and the end of the time period defined by compare_duration and read_time. If compare_duration is not specified, then the only possible state_change is \"UNUSED\", which will be the state_change set for all assets present at read_time.", - // "format": "google-duration", - // "location": "query", - // "type": "string" - // }, - // "fieldMask": { - // "description": "A field mask to specify the ListAssetsResult fields to be listed in the response. An empty field mask will list all fields.", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" - // }, - // "filter": { - // "description": "Expression that defines the filter to apply across assets. The expression is a list of zero or more restrictions combined via logical operators `AND` and `OR`. Parentheses are supported, and `OR` has higher precedence than `AND`. Restrictions have the form ` ` and may have a `-` character in front of them to indicate negation. The fields map to those defined in the Asset resource. Examples include: * name * security_center_properties.resource_name * resource_properties.a_property * security_marks.marks.marka The supported operators are: * `=` for all value types. * `\u003e`, `\u003c`, `\u003e=`, `\u003c=` for integer values. * `:`, meaning substring matching, for strings. The supported value types are: * string literals in quotes. * integer literals without quotes. * boolean literals `true` and `false` without quotes. The following are the allowed field and operator combinations: * name: `=` * update_time: `=`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: `update_time = \"2019-06-10T16:07:18-07:00\"` `update_time = 1560208038000` * create_time: `=`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: `create_time = \"2019-06-10T16:07:18-07:00\"` `create_time = 1560208038000` * iam_policy.policy_blob: `=`, `:` * resource_properties: `=`, `:`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=` * security_marks.marks: `=`, `:` * security_center_properties.resource_name: `=`, `:` * security_center_properties.resource_display_name: `=`, `:` * security_center_properties.resource_type: `=`, `:` * security_center_properties.resource_parent: `=`, `:` * security_center_properties.resource_parent_display_name: `=`, `:` * security_center_properties.resource_project: `=`, `:` * security_center_properties.resource_project_display_name: `=`, `:` * security_center_properties.resource_owners: `=`, `:` For example, `resource_properties.size = 100` is a valid filter string. Use a partial match on the empty string to filter based on a property existing: `resource_properties.my_property : \"\"` Use a negated partial match on the empty string to filter based on a property not existing: `-resource_properties.my_property : \"\"`", - // "location": "query", - // "type": "string" - // }, - // "orderBy": { - // "description": "Expression that defines what fields and order to use for sorting. The string value should follow SQL syntax: comma separated list of fields. For example: \"name,resource_properties.a_property\". The default sorting order is ascending. To specify descending order for a field, a suffix \" desc\" should be appended to the field name. For example: \"name desc,resource_properties.a_property\". Redundant space characters in the syntax are insignificant. \"name desc,resource_properties.a_property\" and \" name desc , resource_properties.a_property \" are equivalent. The following fields are supported: name update_time resource_properties security_marks.marks security_center_properties.resource_name security_center_properties.resource_display_name security_center_properties.resource_parent security_center_properties.resource_parent_display_name security_center_properties.resource_project security_center_properties.resource_project_display_name security_center_properties.resource_type", - // "location": "query", - // "type": "string" - // }, - // "pageSize": { - // "description": "The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The value returned by the last `ListAssetsResponse`; indicates that this is a continuation of a prior `ListAssets` call, and that the system should return the next page of data.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. 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]\".", + // "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": "^projects/[^/]+$", + // "pattern": "^projects/[^/]+/bigQueryExports/[^/]+$", // "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/{+name}", // "response": { - // "$ref": "ListAssetsResponse" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -24880,115 +26846,80 @@ 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.projects.bigQueryExports.get": -type ProjectsAssetsUpdateSecurityMarksCall struct { - s *Service - name string - securitymarks *SecurityMarks - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsBigQueryExportsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// 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 *ProjectsAssetsService) UpdateSecurityMarks(name string, securitymarks *SecurityMarks) *ProjectsAssetsUpdateSecurityMarksCall { - c := &ProjectsAssetsUpdateSecurityMarksCall{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 - 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 *ProjectsAssetsUpdateSecurityMarksCall) Fields(s ...googleapi.Field) *ProjectsAssetsUpdateSecurityMarksCall { +func (c *ProjectsBigQueryExportsGetCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsBigQueryExportsGetCall) IfNoneMatch(entityTag string) *ProjectsBigQueryExportsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsAssetsUpdateSecurityMarksCall) Context(ctx context.Context) *ProjectsAssetsUpdateSecurityMarksCall { +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 *ProjectsAssetsUpdateSecurityMarksCall) Header() http.Header { +func (c *ProjectsBigQueryExportsGetCall) 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 *ProjectsBigQueryExportsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitymarks) - 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 } @@ -24999,14 +26930,16 @@ func (c *ProjectsAssetsUpdateSecurityMarksCall) doRequest(alt string) (*http.Res return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.projects.assets.updateSecurityMarks" call. -// Exactly one of *SecurityMarks or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *SecurityMarks.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsAssetsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOption) (*SecurityMarks, error) { +// Do executes the "securitycenter.projects.bigQueryExports.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 { @@ -25025,7 +26958,7 @@ func (c *ProjectsAssetsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOption) 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, @@ -25037,40 +26970,25 @@ 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": "Gets a BigQuery export.", + // "flatPath": "v1/projects/{projectsId}/bigQueryExports/{bigQueryExportsId}", + // "httpMethod": "GET", + // "id": "securitycenter.projects.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": "^projects/[^/]+/assets/[^/]+/securityMarks$", + // "pattern": "^projects/[^/]+/bigQueryExports/[^/]+$", // "required": true, // "type": "string" - // }, - // "startTime": { - // "description": "The time at which the updated SecurityMarks take effect. If not set uses current server time. Updates will be applied to the SecurityMarks that are active immediately preceding this time. Must be earlier or equal to the server time.", - // "format": "google-datetime", - // "location": "query", - // "type": "string" - // }, - // "updateMask": { - // "description": "The FieldMask to use when updating the security marks resource. The field mask must not contain duplicate fields. If empty or set to \"marks\", all marks will be replaced. Individual marks can be updated using \"marks.\".", - // "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" @@ -25079,82 +26997,102 @@ func (c *ProjectsAssetsUpdateSecurityMarksCall) Do(opts ...googleapi.CallOption) } -// method id "securitycenter.projects.bigQueryExports.create": +// method id "securitycenter.projects.bigQueryExports.list": -type ProjectsBigQueryExportsCreateCall struct { - s *Service - parent string - googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsBigQueryExportsListCall 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 *ProjectsBigQueryExportsService) Create(parent string, googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport) *ProjectsBigQueryExportsCreateCall { - c := &ProjectsBigQueryExportsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// "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 - 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) +// 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) return 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 *ProjectsBigQueryExportsListCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsListCall { 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 *ProjectsBigQueryExportsCreateCall) Context(ctx context.Context) *ProjectsBigQueryExportsCreateCall { +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 *ProjectsBigQueryExportsCreateCall) Header() http.Header { +func (c *ProjectsBigQueryExportsListCall) 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 *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_ { 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 } @@ -25165,16 +27103,14 @@ func (c *ProjectsBigQueryExportsCreateCall) doRequest(alt string) (*http.Respons return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.projects.bigQueryExports.create" call. -// Exactly one of *GoogleCloudSecuritycenterV1BigQueryExport or error -// will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudSecuritycenterV1BigQueryExport.ServerResponse.Header or -// (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *ProjectsBigQueryExportsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1BigQueryExport, error) { +// Do executes the "securitycenter.projects.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 { @@ -25193,7 +27129,7 @@ func (c *ProjectsBigQueryExportsCreateCall) Do(opts ...googleapi.CallOption) (*G 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, @@ -25205,21 +27141,27 @@ func (c *ProjectsBigQueryExportsCreateCall) Do(opts ...googleapi.CallOption) (*G } 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/projects/{projectsId}/bigQueryExports", - // "httpMethod": "POST", - // "id": "securitycenter.projects.bigQueryExports.create", + // "httpMethod": "GET", + // "id": "securitycenter.projects.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": "^projects/[^/]+$", // "required": true, @@ -25227,11 +27169,8 @@ func (c *ProjectsBigQueryExportsCreateCall) Do(opts ...googleapi.CallOption) (*G // } // }, // "path": "v1/{+parent}/bigQueryExports", - // "request": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" - // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // "$ref": "ListBigQueryExportsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -25240,32 +27179,66 @@ func (c *ProjectsBigQueryExportsCreateCall) Do(opts ...googleapi.CallOption) (*G } -// method id "securitycenter.projects.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 *ProjectsBigQueryExportsListCall) Pages(ctx context.Context, f func(*ListBigQueryExportsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type ProjectsBigQueryExportsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "securitycenter.projects.bigQueryExports.patch": + +type ProjectsBigQueryExportsPatchCall 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 *ProjectsBigQueryExportsService) Delete(name string) *ProjectsBigQueryExportsDeleteCall { - c := &ProjectsBigQueryExportsDeleteCall{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.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 *ProjectsBigQueryExportsPatchCall) UpdateMask(updateMask string) *ProjectsBigQueryExportsPatchCall { + 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 *ProjectsBigQueryExportsPatchCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -25273,21 +27246,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 *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 *ProjectsBigQueryExportsDeleteCall) Header() http.Header { +func (c *ProjectsBigQueryExportsPatchCall) 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 *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_ { @@ -25295,11 +27268,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.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 } @@ -25310,14 +27288,16 @@ 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.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 { @@ -25336,7 +27316,7 @@ func (c *ProjectsBigQueryExportsDeleteCall) Do(opts ...googleapi.CallOption) (*E 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, @@ -25348,25 +27328,34 @@ func (c *ProjectsBigQueryExportsDeleteCall) Do(opts ...googleapi.CallOption) (*E } return ret, nil // { - // "description": "Deletes an existing BigQuery export.", + // "description": "Updates a BigQuery export.", // "flatPath": "v1/projects/{projectsId}/bigQueryExports/{bigQueryExportsId}", - // "httpMethod": "DELETE", - // "id": "securitycenter.projects.bigQueryExports.delete", + // "httpMethod": "PATCH", + // "id": "securitycenter.projects.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": "^projects/[^/]+/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" @@ -25375,100 +27364,93 @@ func (c *ProjectsBigQueryExportsDeleteCall) Do(opts ...googleapi.CallOption) (*E } -// method id "securitycenter.projects.bigQueryExports.get": +// method id "securitycenter.projects.findings.bulkMute": -type ProjectsBigQueryExportsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsFindingsBulkMuteCall struct { + s *Service + parent string + bulkmutefindingsrequest *BulkMuteFindingsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a BigQuery export. +// BulkMute: Kicks off an LRO to bulk mute findings for a parent based +// on a filter. The parent can be either an organization, folder or +// project. The findings matched by the filter will be muted after the +// LRO is done. // -// - 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 +// - parent: The parent, at which bulk action needs to be applied. Its +// format is "organizations/[organization_id]", "folders/[folder_id]", +// "projects/[project_id]". +func (r *ProjectsFindingsService) BulkMute(parent string, bulkmutefindingsrequest *BulkMuteFindingsRequest) *ProjectsFindingsBulkMuteCall { + c := &ProjectsFindingsBulkMuteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.bulkmutefindingsrequest = bulkmutefindingsrequest return 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 *ProjectsFindingsBulkMuteCall) Fields(s ...googleapi.Field) *ProjectsFindingsBulkMuteCall { 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 *ProjectsFindingsBulkMuteCall) Context(ctx context.Context) *ProjectsFindingsBulkMuteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsBigQueryExportsGetCall) Header() http.Header { +func (c *ProjectsFindingsBulkMuteCall) 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 *ProjectsFindingsBulkMuteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { 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.projects.bigQueryExports.get" call. -// Exactly one of *GoogleCloudSecuritycenterV1BigQueryExport or error -// will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudSecuritycenterV1BigQueryExport.ServerResponse.Header or -// (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *ProjectsBigQueryExportsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1BigQueryExport, error) { +// Do executes the "securitycenter.projects.findings.bulkMute" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsFindingsBulkMuteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -25487,7 +27469,7 @@ func (c *ProjectsBigQueryExportsGetCall) Do(opts ...googleapi.CallOption) (*Goog if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1BigQueryExport{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -25499,25 +27481,28 @@ 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": "Kicks off an LRO to bulk mute findings for a parent based on a filter. The parent can be either an organization, folder or project. The findings matched by the filter will be muted after the LRO is done.", + // "flatPath": "v1/projects/{projectsId}/findings:bulkMute", + // "httpMethod": "POST", + // "id": "securitycenter.projects.findings.bulkMute", // "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. The parent, at which bulk action needs to be applied. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", \"projects/[project_id]\".", // "location": "path", - // "pattern": "^projects/[^/]+/bigQueryExports/[^/]+$", + // "pattern": "^projects/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+name}", + // "path": "v1/{+parent}/findings:bulkMute", + // "request": { + // "$ref": "BulkMuteFindingsRequest" + // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -25526,120 +27511,87 @@ func (c *ProjectsBigQueryExportsGetCall) Do(opts ...googleapi.CallOption) (*Goog } -// method id "securitycenter.projects.bigQueryExports.list": +// method id "securitycenter.projects.locations.muteConfigs.delete": -type ProjectsBigQueryExportsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsMuteConfigsDeleteCall struct { + s *Service + name string + 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. +// Delete: Deletes an existing mute config. // -// - parent: The parent, which owns the collection of BigQuery exports. -// Its format is "organizations/[organization_id]", -// "folders/[folder_id]", "projects/[project_id]". -func (r *ProjectsBigQueryExportsService) List(parent string) *ProjectsBigQueryExportsListCall { - c := &ProjectsBigQueryExportsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of configs to return. The service may return fewer than this value. -// If unspecified, at most 10 configs will be returned. The maximum -// value is 1000; values above 1000 will be coerced to 1000. -func (c *ProjectsBigQueryExportsListCall) PageSize(pageSize int64) *ProjectsBigQueryExportsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": A page token, -// received from a previous `ListBigQueryExports` call. Provide this to -// retrieve the subsequent page. When paginating, all other parameters -// provided to `ListBigQueryExports` must match the call that provided -// the page token. -func (c *ProjectsBigQueryExportsListCall) PageToken(pageToken string) *ProjectsBigQueryExportsListCall { - c.urlParams_.Set("pageToken", pageToken) +// - name: Name of the mute config to delete. Its format is +// organizations/{organization}/muteConfigs/{config_id}, +// folders/{folder}/muteConfigs/{config_id}, +// projects/{project}/muteConfigs/{config_id}, +// organizations/{organization}/locations/global/muteConfigs/{config_id +// }, folders/{folder}/locations/global/muteConfigs/{config_id}, or +// projects/{project}/locations/global/muteConfigs/{config_id}. +func (r *ProjectsLocationsMuteConfigsService) Delete(name string) *ProjectsLocationsMuteConfigsDeleteCall { + c := &ProjectsLocationsMuteConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsBigQueryExportsListCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsListCall { +func (c *ProjectsLocationsMuteConfigsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsMuteConfigsDeleteCall { 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 *ProjectsLocationsMuteConfigsDeleteCall) Context(ctx context.Context) *ProjectsLocationsMuteConfigsDeleteCall { c.ctx_ = 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 *ProjectsLocationsMuteConfigsDeleteCall) 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 *ProjectsLocationsMuteConfigsDeleteCall) doRequest(alt string) (*http.Response, 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}/bigQueryExports") + 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.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) { +// Do executes the "securitycenter.projects.locations.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 *ProjectsLocationsMuteConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -25658,7 +27610,7 @@ func (c *ProjectsBigQueryExportsListCall) Do(opts ...googleapi.CallOption) (*Lis if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListBigQueryExportsResponse{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -25670,36 +27622,25 @@ func (c *ProjectsBigQueryExportsListCall) Do(opts ...googleapi.CallOption) (*Lis } return ret, nil // { - // "description": "Lists BigQuery exports. Note that when requesting BigQuery exports at a given level all exports under that level are also returned e.g. if requesting BigQuery exports under a folder, then all BigQuery exports immediately under the folder plus the ones created under the projects within the folder are returned.", - // "flatPath": "v1/projects/{projectsId}/bigQueryExports", - // "httpMethod": "GET", - // "id": "securitycenter.projects.bigQueryExports.list", + // "description": "Deletes an existing mute config.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/muteConfigs/{muteConfigsId}", + // "httpMethod": "DELETE", + // "id": "securitycenter.projects.locations.muteConfigs.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 `ListBigQueryExports` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListBigQueryExports` must match the call that provided the page token.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The parent, which owns the collection of BigQuery exports. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", \"projects/[project_id]\".", + // "name": { + // "description": "Required. Name of the mute config to delete. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", // "location": "path", - // "pattern": "^projects/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/muteConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1/{+parent}/bigQueryExports", + // "path": "v1/{+name}", // "response": { - // "$ref": "ListBigQueryExportsResponse" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -25708,105 +27649,83 @@ func (c *ProjectsBigQueryExportsListCall) Do(opts ...googleapi.CallOption) (*Lis } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ProjectsBigQueryExportsListCall) Pages(ctx context.Context, f func(*ListBigQueryExportsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} +// method id "securitycenter.projects.locations.muteConfigs.get": -// method id "securitycenter.projects.bigQueryExports.patch": - -type ProjectsBigQueryExportsPatchCall struct { - s *Service - name string - googlecloudsecuritycenterv1bigqueryexport *GoogleCloudSecuritycenterV1BigQueryExport - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsMuteConfigsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Patch: Updates a BigQuery export. +// Get: Gets a mute config. // -// - 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)} +// - name: Name of the mute config to retrieve. Its format is +// organizations/{organization}/muteConfigs/{config_id}, +// folders/{folder}/muteConfigs/{config_id}, +// projects/{project}/muteConfigs/{config_id}, +// organizations/{organization}/locations/global/muteConfigs/{config_id +// }, folders/{folder}/locations/global/muteConfigs/{config_id}, or +// projects/{project}/locations/global/muteConfigs/{config_id}. +func (r *ProjectsLocationsMuteConfigsService) Get(name string) *ProjectsLocationsMuteConfigsGetCall { + c := &ProjectsLocationsMuteConfigsGetCall{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 *ProjectsBigQueryExportsPatchCall) UpdateMask(updateMask string) *ProjectsBigQueryExportsPatchCall { - 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 *ProjectsBigQueryExportsPatchCall) Fields(s ...googleapi.Field) *ProjectsBigQueryExportsPatchCall { +func (c *ProjectsLocationsMuteConfigsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsMuteConfigsGetCall { 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 *ProjectsLocationsMuteConfigsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsMuteConfigsGetCall { + 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 *ProjectsLocationsMuteConfigsGetCall) Context(ctx context.Context) *ProjectsLocationsMuteConfigsGetCall { c.ctx_ = 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 *ProjectsLocationsMuteConfigsGetCall) 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 *ProjectsLocationsMuteConfigsGetCall) doRequest(alt string) (*http.Response, 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 += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -25817,16 +27736,15 @@ func (c *ProjectsBigQueryExportsPatchCall) doRequest(alt string) (*http.Response 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.locations.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 *ProjectsLocationsMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -25845,7 +27763,7 @@ func (c *ProjectsBigQueryExportsPatchCall) Do(opts ...googleapi.CallOption) (*Go if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudSecuritycenterV1BigQueryExport{ + ret := &GoogleCloudSecuritycenterV1MuteConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -25857,34 +27775,25 @@ func (c *ProjectsBigQueryExportsPatchCall) Do(opts ...googleapi.CallOption) (*Go } return ret, nil // { - // "description": "Updates a BigQuery export.", - // "flatPath": "v1/projects/{projectsId}/bigQueryExports/{bigQueryExportsId}", - // "httpMethod": "PATCH", - // "id": "securitycenter.projects.bigQueryExports.patch", + // "description": "Gets a mute config.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/muteConfigs/{muteConfigsId}", + // "httpMethod": "GET", + // "id": "securitycenter.projects.locations.muteConfigs.get", // "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 mute config to retrieve. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", // "location": "path", - // "pattern": "^projects/[^/]+/bigQueryExports/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/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": "GoogleCloudSecuritycenterV1BigQueryExport" - // }, // "response": { - // "$ref": "GoogleCloudSecuritycenterV1BigQueryExport" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -25893,36 +27802,44 @@ func (c *ProjectsBigQueryExportsPatchCall) Do(opts ...googleapi.CallOption) (*Go } -// method id "securitycenter.projects.findings.bulkMute": +// method id "securitycenter.projects.locations.muteConfigs.patch": -type ProjectsFindingsBulkMuteCall struct { - s *Service - parent string - bulkmutefindingsrequest *BulkMuteFindingsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsMuteConfigsPatchCall struct { + s *Service + name string + googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// BulkMute: Kicks off an LRO to bulk mute findings for a parent based -// on a filter. The parent can be either an organization, folder or -// project. The findings matched by the filter will be muted after the -// LRO is done. +// Patch: Updates a mute config. // -// - parent: The parent, at which bulk action needs to be applied. Its -// format is "organizations/[organization_id]", "folders/[folder_id]", -// "projects/[project_id]". -func (r *ProjectsFindingsService) BulkMute(parent string, bulkmutefindingsrequest *BulkMuteFindingsRequest) *ProjectsFindingsBulkMuteCall { - c := &ProjectsFindingsBulkMuteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.bulkmutefindingsrequest = bulkmutefindingsrequest +// - name: This field will be ignored if provided on config creation. +// Format "organizations/{organization}/muteConfigs/{mute_config}" +// "folders/{folder}/muteConfigs/{mute_config}" +// "projects/{project}/muteConfigs/{mute_config}" +// "organizations/{organization}/locations/global/muteConfigs/{mute_con +// fig}" "folders/{folder}/locations/global/muteConfigs/{mute_config}" +// "projects/{project}/locations/global/muteConfigs/{mute_config}". +func (r *ProjectsLocationsMuteConfigsService) Patch(name string, googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig) *ProjectsLocationsMuteConfigsPatchCall { + c := &ProjectsLocationsMuteConfigsPatchCall{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 *ProjectsLocationsMuteConfigsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsMuteConfigsPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsFindingsBulkMuteCall) Fields(s ...googleapi.Field) *ProjectsFindingsBulkMuteCall { +func (c *ProjectsLocationsMuteConfigsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsMuteConfigsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -25930,21 +27847,21 @@ func (c *ProjectsFindingsBulkMuteCall) Fields(s ...googleapi.Field) *ProjectsFin // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsFindingsBulkMuteCall) Context(ctx context.Context) *ProjectsFindingsBulkMuteCall { +func (c *ProjectsLocationsMuteConfigsPatchCall) Context(ctx context.Context) *ProjectsLocationsMuteConfigsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsFindingsBulkMuteCall) Header() http.Header { +func (c *ProjectsLocationsMuteConfigsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsFindingsBulkMuteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsMuteConfigsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -25952,34 +27869,35 @@ func (c *ProjectsFindingsBulkMuteCall) doRequest(alt string) (*http.Response, er } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkmutefindingsrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudsecuritycenterv1muteconfig) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/findings:bulkMute") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "securitycenter.projects.findings.bulkMute" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *ProjectsFindingsBulkMuteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// Do executes the "securitycenter.projects.locations.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 *ProjectsLocationsMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudSecuritycenterV1MuteConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -25998,7 +27916,7 @@ func (c *ProjectsFindingsBulkMuteCall) Do(opts ...googleapi.CallOption) (*Operat 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, @@ -26010,28 +27928,34 @@ func (c *ProjectsFindingsBulkMuteCall) Do(opts ...googleapi.CallOption) (*Operat } return ret, nil // { - // "description": "Kicks off an LRO to bulk mute findings for a parent based on a filter. The parent can be either an organization, folder or project. The findings matched by the filter will be muted after the LRO is done.", - // "flatPath": "v1/projects/{projectsId}/findings:bulkMute", - // "httpMethod": "POST", - // "id": "securitycenter.projects.findings.bulkMute", + // "description": "Updates a mute config.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/muteConfigs/{muteConfigsId}", + // "httpMethod": "PATCH", + // "id": "securitycenter.projects.locations.muteConfigs.patch", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. The parent, at which bulk action needs to be applied. Its format is \"organizations/[organization_id]\", \"folders/[folder_id]\", \"projects/[project_id]\".", + // "name": { + // "description": "This field will be ignored if provided on config creation. Format \"organizations/{organization}/muteConfigs/{mute_config}\" \"folders/{folder}/muteConfigs/{mute_config}\" \"projects/{project}/muteConfigs/{mute_config}\" \"organizations/{organization}/locations/global/muteConfigs/{mute_config}\" \"folders/{folder}/locations/global/muteConfigs/{mute_config}\" \"projects/{project}/locations/global/muteConfigs/{mute_config}\"", // "location": "path", - // "pattern": "^projects/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/muteConfigs/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "The list of fields to be updated. If empty all mutable fields will be updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v1/{+parent}/findings:bulkMute", + // "path": "v1/{+name}", // "request": { - // "$ref": "BulkMuteFindingsRequest" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "response": { - // "$ref": "Operation" + // "$ref": "GoogleCloudSecuritycenterV1MuteConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -26214,8 +28138,11 @@ type ProjectsMuteConfigsDeleteCall struct { // // - 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}. +// folders/{folder}/muteConfigs/{config_id}, +// projects/{project}/muteConfigs/{config_id}, +// organizations/{organization}/locations/global/muteConfigs/{config_id +// }, folders/{folder}/locations/global/muteConfigs/{config_id}, or +// projects/{project}/locations/global/muteConfigs/{config_id}. func (r *ProjectsMuteConfigsService) Delete(name string) *ProjectsMuteConfigsDeleteCall { c := &ProjectsMuteConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name @@ -26317,7 +28244,7 @@ func (c *ProjectsMuteConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty // ], // "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 mute config to delete. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", // "location": "path", // "pattern": "^projects/[^/]+/muteConfigs/[^/]+$", // "required": true, @@ -26350,8 +28277,11 @@ type ProjectsMuteConfigsGetCall struct { // // - 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}. +// folders/{folder}/muteConfigs/{config_id}, +// projects/{project}/muteConfigs/{config_id}, +// organizations/{organization}/locations/global/muteConfigs/{config_id +// }, folders/{folder}/locations/global/muteConfigs/{config_id}, or +// projects/{project}/locations/global/muteConfigs/{config_id}. func (r *ProjectsMuteConfigsService) Get(name string) *ProjectsMuteConfigsGetCall { c := &ProjectsMuteConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name @@ -26467,7 +28397,7 @@ func (c *ProjectsMuteConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCl // ], // "parameters": { // "name": { - // "description": "Required. Name of the mute config to retrieve. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, or projects/{project}/muteConfigs/{config_id}", + // "description": "Required. Name of the mute config to retrieve. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, projects/{project}/muteConfigs/{config_id}, organizations/{organization}/locations/global/muteConfigs/{config_id}, folders/{folder}/locations/global/muteConfigs/{config_id}, or projects/{project}/locations/global/muteConfigs/{config_id}.", // "location": "path", // "pattern": "^projects/[^/]+/muteConfigs/[^/]+$", // "required": true, @@ -26700,7 +28630,10 @@ type ProjectsMuteConfigsPatchCall struct { // - 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}". +// "projects/{project}/muteConfigs/{mute_config}" +// "organizations/{organization}/locations/global/muteConfigs/{mute_con +// fig}" "folders/{folder}/locations/global/muteConfigs/{mute_config}" +// "projects/{project}/locations/global/muteConfigs/{mute_config}". func (r *ProjectsMuteConfigsService) Patch(name string, googlecloudsecuritycenterv1muteconfig *GoogleCloudSecuritycenterV1MuteConfig) *ProjectsMuteConfigsPatchCall { c := &ProjectsMuteConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name @@ -26816,7 +28749,7 @@ func (c *ProjectsMuteConfigsPatchCall) Do(opts ...googleapi.CallOption) (*Google // ], // "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": "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}\" \"organizations/{organization}/locations/global/muteConfigs/{mute_config}\" \"folders/{folder}/locations/global/muteConfigs/{mute_config}\" \"projects/{project}/locations/global/muteConfigs/{mute_config}\"", // "location": "path", // "pattern": "^projects/[^/]+/muteConfigs/[^/]+$", // "required": true, @@ -28664,6 +30597,154 @@ func (c *ProjectsSecurityHealthAnalyticsSettingsCustomModulesPatchCall) Do(opts } +// method id "securitycenter.projects.securityHealthAnalyticsSettings.customModules.simulate": + +type ProjectsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall struct { + s *Service + parent string + simulatesecurityhealthanalyticscustommodulerequest *SimulateSecurityHealthAnalyticsCustomModuleRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Simulate: Simulates a given SecurityHealthAnalyticsCustomModule and +// Resource. +// +// - parent: The relative resource name of the organization, project, or +// folder. See: +// https://cloud.google.com/apis/design/resource_names#relative_resource_name +// An example is: "organizations/{organization_id}". +func (r *ProjectsSecurityHealthAnalyticsSettingsCustomModulesService) Simulate(parent string, simulatesecurityhealthanalyticscustommodulerequest *SimulateSecurityHealthAnalyticsCustomModuleRequest) *ProjectsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall { + c := &ProjectsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.simulatesecurityhealthanalyticscustommodulerequest = simulatesecurityhealthanalyticscustommodulerequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) Fields(s ...googleapi.Field) *ProjectsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall { + 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 *ProjectsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) Context(ctx context.Context) *ProjectsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) doRequest(alt string) (*http.Response, 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.simulatesecurityhealthanalyticscustommodulerequest) + 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:simulate") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "securitycenter.projects.securityHealthAnalyticsSettings.customModules.simulate" call. +// Exactly one of *SimulateSecurityHealthAnalyticsCustomModuleResponse +// or error will be non-nil. Any non-2xx status code is an error. +// Response headers are in either +// *SimulateSecurityHealthAnalyticsCustomModuleResponse.ServerResponse.He +// ader or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsSecurityHealthAnalyticsSettingsCustomModulesSimulateCall) Do(opts ...googleapi.CallOption) (*SimulateSecurityHealthAnalyticsCustomModuleResponse, 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 := &SimulateSecurityHealthAnalyticsCustomModuleResponse{ + 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": "Simulates a given SecurityHealthAnalyticsCustomModule and Resource.", + // "flatPath": "v1/projects/{projectsId}/securityHealthAnalyticsSettings/customModules:simulate", + // "httpMethod": "POST", + // "id": "securitycenter.projects.securityHealthAnalyticsSettings.customModules.simulate", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. The relative resource name of the organization, project, or folder. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name An example is: \"organizations/{organization_id}\".", + // "location": "path", + // "pattern": "^projects/[^/]+/securityHealthAnalyticsSettings$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+parent}/customModules:simulate", + // "request": { + // "$ref": "SimulateSecurityHealthAnalyticsCustomModuleRequest" + // }, + // "response": { + // "$ref": "SimulateSecurityHealthAnalyticsCustomModuleResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + // method id "securitycenter.projects.securityHealthAnalyticsSettings.effectiveCustomModules.get": type ProjectsSecurityHealthAnalyticsSettingsEffectiveCustomModulesGetCall struct { diff --git a/securitycenter/v1beta1/securitycenter-api.json b/securitycenter/v1beta1/securitycenter-api.json index 3a92fc63c72..e0687ac1613 100644 --- a/securitycenter/v1beta1/securitycenter-api.json +++ b/securitycenter/v1beta1/securitycenter-api.json @@ -896,7 +896,7 @@ } } }, - "revision": "20231005", + "revision": "20231023", "rootUrl": "https://securitycenter.googleapis.com/", "schemas": { "Access": { @@ -1871,6 +1871,13 @@ "description": "Steps to address the finding.", "type": "string" }, + "orgPolicies": { + "description": "Contains information about the org policies associated with the finding.", + "items": { + "$ref": "OrgPolicy" + }, + "type": "array" + }, "parent": { "description": "The relative resource name of the source the finding belongs to. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name This field is immutable after creation time. For example: \"organizations/{organization_id}/sources/{source_id}\"", "type": "string" @@ -2228,7 +2235,7 @@ "type": "string" }, "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": "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}\" \"organizations/{organization}/locations/global/muteConfigs/{mute_config}\" \"folders/{folder}/locations/global/muteConfigs/{mute_config}\" \"projects/{project}/locations/global/muteConfigs/{mute_config}\"", "type": "string" }, "updateTime": { @@ -3593,6 +3600,17 @@ }, "type": "object" }, + "OrgPolicy": { + "description": "Contains information about the org policies associated with the finding.", + "id": "OrgPolicy", + "properties": { + "name": { + "description": "The resource name of the org policy. Example: \"organizations/{organization_id}/policies/{constraint_name}\"", + "type": "string" + } + }, + "type": "object" + }, "OrganizationSettings": { "description": "User specified settings that are attached to the Security Command Center organization.", "id": "OrganizationSettings", diff --git a/securitycenter/v1beta1/securitycenter-gen.go b/securitycenter/v1beta1/securitycenter-gen.go index ff3133c2e1b..ddab4d08841 100644 --- a/securitycenter/v1beta1/securitycenter-gen.go +++ b/securitycenter/v1beta1/securitycenter-gen.go @@ -1690,6 +1690,10 @@ type Finding struct { // NextSteps: Steps to address the finding. NextSteps string `json:"nextSteps,omitempty"` + // OrgPolicies: Contains information about the org policies associated + // with the finding. + OrgPolicies []*OrgPolicy `json:"orgPolicies,omitempty"` + // Parent: The relative resource name of the source the finding belongs // to. See: // https://cloud.google.com/apis/design/resource_names#relative_resource_name @@ -2309,6 +2313,9 @@ type GoogleCloudSecuritycenterV1MuteConfig struct { // Format "organizations/{organization}/muteConfigs/{mute_config}" // "folders/{folder}/muteConfigs/{mute_config}" // "projects/{project}/muteConfigs/{mute_config}" + // "organizations/{organization}/locations/global/muteConfigs/{mute_confi + // g}" "folders/{folder}/locations/global/muteConfigs/{mute_config}" + // "projects/{project}/locations/global/muteConfigs/{mute_config}" Name string `json:"name,omitempty"` // UpdateTime: Output only. The most recent time at which the mute @@ -4309,6 +4316,36 @@ func (s *Operation) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// OrgPolicy: Contains information about the org policies associated +// with the finding. +type OrgPolicy struct { + // Name: The resource name of the org policy. Example: + // "organizations/{organization_id}/policies/{constraint_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 *OrgPolicy) MarshalJSON() ([]byte, error) { + type NoMethod OrgPolicy + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // OrganizationSettings: User specified settings that are attached to // the Security Command Center organization. type OrganizationSettings struct { diff --git a/securitycenter/v1beta2/securitycenter-api.json b/securitycenter/v1beta2/securitycenter-api.json index 30bbc9594fc..84631c77027 100644 --- a/securitycenter/v1beta2/securitycenter-api.json +++ b/securitycenter/v1beta2/securitycenter-api.json @@ -1906,7 +1906,7 @@ } } }, - "revision": "20231005", + "revision": "20231023", "rootUrl": "https://securitycenter.googleapis.com/", "schemas": { "Access": { @@ -2888,6 +2888,13 @@ "description": "Steps to address the finding.", "type": "string" }, + "orgPolicies": { + "description": "Contains information about the org policies associated with the finding.", + "items": { + "$ref": "OrgPolicy" + }, + "type": "array" + }, "parent": { "description": "The relative resource name of the source the finding belongs to. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name This field is immutable after creation time. For example: \"organizations/{organization_id}/sources/{source_id}\"", "type": "string" @@ -3222,7 +3229,7 @@ "type": "string" }, "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": "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}\" \"organizations/{organization}/locations/global/muteConfigs/{mute_config}\" \"folders/{folder}/locations/global/muteConfigs/{mute_config}\" \"projects/{project}/locations/global/muteConfigs/{mute_config}\"", "type": "string" }, "updateTime": { @@ -4222,6 +4229,17 @@ }, "type": "object" }, + "OrgPolicy": { + "description": "Contains information about the org policies associated with the finding.", + "id": "OrgPolicy", + "properties": { + "name": { + "description": "The resource name of the org policy. Example: \"organizations/{organization_id}/policies/{constraint_name}\"", + "type": "string" + } + }, + "type": "object" + }, "Pod": { "description": "A Kubernetes Pod.", "id": "Pod", @@ -4409,7 +4427,7 @@ "type": "object" }, "SecurityCenterSettings": { - "description": "Resource capturing the settings for Security Center.", + "description": "Resource capturing the settings for Security Center. Next ID: 12", "id": "SecurityCenterSettings", "properties": { "logSinkProject": { diff --git a/securitycenter/v1beta2/securitycenter-gen.go b/securitycenter/v1beta2/securitycenter-gen.go index dc28d59baa1..59a5c4012a6 100644 --- a/securitycenter/v1beta2/securitycenter-gen.go +++ b/securitycenter/v1beta2/securitycenter-gen.go @@ -1834,6 +1834,10 @@ type Finding struct { // NextSteps: Steps to address the finding. NextSteps string `json:"nextSteps,omitempty"` + // OrgPolicies: Contains information about the org policies associated + // with the finding. + OrgPolicies []*OrgPolicy `json:"orgPolicies,omitempty"` + // Parent: The relative resource name of the source the finding belongs // to. See: // https://cloud.google.com/apis/design/resource_names#relative_resource_name @@ -2383,6 +2387,9 @@ type GoogleCloudSecuritycenterV1MuteConfig struct { // Format "organizations/{organization}/muteConfigs/{mute_config}" // "folders/{folder}/muteConfigs/{mute_config}" // "projects/{project}/muteConfigs/{mute_config}" + // "organizations/{organization}/locations/global/muteConfigs/{mute_confi + // g}" "folders/{folder}/locations/global/muteConfigs/{mute_config}" + // "projects/{project}/locations/global/muteConfigs/{mute_config}" Name string `json:"name,omitempty"` // UpdateTime: Output only. The most recent time at which the mute @@ -3709,6 +3716,36 @@ func (s *Object) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// OrgPolicy: Contains information about the org policies associated +// with the finding. +type OrgPolicy struct { + // Name: The resource name of the org policy. Example: + // "organizations/{organization_id}/policies/{constraint_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 *OrgPolicy) MarshalJSON() ([]byte, error) { + type NoMethod OrgPolicy + 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. @@ -3969,7 +4006,7 @@ func (s *Role) MarshalJSON() ([]byte, error) { } // SecurityCenterSettings: Resource capturing the settings for Security -// Center. +// Center. Next ID: 12 type SecurityCenterSettings struct { // LogSinkProject: The resource name of the project to send logs to. // This project must be part of the organization this resource resides