diff --git a/chat/v1/chat-api.json b/chat/v1/chat-api.json index a25d735b779..07eceb694a5 100644 --- a/chat/v1/chat-api.json +++ b/chat/v1/chat-api.json @@ -288,7 +288,7 @@ "parameterOrder": [], "parameters": { "name": { - "description": "Required. Resource name of the user to find direct message with. Format: `users/{user}`, where `{user}` is either the `{person_id}` for the [person](https://developers.google.com/people/api/rest/v1/people) from the People API, or the `id` for the [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Directory API. For example, if the People API `Person.resourceName` is `people/123456789`, you can find a direct message with that person by using `users/123456789` as the `name`. When [authenticated as a user](https://developers.google.com/chat/api/guides/auth/users), you can use the email as an alias for `{user}`. For example, `users/example@gmail.com` where `example@gmail.com` is the email of the Google Chat user.", + "description": "Required. Resource name of the user to find direct message with. Format: `users/{user}`, where `{user}` is either the `id` for the [person](https://developers.google.com/people/api/rest/v1/people) from the People API, or the `id` for the [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Directory API. For example, if the People API profile ID is `123456789`, you can find a direct message with that person by using `users/123456789` as the `name`. When [authenticated as a user](https://developers.google.com/chat/api/guides/auth/users), you can use the email as an alias for `{user}`. For example, `users/example@gmail.com` where `example@gmail.com` is the email of the Google Chat user.", "location": "query", "type": "string" } @@ -400,7 +400,7 @@ ] }, "setup": { - "description": "Creates a space and adds specified users to it. The calling user is automatically added to the space, and shouldn't be specified as a membership in the request. For an example, see [Set up a space](https://developers.google.com/chat/api/guides/v1/spaces/set-up). To specify the human members to add, add memberships with the appropriate `member.name` in the `SetUpSpaceRequest`. To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace organization `{user}` can also be the `{person_id}` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person `resourceName` for `user@example.com` is `people/123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user@example.com` or `users/123456789`. For a space or group chat, if the caller blocks or is blocked by some members, then those members aren't added to the created space. To create a direct message (DM) between the calling user and another human user, specify exactly one membership to represent the human user. If one user blocks the other, the request fails and the DM isn't created. To create a DM between the calling user and the calling app, set `Space.singleUserBotDm` to `true` and don't specify any memberships. You can only use this method to set up a DM with the calling app. To add the calling app as a member of a space or an existing DM between two human users, see [create a membership](https://developers.google.com/chat/api/guides/v1/members/create). If a DM already exists between two users, even when one user blocks the other at the time a request is made, then the existing DM is returned. Spaces with threaded replies aren't supported. If you receive the error message `ALREADY_EXISTS` when setting up a space, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users).", + "description": "Creates a space and adds specified users to it. The calling user is automatically added to the space, and shouldn't be specified as a membership in the request. For an example, see [Set up a space](https://developers.google.com/chat/api/guides/v1/spaces/set-up). To specify the human members to add, add memberships with the appropriate `member.name` in the `SetUpSpaceRequest`. To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace organization `{user}` can also be the `id` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person profile ID for `user@example.com` is `123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user@example.com` or `users/123456789`. For a space or group chat, if the caller blocks or is blocked by some members, then those members aren't added to the created space. To create a direct message (DM) between the calling user and another human user, specify exactly one membership to represent the human user. If one user blocks the other, the request fails and the DM isn't created. To create a DM between the calling user and the calling app, set `Space.singleUserBotDm` to `true` and don't specify any memberships. You can only use this method to set up a DM with the calling app. To add the calling app as a member of a space or an existing DM between two human users, see [create a membership](https://developers.google.com/chat/api/guides/v1/members/create). If a DM already exists between two users, even when one user blocks the other at the time a request is made, then the existing DM is returned. Spaces with threaded replies aren't supported. If you receive the error message `ALREADY_EXISTS` when setting up a space, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users).", "flatPath": "v1/spaces:setup", "httpMethod": "POST", "id": "chat.spaces.setup", @@ -423,7 +423,7 @@ "members": { "methods": { "create": { - "description": "Creates a human membership or app membership for the calling app. Creating memberships for other apps isn't supported. For an example, see [ Create a membership](https://developers.google.com/chat/api/guides/v1/members/create). When creating a membership, if the specified member has their auto-accept policy turned off, then they're invited, and must accept the space invitation before joining. Otherwise, creating a membership adds the member directly to the specified space. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). To specify the member to add, set the `membership.member.name` in the `CreateMembershipRequest`: - To add the calling app to a space or a direct message between two human users, use `users/app`. Unable to add other apps to the space. - To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace organization `{user}` can also be the `{person_id}` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person `resourceName` for `user@example.com` is `people/123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user@example.com` or `users/123456789`.", + "description": "Creates a human membership or app membership for the calling app. Creating memberships for other apps isn't supported. For an example, see [ Create a membership](https://developers.google.com/chat/api/guides/v1/members/create). When creating a membership, if the specified member has their auto-accept policy turned off, then they're invited, and must accept the space invitation before joining. Otherwise, creating a membership adds the member directly to the specified space. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). To specify the member to add, set the `membership.member.name` in the `CreateMembershipRequest`: - To add the calling app to a space or a direct message between two human users, use `users/app`. Unable to add other apps to the space. - To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace organization `{user}` can also be the `id` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person profile ID for `user@example.com` is `123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user@example.com` or `users/123456789`.", "flatPath": "v1/spaces/{spacesId}/members", "httpMethod": "POST", "id": "chat.spaces.members.create", @@ -957,7 +957,7 @@ } } }, - "revision": "20231105", + "revision": "20231114", "rootUrl": "https://chat.googleapis.com/", "schemas": { "ActionParameter": { @@ -3661,7 +3661,7 @@ "type": "boolean" }, "name": { - "description": "Resource name for a Google Chat user. Format: `users/{user}`. `users/app` can be used as an alias for the calling app bot user. For human users, `{user}` is the same user identifier as: - the `{person_id`} for the [Person](https://developers.google.com/people/api/rest/v1/people) in the People API, where the Person `resource_name` is `people/{person_id}`. For example, `users/123456789` in Chat API represents the same person as `people/123456789` in People API. - the `id` for a [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Admin SDK Directory API. - the user's email address can be used as an alias for `{user}` in API requests. For example, if the People API Person `resourceName` for `user@example.com` is `people/123456789`, you can use `users/user@example.com` as an alias to reference `users/123456789`. Only the canonical resource name (for example `users/123456789`) will be returned from the API.", + "description": "Resource name for a Google Chat user. Format: `users/{user}`. `users/app` can be used as an alias for the calling app bot user. For human users, `{user}` is the same user identifier as: - the `id` for the [Person](https://developers.google.com/people/api/rest/v1/people) in the People API. For example, `users/123456789` in Chat API represents the same person as the `123456789` Person profile ID in People API. - the `id` for a [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Admin SDK Directory API. - the user's email address can be used as an alias for `{user}` in API requests. For example, if the People API Person profile ID for `user@example.com` is `123456789`, you can use `users/user@example.com` as an alias to reference `users/123456789`. Only the canonical resource name (for example `users/123456789`) will be returned from the API.", "type": "string" }, "type": { diff --git a/chat/v1/chat-gen.go b/chat/v1/chat-gen.go index 1a5711dd0f3..9f646f12d61 100644 --- a/chat/v1/chat-gen.go +++ b/chat/v1/chat-gen.go @@ -5079,19 +5079,18 @@ type User struct { // Name: Resource name for a Google Chat user. Format: `users/{user}`. // `users/app` can be used as an alias for the calling app bot user. For - // human users, `{user}` is the same user identifier as: - the - // `{person_id`} for the Person - // (https://developers.google.com/people/api/rest/v1/people) in the - // People API, where the Person `resource_name` is `people/{person_id}`. - // For example, `users/123456789` in Chat API represents the same person - // as `people/123456789` in People API. - the `id` for a user + // human users, `{user}` is the same user identifier as: - the `id` for + // the Person (https://developers.google.com/people/api/rest/v1/people) + // in the People API. For example, `users/123456789` in Chat API + // represents the same person as the `123456789` Person profile ID in + // People API. - the `id` for a user // (https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) // in the Admin SDK Directory API. - the user's email address can be // used as an alias for `{user}` in API requests. For example, if the - // People API Person `resourceName` for `user@example.com` is - // `people/123456789`, you can use `users/user@example.com` as an alias - // to reference `users/123456789`. Only the canonical resource name (for - // example `users/123456789`) will be returned from the API. + // People API Person profile ID for `user@example.com` is `123456789`, + // you can use `users/user@example.com` as an alias to reference + // `users/123456789`. Only the canonical resource name (for example + // `users/123456789`) will be returned from the API. Name string `json:"name,omitempty"` // Type: User type. @@ -5925,14 +5924,13 @@ func (r *SpacesService) FindDirectMessage() *SpacesFindDirectMessageCall { // Name sets the optional parameter "name": Required. Resource name of // the user to find direct message with. Format: `users/{user}`, where -// `{user}` is either the `{person_id}` for the person +// `{user}` is either the `id` for the person // (https://developers.google.com/people/api/rest/v1/people) from the // People API, or the `id` for the user // (https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) -// in the Directory API. For example, if the People API -// `Person.resourceName` is `people/123456789`, you can find a direct -// message with that person by using `users/123456789` as the `name`. -// When authenticated as a user +// in the Directory API. For example, if the People API profile ID is +// `123456789`, you can find a direct message with that person by using +// `users/123456789` as the `name`. When authenticated as a user // (https://developers.google.com/chat/api/guides/auth/users), you can // use the email as an alias for `{user}`. For example, // `users/example@gmail.com` where `example@gmail.com` is the email of @@ -6045,7 +6043,7 @@ func (c *SpacesFindDirectMessageCall) Do(opts ...googleapi.CallOption) (*Space, // "parameterOrder": [], // "parameters": { // "name": { - // "description": "Required. Resource name of the user to find direct message with. Format: `users/{user}`, where `{user}` is either the `{person_id}` for the [person](https://developers.google.com/people/api/rest/v1/people) from the People API, or the `id` for the [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Directory API. For example, if the People API `Person.resourceName` is `people/123456789`, you can find a direct message with that person by using `users/123456789` as the `name`. When [authenticated as a user](https://developers.google.com/chat/api/guides/auth/users), you can use the email as an alias for `{user}`. For example, `users/example@gmail.com` where `example@gmail.com` is the email of the Google Chat user.", + // "description": "Required. Resource name of the user to find direct message with. Format: `users/{user}`, where `{user}` is either the `id` for the [person](https://developers.google.com/people/api/rest/v1/people) from the People API, or the `id` for the [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Directory API. For example, if the People API profile ID is `123456789`, you can find a direct message with that person by using `users/123456789` as the `name`. When [authenticated as a user](https://developers.google.com/chat/api/guides/auth/users), you can use the email as an alias for `{user}`. For example, `users/example@gmail.com` where `example@gmail.com` is the email of the Google Chat user.", // "location": "query", // "type": "string" // } @@ -6641,22 +6639,21 @@ type SpacesSetupCall struct { // appropriate `member.name` in the `SetUpSpaceRequest`. To add a human // user, use `users/{user}`, where `{user}` can be the email address for // the user. For users in the same Workspace organization `{user}` can -// also be the `{person_id}` for the person from the People API, or the -// `id` for the user in the Directory API. For example, if the People -// API Person `resourceName` for `user@example.com` is -// `people/123456789`, you can add the user to the space by setting the -// `membership.member.name` to `users/user@example.com` or -// `users/123456789`. For a space or group chat, if the caller blocks or -// is blocked by some members, then those members aren't added to the -// created space. To create a direct message (DM) between the calling -// user and another human user, specify exactly one membership to -// represent the human user. If one user blocks the other, the request -// fails and the DM isn't created. To create a DM between the calling -// user and the calling app, set `Space.singleUserBotDm` to `true` and -// don't specify any memberships. You can only use this method to set up -// a DM with the calling app. To add the calling app as a member of a -// space or an existing DM between two human users, see create a -// membership +// also be the `id` for the person from the People API, or the `id` for +// the user in the Directory API. For example, if the People API Person +// profile ID for `user@example.com` is `123456789`, you can add the +// user to the space by setting the `membership.member.name` to +// `users/user@example.com` or `users/123456789`. For a space or group +// chat, if the caller blocks or is blocked by some members, then those +// members aren't added to the created space. To create a direct message +// (DM) between the calling user and another human user, specify exactly +// one membership to represent the human user. If one user blocks the +// other, the request fails and the DM isn't created. To create a DM +// between the calling user and the calling app, set +// `Space.singleUserBotDm` to `true` and don't specify any memberships. +// You can only use this method to set up a DM with the calling app. To +// add the calling app as a member of a space or an existing DM between +// two human users, see create a membership // (https://developers.google.com/chat/api/guides/v1/members/create). If // a DM already exists between two users, even when one user blocks the // other at the time a request is made, then the existing DM is @@ -6760,7 +6757,7 @@ func (c *SpacesSetupCall) Do(opts ...googleapi.CallOption) (*Space, error) { } return ret, nil // { - // "description": "Creates a space and adds specified users to it. The calling user is automatically added to the space, and shouldn't be specified as a membership in the request. For an example, see [Set up a space](https://developers.google.com/chat/api/guides/v1/spaces/set-up). To specify the human members to add, add memberships with the appropriate `member.name` in the `SetUpSpaceRequest`. To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace organization `{user}` can also be the `{person_id}` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person `resourceName` for `user@example.com` is `people/123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user@example.com` or `users/123456789`. For a space or group chat, if the caller blocks or is blocked by some members, then those members aren't added to the created space. To create a direct message (DM) between the calling user and another human user, specify exactly one membership to represent the human user. If one user blocks the other, the request fails and the DM isn't created. To create a DM between the calling user and the calling app, set `Space.singleUserBotDm` to `true` and don't specify any memberships. You can only use this method to set up a DM with the calling app. To add the calling app as a member of a space or an existing DM between two human users, see [create a membership](https://developers.google.com/chat/api/guides/v1/members/create). If a DM already exists between two users, even when one user blocks the other at the time a request is made, then the existing DM is returned. Spaces with threaded replies aren't supported. If you receive the error message `ALREADY_EXISTS` when setting up a space, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users).", + // "description": "Creates a space and adds specified users to it. The calling user is automatically added to the space, and shouldn't be specified as a membership in the request. For an example, see [Set up a space](https://developers.google.com/chat/api/guides/v1/spaces/set-up). To specify the human members to add, add memberships with the appropriate `member.name` in the `SetUpSpaceRequest`. To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace organization `{user}` can also be the `id` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person profile ID for `user@example.com` is `123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user@example.com` or `users/123456789`. For a space or group chat, if the caller blocks or is blocked by some members, then those members aren't added to the created space. To create a direct message (DM) between the calling user and another human user, specify exactly one membership to represent the human user. If one user blocks the other, the request fails and the DM isn't created. To create a DM between the calling user and the calling app, set `Space.singleUserBotDm` to `true` and don't specify any memberships. You can only use this method to set up a DM with the calling app. To add the calling app as a member of a space or an existing DM between two human users, see [create a membership](https://developers.google.com/chat/api/guides/v1/members/create). If a DM already exists between two users, even when one user blocks the other at the time a request is made, then the existing DM is returned. Spaces with threaded replies aren't supported. If you receive the error message `ALREADY_EXISTS` when setting up a space, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users).", // "flatPath": "v1/spaces:setup", // "httpMethod": "POST", // "id": "chat.spaces.setup", @@ -6808,10 +6805,10 @@ type SpacesMembersCreateCall struct { // add other apps to the space. - To add a human user, use // `users/{user}`, where `{user}` can be the email address for the user. // For users in the same Workspace organization `{user}` can also be the -// `{person_id}` for the person from the People API, or the `id` for the -// user in the Directory API. For example, if the People API Person -// `resourceName` for `user@example.com` is `people/123456789`, you can -// add the user to the space by setting the `membership.member.name` to +// `id` for the person from the People API, or the `id` for the user in +// the Directory API. For example, if the People API Person profile ID +// for `user@example.com` is `123456789`, you can add the user to the +// space by setting the `membership.member.name` to // `users/user@example.com` or `users/123456789`. // // - parent: The resource name of the space for which to create the @@ -6914,7 +6911,7 @@ func (c *SpacesMembersCreateCall) Do(opts ...googleapi.CallOption) (*Membership, } return ret, nil // { - // "description": "Creates a human membership or app membership for the calling app. Creating memberships for other apps isn't supported. For an example, see [ Create a membership](https://developers.google.com/chat/api/guides/v1/members/create). When creating a membership, if the specified member has their auto-accept policy turned off, then they're invited, and must accept the space invitation before joining. Otherwise, creating a membership adds the member directly to the specified space. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). To specify the member to add, set the `membership.member.name` in the `CreateMembershipRequest`: - To add the calling app to a space or a direct message between two human users, use `users/app`. Unable to add other apps to the space. - To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace organization `{user}` can also be the `{person_id}` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person `resourceName` for `user@example.com` is `people/123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user@example.com` or `users/123456789`.", + // "description": "Creates a human membership or app membership for the calling app. Creating memberships for other apps isn't supported. For an example, see [ Create a membership](https://developers.google.com/chat/api/guides/v1/members/create). When creating a membership, if the specified member has their auto-accept policy turned off, then they're invited, and must accept the space invitation before joining. Otherwise, creating a membership adds the member directly to the specified space. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). To specify the member to add, set the `membership.member.name` in the `CreateMembershipRequest`: - To add the calling app to a space or a direct message between two human users, use `users/app`. Unable to add other apps to the space. - To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace organization `{user}` can also be the `id` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person profile ID for `user@example.com` is `123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user@example.com` or `users/123456789`.", // "flatPath": "v1/spaces/{spacesId}/members", // "httpMethod": "POST", // "id": "chat.spaces.members.create", diff --git a/cloudbilling/v1/cloudbilling-api.json b/cloudbilling/v1/cloudbilling-api.json index c53a387f87c..9650aa9e47f 100644 --- a/cloudbilling/v1/cloudbilling-api.json +++ b/cloudbilling/v1/cloudbilling-api.json @@ -751,7 +751,7 @@ } } }, - "revision": "20231025", + "revision": "20231115", "rootUrl": "https://cloudbilling.googleapis.com/", "schemas": { "AggregationInfo": { @@ -861,6 +861,11 @@ "description": "Output only. True if the billing account is open, and will therefore be charged for any usage on associated projects. False if the billing account is closed, and therefore projects associated with it will be unable to use paid services.", "readOnly": true, "type": "boolean" + }, + "parent": { + "description": "Output only. The billing account's parent resource identifier. Use the `MoveBillingAccount` method to update the account's parent resource if it is a organization. Format: - organizations/{organization_id}, for example: organizations/12345678 - billingAccounts/{billing_account_id}, for example: `billingAccounts/012345-567890-ABCDEF`", + "readOnly": true, + "type": "string" } }, "type": "object" diff --git a/cloudbilling/v1/cloudbilling-gen.go b/cloudbilling/v1/cloudbilling-gen.go index b2e5b85f30f..1e9678423b1 100644 --- a/cloudbilling/v1/cloudbilling-gen.go +++ b/cloudbilling/v1/cloudbilling-gen.go @@ -425,6 +425,14 @@ type BillingAccount struct { // it will be unable to use paid services. Open bool `json:"open,omitempty"` + // Parent: Output only. The billing account's parent resource + // identifier. Use the `MoveBillingAccount` method to update the + // account's parent resource if it is a organization. Format: - + // organizations/{organization_id}, for example: organizations/12345678 + // - billingAccounts/{billing_account_id}, for example: + // `billingAccounts/012345-567890-ABCDEF` + Parent string `json:"parent,omitempty"` + // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` diff --git a/cloudbilling/v1beta/cloudbilling-api.json b/cloudbilling/v1beta/cloudbilling-api.json index 21c8767fee8..ef93175053a 100644 --- a/cloudbilling/v1beta/cloudbilling-api.json +++ b/cloudbilling/v1beta/cloudbilling-api.json @@ -431,7 +431,7 @@ "price": { "methods": { "get": { - "description": "Gets the latest price for the given billing account SKU.", + "description": "Gets the latest price for SKUs available to your Cloud Billing account.", "flatPath": "v1beta/billingAccounts/{billingAccountsId}/skus/{skusId}/price", "httpMethod": "GET", "id": "cloudbilling.billingAccounts.skus.price.get", @@ -440,12 +440,12 @@ ], "parameters": { "currencyCode": { - "description": "Optional. ISO-4217 currency code for the price. If not specified, currency of billing account will be used.", + "description": "Optional. ISO-4217 currency code for the price. If not specified, the currency of the billing account is used.", "location": "query", "type": "string" }, "name": { - "description": "Required. Name of the latest billing account price to retrieve. Format: billingAccounts/{billing_account}/skus/{sku}/price", + "description": "Required. Name of the billing account price to retrieve. Format: billingAccounts/{billing_account}/skus/{sku}/price", "location": "path", "pattern": "^billingAccounts/[^/]+/skus/[^/]+/price$", "required": true, @@ -664,7 +664,7 @@ } } }, - "revision": "20230901", + "revision": "20231115", "rootUrl": "https://cloudbilling.googleapis.com/", "schemas": { "CacheFillRegions": { @@ -1261,7 +1261,7 @@ "type": "object" }, "GoogleCloudBillingBillingaccountpricesV1betaBillingAccountPrice": { - "description": "Encapsulates the latest price for the given billing account SKU.", + "description": "Encapsulates the latest price for a billing account SKU.", "id": "GoogleCloudBillingBillingaccountpricesV1betaBillingAccountPrice", "properties": { "currencyCode": { @@ -1281,7 +1281,7 @@ "description": "Rate price metadata. Billing account SKUs with `Rate` price are offered by pricing tiers. The price can have 1 or more rate pricing tiers." }, "valueType": { - "description": "Type of the price. It can have values: [\"unspecified\", \"rate\"].", + "description": "Type of the price. The possible values are: [\"unspecified\", \"rate\"].", "type": "string" } }, @@ -1876,7 +1876,7 @@ "type": "object" }, "GoogleCloudBillingPricesV1betaPrice": { - "description": "Encapsulates the latest price for the given SKU.", + "description": "Encapsulates the latest price for a SKU.", "id": "GoogleCloudBillingPricesV1betaPrice", "properties": { "currencyCode": { diff --git a/cloudbilling/v1beta/cloudbilling-gen.go b/cloudbilling/v1beta/cloudbilling-gen.go index c54c6a1cfbe..799b46688f2 100644 --- a/cloudbilling/v1beta/cloudbilling-gen.go +++ b/cloudbilling/v1beta/cloudbilling-gen.go @@ -1304,7 +1304,7 @@ func (s *GoogleCloudBillingBillingaccountpricesV1betaAggregationInfo) MarshalJSO } // GoogleCloudBillingBillingaccountpricesV1betaBillingAccountPrice: -// Encapsulates the latest price for the given billing account SKU. +// Encapsulates the latest price for a billing account SKU. type GoogleCloudBillingBillingaccountpricesV1betaBillingAccountPrice struct { // CurrencyCode: ISO-4217 currency code for the price. CurrencyCode string `json:"currencyCode,omitempty"` @@ -1320,8 +1320,8 @@ type GoogleCloudBillingBillingaccountpricesV1betaBillingAccountPrice struct { // tiers. Rate *GoogleCloudBillingBillingaccountpricesV1betaRate `json:"rate,omitempty"` - // ValueType: Type of the price. It can have values: ["unspecified", - // "rate"]. + // ValueType: Type of the price. The possible values are: + // ["unspecified", "rate"]. ValueType string `json:"valueType,omitempty"` // ServerResponse contains the HTTP response code and headers from the @@ -2501,7 +2501,7 @@ func (s *GoogleCloudBillingPricesV1betaAggregationInfo) MarshalJSON() ([]byte, e } // GoogleCloudBillingPricesV1betaPrice: Encapsulates the latest price -// for the given SKU. +// for a SKU. type GoogleCloudBillingPricesV1betaPrice struct { // CurrencyCode: ISO-4217 currency code for the price. CurrencyCode string `json:"currencyCode,omitempty"` @@ -5728,9 +5728,10 @@ type BillingAccountsSkusPriceGetCall struct { header_ http.Header } -// Get: Gets the latest price for the given billing account SKU. +// Get: Gets the latest price for SKUs available to your Cloud Billing +// account. // -// - name: Name of the latest billing account price to retrieve. Format: +// - name: Name of the billing account price to retrieve. Format: // billingAccounts/{billing_account}/skus/{sku}/price. func (r *BillingAccountsSkusPriceService) Get(name string) *BillingAccountsSkusPriceGetCall { c := &BillingAccountsSkusPriceGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -5739,8 +5740,8 @@ func (r *BillingAccountsSkusPriceService) Get(name string) *BillingAccountsSkusP } // CurrencyCode sets the optional parameter "currencyCode": ISO-4217 -// currency code for the price. If not specified, currency of billing -// account will be used. +// currency code for the price. If not specified, the currency of the +// billing account is used. func (c *BillingAccountsSkusPriceGetCall) CurrencyCode(currencyCode string) *BillingAccountsSkusPriceGetCall { c.urlParams_.Set("currencyCode", currencyCode) return c @@ -5848,7 +5849,7 @@ func (c *BillingAccountsSkusPriceGetCall) Do(opts ...googleapi.CallOption) (*Goo } return ret, nil // { - // "description": "Gets the latest price for the given billing account SKU.", + // "description": "Gets the latest price for SKUs available to your Cloud Billing account.", // "flatPath": "v1beta/billingAccounts/{billingAccountsId}/skus/{skusId}/price", // "httpMethod": "GET", // "id": "cloudbilling.billingAccounts.skus.price.get", @@ -5857,12 +5858,12 @@ func (c *BillingAccountsSkusPriceGetCall) Do(opts ...googleapi.CallOption) (*Goo // ], // "parameters": { // "currencyCode": { - // "description": "Optional. ISO-4217 currency code for the price. If not specified, currency of billing account will be used.", + // "description": "Optional. ISO-4217 currency code for the price. If not specified, the currency of the billing account is used.", // "location": "query", // "type": "string" // }, // "name": { - // "description": "Required. Name of the latest billing account price to retrieve. Format: billingAccounts/{billing_account}/skus/{sku}/price", + // "description": "Required. Name of the billing account price to retrieve. Format: billingAccounts/{billing_account}/skus/{sku}/price", // "location": "path", // "pattern": "^billingAccounts/[^/]+/skus/[^/]+/price$", // "required": true, diff --git a/container/v1beta1/container-api.json b/container/v1beta1/container-api.json index 14509455c21..c4d3edb957a 100644 --- a/container/v1beta1/container-api.json +++ b/container/v1beta1/container-api.json @@ -2565,7 +2565,7 @@ } } }, - "revision": "20231024", + "revision": "20231030", "rootUrl": "https://container.googleapis.com/", "schemas": { "AcceleratorConfig": { @@ -2793,6 +2793,10 @@ "description": "Autopilot is the configuration for Autopilot settings on the cluster.", "id": "Autopilot", "properties": { + "conversionStatus": { + "$ref": "AutopilotConversionStatus", + "description": "ConversionStatus shows conversion status." + }, "enabled": { "description": "Enable Autopilot", "type": "boolean" @@ -2851,6 +2855,26 @@ }, "type": "object" }, + "AutopilotConversionStatus": { + "description": "AutopilotConversionStatus represents conversion status.", + "id": "AutopilotConversionStatus", + "properties": { + "state": { + "description": "Output only. The current state of the conversion.", + "enum": [ + "STATE_UNSPECIFIED", + "DONE" + ], + "enumDescriptions": [ + "STATE_UNSPECIFIED indicates the state is unspecified.", + "DONE indicates the conversion has been completed. Old node pools will continue being deleted in the background." + ], + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, "AutoprovisioningNodePoolDefaults": { "description": "AutoprovisioningNodePoolDefaults contains defaults for a node pool created by NAP.", "id": "AutoprovisioningNodePoolDefaults", @@ -5784,7 +5808,7 @@ "type": "object" }, "NodePool": { - "description": "NodePool contains the name and configuration for a cluster's node pool. Node pools are a set of nodes (i.e. VM's), with a common configuration and specification, under the control of the cluster master. They may have a set of Kubernetes labels applied to them, which may be used to reference them during pod scheduling. They may also be resized up or down, to accommodate the workload. These upgrade settings control the level of parallelism and the level of disruption caused by an upgrade. maxUnavailable controls the number of nodes that can be simultaneously unavailable. maxSurge controls the number of additional nodes that can be added to the node pool temporarily for the time of the upgrade to increase the number of available nodes. (maxUnavailable + maxSurge) determines the level of parallelism (how many nodes are being upgraded at the same time). Note: upgrades inevitably introduce some disruption since workloads need to be moved from old nodes to new, upgraded ones. Even if maxUnavailable=0, this holds true. (Disruption stays within the limits of PodDisruptionBudget, if it is configured.) Consider a hypothetical node pool with 5 nodes having maxSurge=2, maxUnavailable=1. This means the upgrade process upgrades 3 nodes simultaneously. It creates 2 additional (upgraded) nodes, then it brings down 3 old (not yet upgraded) nodes at the same time. This ensures that there are always at least 4 nodes available.", + "description": "NodePool contains the name and configuration for a cluster's node pool. Node pools are a set of nodes (i.e. VM's), with a common configuration and specification, under the control of the cluster master. They may have a set of Kubernetes labels applied to them, which may be used to reference them during pod scheduling. They may also be resized up or down, to accommodate the workload.", "id": "NodePool", "properties": { "autoscaling": { @@ -5854,6 +5878,10 @@ "format": "int32", "type": "integer" }, + "queuedProvisioning": { + "$ref": "QueuedProvisioning", + "description": "Specifies the configuration of queued provisioning." + }, "selfLink": { "description": "[Output only] Server-defined URL for the resource.", "type": "string" @@ -6436,6 +6464,17 @@ }, "type": "object" }, + "QueuedProvisioning": { + "description": "QueuedProvisioning defines the queued provisioning used by the node pool.", + "id": "QueuedProvisioning", + "properties": { + "enabled": { + "description": "Denotes that this nodepool is QRM specific, meaning nodes can be only obtained through queuing via the Cluster Autoscaler ProvisioningRequest API.", + "type": "boolean" + } + }, + "type": "object" + }, "RangeInfo": { "description": "RangeInfo contains the range name and the range utilization by this cluster.", "id": "RangeInfo", @@ -7761,7 +7800,7 @@ "type": "object" }, "UpgradeSettings": { - "description": "These upgrade settings configure the upgrade strategy for the node pool. Use strategy to switch between the strategies applied to the node pool. If the strategy is SURGE, use max_surge and max_unavailable to control the level of parallelism and the level of disruption caused by upgrade. 1. maxSurge controls the number of additional nodes that can be added to the node pool temporarily for the time of the upgrade to increase the number of available nodes. 2. maxUnavailable controls the number of nodes that can be simultaneously unavailable. 3. (maxUnavailable + maxSurge) determines the level of parallelism (how many nodes are being upgraded at the same time). If the strategy is BLUE_GREEN, use blue_green_settings to configure the blue-green upgrade related settings. 1. standard_rollout_policy is the default policy. The policy is used to control the way blue pool gets drained. The draining is executed in the batch mode. The batch size could be specified as either percentage of the node pool size or the number of nodes. batch_soak_duration is the soak time after each batch gets drained. 2. node_pool_soak_duration is the soak time after all blue nodes are drained. After this period, the blue pool nodes will be deleted.", + "description": "These upgrade settings control the level of parallelism and the level of disruption caused by an upgrade. maxUnavailable controls the number of nodes that can be simultaneously unavailable. maxSurge controls the number of additional nodes that can be added to the node pool temporarily for the time of the upgrade to increase the number of available nodes. (maxUnavailable + maxSurge) determines the level of parallelism (how many nodes are being upgraded at the same time). Note: upgrades inevitably introduce some disruption since workloads need to be moved from old nodes to new, upgraded ones. Even if maxUnavailable=0, this holds true. (Disruption stays within the limits of PodDisruptionBudget, if it is configured.) Consider a hypothetical node pool with 5 nodes having maxSurge=2, maxUnavailable=1. This means the upgrade process upgrades 3 nodes simultaneously. It creates 2 additional (upgraded) nodes, then it brings down 3 old (not yet upgraded) nodes at the same time. This ensures that there are always at least 4 nodes available. These upgrade settings configure the upgrade strategy for the node pool. Use strategy to switch between the strategies applied to the node pool. If the strategy is SURGE, use max_surge and max_unavailable to control the level of parallelism and the level of disruption caused by upgrade. 1. maxSurge controls the number of additional nodes that can be added to the node pool temporarily for the time of the upgrade to increase the number of available nodes. 2. maxUnavailable controls the number of nodes that can be simultaneously unavailable. 3. (maxUnavailable + maxSurge) determines the level of parallelism (how many nodes are being upgraded at the same time). If the strategy is BLUE_GREEN, use blue_green_settings to configure the blue-green upgrade related settings. 1. standard_rollout_policy is the default policy. The policy is used to control the way blue pool gets drained. The draining is executed in the batch mode. The batch size could be specified as either percentage of the node pool size or the number of nodes. batch_soak_duration is the soak time after each batch gets drained. 2. node_pool_soak_duration is the soak time after all blue nodes are drained. After this period, the blue pool nodes will be deleted.", "id": "UpgradeSettings", "properties": { "blueGreenSettings": { diff --git a/container/v1beta1/container-gen.go b/container/v1beta1/container-gen.go index b60d2c29d85..5d8cdb0ca94 100644 --- a/container/v1beta1/container-gen.go +++ b/container/v1beta1/container-gen.go @@ -688,13 +688,16 @@ func (s *AutoUpgradeOptions) MarshalJSON() ([]byte, error) { // Autopilot: Autopilot is the configuration for Autopilot settings on // the cluster. type Autopilot struct { + // ConversionStatus: ConversionStatus shows conversion status. + ConversionStatus *AutopilotConversionStatus `json:"conversionStatus,omitempty"` + // Enabled: Enable Autopilot Enabled bool `json:"enabled,omitempty"` // WorkloadPolicyConfig: Workload policy configuration for Autopilot. WorkloadPolicyConfig *WorkloadPolicyConfig `json:"workloadPolicyConfig,omitempty"` - // ForceSendFields is a list of field names (e.g. "Enabled") to + // ForceSendFields is a list of field names (e.g. "ConversionStatus") 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 @@ -702,12 +705,13 @@ type Autopilot struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Enabled") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "ConversionStatus") 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:"-"` } @@ -773,6 +777,41 @@ func (s *AutopilotCompatibilityIssue) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// AutopilotConversionStatus: AutopilotConversionStatus represents +// conversion status. +type AutopilotConversionStatus struct { + // State: Output only. The current state of the conversion. + // + // Possible values: + // "STATE_UNSPECIFIED" - STATE_UNSPECIFIED indicates the state is + // unspecified. + // "DONE" - DONE indicates the conversion has been completed. Old node + // pools will continue being deleted in the background. + State string `json:"state,omitempty"` + + // ForceSendFields is a list of field names (e.g. "State") 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. "State") 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 *AutopilotConversionStatus) MarshalJSON() ([]byte, error) { + type NoMethod AutopilotConversionStatus + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // AutoprovisioningNodePoolDefaults: AutoprovisioningNodePoolDefaults // contains defaults for a node pool created by NAP. type AutoprovisioningNodePoolDefaults struct { @@ -5609,23 +5648,7 @@ func (s *NodeNetworkConfig) UnmarshalJSON(data []byte) error { // a common configuration and specification, under the control of the // cluster master. They may have a set of Kubernetes labels applied to // them, which may be used to reference them during pod scheduling. They -// may also be resized up or down, to accommodate the workload. These -// upgrade settings control the level of parallelism and the level of -// disruption caused by an upgrade. maxUnavailable controls the number -// of nodes that can be simultaneously unavailable. maxSurge controls -// the number of additional nodes that can be added to the node pool -// temporarily for the time of the upgrade to increase the number of -// available nodes. (maxUnavailable + maxSurge) determines the level of -// parallelism (how many nodes are being upgraded at the same time). -// Note: upgrades inevitably introduce some disruption since workloads -// need to be moved from old nodes to new, upgraded ones. Even if -// maxUnavailable=0, this holds true. (Disruption stays within the -// limits of PodDisruptionBudget, if it is configured.) Consider a -// hypothetical node pool with 5 nodes having maxSurge=2, -// maxUnavailable=1. This means the upgrade process upgrades 3 nodes -// simultaneously. It creates 2 additional (upgraded) nodes, then it -// brings down 3 old (not yet upgraded) nodes at the same time. This -// ensures that there are always at least 4 nodes available. +// may also be resized up or down, to accommodate the workload. type NodePool struct { // Autoscaling: Autoscaler configuration for this NodePool. Autoscaler // is enabled only if a valid configuration is present. @@ -5689,6 +5712,10 @@ type NodePool struct { // this node pool. PodIpv4CidrSize int64 `json:"podIpv4CidrSize,omitempty"` + // QueuedProvisioning: Specifies the configuration of queued + // provisioning. + QueuedProvisioning *QueuedProvisioning `json:"queuedProvisioning,omitempty"` + // SelfLink: [Output only] Server-defined URL for the resource. SelfLink string `json:"selfLink,omitempty"` @@ -6652,6 +6679,37 @@ func (s *PubSub) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// QueuedProvisioning: QueuedProvisioning defines the queued +// provisioning used by the node pool. +type QueuedProvisioning struct { + // Enabled: Denotes that this nodepool is QRM specific, meaning nodes + // can be only obtained through queuing via the Cluster Autoscaler + // ProvisioningRequest API. + Enabled bool `json:"enabled,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Enabled") 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. "Enabled") 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 *QueuedProvisioning) MarshalJSON() ([]byte, error) { + type NoMethod QueuedProvisioning + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // RangeInfo: RangeInfo contains the range name and the range // utilization by this cluster. type RangeInfo struct { @@ -8843,12 +8901,28 @@ func (s *UpgradeEvent) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// UpgradeSettings: These upgrade settings configure the upgrade -// strategy for the node pool. Use strategy to switch between the -// strategies applied to the node pool. If the strategy is SURGE, use -// max_surge and max_unavailable to control the level of parallelism and -// the level of disruption caused by upgrade. 1. maxSurge controls the -// number of additional nodes that can be added to the node pool +// UpgradeSettings: These upgrade settings control the level of +// parallelism and the level of disruption caused by an upgrade. +// maxUnavailable controls the number of nodes that can be +// simultaneously unavailable. maxSurge controls the number of +// additional nodes that can be added to the node pool temporarily for +// the time of the upgrade to increase the number of available nodes. +// (maxUnavailable + maxSurge) determines the level of parallelism (how +// many nodes are being upgraded at the same time). Note: upgrades +// inevitably introduce some disruption since workloads need to be moved +// from old nodes to new, upgraded ones. Even if maxUnavailable=0, this +// holds true. (Disruption stays within the limits of +// PodDisruptionBudget, if it is configured.) Consider a hypothetical +// node pool with 5 nodes having maxSurge=2, maxUnavailable=1. This +// means the upgrade process upgrades 3 nodes simultaneously. It creates +// 2 additional (upgraded) nodes, then it brings down 3 old (not yet +// upgraded) nodes at the same time. This ensures that there are always +// at least 4 nodes available. These upgrade settings configure the +// upgrade strategy for the node pool. Use strategy to switch between +// the strategies applied to the node pool. If the strategy is SURGE, +// use max_surge and max_unavailable to control the level of parallelism +// and the level of disruption caused by upgrade. 1. maxSurge controls +// the number of additional nodes that can be added to the node pool // temporarily for the time of the upgrade to increase the number of // available nodes. 2. maxUnavailable controls the number of nodes that // can be simultaneously unavailable. 3. (maxUnavailable + maxSurge) diff --git a/dataflow/v1b3/dataflow-api.json b/dataflow/v1b3/dataflow-api.json index 7ac2894a254..9010876c0fa 100644 --- a/dataflow/v1b3/dataflow-api.json +++ b/dataflow/v1b3/dataflow-api.json @@ -2221,7 +2221,7 @@ } } }, - "revision": "20231021", + "revision": "20231112", "rootUrl": "https://dataflow.googleapis.com/", "schemas": { "ApproximateProgress": { @@ -3895,7 +3895,7 @@ "type": "string" }, "requestedState": { - "description": "The job's requested state. `UpdateJob` may be used to switch between the `JOB_STATE_STOPPED` and `JOB_STATE_RUNNING` states, by setting requested_state. `UpdateJob` may also be used to directly set a job's requested state to `JOB_STATE_CANCELLED` or `JOB_STATE_DONE`, irrevocably terminating the job if it has not already reached a terminal state.", + "description": "The job's requested state. Applies to `UpdateJob` requests. Set `requested_state` with `UpdateJob` requests to switch between the states `JOB_STATE_STOPPED` and `JOB_STATE_RUNNING`. You can also use `UpdateJob` requests to change a job's state from `JOB_STATE_RUNNING` to `JOB_STATE_CANCELLED`, `JOB_STATE_DONE`, or `JOB_STATE_DRAINED`. These states irrevocably terminate the job if it hasn't already reached a terminal state. This field has no effect on `CreateJob` requests.", "enum": [ "JOB_STATE_UNKNOWN", "JOB_STATE_STOPPED", diff --git a/dataflow/v1b3/dataflow-gen.go b/dataflow/v1b3/dataflow-gen.go index 3c23e132a53..6f2f840b8ee 100644 --- a/dataflow/v1b3/dataflow-gen.go +++ b/dataflow/v1b3/dataflow-gen.go @@ -3036,12 +3036,14 @@ type Job struct { // that job. ReplacedByJobId string `json:"replacedByJobId,omitempty"` - // RequestedState: The job's requested state. `UpdateJob` may be used to - // switch between the `JOB_STATE_STOPPED` and `JOB_STATE_RUNNING` - // states, by setting requested_state. `UpdateJob` may also be used to - // directly set a job's requested state to `JOB_STATE_CANCELLED` or - // `JOB_STATE_DONE`, irrevocably terminating the job if it has not - // already reached a terminal state. + // RequestedState: The job's requested state. Applies to `UpdateJob` + // requests. Set `requested_state` with `UpdateJob` requests to switch + // between the states `JOB_STATE_STOPPED` and `JOB_STATE_RUNNING`. You + // can also use `UpdateJob` requests to change a job's state from + // `JOB_STATE_RUNNING` to `JOB_STATE_CANCELLED`, `JOB_STATE_DONE`, or + // `JOB_STATE_DRAINED`. These states irrevocably terminate the job if it + // hasn't already reached a terminal state. This field has no effect on + // `CreateJob` requests. // // Possible values: // "JOB_STATE_UNKNOWN" - The job's run state isn't specified. diff --git a/documentai/v1/documentai-api.json b/documentai/v1/documentai-api.json index dea7bcb4516..aa25f84046a 100644 --- a/documentai/v1/documentai-api.json +++ b/documentai/v1/documentai-api.json @@ -1042,7 +1042,7 @@ } } }, - "revision": "20231026", + "revision": "20231116", "rootUrl": "https://documentai.googleapis.com/", "schemas": { "GoogleCloudDocumentaiUiv1beta3AutoLabelDocumentsMetadata": { @@ -1076,11 +1076,6 @@ "$ref": "GoogleCloudDocumentaiUiv1beta3DocumentId", "description": "The document id of the auto-labeled document. This will replace the gcs_uri." }, - "gcsUri": { - "deprecated": true, - "description": "The gcs_uri of the auto-labeling document, which uniquely identifies a dataset document.", - "type": "string" - }, "status": { "$ref": "GoogleRpcStatus", "description": "The status of the document auto-labeling." diff --git a/documentai/v1/documentai-gen.go b/documentai/v1/documentai-gen.go index 1ef3f2758e1..e47c39316a2 100644 --- a/documentai/v1/documentai-gen.go +++ b/documentai/v1/documentai-gen.go @@ -313,10 +313,6 @@ type GoogleCloudDocumentaiUiv1beta3AutoLabelDocumentsMetadataIndividualAutoLabel // replace the gcs_uri. DocumentId *GoogleCloudDocumentaiUiv1beta3DocumentId `json:"documentId,omitempty"` - // GcsUri: The gcs_uri of the auto-labeling document, which uniquely - // identifies a dataset document. - GcsUri string `json:"gcsUri,omitempty"` - // Status: The status of the document auto-labeling. Status *GoogleRpcStatus `json:"status,omitempty"` diff --git a/documentai/v1beta2/documentai-api.json b/documentai/v1beta2/documentai-api.json index 2bee4d1bb7b..35f518ff990 100644 --- a/documentai/v1beta2/documentai-api.json +++ b/documentai/v1beta2/documentai-api.json @@ -292,7 +292,7 @@ } } }, - "revision": "20231026", + "revision": "20231116", "rootUrl": "https://documentai.googleapis.com/", "schemas": { "GoogleCloudDocumentaiUiv1beta3AutoLabelDocumentsMetadata": { @@ -326,11 +326,6 @@ "$ref": "GoogleCloudDocumentaiUiv1beta3DocumentId", "description": "The document id of the auto-labeled document. This will replace the gcs_uri." }, - "gcsUri": { - "deprecated": true, - "description": "The gcs_uri of the auto-labeling document, which uniquely identifies a dataset document.", - "type": "string" - }, "status": { "$ref": "GoogleRpcStatus", "description": "The status of the document auto-labeling." diff --git a/documentai/v1beta2/documentai-gen.go b/documentai/v1beta2/documentai-gen.go index c75e98096ca..c9fe002bf4b 100644 --- a/documentai/v1beta2/documentai-gen.go +++ b/documentai/v1beta2/documentai-gen.go @@ -265,10 +265,6 @@ type GoogleCloudDocumentaiUiv1beta3AutoLabelDocumentsMetadataIndividualAutoLabel // replace the gcs_uri. DocumentId *GoogleCloudDocumentaiUiv1beta3DocumentId `json:"documentId,omitempty"` - // GcsUri: The gcs_uri of the auto-labeling document, which uniquely - // identifies a dataset document. - GcsUri string `json:"gcsUri,omitempty"` - // Status: The status of the document auto-labeling. Status *GoogleRpcStatus `json:"status,omitempty"` diff --git a/documentai/v1beta3/documentai-api.json b/documentai/v1beta3/documentai-api.json index 98a52950292..05d96e1f1d4 100644 --- a/documentai/v1beta3/documentai-api.json +++ b/documentai/v1beta3/documentai-api.json @@ -1284,7 +1284,7 @@ } } }, - "revision": "20231026", + "revision": "20231116", "rootUrl": "https://documentai.googleapis.com/", "schemas": { "GoogleCloudDocumentaiUiv1beta3AutoLabelDocumentsMetadata": { @@ -1318,11 +1318,6 @@ "$ref": "GoogleCloudDocumentaiUiv1beta3DocumentId", "description": "The document id of the auto-labeled document. This will replace the gcs_uri." }, - "gcsUri": { - "deprecated": true, - "description": "The gcs_uri of the auto-labeling document, which uniquely identifies a dataset document.", - "type": "string" - }, "status": { "$ref": "GoogleRpcStatus", "description": "The status of the document auto-labeling." diff --git a/documentai/v1beta3/documentai-gen.go b/documentai/v1beta3/documentai-gen.go index 13773f2c99f..77ffd61d25c 100644 --- a/documentai/v1beta3/documentai-gen.go +++ b/documentai/v1beta3/documentai-gen.go @@ -301,10 +301,6 @@ type GoogleCloudDocumentaiUiv1beta3AutoLabelDocumentsMetadataIndividualAutoLabel // replace the gcs_uri. DocumentId *GoogleCloudDocumentaiUiv1beta3DocumentId `json:"documentId,omitempty"` - // GcsUri: The gcs_uri of the auto-labeling document, which uniquely - // identifies a dataset document. - GcsUri string `json:"gcsUri,omitempty"` - // Status: The status of the document auto-labeling. Status *GoogleRpcStatus `json:"status,omitempty"` diff --git a/logging/v2/logging-api.json b/logging/v2/logging-api.json index 8d993f8e9b1..bbd428425fc 100644 --- a/logging/v2/logging-api.json +++ b/logging/v2/logging-api.json @@ -1139,6 +1139,152 @@ ] } } + }, + "recentQueries": { + "methods": { + "list": { + "description": "Lists the RecentQueries that were created by the user making the request.", + "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/recentQueries", + "httpMethod": "GET", + "id": "logging.billingAccounts.locations.recentQueries.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The resource to which the listed queries belong. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" For example:projects/my-project/locations/us-central1Note: The location portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all recent queries.", + "location": "path", + "pattern": "^billingAccounts/[^/]+/locations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+parent}/recentQueries", + "response": { + "$ref": "ListRecentQueriesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ] + } + } + }, + "savedQueries": { + "methods": { + "create": { + "description": "Creates a new SavedQuery for the user making the request.", + "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/savedQueries", + "httpMethod": "POST", + "id": "logging.billingAccounts.locations.savedQueries.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The parent resource in which to create the saved query: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" For example: \"projects/my-project/locations/global\" \"organizations/123456789/locations/us-central1\" ", + "location": "path", + "pattern": "^billingAccounts/[^/]+/locations/[^/]+$", + "required": true, + "type": "string" + }, + "savedQueryId": { + "description": "Optional. The ID to use for the saved query, which will become the final component of the saved query's resource name.If the saved_query_id is not provided, the system will generate an alphanumeric ID.The saved_query_id is limited to 100 characters and can include only the following characters: upper and lower-case alphanumeric characters, underscores, hyphens, and periods. First character has to be alphanumeric.", + "location": "query", + "type": "string" + } + }, + "path": "v2/{+parent}/savedQueries", + "request": { + "$ref": "SavedQuery" + }, + "response": { + "$ref": "SavedQuery" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + }, + "delete": { + "description": "Deletes an existing SavedQuery that was created by the user making the request.", + "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/savedQueries/{savedQueriesId}", + "httpMethod": "DELETE", + "id": "logging.billingAccounts.locations.savedQueries.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The full resource name of the saved query to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]\" For example: \"projects/my-project/locations/global/savedQueries/my-saved-query\" ", + "location": "path", + "pattern": "^billingAccounts/[^/]+/locations/[^/]+/savedQueries/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + }, + "list": { + "description": "Lists the SavedQueries that were created by the user making the request.", + "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/savedQueries", + "httpMethod": "GET", + "id": "logging.billingAccounts.locations.savedQueries.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of results to return from this request.Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The resource to which the listed queries belong. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" For example: \"projects/my-project/locations/us-central1\" Note: The locations portion of the resource must be specified. To get a list of all saved queries, a wildcard character - can be used for LOCATION_ID, for example: \"projects/my-project/locations/-\" ", + "location": "path", + "pattern": "^billingAccounts/[^/]+/locations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+parent}/savedQueries", + "response": { + "$ref": "ListSavedQueriesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ] + } + } } } }, @@ -2741,6 +2887,152 @@ ] } } + }, + "recentQueries": { + "methods": { + "list": { + "description": "Lists the RecentQueries that were created by the user making the request.", + "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/recentQueries", + "httpMethod": "GET", + "id": "logging.folders.locations.recentQueries.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The resource to which the listed queries belong. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" For example:projects/my-project/locations/us-central1Note: The location portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all recent queries.", + "location": "path", + "pattern": "^folders/[^/]+/locations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+parent}/recentQueries", + "response": { + "$ref": "ListRecentQueriesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ] + } + } + }, + "savedQueries": { + "methods": { + "create": { + "description": "Creates a new SavedQuery for the user making the request.", + "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/savedQueries", + "httpMethod": "POST", + "id": "logging.folders.locations.savedQueries.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The parent resource in which to create the saved query: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" For example: \"projects/my-project/locations/global\" \"organizations/123456789/locations/us-central1\" ", + "location": "path", + "pattern": "^folders/[^/]+/locations/[^/]+$", + "required": true, + "type": "string" + }, + "savedQueryId": { + "description": "Optional. The ID to use for the saved query, which will become the final component of the saved query's resource name.If the saved_query_id is not provided, the system will generate an alphanumeric ID.The saved_query_id is limited to 100 characters and can include only the following characters: upper and lower-case alphanumeric characters, underscores, hyphens, and periods. First character has to be alphanumeric.", + "location": "query", + "type": "string" + } + }, + "path": "v2/{+parent}/savedQueries", + "request": { + "$ref": "SavedQuery" + }, + "response": { + "$ref": "SavedQuery" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + }, + "delete": { + "description": "Deletes an existing SavedQuery that was created by the user making the request.", + "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/savedQueries/{savedQueriesId}", + "httpMethod": "DELETE", + "id": "logging.folders.locations.savedQueries.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The full resource name of the saved query to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]\" For example: \"projects/my-project/locations/global/savedQueries/my-saved-query\" ", + "location": "path", + "pattern": "^folders/[^/]+/locations/[^/]+/savedQueries/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + }, + "list": { + "description": "Lists the SavedQueries that were created by the user making the request.", + "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/savedQueries", + "httpMethod": "GET", + "id": "logging.folders.locations.savedQueries.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of results to return from this request.Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The resource to which the listed queries belong. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" For example: \"projects/my-project/locations/us-central1\" Note: The locations portion of the resource must be specified. To get a list of all saved queries, a wildcard character - can be used for LOCATION_ID, for example: \"projects/my-project/locations/-\" ", + "location": "path", + "pattern": "^folders/[^/]+/locations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+parent}/savedQueries", + "response": { + "$ref": "ListSavedQueriesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ] + } + } } } }, @@ -4964,20 +5256,166 @@ "type": "string" }, "pageSize": { - "description": "The standard list page size.", + "description": "The standard list page size.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "The standard list page token.", + "location": "query", + "type": "string" + } + }, + "path": "v2/{+name}/operations", + "response": { + "$ref": "ListOperationsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ] + } + } + }, + "recentQueries": { + "methods": { + "list": { + "description": "Lists the RecentQueries that were created by the user making the request.", + "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/recentQueries", + "httpMethod": "GET", + "id": "logging.organizations.locations.recentQueries.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The resource to which the listed queries belong. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" For example:projects/my-project/locations/us-central1Note: The location portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all recent queries.", + "location": "path", + "pattern": "^organizations/[^/]+/locations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+parent}/recentQueries", + "response": { + "$ref": "ListRecentQueriesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ] + } + } + }, + "savedQueries": { + "methods": { + "create": { + "description": "Creates a new SavedQuery for the user making the request.", + "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/savedQueries", + "httpMethod": "POST", + "id": "logging.organizations.locations.savedQueries.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The parent resource in which to create the saved query: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" For example: \"projects/my-project/locations/global\" \"organizations/123456789/locations/us-central1\" ", + "location": "path", + "pattern": "^organizations/[^/]+/locations/[^/]+$", + "required": true, + "type": "string" + }, + "savedQueryId": { + "description": "Optional. The ID to use for the saved query, which will become the final component of the saved query's resource name.If the saved_query_id is not provided, the system will generate an alphanumeric ID.The saved_query_id is limited to 100 characters and can include only the following characters: upper and lower-case alphanumeric characters, underscores, hyphens, and periods. First character has to be alphanumeric.", + "location": "query", + "type": "string" + } + }, + "path": "v2/{+parent}/savedQueries", + "request": { + "$ref": "SavedQuery" + }, + "response": { + "$ref": "SavedQuery" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + }, + "delete": { + "description": "Deletes an existing SavedQuery that was created by the user making the request.", + "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/savedQueries/{savedQueriesId}", + "httpMethod": "DELETE", + "id": "logging.organizations.locations.savedQueries.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The full resource name of the saved query to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]\" For example: \"projects/my-project/locations/global/savedQueries/my-saved-query\" ", + "location": "path", + "pattern": "^organizations/[^/]+/locations/[^/]+/savedQueries/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + }, + "list": { + "description": "Lists the SavedQueries that were created by the user making the request.", + "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/savedQueries", + "httpMethod": "GET", + "id": "logging.organizations.locations.savedQueries.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of results to return from this request.Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", "format": "int32", "location": "query", "type": "integer" }, "pageToken": { - "description": "The standard list page token.", + "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", "location": "query", "type": "string" + }, + "parent": { + "description": "Required. The resource to which the listed queries belong. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" For example: \"projects/my-project/locations/us-central1\" Note: The locations portion of the resource must be specified. To get a list of all saved queries, a wildcard character - can be used for LOCATION_ID, for example: \"projects/my-project/locations/-\" ", + "location": "path", + "pattern": "^organizations/[^/]+/locations/[^/]+$", + "required": true, + "type": "string" } }, - "path": "v2/{+name}/operations", + "path": "v2/{+parent}/savedQueries", "response": { - "$ref": "ListOperationsResponse" + "$ref": "ListSavedQueriesResponse" }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", @@ -6308,6 +6746,152 @@ ] } } + }, + "recentQueries": { + "methods": { + "list": { + "description": "Lists the RecentQueries that were created by the user making the request.", + "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/recentQueries", + "httpMethod": "GET", + "id": "logging.projects.locations.recentQueries.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The resource to which the listed queries belong. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" For example:projects/my-project/locations/us-central1Note: The location portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all recent queries.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+parent}/recentQueries", + "response": { + "$ref": "ListRecentQueriesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ] + } + } + }, + "savedQueries": { + "methods": { + "create": { + "description": "Creates a new SavedQuery for the user making the request.", + "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/savedQueries", + "httpMethod": "POST", + "id": "logging.projects.locations.savedQueries.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The parent resource in which to create the saved query: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" For example: \"projects/my-project/locations/global\" \"organizations/123456789/locations/us-central1\" ", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+$", + "required": true, + "type": "string" + }, + "savedQueryId": { + "description": "Optional. The ID to use for the saved query, which will become the final component of the saved query's resource name.If the saved_query_id is not provided, the system will generate an alphanumeric ID.The saved_query_id is limited to 100 characters and can include only the following characters: upper and lower-case alphanumeric characters, underscores, hyphens, and periods. First character has to be alphanumeric.", + "location": "query", + "type": "string" + } + }, + "path": "v2/{+parent}/savedQueries", + "request": { + "$ref": "SavedQuery" + }, + "response": { + "$ref": "SavedQuery" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + }, + "delete": { + "description": "Deletes an existing SavedQuery that was created by the user making the request.", + "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/savedQueries/{savedQueriesId}", + "httpMethod": "DELETE", + "id": "logging.projects.locations.savedQueries.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The full resource name of the saved query to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]\" For example: \"projects/my-project/locations/global/savedQueries/my-saved-query\" ", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/savedQueries/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + }, + "list": { + "description": "Lists the SavedQueries that were created by the user making the request.", + "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/savedQueries", + "httpMethod": "GET", + "id": "logging.projects.locations.savedQueries.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of results to return from this request.Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The resource to which the listed queries belong. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" For example: \"projects/my-project/locations/us-central1\" Note: The locations portion of the resource must be specified. To get a list of all saved queries, a wildcard character - can be used for LOCATION_ID, for example: \"projects/my-project/locations/-\" ", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+parent}/savedQueries", + "response": { + "$ref": "ListSavedQueriesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ] + } + } } } }, @@ -7084,7 +7668,7 @@ } } }, - "revision": "20231026", + "revision": "20231110", "rootUrl": "https://logging.googleapis.com/", "schemas": { "BigQueryDataset": { @@ -7337,6 +7921,38 @@ }, "type": "object" }, + "DefaultSinkConfig": { + "description": "Describes the custom _Default sink configuration that is used to override the built-in _Default sink configuration in newly created resource containers, such as projects or folders.", + "id": "DefaultSinkConfig", + "properties": { + "exclusions": { + "description": "Optional. Specifies the set of exclusions to be added to the _Default sink in newly created resource containers.", + "items": { + "$ref": "LogExclusion" + }, + "type": "array" + }, + "filter": { + "description": "Optional. An advanced logs filter (https://cloud.google.com/logging/docs/view/advanced-queries). The only exported log entries are those that are in the resource owning the sink and that match the filter.For example:logName=\"projects/[PROJECT_ID]/logs/[LOG_ID]\" AND severity\u003e=ERRORCannot be empty or unset if mode == OVERWRITE. In order to match all logs, use the following line as the value of filter and do not use exclusions:logName:*", + "type": "string" + }, + "mode": { + "description": "Required. Determines the behavior to apply to the built-in _Default sink inclusion filter.Exclusions are always appended, as built-in _Default sinks have no exclusions.", + "enum": [ + "FILTER_WRITE_MODE_UNSPECIFIED", + "APPEND", + "OVERWRITE" + ], + "enumDescriptions": [ + "The filter's write mode is unspecified. This mode must not be used.", + "The contents of filter will be appended to the built-in _Default sink filter. Using the append mode with an empty filter will keep the sink inclusion filter unchanged.", + "The contents of filter will overwrite the built-in _Default sink filter." + ], + "type": "string" + } + }, + "type": "object" + }, "DeleteLinkRequest": { "description": "The parameters to DeleteLink.", "id": "DeleteLinkRequest", @@ -7839,6 +8455,56 @@ }, "type": "object" }, + "ListRecentQueriesResponse": { + "description": "The response from ListRecentQueries.", + "id": "ListRecentQueriesResponse", + "properties": { + "nextPageToken": { + "description": "If there might be more results than appear in this response, then nextPageToken is included. To get the next set of results, call the same method again using the value of nextPageToken as pageToken.", + "type": "string" + }, + "recentQueries": { + "description": "A list of recent queries.", + "items": { + "$ref": "RecentQuery" + }, + "type": "array" + }, + "unreachable": { + "description": "The unreachable resources. Each resource can be either 1) a saved query if a specific query is unreachable or 2) a location if a specific location is unreachable. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/recentQueries/[QUERY_ID]\" \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global/recentQueries/12345678\" \"projects/my-project/locations/global\"If there are unreachable resources, the response will first return pages that contain recent queries, and then return pages that contain the unreachable resources.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "ListSavedQueriesResponse": { + "description": "The response from ListSavedQueries.", + "id": "ListSavedQueriesResponse", + "properties": { + "nextPageToken": { + "description": "If there might be more results than appear in this response, then nextPageToken is included. To get the next set of results, call the same method again using the value of nextPageToken as pageToken.", + "type": "string" + }, + "savedQueries": { + "description": "A list of saved queries.", + "items": { + "$ref": "SavedQuery" + }, + "type": "array" + }, + "unreachable": { + "description": "The unreachable resources. It can be either 1) a saved query if a specific query is unreachable or 2) a location if a specific location is unreachabe. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]\" \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example: \"projects/my-project/locations/global/savedQueries/12345678\" \"projects/my-project/locations/global\" If there are unreachable resources, the response will first return pages that contain saved queries, and then return pages that contain the unreachable resources.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, "ListSinksResponse": { "description": "Result returned from ListSinks.", "id": "ListSinksResponse", @@ -8457,6 +9123,34 @@ }, "type": "object" }, + "LoggingQuery": { + "description": "Describes a Cloud Logging query that can be run in Logs Explorer UI or via the logging API.In addition to the query itself, additional information may be stored to capture the display configuration and other UI state used in association with analysis of query results.", + "id": "LoggingQuery", + "properties": { + "filter": { + "description": "An advanced query using the Logging Query Language (https://cloud.google.com/logging/docs/view/logging-query-language). The maximum length of the filter is 20000 characters.", + "type": "string" + }, + "summaryFieldEnd": { + "description": "Characters will be counted from the end of the string.", + "format": "int32", + "type": "integer" + }, + "summaryFieldStart": { + "description": "Characters will be counted from the start of the string.", + "format": "int32", + "type": "integer" + }, + "summaryFields": { + "description": "The set of summary fields to display for this saved query.", + "items": { + "$ref": "SummaryField" + }, + "type": "array" + } + }, + "type": "object" + }, "MetricDescriptor": { "description": "Defines a metric type and its schema. Once a metric descriptor is created, deleting or altering it stops data collection and makes the metric type's existing data unusable.", "id": "MetricDescriptor", @@ -8735,6 +9429,42 @@ }, "type": "object" }, + "OpsAnalyticsQuery": { + "description": "Describes an analytics query that can be run in the Log Analytics page of Google Cloud console.Preview: This is a preview feature and may be subject to change before final release.", + "id": "OpsAnalyticsQuery", + "properties": { + "sqlQueryText": { + "description": "Required. A logs analytics SQL query, which generally follows BigQuery format.This is the SQL query that appears in the Log Analytics UI's query editor.", + "type": "string" + } + }, + "type": "object" + }, + "RecentQuery": { + "description": "Describes a recent query executed on the Logs Explorer or Log Analytics page within the last ~ 30 days.", + "id": "RecentQuery", + "properties": { + "lastRunTime": { + "description": "The timestamp when this query was last run.", + "format": "google-datetime", + "type": "string" + }, + "loggingQuery": { + "$ref": "LoggingQuery", + "description": "Logging query that can be executed in Logs Explorer or via Logging API." + }, + "name": { + "description": "Output only. Resource name of the recent query.In the format: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/recentQueries/[QUERY_ID]\" For a list of supported locations, see Supported Regions (https://cloud.google.com/logging/docs/region-support)The QUERY_ID is a system generated alphanumeric ID.", + "readOnly": true, + "type": "string" + }, + "opsAnalyticsQuery": { + "$ref": "OpsAnalyticsQuery", + "description": "Analytics query that can be executed in Log Analytics." + } + }, + "type": "object" + }, "RequestLog": { "description": "Complete log information about a single HTTP request to an App Engine application.", "id": "RequestLog", @@ -8893,10 +9623,54 @@ }, "type": "object" }, + "SavedQuery": { + "description": "Describes a query that has been saved by a user.", + "id": "SavedQuery", + "properties": { + "createTime": { + "description": "Output only. The timestamp when the saved query was created.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "description": { + "description": "A human readable description of the saved query.", + "type": "string" + }, + "displayName": { + "description": "The user specified title for the SavedQuery.", + "type": "string" + }, + "loggingQuery": { + "$ref": "LoggingQuery", + "description": "Logging query that can be executed in Logs Explorer or via Logging API." + }, + "name": { + "description": "Output only. Resource name of the saved query.In the format: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]\" For a list of supported locations, see Supported Regions (https://cloud.google.com/logging/docs/region-support#bucket-regions)After the saved query is created, the location cannot be changed.If the user doesn't provide a QUERY_ID, the system will generate an alphanumeric ID.", + "readOnly": true, + "type": "string" + }, + "opsAnalyticsQuery": { + "$ref": "OpsAnalyticsQuery", + "description": "Analytics query that can be executed in Log Analytics." + }, + "updateTime": { + "description": "Output only. The timestamp when the saved query was last updated.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, "Settings": { "description": "Describes the settings associated with a project, folder, organization, billing account, or flexible resource.", "id": "Settings", "properties": { + "defaultSinkConfig": { + "$ref": "DefaultSinkConfig", + "description": "Optional. Overrides the built-in configuration for _Default sink." + }, "disableDefaultSink": { "description": "Optional. If set to true, the _Default sink in newly created projects and folders will created in a disabled state. This can be used to automatically disable log storage if there is already an aggregated sink configured in the hierarchy. The _Default sink can be re-enabled manually if needed.", "type": "boolean" @@ -8911,7 +9685,7 @@ "type": "string" }, "loggingServiceAccountId": { - "description": "Output only. The service account for the given container. Sinks use this service account as their writer_identity if no custom service account is provided.", + "description": "Output only. The service account for the given resource container, such as project or folder. Log sinks use this service account as their writer_identity if no custom service account is provided in the request when calling the create sink method.", "readOnly": true, "type": "string" }, @@ -8989,6 +9763,17 @@ }, "type": "object" }, + "SummaryField": { + "description": "A field from the LogEntry that is added to the summary line (https://cloud.google.com/logging/docs/view/logs-explorer-interface#add-summary-fields) for a query in the Logs Explorer.", + "id": "SummaryField", + "properties": { + "field": { + "description": "The field from the LogEntry to include in the summary line, for example resource.type or jsonPayload.name.", + "type": "string" + } + }, + "type": "object" + }, "SuppressionInfo": { "description": "Information about entries that were omitted from the session.", "id": "SuppressionInfo", diff --git a/logging/v2/logging-gen.go b/logging/v2/logging-gen.go index 4eb3d5da31b..e85d0f3b035 100644 --- a/logging/v2/logging-gen.go +++ b/logging/v2/logging-gen.go @@ -239,6 +239,8 @@ func NewBillingAccountsLocationsService(s *Service) *BillingAccountsLocationsSer rs := &BillingAccountsLocationsService{s: s} rs.Buckets = NewBillingAccountsLocationsBucketsService(s) rs.Operations = NewBillingAccountsLocationsOperationsService(s) + rs.RecentQueries = NewBillingAccountsLocationsRecentQueriesService(s) + rs.SavedQueries = NewBillingAccountsLocationsSavedQueriesService(s) return rs } @@ -248,6 +250,10 @@ type BillingAccountsLocationsService struct { Buckets *BillingAccountsLocationsBucketsService Operations *BillingAccountsLocationsOperationsService + + RecentQueries *BillingAccountsLocationsRecentQueriesService + + SavedQueries *BillingAccountsLocationsSavedQueriesService } func NewBillingAccountsLocationsBucketsService(s *Service) *BillingAccountsLocationsBucketsService { @@ -304,6 +310,24 @@ type BillingAccountsLocationsOperationsService struct { s *Service } +func NewBillingAccountsLocationsRecentQueriesService(s *Service) *BillingAccountsLocationsRecentQueriesService { + rs := &BillingAccountsLocationsRecentQueriesService{s: s} + return rs +} + +type BillingAccountsLocationsRecentQueriesService struct { + s *Service +} + +func NewBillingAccountsLocationsSavedQueriesService(s *Service) *BillingAccountsLocationsSavedQueriesService { + rs := &BillingAccountsLocationsSavedQueriesService{s: s} + return rs +} + +type BillingAccountsLocationsSavedQueriesService struct { + s *Service +} + func NewBillingAccountsLogsService(s *Service) *BillingAccountsLogsService { rs := &BillingAccountsLogsService{s: s} return rs @@ -374,6 +398,8 @@ func NewFoldersLocationsService(s *Service) *FoldersLocationsService { rs := &FoldersLocationsService{s: s} rs.Buckets = NewFoldersLocationsBucketsService(s) rs.Operations = NewFoldersLocationsOperationsService(s) + rs.RecentQueries = NewFoldersLocationsRecentQueriesService(s) + rs.SavedQueries = NewFoldersLocationsSavedQueriesService(s) return rs } @@ -383,6 +409,10 @@ type FoldersLocationsService struct { Buckets *FoldersLocationsBucketsService Operations *FoldersLocationsOperationsService + + RecentQueries *FoldersLocationsRecentQueriesService + + SavedQueries *FoldersLocationsSavedQueriesService } func NewFoldersLocationsBucketsService(s *Service) *FoldersLocationsBucketsService { @@ -439,6 +469,24 @@ type FoldersLocationsOperationsService struct { s *Service } +func NewFoldersLocationsRecentQueriesService(s *Service) *FoldersLocationsRecentQueriesService { + rs := &FoldersLocationsRecentQueriesService{s: s} + return rs +} + +type FoldersLocationsRecentQueriesService struct { + s *Service +} + +func NewFoldersLocationsSavedQueriesService(s *Service) *FoldersLocationsSavedQueriesService { + rs := &FoldersLocationsSavedQueriesService{s: s} + return rs +} + +type FoldersLocationsSavedQueriesService struct { + s *Service +} + func NewFoldersLogsService(s *Service) *FoldersLogsService { rs := &FoldersLogsService{s: s} return rs @@ -566,6 +614,8 @@ func NewOrganizationsLocationsService(s *Service) *OrganizationsLocationsService rs := &OrganizationsLocationsService{s: s} rs.Buckets = NewOrganizationsLocationsBucketsService(s) rs.Operations = NewOrganizationsLocationsOperationsService(s) + rs.RecentQueries = NewOrganizationsLocationsRecentQueriesService(s) + rs.SavedQueries = NewOrganizationsLocationsSavedQueriesService(s) return rs } @@ -575,6 +625,10 @@ type OrganizationsLocationsService struct { Buckets *OrganizationsLocationsBucketsService Operations *OrganizationsLocationsOperationsService + + RecentQueries *OrganizationsLocationsRecentQueriesService + + SavedQueries *OrganizationsLocationsSavedQueriesService } func NewOrganizationsLocationsBucketsService(s *Service) *OrganizationsLocationsBucketsService { @@ -631,6 +685,24 @@ type OrganizationsLocationsOperationsService struct { s *Service } +func NewOrganizationsLocationsRecentQueriesService(s *Service) *OrganizationsLocationsRecentQueriesService { + rs := &OrganizationsLocationsRecentQueriesService{s: s} + return rs +} + +type OrganizationsLocationsRecentQueriesService struct { + s *Service +} + +func NewOrganizationsLocationsSavedQueriesService(s *Service) *OrganizationsLocationsSavedQueriesService { + rs := &OrganizationsLocationsSavedQueriesService{s: s} + return rs +} + +type OrganizationsLocationsSavedQueriesService struct { + s *Service +} + func NewOrganizationsLogsService(s *Service) *OrganizationsLogsService { rs := &OrganizationsLogsService{s: s} return rs @@ -686,6 +758,8 @@ func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { rs := &ProjectsLocationsService{s: s} rs.Buckets = NewProjectsLocationsBucketsService(s) rs.Operations = NewProjectsLocationsOperationsService(s) + rs.RecentQueries = NewProjectsLocationsRecentQueriesService(s) + rs.SavedQueries = NewProjectsLocationsSavedQueriesService(s) return rs } @@ -695,6 +769,10 @@ type ProjectsLocationsService struct { Buckets *ProjectsLocationsBucketsService Operations *ProjectsLocationsOperationsService + + RecentQueries *ProjectsLocationsRecentQueriesService + + SavedQueries *ProjectsLocationsSavedQueriesService } func NewProjectsLocationsBucketsService(s *Service) *ProjectsLocationsBucketsService { @@ -751,6 +829,24 @@ type ProjectsLocationsOperationsService struct { s *Service } +func NewProjectsLocationsRecentQueriesService(s *Service) *ProjectsLocationsRecentQueriesService { + rs := &ProjectsLocationsRecentQueriesService{s: s} + return rs +} + +type ProjectsLocationsRecentQueriesService struct { + s *Service +} + +func NewProjectsLocationsSavedQueriesService(s *Service) *ProjectsLocationsSavedQueriesService { + rs := &ProjectsLocationsSavedQueriesService{s: s} + return rs +} + +type ProjectsLocationsSavedQueriesService struct { + s *Service +} + func NewProjectsLogsService(s *Service) *ProjectsLogsService { rs := &ProjectsLogsService{s: s} return rs @@ -1283,6 +1379,61 @@ func (s *CreateLinkRequest) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// DefaultSinkConfig: Describes the custom _Default sink configuration +// that is used to override the built-in _Default sink configuration in +// newly created resource containers, such as projects or folders. +type DefaultSinkConfig struct { + // Exclusions: Optional. Specifies the set of exclusions to be added to + // the _Default sink in newly created resource containers. + Exclusions []*LogExclusion `json:"exclusions,omitempty"` + + // Filter: Optional. An advanced logs filter + // (https://cloud.google.com/logging/docs/view/advanced-queries). The + // only exported log entries are those that are in the resource owning + // the sink and that match the filter.For + // example:logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND + // severity>=ERRORCannot be empty or unset if mode == OVERWRITE. In + // order to match all logs, use the following line as the value of + // filter and do not use exclusions:logName:* + Filter string `json:"filter,omitempty"` + + // Mode: Required. Determines the behavior to apply to the built-in + // _Default sink inclusion filter.Exclusions are always appended, as + // built-in _Default sinks have no exclusions. + // + // Possible values: + // "FILTER_WRITE_MODE_UNSPECIFIED" - The filter's write mode is + // unspecified. This mode must not be used. + // "APPEND" - The contents of filter will be appended to the built-in + // _Default sink filter. Using the append mode with an empty filter will + // keep the sink inclusion filter unchanged. + // "OVERWRITE" - The contents of filter will overwrite the built-in + // _Default sink filter. + Mode string `json:"mode,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Exclusions") 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. "Exclusions") 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 *DefaultSinkConfig) MarshalJSON() ([]byte, error) { + type NoMethod DefaultSinkConfig + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // DeleteLinkRequest: The parameters to DeleteLink. type DeleteLinkRequest struct { // Name: Required. The full resource name of the link to delete. @@ -2227,6 +2378,106 @@ func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// ListRecentQueriesResponse: The response from ListRecentQueries. +type ListRecentQueriesResponse struct { + // NextPageToken: If there might be more results than appear in this + // response, then nextPageToken is included. To get the next set of + // results, call the same method again using the value of nextPageToken + // as pageToken. + NextPageToken string `json:"nextPageToken,omitempty"` + + // RecentQueries: A list of recent queries. + RecentQueries []*RecentQuery `json:"recentQueries,omitempty"` + + // Unreachable: The unreachable resources. Each resource can be either + // 1) a saved query if a specific query is unreachable or 2) a location + // if a specific location is unreachable. + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/recentQueries/[QUERY_ID + // ]" "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For + // example:"projects/my-project/locations/global/recentQueries/12345678" + // "projects/my-project/locations/global"If there are unreachable + // resources, the response will first return pages that contain recent + // queries, and then return pages that contain the unreachable + // resources. + Unreachable []string `json:"unreachable,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "NextPageToken") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ListRecentQueriesResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListRecentQueriesResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ListSavedQueriesResponse: The response from ListSavedQueries. +type ListSavedQueriesResponse struct { + // NextPageToken: If there might be more results than appear in this + // response, then nextPageToken is included. To get the next set of + // results, call the same method again using the value of nextPageToken + // as pageToken. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SavedQueries: A list of saved queries. + SavedQueries []*SavedQuery `json:"savedQueries,omitempty"` + + // Unreachable: The unreachable resources. It can be either 1) a saved + // query if a specific query is unreachable or 2) a location if a + // specific location is unreachabe. + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID] + // " "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For example: + // "projects/my-project/locations/global/savedQueries/12345678" + // "projects/my-project/locations/global" If there are unreachable + // resources, the response will first return pages that contain saved + // queries, and then return pages that contain the unreachable + // resources. + Unreachable []string `json:"unreachable,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "NextPageToken") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ListSavedQueriesResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListSavedQueriesResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // ListSinksResponse: Result returned from ListSinks. type ListSinksResponse struct { // NextPageToken: If there might be more results than appear in this @@ -3276,6 +3527,52 @@ func (s *LogView) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// LoggingQuery: Describes a Cloud Logging query that can be run in Logs +// Explorer UI or via the logging API.In addition to the query itself, +// additional information may be stored to capture the display +// configuration and other UI state used in association with analysis of +// query results. +type LoggingQuery struct { + // Filter: An advanced query using the Logging Query Language + // (https://cloud.google.com/logging/docs/view/logging-query-language). + // The maximum length of the filter is 20000 characters. + Filter string `json:"filter,omitempty"` + + // SummaryFieldEnd: Characters will be counted from the end of the + // string. + SummaryFieldEnd int64 `json:"summaryFieldEnd,omitempty"` + + // SummaryFieldStart: Characters will be counted from the start of the + // string. + SummaryFieldStart int64 `json:"summaryFieldStart,omitempty"` + + // SummaryFields: The set of summary fields to display for this saved + // query. + SummaryFields []*SummaryField `json:"summaryFields,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Filter") 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. "Filter") 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 *LoggingQuery) MarshalJSON() ([]byte, error) { + type NoMethod LoggingQuery + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // MetricDescriptor: Defines a metric type and its schema. Once a metric // descriptor is created, deleting or altering it stops data collection // and makes the metric type's existing data unusable. @@ -3791,6 +4088,82 @@ func (s *Operation) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// OpsAnalyticsQuery: Describes an analytics query that can be run in +// the Log Analytics page of Google Cloud console.Preview: This is a +// preview feature and may be subject to change before final release. +type OpsAnalyticsQuery struct { + // SqlQueryText: Required. A logs analytics SQL query, which generally + // follows BigQuery format.This is the SQL query that appears in the Log + // Analytics UI's query editor. + SqlQueryText string `json:"sqlQueryText,omitempty"` + + // ForceSendFields is a list of field names (e.g. "SqlQueryText") 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. "SqlQueryText") 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 *OpsAnalyticsQuery) MarshalJSON() ([]byte, error) { + type NoMethod OpsAnalyticsQuery + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// RecentQuery: Describes a recent query executed on the Logs Explorer +// or Log Analytics page within the last ~ 30 days. +type RecentQuery struct { + // LastRunTime: The timestamp when this query was last run. + LastRunTime string `json:"lastRunTime,omitempty"` + + // LoggingQuery: Logging query that can be executed in Logs Explorer or + // via Logging API. + LoggingQuery *LoggingQuery `json:"loggingQuery,omitempty"` + + // Name: Output only. Resource name of the recent query.In the format: + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/recentQueries/[QUERY_ID + // ]" For a list of supported locations, see Supported Regions + // (https://cloud.google.com/logging/docs/region-support)The QUERY_ID is + // a system generated alphanumeric ID. + Name string `json:"name,omitempty"` + + // OpsAnalyticsQuery: Analytics query that can be executed in Log + // Analytics. + OpsAnalyticsQuery *OpsAnalyticsQuery `json:"opsAnalyticsQuery,omitempty"` + + // ForceSendFields is a list of field names (e.g. "LastRunTime") 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. "LastRunTime") 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 *RecentQuery) MarshalJSON() ([]byte, error) { + type NoMethod RecentQuery + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // RequestLog: Complete log information about a single HTTP request to // an App Engine application. type RequestLog struct { @@ -3959,9 +4332,73 @@ func (s *RequestLog) UnmarshalJSON(data []byte) error { return nil } +// SavedQuery: Describes a query that has been saved by a user. +type SavedQuery struct { + // CreateTime: Output only. The timestamp when the saved query was + // created. + CreateTime string `json:"createTime,omitempty"` + + // Description: A human readable description of the saved query. + Description string `json:"description,omitempty"` + + // DisplayName: The user specified title for the SavedQuery. + DisplayName string `json:"displayName,omitempty"` + + // LoggingQuery: Logging query that can be executed in Logs Explorer or + // via Logging API. + LoggingQuery *LoggingQuery `json:"loggingQuery,omitempty"` + + // Name: Output only. Resource name of the saved query.In the format: + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID] + // " For a list of supported locations, see Supported Regions + // (https://cloud.google.com/logging/docs/region-support#bucket-regions)After + // the saved query is created, the location cannot be changed.If the + // user doesn't provide a QUERY_ID, the system will generate an + // alphanumeric ID. + Name string `json:"name,omitempty"` + + // OpsAnalyticsQuery: Analytics query that can be executed in Log + // Analytics. + OpsAnalyticsQuery *OpsAnalyticsQuery `json:"opsAnalyticsQuery,omitempty"` + + // UpdateTime: Output only. The timestamp when the saved query was last + // updated. + UpdateTime string `json:"updateTime,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *SavedQuery) MarshalJSON() ([]byte, error) { + type NoMethod SavedQuery + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // Settings: Describes the settings associated with a project, folder, // organization, billing account, or flexible resource. type Settings struct { + // DefaultSinkConfig: Optional. Overrides the built-in configuration for + // _Default sink. + DefaultSinkConfig *DefaultSinkConfig `json:"defaultSinkConfig,omitempty"` + // DisableDefaultSink: Optional. If set to true, the _Default sink in // newly created projects and folders will created in a disabled state. // This can be used to automatically disable log storage if there is @@ -4000,8 +4437,10 @@ type Settings struct { KmsServiceAccountId string `json:"kmsServiceAccountId,omitempty"` // LoggingServiceAccountId: Output only. The service account for the - // given container. Sinks use this service account as their - // writer_identity if no custom service account is provided. + // given resource container, such as project or folder. Log sinks use + // this service account as their writer_identity if no custom service + // account is provided in the request when calling the create sink + // method. LoggingServiceAccountId string `json:"loggingServiceAccountId,omitempty"` // Name: Output only. The resource name of the settings. @@ -4020,7 +4459,7 @@ type Settings struct { // server. googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "DisableDefaultSink") + // ForceSendFields is a list of field names (e.g. "DefaultSinkConfig") // 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 @@ -4028,7 +4467,7 @@ type Settings struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DisableDefaultSink") to + // NullFields is a list of field names (e.g. "DefaultSinkConfig") 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 @@ -4162,6 +4601,38 @@ func (s *Status) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// SummaryField: A field from the LogEntry that is added to the summary +// line +// (https://cloud.google.com/logging/docs/view/logs-explorer-interface#add-summary-fields) +// for a query in the Logs Explorer. +type SummaryField struct { + // Field: The field from the LogEntry to include in the summary line, + // for example resource.type or jsonPayload.name. + Field string `json:"field,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Field") 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. "Field") 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 *SummaryField) MarshalJSON() ([]byte, error) { + type NoMethod SummaryField + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // SuppressionInfo: Information about entries that were omitted from the // session. type SuppressionInfo struct { @@ -9499,153 +9970,9 @@ func (c *BillingAccountsLocationsOperationsListCall) Pages(ctx context.Context, } } -// method id "logging.billingAccounts.logs.delete": - -type BillingAccountsLogsDeleteCall struct { - s *Service - logName string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Delete: Deletes all the log entries in a log for the _Default Log -// Bucket. The log reappears if it receives new entries. Log entries -// written shortly before the delete operation might not be deleted. -// Entries received after the delete operation with a timestamp before -// the operation will be deleted. -// -// - logName: The resource name of the log to delete: -// projects/[PROJECT_ID]/logs/[LOG_ID] -// organizations/[ORGANIZATION_ID]/logs/[LOG_ID] -// billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID] -// folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For -// example, "projects/my-project-id/logs/syslog", -// "organizations/123/logs/cloudaudit.googleapis.com%2Factivity".For -// more information about log names, see LogEntry. -func (r *BillingAccountsLogsService) Delete(logName string) *BillingAccountsLogsDeleteCall { - c := &BillingAccountsLogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.logName = logName - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *BillingAccountsLogsDeleteCall) Fields(s ...googleapi.Field) *BillingAccountsLogsDeleteCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *BillingAccountsLogsDeleteCall) Context(ctx context.Context) *BillingAccountsLogsDeleteCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *BillingAccountsLogsDeleteCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *BillingAccountsLogsDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+logName}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "logName": c.logName, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "logging.billingAccounts.logs.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *BillingAccountsLogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &Empty{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Deletes all the log entries in a log for the _Default Log Bucket. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted.", - // "flatPath": "v2/billingAccounts/{billingAccountsId}/logs/{logsId}", - // "httpMethod": "DELETE", - // "id": "logging.billingAccounts.logs.delete", - // "parameterOrder": [ - // "logName" - // ], - // "parameters": { - // "logName": { - // "description": "Required. The resource name of the log to delete: projects/[PROJECT_ID]/logs/[LOG_ID] organizations/[ORGANIZATION_ID]/logs/[LOG_ID] billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID] folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/123/logs/cloudaudit.googleapis.com%2Factivity\".For more information about log names, see LogEntry.", - // "location": "path", - // "pattern": "^billingAccounts/[^/]+/logs/[^/]+$", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v2/{+logName}", - // "response": { - // "$ref": "Empty" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" - // ] - // } +// method id "logging.billingAccounts.locations.recentQueries.list": -} - -// method id "logging.billingAccounts.logs.list": - -type BillingAccountsLogsListCall struct { +type BillingAccountsLocationsRecentQueriesListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -9654,14 +9981,19 @@ type BillingAccountsLogsListCall struct { header_ http.Header } -// List: Lists the logs in projects, organizations, folders, or billing -// accounts. Only logs that have entries are listed. +// List: Lists the RecentQueries that were created by the user making +// the request. // -// - parent: The resource name to list logs for: projects/[PROJECT_ID] -// organizations/[ORGANIZATION_ID] -// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]. -func (r *BillingAccountsLogsService) List(parent string) *BillingAccountsLogsListCall { - c := &BillingAccountsLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The resource to which the listed queries belong. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" For +// example:projects/my-project/locations/us-central1Note: The location +// portion of the resource must be specified, but supplying the +// character - in place of LOCATION_ID will return all recent queries. +func (r *BillingAccountsLocationsRecentQueriesService) List(parent string) *BillingAccountsLocationsRecentQueriesListCall { + c := &BillingAccountsLocationsRecentQueriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } @@ -9670,7 +10002,7 @@ func (r *BillingAccountsLogsService) List(parent string) *BillingAccountsLogsLis // of results to return from this request. Non-positive values are // ignored. The presence of nextPageToken in the response indicates that // more results might be available. -func (c *BillingAccountsLogsListCall) PageSize(pageSize int64) *BillingAccountsLogsListCall { +func (c *BillingAccountsLocationsRecentQueriesListCall) PageSize(pageSize int64) *BillingAccountsLocationsRecentQueriesListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } @@ -9680,33 +10012,15 @@ func (c *BillingAccountsLogsListCall) PageSize(pageSize int64) *BillingAccountsL // method. pageToken must be the value of nextPageToken from the // previous response. The values of other method parameters should be // identical to those in the previous call. -func (c *BillingAccountsLogsListCall) PageToken(pageToken string) *BillingAccountsLogsListCall { +func (c *BillingAccountsLocationsRecentQueriesListCall) PageToken(pageToken string) *BillingAccountsLocationsRecentQueriesListCall { c.urlParams_.Set("pageToken", pageToken) return c } -// ResourceNames sets the optional parameter "resourceNames": List of -// resource names to list logs for: -// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/view -// s/[VIEW_ID] -// organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKE -// T_ID]/views/[VIEW_ID] -// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[ -// BUCKET_ID]/views/[VIEW_ID] -// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/ -// [VIEW_ID]To support legacy queries, it could also be: -// projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] -// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]The resource -// name in the parent field is added to this list. -func (c *BillingAccountsLogsListCall) ResourceNames(resourceNames ...string) *BillingAccountsLogsListCall { - c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...)) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *BillingAccountsLogsListCall) Fields(s ...googleapi.Field) *BillingAccountsLogsListCall { +func (c *BillingAccountsLocationsRecentQueriesListCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsRecentQueriesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -9716,7 +10030,7 @@ func (c *BillingAccountsLogsListCall) Fields(s ...googleapi.Field) *BillingAccou // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *BillingAccountsLogsListCall) IfNoneMatch(entityTag string) *BillingAccountsLogsListCall { +func (c *BillingAccountsLocationsRecentQueriesListCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsRecentQueriesListCall { c.ifNoneMatch_ = entityTag return c } @@ -9724,21 +10038,21 @@ func (c *BillingAccountsLogsListCall) IfNoneMatch(entityTag string) *BillingAcco // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *BillingAccountsLogsListCall) Context(ctx context.Context) *BillingAccountsLogsListCall { +func (c *BillingAccountsLocationsRecentQueriesListCall) Context(ctx context.Context) *BillingAccountsLocationsRecentQueriesListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *BillingAccountsLogsListCall) Header() http.Header { +func (c *BillingAccountsLocationsRecentQueriesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *BillingAccountsLogsListCall) doRequest(alt string) (*http.Response, error) { +func (c *BillingAccountsLocationsRecentQueriesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -9751,7 +10065,7 @@ func (c *BillingAccountsLogsListCall) doRequest(alt string) (*http.Response, err var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/recentQueries") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -9764,14 +10078,14 @@ func (c *BillingAccountsLogsListCall) doRequest(alt string) (*http.Response, err return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.billingAccounts.logs.list" call. -// Exactly one of *ListLogsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListLogsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use +// Do executes the "logging.billingAccounts.locations.recentQueries.list" call. +// Exactly one of *ListRecentQueriesResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ListRecentQueriesResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *BillingAccountsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) { +func (c *BillingAccountsLocationsRecentQueriesListCall) Do(opts ...googleapi.CallOption) (*ListRecentQueriesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9790,7 +10104,7 @@ func (c *BillingAccountsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLog if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListLogsResponse{ + ret := &ListRecentQueriesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9802,10 +10116,10 @@ func (c *BillingAccountsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLog } return ret, nil // { - // "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", - // "flatPath": "v2/billingAccounts/{billingAccountsId}/logs", + // "description": "Lists the RecentQueries that were created by the user making the request.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/recentQueries", // "httpMethod": "GET", - // "id": "logging.billingAccounts.logs.list", + // "id": "logging.billingAccounts.locations.recentQueries.list", // "parameterOrder": [ // "parent" // ], @@ -9822,22 +10136,16 @@ func (c *BillingAccountsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLog // "type": "string" // }, // "parent": { - // "description": "Required. The resource name to list logs for: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", + // "description": "Required. The resource to which the listed queries belong. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" For example:projects/my-project/locations/us-central1Note: The location portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all recent queries.", // "location": "path", - // "pattern": "^billingAccounts/[^/]+$", + // "pattern": "^billingAccounts/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" - // }, - // "resourceNames": { - // "description": "Optional. List of resource names to list logs for: projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]To support legacy queries, it could also be: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]The resource name in the parent field is added to this list.", - // "location": "query", - // "repeated": true, - // "type": "string" // } // }, - // "path": "v2/{+parent}/logs", + // "path": "v2/{+parent}/recentQueries", // "response": { - // "$ref": "ListLogsResponse" + // "$ref": "ListRecentQueriesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -9852,7 +10160,7 @@ func (c *BillingAccountsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLog // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *BillingAccountsLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error { +func (c *BillingAccountsLocationsRecentQueriesListCall) Pages(ctx context.Context, f func(*ListRecentQueriesResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -9870,66 +10178,50 @@ func (c *BillingAccountsLogsListCall) Pages(ctx context.Context, f func(*ListLog } } -// method id "logging.billingAccounts.sinks.create": +// method id "logging.billingAccounts.locations.savedQueries.create": -type BillingAccountsSinksCreateCall struct { +type BillingAccountsLocationsSavedQueriesCreateCall struct { s *Service parent string - logsink *LogSink + savedquery *SavedQuery urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Create: Creates a sink that exports specified log entries to a -// destination. The export begins upon ingress, unless the sink's -// writer_identity is not permitted to write to the destination. A sink -// can export log entries only from the resource owning the sink. +// Create: Creates a new SavedQuery for the user making the request. // -// - parent: The resource in which to create the sink: -// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For -// examples:"projects/my-project" "organizations/123456789". -func (r *BillingAccountsSinksService) Create(parent string, logsink *LogSink) *BillingAccountsSinksCreateCall { - c := &BillingAccountsSinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The parent resource in which to create the saved query: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" For example: +// "projects/my-project/locations/global" +// "organizations/123456789/locations/us-central1". +func (r *BillingAccountsLocationsSavedQueriesService) Create(parent string, savedquery *SavedQuery) *BillingAccountsLocationsSavedQueriesCreateCall { + c := &BillingAccountsLocationsSavedQueriesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.logsink = logsink - return c -} - -// CustomWriterIdentity sets the optional parameter -// "customWriterIdentity": A service account provided by the caller that -// will be used to write the log entries. The format must be -// serviceAccount:some@email. This field can only be specified if you -// are routing logs to a destination outside this sink's project. If not -// specified, a Logging service account will automatically be generated. -func (c *BillingAccountsSinksCreateCall) CustomWriterIdentity(customWriterIdentity string) *BillingAccountsSinksCreateCall { - c.urlParams_.Set("customWriterIdentity", customWriterIdentity) + c.savedquery = savedquery return c } -// UniqueWriterIdentity sets the optional parameter -// "uniqueWriterIdentity": Determines the kind of IAM identity returned -// as writer_identity in the new sink. If this value is omitted or set -// to false, and if the sink's parent is a project, then the value -// returned as writer_identity is the same group or service account used -// by Cloud Logging before the addition of writer identities to this -// API. The sink's destination must be in the same project as the sink -// itself.If this field is set to true, or if the sink is owned by a -// non-project resource such as an organization, then the value of -// writer_identity will be a service agent -// (https://cloud.google.com/iam/docs/service-account-types#service-agents) -// used by the sinks with the same parent. For more information, see -// writer_identity in LogSink. -func (c *BillingAccountsSinksCreateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *BillingAccountsSinksCreateCall { - c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity)) +// SavedQueryId sets the optional parameter "savedQueryId": The ID to +// use for the saved query, which will become the final component of the +// saved query's resource name.If the saved_query_id is not provided, +// the system will generate an alphanumeric ID.The saved_query_id is +// limited to 100 characters and can include only the following +// characters: upper and lower-case alphanumeric characters, +// underscores, hyphens, and periods. First character has to be +// alphanumeric. +func (c *BillingAccountsLocationsSavedQueriesCreateCall) SavedQueryId(savedQueryId string) *BillingAccountsLocationsSavedQueriesCreateCall { + c.urlParams_.Set("savedQueryId", savedQueryId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *BillingAccountsSinksCreateCall) Fields(s ...googleapi.Field) *BillingAccountsSinksCreateCall { +func (c *BillingAccountsLocationsSavedQueriesCreateCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsSavedQueriesCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -9937,21 +10229,21 @@ func (c *BillingAccountsSinksCreateCall) Fields(s ...googleapi.Field) *BillingAc // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *BillingAccountsSinksCreateCall) Context(ctx context.Context) *BillingAccountsSinksCreateCall { +func (c *BillingAccountsLocationsSavedQueriesCreateCall) Context(ctx context.Context) *BillingAccountsLocationsSavedQueriesCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *BillingAccountsSinksCreateCall) Header() http.Header { +func (c *BillingAccountsLocationsSavedQueriesCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *BillingAccountsSinksCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *BillingAccountsLocationsSavedQueriesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -9959,14 +10251,14 @@ func (c *BillingAccountsSinksCreateCall) doRequest(alt string) (*http.Response, } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.savedquery) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/savedQueries") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -9979,14 +10271,14 @@ func (c *BillingAccountsSinksCreateCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.billingAccounts.sinks.create" call. -// Exactly one of *LogSink or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *LogSink.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *BillingAccountsSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { +// Do executes the "logging.billingAccounts.locations.savedQueries.create" call. +// Exactly one of *SavedQuery or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SavedQuery.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *BillingAccountsLocationsSavedQueriesCreateCall) Do(opts ...googleapi.CallOption) (*SavedQuery, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10005,7 +10297,7 @@ func (c *BillingAccountsSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogS if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogSink{ + ret := &SavedQuery{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10017,38 +10309,33 @@ func (c *BillingAccountsSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogS } return ret, nil // { - // "description": "Creates a sink that exports specified log entries to a destination. The export begins upon ingress, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.", - // "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks", + // "description": "Creates a new SavedQuery for the user making the request.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/savedQueries", // "httpMethod": "POST", - // "id": "logging.billingAccounts.sinks.create", + // "id": "logging.billingAccounts.locations.savedQueries.create", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "customWriterIdentity": { - // "description": "Optional. A service account provided by the caller that will be used to write the log entries. The format must be serviceAccount:some@email. This field can only be specified if you are routing logs to a destination outside this sink's project. If not specified, a Logging service account will automatically be generated.", - // "location": "query", - // "type": "string" - // }, // "parent": { - // "description": "Required. The resource in which to create the sink: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-project\" \"organizations/123456789\"", + // "description": "Required. The parent resource in which to create the saved query: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" For example: \"projects/my-project/locations/global\" \"organizations/123456789/locations/us-central1\" ", // "location": "path", - // "pattern": "^billingAccounts/[^/]+$", + // "pattern": "^billingAccounts/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // }, - // "uniqueWriterIdentity": { - // "description": "Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Cloud Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a service agent (https://cloud.google.com/iam/docs/service-account-types#service-agents) used by the sinks with the same parent. For more information, see writer_identity in LogSink.", + // "savedQueryId": { + // "description": "Optional. The ID to use for the saved query, which will become the final component of the saved query's resource name.If the saved_query_id is not provided, the system will generate an alphanumeric ID.The saved_query_id is limited to 100 characters and can include only the following characters: upper and lower-case alphanumeric characters, underscores, hyphens, and periods. First character has to be alphanumeric.", // "location": "query", - // "type": "boolean" + // "type": "string" // } // }, - // "path": "v2/{+parent}/sinks", + // "path": "v2/{+parent}/savedQueries", // "request": { - // "$ref": "LogSink" + // "$ref": "SavedQuery" // }, // "response": { - // "$ref": "LogSink" + // "$ref": "SavedQuery" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -10058,36 +10345,39 @@ func (c *BillingAccountsSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogS } -// method id "logging.billingAccounts.sinks.delete": +// method id "logging.billingAccounts.locations.savedQueries.delete": -type BillingAccountsSinksDeleteCall struct { +type BillingAccountsLocationsSavedQueriesDeleteCall struct { s *Service - sinkNameid string + name string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Delete: Deletes a sink. If the sink has a unique writer_identity, -// then that service account is also deleted. +// Delete: Deletes an existing SavedQuery that was created by the user +// making the request. // -// - sinkName: The full resource name of the sink to delete, including -// the parent resource and the sink identifier: -// "projects/[PROJECT_ID]/sinks/[SINK_ID]" -// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" -// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For -// example:"projects/my-project/sinks/my-sink". -func (r *BillingAccountsSinksService) Delete(sinkNameid string) *BillingAccountsSinksDeleteCall { - c := &BillingAccountsSinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.sinkNameid = sinkNameid +// - name: The full resource name of the saved query to delete. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_I +// D]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/savedQuerie +// s/[QUERY_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/savedQ +// ueries/[QUERY_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID] +// " For example: +// "projects/my-project/locations/global/savedQueries/my-saved-query". +func (r *BillingAccountsLocationsSavedQueriesService) Delete(name string) *BillingAccountsLocationsSavedQueriesDeleteCall { + c := &BillingAccountsLocationsSavedQueriesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *BillingAccountsSinksDeleteCall) Fields(s ...googleapi.Field) *BillingAccountsSinksDeleteCall { +func (c *BillingAccountsLocationsSavedQueriesDeleteCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsSavedQueriesDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -10095,21 +10385,21 @@ func (c *BillingAccountsSinksDeleteCall) Fields(s ...googleapi.Field) *BillingAc // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *BillingAccountsSinksDeleteCall) Context(ctx context.Context) *BillingAccountsSinksDeleteCall { +func (c *BillingAccountsLocationsSavedQueriesDeleteCall) Context(ctx context.Context) *BillingAccountsLocationsSavedQueriesDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *BillingAccountsSinksDeleteCall) Header() http.Header { +func (c *BillingAccountsLocationsSavedQueriesDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *BillingAccountsSinksDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *BillingAccountsLocationsSavedQueriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -10119,7 +10409,7 @@ func (c *BillingAccountsSinksDeleteCall) doRequest(alt string) (*http.Response, var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("DELETE", urls, body) if err != nil { @@ -10127,19 +10417,19 @@ func (c *BillingAccountsSinksDeleteCall) doRequest(alt string) (*http.Response, } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "sinkName": c.sinkNameid, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.billingAccounts.sinks.delete" call. +// Do executes the "logging.billingAccounts.locations.savedQueries.delete" call. // Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *Empty.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. -func (c *BillingAccountsSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +func (c *BillingAccountsLocationsSavedQueriesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10170,23 +10460,23 @@ func (c *BillingAccountsSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empt } return ret, nil // { - // "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.", - // "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}", + // "description": "Deletes an existing SavedQuery that was created by the user making the request.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/savedQueries/{savedQueriesId}", // "httpMethod": "DELETE", - // "id": "logging.billingAccounts.sinks.delete", + // "id": "logging.billingAccounts.locations.savedQueries.delete", // "parameterOrder": [ - // "sinkName" + // "name" // ], // "parameters": { - // "sinkName": { - // "description": "Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", + // "name": { + // "description": "Required. The full resource name of the saved query to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]\" For example: \"projects/my-project/locations/global/savedQueries/my-saved-query\" ", // "location": "path", - // "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$", + // "pattern": "^billingAccounts/[^/]+/locations/[^/]+/savedQueries/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+sinkName}", + // "path": "v2/{+name}", // "response": { // "$ref": "Empty" // }, @@ -10198,35 +10488,58 @@ func (c *BillingAccountsSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empt } -// method id "logging.billingAccounts.sinks.get": +// method id "logging.billingAccounts.locations.savedQueries.list": -type BillingAccountsSinksGetCall struct { +type BillingAccountsLocationsSavedQueriesListCall struct { s *Service - sinkName string + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Gets a sink. +// List: Lists the SavedQueries that were created by the user making the +// request. // -// - sinkName: The resource name of the sink: -// "projects/[PROJECT_ID]/sinks/[SINK_ID]" -// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" -// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For -// example:"projects/my-project/sinks/my-sink". -func (r *BillingAccountsSinksService) Get(sinkName string) *BillingAccountsSinksGetCall { - c := &BillingAccountsSinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.sinkName = sinkName +// - parent: The resource to which the listed queries belong. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" For example: +// "projects/my-project/locations/us-central1" Note: The locations +// portion of the resource must be specified. To get a list of all +// saved queries, a wildcard character - can be used for LOCATION_ID, +// for example: "projects/my-project/locations/-". +func (r *BillingAccountsLocationsSavedQueriesService) List(parent string) *BillingAccountsLocationsSavedQueriesListCall { + c := &BillingAccountsLocationsSavedQueriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request.Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *BillingAccountsLocationsSavedQueriesListCall) PageSize(pageSize int64) *BillingAccountsLocationsSavedQueriesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *BillingAccountsLocationsSavedQueriesListCall) PageToken(pageToken string) *BillingAccountsLocationsSavedQueriesListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *BillingAccountsSinksGetCall) Fields(s ...googleapi.Field) *BillingAccountsSinksGetCall { +func (c *BillingAccountsLocationsSavedQueriesListCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsSavedQueriesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -10236,7 +10549,7 @@ func (c *BillingAccountsSinksGetCall) Fields(s ...googleapi.Field) *BillingAccou // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *BillingAccountsSinksGetCall) IfNoneMatch(entityTag string) *BillingAccountsSinksGetCall { +func (c *BillingAccountsLocationsSavedQueriesListCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsSavedQueriesListCall { c.ifNoneMatch_ = entityTag return c } @@ -10244,21 +10557,21 @@ func (c *BillingAccountsSinksGetCall) IfNoneMatch(entityTag string) *BillingAcco // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *BillingAccountsSinksGetCall) Context(ctx context.Context) *BillingAccountsSinksGetCall { +func (c *BillingAccountsLocationsSavedQueriesListCall) Context(ctx context.Context) *BillingAccountsLocationsSavedQueriesListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *BillingAccountsSinksGetCall) Header() http.Header { +func (c *BillingAccountsLocationsSavedQueriesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *BillingAccountsSinksGetCall) doRequest(alt string) (*http.Response, error) { +func (c *BillingAccountsLocationsSavedQueriesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -10271,7 +10584,7 @@ func (c *BillingAccountsSinksGetCall) doRequest(alt string) (*http.Response, err var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/savedQueries") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -10279,19 +10592,19 @@ func (c *BillingAccountsSinksGetCall) doRequest(alt string) (*http.Response, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "sinkName": c.sinkName, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.billingAccounts.sinks.get" call. -// Exactly one of *LogSink or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *LogSink.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *BillingAccountsSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { +// Do executes the "logging.billingAccounts.locations.savedQueries.list" call. +// Exactly one of *ListSavedQueriesResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ListSavedQueriesResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BillingAccountsLocationsSavedQueriesListCall) Do(opts ...googleapi.CallOption) (*ListSavedQueriesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10310,7 +10623,7 @@ func (c *BillingAccountsSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogSink{ + ret := &ListSavedQueriesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10322,25 +10635,36 @@ func (c *BillingAccountsSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink } return ret, nil // { - // "description": "Gets a sink.", - // "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}", + // "description": "Lists the SavedQueries that were created by the user making the request.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/savedQueries", // "httpMethod": "GET", - // "id": "logging.billingAccounts.sinks.get", + // "id": "logging.billingAccounts.locations.savedQueries.list", // "parameterOrder": [ - // "sinkName" + // "parent" // ], // "parameters": { - // "sinkName": { - // "description": "Required. The resource name of the sink: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request.Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The resource to which the listed queries belong. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" For example: \"projects/my-project/locations/us-central1\" Note: The locations portion of the resource must be specified. To get a list of all saved queries, a wildcard character - can be used for LOCATION_ID, for example: \"projects/my-project/locations/-\" ", // "location": "path", - // "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$", + // "pattern": "^billingAccounts/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+sinkName}", + // "path": "v2/{+parent}/savedQueries", // "response": { - // "$ref": "LogSink" + // "$ref": "ListSavedQueriesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -10352,9 +10676,174 @@ func (c *BillingAccountsSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink } -// method id "logging.billingAccounts.sinks.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 *BillingAccountsLocationsSavedQueriesListCall) Pages(ctx context.Context, f func(*ListSavedQueriesResponse) 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 BillingAccountsSinksListCall struct { +// method id "logging.billingAccounts.logs.delete": + +type BillingAccountsLogsDeleteCall struct { + s *Service + logName string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes all the log entries in a log for the _Default Log +// Bucket. The log reappears if it receives new entries. Log entries +// written shortly before the delete operation might not be deleted. +// Entries received after the delete operation with a timestamp before +// the operation will be deleted. +// +// - logName: The resource name of the log to delete: +// projects/[PROJECT_ID]/logs/[LOG_ID] +// organizations/[ORGANIZATION_ID]/logs/[LOG_ID] +// billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID] +// folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For +// example, "projects/my-project-id/logs/syslog", +// "organizations/123/logs/cloudaudit.googleapis.com%2Factivity".For +// more information about log names, see LogEntry. +func (r *BillingAccountsLogsService) Delete(logName string) *BillingAccountsLogsDeleteCall { + c := &BillingAccountsLogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.logName = logName + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BillingAccountsLogsDeleteCall) Fields(s ...googleapi.Field) *BillingAccountsLogsDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *BillingAccountsLogsDeleteCall) Context(ctx context.Context) *BillingAccountsLogsDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *BillingAccountsLogsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *BillingAccountsLogsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+logName}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "logName": c.logName, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "logging.billingAccounts.logs.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BillingAccountsLogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes all the log entries in a log for the _Default Log Bucket. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/logs/{logsId}", + // "httpMethod": "DELETE", + // "id": "logging.billingAccounts.logs.delete", + // "parameterOrder": [ + // "logName" + // ], + // "parameters": { + // "logName": { + // "description": "Required. The resource name of the log to delete: projects/[PROJECT_ID]/logs/[LOG_ID] organizations/[ORGANIZATION_ID]/logs/[LOG_ID] billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID] folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/123/logs/cloudaudit.googleapis.com%2Factivity\".For more information about log names, see LogEntry.", + // "location": "path", + // "pattern": "^billingAccounts/[^/]+/logs/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+logName}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.billingAccounts.logs.list": + +type BillingAccountsLogsListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -10363,13 +10852,14 @@ type BillingAccountsSinksListCall struct { header_ http.Header } -// List: Lists sinks. +// List: Lists the logs in projects, organizations, folders, or billing +// accounts. Only logs that have entries are listed. // -// - parent: The parent resource whose sinks are to be listed: -// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]". -func (r *BillingAccountsSinksService) List(parent string) *BillingAccountsSinksListCall { - c := &BillingAccountsSinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The resource name to list logs for: projects/[PROJECT_ID] +// organizations/[ORGANIZATION_ID] +// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]. +func (r *BillingAccountsLogsService) List(parent string) *BillingAccountsLogsListCall { + c := &BillingAccountsLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } @@ -10378,7 +10868,7 @@ func (r *BillingAccountsSinksService) List(parent string) *BillingAccountsSinksL // of results to return from this request. Non-positive values are // ignored. The presence of nextPageToken in the response indicates that // more results might be available. -func (c *BillingAccountsSinksListCall) PageSize(pageSize int64) *BillingAccountsSinksListCall { +func (c *BillingAccountsLogsListCall) PageSize(pageSize int64) *BillingAccountsLogsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } @@ -10388,15 +10878,33 @@ func (c *BillingAccountsSinksListCall) PageSize(pageSize int64) *BillingAccounts // method. pageToken must be the value of nextPageToken from the // previous response. The values of other method parameters should be // identical to those in the previous call. -func (c *BillingAccountsSinksListCall) PageToken(pageToken string) *BillingAccountsSinksListCall { +func (c *BillingAccountsLogsListCall) PageToken(pageToken string) *BillingAccountsLogsListCall { c.urlParams_.Set("pageToken", pageToken) return c } +// ResourceNames sets the optional parameter "resourceNames": List of +// resource names to list logs for: +// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/view +// s/[VIEW_ID] +// organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKE +// T_ID]/views/[VIEW_ID] +// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[ +// BUCKET_ID]/views/[VIEW_ID] +// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/ +// [VIEW_ID]To support legacy queries, it could also be: +// projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] +// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]The resource +// name in the parent field is added to this list. +func (c *BillingAccountsLogsListCall) ResourceNames(resourceNames ...string) *BillingAccountsLogsListCall { + c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...)) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *BillingAccountsSinksListCall) Fields(s ...googleapi.Field) *BillingAccountsSinksListCall { +func (c *BillingAccountsLogsListCall) Fields(s ...googleapi.Field) *BillingAccountsLogsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -10406,7 +10914,7 @@ func (c *BillingAccountsSinksListCall) Fields(s ...googleapi.Field) *BillingAcco // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *BillingAccountsSinksListCall) IfNoneMatch(entityTag string) *BillingAccountsSinksListCall { +func (c *BillingAccountsLogsListCall) IfNoneMatch(entityTag string) *BillingAccountsLogsListCall { c.ifNoneMatch_ = entityTag return c } @@ -10414,21 +10922,21 @@ func (c *BillingAccountsSinksListCall) IfNoneMatch(entityTag string) *BillingAcc // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *BillingAccountsSinksListCall) Context(ctx context.Context) *BillingAccountsSinksListCall { +func (c *BillingAccountsLogsListCall) Context(ctx context.Context) *BillingAccountsLogsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *BillingAccountsSinksListCall) Header() http.Header { +func (c *BillingAccountsLogsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *BillingAccountsSinksListCall) doRequest(alt string) (*http.Response, error) { +func (c *BillingAccountsLogsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -10441,7 +10949,7 @@ func (c *BillingAccountsSinksListCall) doRequest(alt string) (*http.Response, er var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -10454,14 +10962,14 @@ func (c *BillingAccountsSinksListCall) doRequest(alt string) (*http.Response, er return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.billingAccounts.sinks.list" call. -// Exactly one of *ListSinksResponse or error will be non-nil. Any +// Do executes the "logging.billingAccounts.logs.list" call. +// Exactly one of *ListLogsResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either -// *ListSinksResponse.ServerResponse.Header or (if a response was +// *ListLogsResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *BillingAccountsSinksListCall) Do(opts ...googleapi.CallOption) (*ListSinksResponse, error) { +func (c *BillingAccountsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10480,7 +10988,7 @@ func (c *BillingAccountsSinksListCall) Do(opts ...googleapi.CallOption) (*ListSi if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListSinksResponse{ + ret := &ListLogsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10492,10 +11000,10 @@ func (c *BillingAccountsSinksListCall) Do(opts ...googleapi.CallOption) (*ListSi } return ret, nil // { - // "description": "Lists sinks.", - // "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks", + // "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/logs", // "httpMethod": "GET", - // "id": "logging.billingAccounts.sinks.list", + // "id": "logging.billingAccounts.logs.list", // "parameterOrder": [ // "parent" // ], @@ -10512,16 +11020,22 @@ func (c *BillingAccountsSinksListCall) Do(opts ...googleapi.CallOption) (*ListSi // "type": "string" // }, // "parent": { - // "description": "Required. The parent resource whose sinks are to be listed: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ", + // "description": "Required. The resource name to list logs for: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", // "location": "path", // "pattern": "^billingAccounts/[^/]+$", // "required": true, // "type": "string" + // }, + // "resourceNames": { + // "description": "Optional. List of resource names to list logs for: projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]To support legacy queries, it could also be: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]The resource name in the parent field is added to this list.", + // "location": "query", + // "repeated": true, + // "type": "string" // } // }, - // "path": "v2/{+parent}/sinks", + // "path": "v2/{+parent}/logs", // "response": { - // "$ref": "ListSinksResponse" + // "$ref": "ListLogsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -10536,7 +11050,7 @@ func (c *BillingAccountsSinksListCall) Do(opts ...googleapi.CallOption) (*ListSi // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *BillingAccountsSinksListCall) Pages(ctx context.Context, f func(*ListSinksResponse) error) error { +func (c *BillingAccountsLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -10554,32 +11068,29 @@ func (c *BillingAccountsSinksListCall) Pages(ctx context.Context, f func(*ListSi } } -// method id "logging.billingAccounts.sinks.patch": +// method id "logging.billingAccounts.sinks.create": -type BillingAccountsSinksPatchCall struct { +type BillingAccountsSinksCreateCall struct { s *Service - sinkNameid string + parent string logsink *LogSink urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Patch: Updates a sink. This method replaces the following fields in -// the existing sink with values from the new sink: destination, and -// filter.The updated sink might also have a new writer_identity; see -// the unique_writer_identity field. +// Create: Creates a sink that exports specified log entries to a +// destination. The export begins upon ingress, unless the sink's +// writer_identity is not permitted to write to the destination. A sink +// can export log entries only from the resource owning the sink. // -// - sinkName: The full resource name of the sink to update, including -// the parent resource and the sink identifier: -// "projects/[PROJECT_ID]/sinks/[SINK_ID]" -// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" -// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For -// example:"projects/my-project/sinks/my-sink". -func (r *BillingAccountsSinksService) Patch(sinkNameid string, logsink *LogSink) *BillingAccountsSinksPatchCall { - c := &BillingAccountsSinksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.sinkNameid = sinkNameid +// - parent: The resource in which to create the sink: +// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For +// examples:"projects/my-project" "organizations/123456789". +func (r *BillingAccountsSinksService) Create(parent string, logsink *LogSink) *BillingAccountsSinksCreateCall { + c := &BillingAccountsSinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent c.logsink = logsink return c } @@ -10590,46 +11101,33 @@ func (r *BillingAccountsSinksService) Patch(sinkNameid string, logsink *LogSink) // serviceAccount:some@email. This field can only be specified if you // are routing logs to a destination outside this sink's project. If not // specified, a Logging service account will automatically be generated. -func (c *BillingAccountsSinksPatchCall) CustomWriterIdentity(customWriterIdentity string) *BillingAccountsSinksPatchCall { +func (c *BillingAccountsSinksCreateCall) CustomWriterIdentity(customWriterIdentity string) *BillingAccountsSinksCreateCall { c.urlParams_.Set("customWriterIdentity", customWriterIdentity) return c } // UniqueWriterIdentity sets the optional parameter -// "uniqueWriterIdentity": See sinks.create for a description of this -// field. When updating a sink, the effect of this field on the value of -// writer_identity in the updated sink depends on both the old and new -// values of this field: If the old and new values of this field are -// both false or both true, then there is no change to the sink's -// writer_identity. If the old value is false and the new value is true, -// then writer_identity is changed to a service agent +// "uniqueWriterIdentity": Determines the kind of IAM identity returned +// as writer_identity in the new sink. If this value is omitted or set +// to false, and if the sink's parent is a project, then the value +// returned as writer_identity is the same group or service account used +// by Cloud Logging before the addition of writer identities to this +// API. The sink's destination must be in the same project as the sink +// itself.If this field is set to true, or if the sink is owned by a +// non-project resource such as an organization, then the value of +// writer_identity will be a service agent // (https://cloud.google.com/iam/docs/service-account-types#service-agents) -// owned by Cloud Logging. It is an error if the old value is true and -// the new value is set to false or defaulted to false. -func (c *BillingAccountsSinksPatchCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *BillingAccountsSinksPatchCall { +// used by the sinks with the same parent. For more information, see +// writer_identity in LogSink. +func (c *BillingAccountsSinksCreateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *BillingAccountsSinksCreateCall { c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity)) return c } -// UpdateMask sets the optional parameter "updateMask": Field mask that -// specifies the fields in sink that need an update. A sink field will -// be overwritten if, and only if, it is in the update mask. name and -// output only fields cannot be updated.An empty updateMask is -// temporarily treated as using the following mask for backwards -// compatibility purposes:destination,filter,includeChildrenAt some -// point in the future, behavior will be removed and specifying an empty -// updateMask will be an error.For a detailed FieldMask definition, see -// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor -// example: updateMask=filter -func (c *BillingAccountsSinksPatchCall) UpdateMask(updateMask string) *BillingAccountsSinksPatchCall { - c.urlParams_.Set("updateMask", updateMask) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *BillingAccountsSinksPatchCall) Fields(s ...googleapi.Field) *BillingAccountsSinksPatchCall { +func (c *BillingAccountsSinksCreateCall) Fields(s ...googleapi.Field) *BillingAccountsSinksCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -10637,21 +11135,21 @@ func (c *BillingAccountsSinksPatchCall) Fields(s ...googleapi.Field) *BillingAcc // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *BillingAccountsSinksPatchCall) Context(ctx context.Context) *BillingAccountsSinksPatchCall { +func (c *BillingAccountsSinksCreateCall) Context(ctx context.Context) *BillingAccountsSinksCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *BillingAccountsSinksPatchCall) Header() http.Header { +func (c *BillingAccountsSinksCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *BillingAccountsSinksPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *BillingAccountsSinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -10666,27 +11164,27 @@ func (c *BillingAccountsSinksPatchCall) doRequest(alt string) (*http.Response, e reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "sinkName": c.sinkNameid, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.billingAccounts.sinks.patch" call. +// Do executes the "logging.billingAccounts.sinks.create" call. // Exactly one of *LogSink or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *LogSink.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. -func (c *BillingAccountsSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { +func (c *BillingAccountsSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10717,12 +11215,12 @@ func (c *BillingAccountsSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSi } return ret, nil // { - // "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field.", - // "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}", - // "httpMethod": "PATCH", - // "id": "logging.billingAccounts.sinks.patch", + // "description": "Creates a sink that exports specified log entries to a destination. The export begins upon ingress, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks", + // "httpMethod": "POST", + // "id": "logging.billingAccounts.sinks.create", // "parameterOrder": [ - // "sinkName" + // "parent" // ], // "parameters": { // "customWriterIdentity": { @@ -10730,26 +11228,20 @@ func (c *BillingAccountsSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSi // "location": "query", // "type": "string" // }, - // "sinkName": { - // "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", + // "parent": { + // "description": "Required. The resource in which to create the sink: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-project\" \"organizations/123456789\"", // "location": "path", - // "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$", + // "pattern": "^billingAccounts/[^/]+$", // "required": true, // "type": "string" // }, // "uniqueWriterIdentity": { - // "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a service agent (https://cloud.google.com/iam/docs/service-account-types#service-agents) owned by Cloud Logging. It is an error if the old value is true and the new value is set to false or defaulted to false.", + // "description": "Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Cloud Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a service agent (https://cloud.google.com/iam/docs/service-account-types#service-agents) used by the sinks with the same parent. For more information, see writer_identity in LogSink.", // "location": "query", // "type": "boolean" - // }, - // "updateMask": { - // "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes:destination,filter,includeChildrenAt some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+sinkName}", + // "path": "v2/{+parent}/sinks", // "request": { // "$ref": "LogSink" // }, @@ -10764,82 +11256,36 @@ func (c *BillingAccountsSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSi } -// method id "logging.billingAccounts.sinks.update": +// method id "logging.billingAccounts.sinks.delete": -type BillingAccountsSinksUpdateCall struct { +type BillingAccountsSinksDeleteCall struct { s *Service sinkNameid string - logsink *LogSink urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Update: Updates a sink. This method replaces the following fields in -// the existing sink with values from the new sink: destination, and -// filter.The updated sink might also have a new writer_identity; see -// the unique_writer_identity field. +// Delete: Deletes a sink. If the sink has a unique writer_identity, +// then that service account is also deleted. // -// - sinkName: The full resource name of the sink to update, including +// - sinkName: The full resource name of the sink to delete, including // the parent resource and the sink identifier: // "projects/[PROJECT_ID]/sinks/[SINK_ID]" // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" // "folders/[FOLDER_ID]/sinks/[SINK_ID]" For // example:"projects/my-project/sinks/my-sink". -func (r *BillingAccountsSinksService) Update(sinkNameid string, logsink *LogSink) *BillingAccountsSinksUpdateCall { - c := &BillingAccountsSinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *BillingAccountsSinksService) Delete(sinkNameid string) *BillingAccountsSinksDeleteCall { + c := &BillingAccountsSinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.sinkNameid = sinkNameid - c.logsink = logsink - return c -} - -// CustomWriterIdentity sets the optional parameter -// "customWriterIdentity": A service account provided by the caller that -// will be used to write the log entries. The format must be -// serviceAccount:some@email. This field can only be specified if you -// are routing logs to a destination outside this sink's project. If not -// specified, a Logging service account will automatically be generated. -func (c *BillingAccountsSinksUpdateCall) CustomWriterIdentity(customWriterIdentity string) *BillingAccountsSinksUpdateCall { - c.urlParams_.Set("customWriterIdentity", customWriterIdentity) - return c -} - -// UniqueWriterIdentity sets the optional parameter -// "uniqueWriterIdentity": See sinks.create for a description of this -// field. When updating a sink, the effect of this field on the value of -// writer_identity in the updated sink depends on both the old and new -// values of this field: If the old and new values of this field are -// both false or both true, then there is no change to the sink's -// writer_identity. If the old value is false and the new value is true, -// then writer_identity is changed to a service agent -// (https://cloud.google.com/iam/docs/service-account-types#service-agents) -// owned by Cloud Logging. It is an error if the old value is true and -// the new value is set to false or defaulted to false. -func (c *BillingAccountsSinksUpdateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *BillingAccountsSinksUpdateCall { - c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity)) - return c -} - -// UpdateMask sets the optional parameter "updateMask": Field mask that -// specifies the fields in sink that need an update. A sink field will -// be overwritten if, and only if, it is in the update mask. name and -// output only fields cannot be updated.An empty updateMask is -// temporarily treated as using the following mask for backwards -// compatibility purposes:destination,filter,includeChildrenAt some -// point in the future, behavior will be removed and specifying an empty -// updateMask will be an error.For a detailed FieldMask definition, see -// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor -// example: updateMask=filter -func (c *BillingAccountsSinksUpdateCall) UpdateMask(updateMask string) *BillingAccountsSinksUpdateCall { - c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *BillingAccountsSinksUpdateCall) Fields(s ...googleapi.Field) *BillingAccountsSinksUpdateCall { +func (c *BillingAccountsSinksDeleteCall) Fields(s ...googleapi.Field) *BillingAccountsSinksDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -10847,21 +11293,21 @@ func (c *BillingAccountsSinksUpdateCall) Fields(s ...googleapi.Field) *BillingAc // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *BillingAccountsSinksUpdateCall) Context(ctx context.Context) *BillingAccountsSinksUpdateCall { +func (c *BillingAccountsSinksDeleteCall) Context(ctx context.Context) *BillingAccountsSinksDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *BillingAccountsSinksUpdateCall) Header() http.Header { +func (c *BillingAccountsSinksDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *BillingAccountsSinksUpdateCall) doRequest(alt string) (*http.Response, error) { +func (c *BillingAccountsSinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -10869,16 +11315,11 @@ func (c *BillingAccountsSinksUpdateCall) doRequest(alt string) (*http.Response, } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -10889,14 +11330,14 @@ func (c *BillingAccountsSinksUpdateCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.billingAccounts.sinks.update" call. -// Exactly one of *LogSink or error will be non-nil. Any non-2xx status +// Do executes the "logging.billingAccounts.sinks.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *LogSink.ServerResponse.Header or (if a response was returned at all) +// *Empty.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. -func (c *BillingAccountsSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { +func (c *BillingAccountsSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10915,7 +11356,7 @@ func (c *BillingAccountsSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogS if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogSink{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10927,44 +11368,25 @@ func (c *BillingAccountsSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogS } return ret, nil // { - // "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field.", + // "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.", // "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}", - // "httpMethod": "PUT", - // "id": "logging.billingAccounts.sinks.update", + // "httpMethod": "DELETE", + // "id": "logging.billingAccounts.sinks.delete", // "parameterOrder": [ // "sinkName" // ], // "parameters": { - // "customWriterIdentity": { - // "description": "Optional. A service account provided by the caller that will be used to write the log entries. The format must be serviceAccount:some@email. This field can only be specified if you are routing logs to a destination outside this sink's project. If not specified, a Logging service account will automatically be generated.", - // "location": "query", - // "type": "string" - // }, // "sinkName": { - // "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", + // "description": "Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", // "location": "path", // "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$", // "required": true, // "type": "string" - // }, - // "uniqueWriterIdentity": { - // "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a service agent (https://cloud.google.com/iam/docs/service-account-types#service-agents) owned by Cloud Logging. It is an error if the old value is true and the new value is set to false or defaulted to false.", - // "location": "query", - // "type": "boolean" - // }, - // "updateMask": { - // "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes:destination,filter,includeChildrenAt some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, // "path": "v2/{+sinkName}", - // "request": { - // "$ref": "LogSink" - // }, // "response": { - // "$ref": "LogSink" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -10974,82 +11396,100 @@ func (c *BillingAccountsSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogS } -// method id "logging.entries.copy": +// method id "logging.billingAccounts.sinks.get": -type EntriesCopyCall struct { - s *Service - copylogentriesrequest *CopyLogEntriesRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type BillingAccountsSinksGetCall struct { + s *Service + sinkName string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Copy: Copies a set of log entries from a log bucket to a Cloud -// Storage bucket. -func (r *EntriesService) Copy(copylogentriesrequest *CopyLogEntriesRequest) *EntriesCopyCall { - c := &EntriesCopyCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.copylogentriesrequest = copylogentriesrequest +// Get: Gets a sink. +// +// - sinkName: The resource name of the sink: +// "projects/[PROJECT_ID]/sinks/[SINK_ID]" +// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" +// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For +// example:"projects/my-project/sinks/my-sink". +func (r *BillingAccountsSinksService) Get(sinkName string) *BillingAccountsSinksGetCall { + c := &BillingAccountsSinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.sinkName = sinkName return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EntriesCopyCall) Fields(s ...googleapi.Field) *EntriesCopyCall { +func (c *BillingAccountsSinksGetCall) Fields(s ...googleapi.Field) *BillingAccountsSinksGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BillingAccountsSinksGetCall) IfNoneMatch(entityTag string) *BillingAccountsSinksGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EntriesCopyCall) Context(ctx context.Context) *EntriesCopyCall { +func (c *BillingAccountsSinksGetCall) Context(ctx context.Context) *BillingAccountsSinksGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EntriesCopyCall) Header() http.Header { +func (c *BillingAccountsSinksGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EntriesCopyCall) doRequest(alt string) (*http.Response, error) { +func (c *BillingAccountsSinksGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.copylogentriesrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/entries:copy") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") 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{ + "sinkName": c.sinkName, + }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.entries.copy" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *EntriesCopyCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// Do executes the "logging.billingAccounts.sinks.get" call. +// Exactly one of *LogSink or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogSink.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BillingAccountsSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -11068,7 +11508,7 @@ func (c *EntriesCopyCall) Do(opts ...googleapi.CallOption) (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &LogSink{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11080,105 +11520,146 @@ func (c *EntriesCopyCall) Do(opts ...googleapi.CallOption) (*Operation, error) { } return ret, nil // { - // "description": "Copies a set of log entries from a log bucket to a Cloud Storage bucket.", - // "flatPath": "v2/entries:copy", - // "httpMethod": "POST", - // "id": "logging.entries.copy", - // "parameterOrder": [], - // "parameters": {}, - // "path": "v2/entries:copy", - // "request": { - // "$ref": "CopyLogEntriesRequest" + // "description": "Gets a sink.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}", + // "httpMethod": "GET", + // "id": "logging.billingAccounts.sinks.get", + // "parameterOrder": [ + // "sinkName" + // ], + // "parameters": { + // "sinkName": { + // "description": "Required. The resource name of the sink: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", + // "location": "path", + // "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$", + // "required": true, + // "type": "string" + // } // }, + // "path": "v2/{+sinkName}", // "response": { - // "$ref": "Operation" + // "$ref": "LogSink" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.entries.list": +// method id "logging.billingAccounts.sinks.list": -type EntriesListCall struct { - s *Service - listlogentriesrequest *ListLogEntriesRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type BillingAccountsSinksListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// List: Lists log entries. Use this method to retrieve log entries that -// originated from a project/folder/organization/billing account. For -// ways to export log entries, see Exporting Logs -// (https://cloud.google.com/logging/docs/export). -func (r *EntriesService) List(listlogentriesrequest *ListLogEntriesRequest) *EntriesListCall { - c := &EntriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.listlogentriesrequest = listlogentriesrequest +// List: Lists sinks. +// +// - parent: The parent resource whose sinks are to be listed: +// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]". +func (r *BillingAccountsSinksService) List(parent string) *BillingAccountsSinksListCall { + c := &BillingAccountsSinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request. Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *BillingAccountsSinksListCall) PageSize(pageSize int64) *BillingAccountsSinksListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *BillingAccountsSinksListCall) PageToken(pageToken string) *BillingAccountsSinksListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EntriesListCall) Fields(s ...googleapi.Field) *EntriesListCall { +func (c *BillingAccountsSinksListCall) Fields(s ...googleapi.Field) *BillingAccountsSinksListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BillingAccountsSinksListCall) IfNoneMatch(entityTag string) *BillingAccountsSinksListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EntriesListCall) Context(ctx context.Context) *EntriesListCall { +func (c *BillingAccountsSinksListCall) Context(ctx context.Context) *BillingAccountsSinksListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EntriesListCall) Header() http.Header { +func (c *BillingAccountsSinksListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EntriesListCall) doRequest(alt string) (*http.Response, error) { +func (c *BillingAccountsSinksListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.listlogentriesrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/entries:list") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.entries.list" call. -// Exactly one of *ListLogEntriesResponse or error will be non-nil. Any +// Do executes the "logging.billingAccounts.sinks.list" call. +// Exactly one of *ListSinksResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either -// *ListLogEntriesResponse.ServerResponse.Header or (if a response was +// *ListSinksResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *EntriesListCall) Do(opts ...googleapi.CallOption) (*ListLogEntriesResponse, error) { +func (c *BillingAccountsSinksListCall) Do(opts ...googleapi.CallOption) (*ListSinksResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -11197,7 +11678,7 @@ func (c *EntriesListCall) Do(opts ...googleapi.CallOption) (*ListLogEntriesRespo if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListLogEntriesResponse{ + ret := &ListSinksResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11209,18 +11690,36 @@ func (c *EntriesListCall) Do(opts ...googleapi.CallOption) (*ListLogEntriesRespo } return ret, nil // { - // "description": "Lists log entries. Use this method to retrieve log entries that originated from a project/folder/organization/billing account. For ways to export log entries, see Exporting Logs (https://cloud.google.com/logging/docs/export).", - // "flatPath": "v2/entries:list", - // "httpMethod": "POST", - // "id": "logging.entries.list", - // "parameterOrder": [], - // "parameters": {}, - // "path": "v2/entries:list", - // "request": { - // "$ref": "ListLogEntriesRequest" + // "description": "Lists sinks.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks", + // "httpMethod": "GET", + // "id": "logging.billingAccounts.sinks.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent resource whose sinks are to be listed: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ", + // "location": "path", + // "pattern": "^billingAccounts/[^/]+$", + // "required": true, + // "type": "string" + // } // }, + // "path": "v2/{+parent}/sinks", // "response": { - // "$ref": "ListLogEntriesResponse" + // "$ref": "ListSinksResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -11235,9 +11734,9 @@ func (c *EntriesListCall) Do(opts ...googleapi.CallOption) (*ListLogEntriesRespo // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *EntriesListCall) Pages(ctx context.Context, f func(*ListLogEntriesResponse) error) error { +func (c *BillingAccountsSinksListCall) Pages(ctx context.Context, f func(*ListSinksResponse) error) error { c.ctx_ = ctx - defer func(pt string) { c.listlogentriesrequest.PageToken = pt }(c.listlogentriesrequest.PageToken) // reset paging to original point + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { x, err := c.Do() if err != nil { @@ -11249,32 +11748,86 @@ func (c *EntriesListCall) Pages(ctx context.Context, f func(*ListLogEntriesRespo if x.NextPageToken == "" { return nil } - c.listlogentriesrequest.PageToken = x.NextPageToken + c.PageToken(x.NextPageToken) } } -// method id "logging.entries.tail": +// method id "logging.billingAccounts.sinks.patch": -type EntriesTailCall struct { - s *Service - taillogentriesrequest *TailLogEntriesRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type BillingAccountsSinksPatchCall struct { + s *Service + sinkNameid string + logsink *LogSink + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Tail: Streaming read of log entries as they are received. Until the -// stream is terminated, it will continue reading logs. -func (r *EntriesService) Tail(taillogentriesrequest *TailLogEntriesRequest) *EntriesTailCall { - c := &EntriesTailCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.taillogentriesrequest = taillogentriesrequest +// Patch: Updates a sink. This method replaces the following fields in +// the existing sink with values from the new sink: destination, and +// filter.The updated sink might also have a new writer_identity; see +// the unique_writer_identity field. +// +// - sinkName: The full resource name of the sink to update, including +// the parent resource and the sink identifier: +// "projects/[PROJECT_ID]/sinks/[SINK_ID]" +// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" +// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For +// example:"projects/my-project/sinks/my-sink". +func (r *BillingAccountsSinksService) Patch(sinkNameid string, logsink *LogSink) *BillingAccountsSinksPatchCall { + c := &BillingAccountsSinksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.sinkNameid = sinkNameid + c.logsink = logsink + return c +} + +// CustomWriterIdentity sets the optional parameter +// "customWriterIdentity": A service account provided by the caller that +// will be used to write the log entries. The format must be +// serviceAccount:some@email. This field can only be specified if you +// are routing logs to a destination outside this sink's project. If not +// specified, a Logging service account will automatically be generated. +func (c *BillingAccountsSinksPatchCall) CustomWriterIdentity(customWriterIdentity string) *BillingAccountsSinksPatchCall { + c.urlParams_.Set("customWriterIdentity", customWriterIdentity) + return c +} + +// UniqueWriterIdentity sets the optional parameter +// "uniqueWriterIdentity": See sinks.create for a description of this +// field. When updating a sink, the effect of this field on the value of +// writer_identity in the updated sink depends on both the old and new +// values of this field: If the old and new values of this field are +// both false or both true, then there is no change to the sink's +// writer_identity. If the old value is false and the new value is true, +// then writer_identity is changed to a service agent +// (https://cloud.google.com/iam/docs/service-account-types#service-agents) +// owned by Cloud Logging. It is an error if the old value is true and +// the new value is set to false or defaulted to false. +func (c *BillingAccountsSinksPatchCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *BillingAccountsSinksPatchCall { + c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity)) + return c +} + +// UpdateMask sets the optional parameter "updateMask": Field mask that +// specifies the fields in sink that need an update. A sink field will +// be overwritten if, and only if, it is in the update mask. name and +// output only fields cannot be updated.An empty updateMask is +// temporarily treated as using the following mask for backwards +// compatibility purposes:destination,filter,includeChildrenAt some +// point in the future, behavior will be removed and specifying an empty +// updateMask will be an error.For a detailed FieldMask definition, see +// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor +// example: updateMask=filter +func (c *BillingAccountsSinksPatchCall) UpdateMask(updateMask string) *BillingAccountsSinksPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EntriesTailCall) Fields(s ...googleapi.Field) *EntriesTailCall { +func (c *BillingAccountsSinksPatchCall) Fields(s ...googleapi.Field) *BillingAccountsSinksPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -11282,21 +11835,21 @@ func (c *EntriesTailCall) Fields(s ...googleapi.Field) *EntriesTailCall { // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EntriesTailCall) Context(ctx context.Context) *EntriesTailCall { +func (c *BillingAccountsSinksPatchCall) Context(ctx context.Context) *BillingAccountsSinksPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EntriesTailCall) Header() http.Header { +func (c *BillingAccountsSinksPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EntriesTailCall) doRequest(alt string) (*http.Response, error) { +func (c *BillingAccountsSinksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -11304,31 +11857,34 @@ func (c *EntriesTailCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.taillogentriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/entries:tail") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "sinkName": c.sinkNameid, + }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.entries.tail" call. -// Exactly one of *TailLogEntriesResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *TailLogEntriesResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *EntriesTailCall) Do(opts ...googleapi.CallOption) (*TailLogEntriesResponse, error) { +// Do executes the "logging.billingAccounts.sinks.patch" call. +// Exactly one of *LogSink or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogSink.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BillingAccountsSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -11347,7 +11903,7 @@ func (c *EntriesTailCall) Do(opts ...googleapi.CallOption) (*TailLogEntriesRespo if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &TailLogEntriesResponse{ + ret := &LogSink{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11359,78 +11915,151 @@ func (c *EntriesTailCall) Do(opts ...googleapi.CallOption) (*TailLogEntriesRespo } return ret, nil // { - // "description": "Streaming read of log entries as they are received. Until the stream is terminated, it will continue reading logs.", - // "flatPath": "v2/entries:tail", - // "httpMethod": "POST", - // "id": "logging.entries.tail", - // "parameterOrder": [], - // "parameters": {}, - // "path": "v2/entries:tail", + // "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}", + // "httpMethod": "PATCH", + // "id": "logging.billingAccounts.sinks.patch", + // "parameterOrder": [ + // "sinkName" + // ], + // "parameters": { + // "customWriterIdentity": { + // "description": "Optional. A service account provided by the caller that will be used to write the log entries. The format must be serviceAccount:some@email. This field can only be specified if you are routing logs to a destination outside this sink's project. If not specified, a Logging service account will automatically be generated.", + // "location": "query", + // "type": "string" + // }, + // "sinkName": { + // "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", + // "location": "path", + // "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "uniqueWriterIdentity": { + // "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a service agent (https://cloud.google.com/iam/docs/service-account-types#service-agents) owned by Cloud Logging. It is an error if the old value is true and the new value is set to false or defaulted to false.", + // "location": "query", + // "type": "boolean" + // }, + // "updateMask": { + // "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes:destination,filter,includeChildrenAt some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v2/{+sinkName}", // "request": { - // "$ref": "TailLogEntriesRequest" + // "$ref": "LogSink" // }, // "response": { - // "$ref": "TailLogEntriesResponse" + // "$ref": "LogSink" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// method id "logging.entries.write": - -type EntriesWriteCall struct { - s *Service - writelogentriesrequest *WriteLogEntriesRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} +// method id "logging.billingAccounts.sinks.update": -// Write: Writes log entries to Logging. This API method is the only way -// to send log entries to Logging. This method is used, directly or -// indirectly, by the Logging agent (fluentd) and all logging libraries -// configured to use Logging. A single request may contain log entries -// for a maximum of 1000 different resource names (projects, -// organizations, billing accounts or folders), where the resource name -// for a log entry is determined from its logName field. -func (r *EntriesService) Write(writelogentriesrequest *WriteLogEntriesRequest) *EntriesWriteCall { - c := &EntriesWriteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.writelogentriesrequest = writelogentriesrequest - return c +type BillingAccountsSinksUpdateCall struct { + s *Service + sinkNameid string + logsink *LogSink + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *EntriesWriteCall) Fields(s ...googleapi.Field) *EntriesWriteCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) +// Update: Updates a sink. This method replaces the following fields in +// the existing sink with values from the new sink: destination, and +// filter.The updated sink might also have a new writer_identity; see +// the unique_writer_identity field. +// +// - sinkName: The full resource name of the sink to update, including +// the parent resource and the sink identifier: +// "projects/[PROJECT_ID]/sinks/[SINK_ID]" +// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" +// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For +// example:"projects/my-project/sinks/my-sink". +func (r *BillingAccountsSinksService) Update(sinkNameid string, logsink *LogSink) *BillingAccountsSinksUpdateCall { + c := &BillingAccountsSinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.sinkNameid = sinkNameid + c.logsink = logsink return c } -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *EntriesWriteCall) Context(ctx context.Context) *EntriesWriteCall { +// CustomWriterIdentity sets the optional parameter +// "customWriterIdentity": A service account provided by the caller that +// will be used to write the log entries. The format must be +// serviceAccount:some@email. This field can only be specified if you +// are routing logs to a destination outside this sink's project. If not +// specified, a Logging service account will automatically be generated. +func (c *BillingAccountsSinksUpdateCall) CustomWriterIdentity(customWriterIdentity string) *BillingAccountsSinksUpdateCall { + c.urlParams_.Set("customWriterIdentity", customWriterIdentity) + return c +} + +// UniqueWriterIdentity sets the optional parameter +// "uniqueWriterIdentity": See sinks.create for a description of this +// field. When updating a sink, the effect of this field on the value of +// writer_identity in the updated sink depends on both the old and new +// values of this field: If the old and new values of this field are +// both false or both true, then there is no change to the sink's +// writer_identity. If the old value is false and the new value is true, +// then writer_identity is changed to a service agent +// (https://cloud.google.com/iam/docs/service-account-types#service-agents) +// owned by Cloud Logging. It is an error if the old value is true and +// the new value is set to false or defaulted to false. +func (c *BillingAccountsSinksUpdateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *BillingAccountsSinksUpdateCall { + c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity)) + return c +} + +// UpdateMask sets the optional parameter "updateMask": Field mask that +// specifies the fields in sink that need an update. A sink field will +// be overwritten if, and only if, it is in the update mask. name and +// output only fields cannot be updated.An empty updateMask is +// temporarily treated as using the following mask for backwards +// compatibility purposes:destination,filter,includeChildrenAt some +// point in the future, behavior will be removed and specifying an empty +// updateMask will be an error.For a detailed FieldMask definition, see +// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor +// example: updateMask=filter +func (c *BillingAccountsSinksUpdateCall) UpdateMask(updateMask string) *BillingAccountsSinksUpdateCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BillingAccountsSinksUpdateCall) Fields(s ...googleapi.Field) *BillingAccountsSinksUpdateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *BillingAccountsSinksUpdateCall) Context(ctx context.Context) *BillingAccountsSinksUpdateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EntriesWriteCall) Header() http.Header { +func (c *BillingAccountsSinksUpdateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EntriesWriteCall) doRequest(alt string) (*http.Response, error) { +func (c *BillingAccountsSinksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -11438,31 +12067,34 @@ func (c *EntriesWriteCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.writelogentriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/entries:write") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PUT", urls, body) if err != nil { return nil, err } req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "sinkName": c.sinkNameid, + }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.entries.write" call. -// Exactly one of *WriteLogEntriesResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *WriteLogEntriesResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *EntriesWriteCall) Do(opts ...googleapi.CallOption) (*WriteLogEntriesResponse, error) { +// Do executes the "logging.billingAccounts.sinks.update" call. +// Exactly one of *LogSink or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogSink.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BillingAccountsSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -11481,7 +12113,7 @@ func (c *EntriesWriteCall) Do(opts ...googleapi.CallOption) (*WriteLogEntriesRes if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &WriteLogEntriesResponse{ + ret := &LogSink{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11493,58 +12125,75 @@ func (c *EntriesWriteCall) Do(opts ...googleapi.CallOption) (*WriteLogEntriesRes } return ret, nil // { - // "description": "Writes log entries to Logging. This API method is the only way to send log entries to Logging. This method is used, directly or indirectly, by the Logging agent (fluentd) and all logging libraries configured to use Logging. A single request may contain log entries for a maximum of 1000 different resource names (projects, organizations, billing accounts or folders), where the resource name for a log entry is determined from its logName field.", - // "flatPath": "v2/entries:write", - // "httpMethod": "POST", - // "id": "logging.entries.write", - // "parameterOrder": [], - // "parameters": {}, - // "path": "v2/entries:write", + // "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field.", + // "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}", + // "httpMethod": "PUT", + // "id": "logging.billingAccounts.sinks.update", + // "parameterOrder": [ + // "sinkName" + // ], + // "parameters": { + // "customWriterIdentity": { + // "description": "Optional. A service account provided by the caller that will be used to write the log entries. The format must be serviceAccount:some@email. This field can only be specified if you are routing logs to a destination outside this sink's project. If not specified, a Logging service account will automatically be generated.", + // "location": "query", + // "type": "string" + // }, + // "sinkName": { + // "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", + // "location": "path", + // "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "uniqueWriterIdentity": { + // "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a service agent (https://cloud.google.com/iam/docs/service-account-types#service-agents) owned by Cloud Logging. It is an error if the old value is true and the new value is set to false or defaulted to false.", + // "location": "query", + // "type": "boolean" + // }, + // "updateMask": { + // "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes:destination,filter,includeChildrenAt some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v2/{+sinkName}", // "request": { - // "$ref": "WriteLogEntriesRequest" + // "$ref": "LogSink" // }, // "response": { - // "$ref": "WriteLogEntriesResponse" + // "$ref": "LogSink" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.write" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// method id "logging.exclusions.create": +// method id "logging.entries.copy": -type ExclusionsCreateCall struct { - s *Service - parent string - logexclusion *LogExclusion - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type EntriesCopyCall struct { + s *Service + copylogentriesrequest *CopyLogEntriesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates a new exclusion in the _Default sink in a specified -// parent resource. Only log entries belonging to that resource can be -// excluded. You can have up to 10 exclusions in a resource. -// -// - parent: The parent resource in which to create the exclusion: -// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For -// examples:"projects/my-logging-project" "organizations/123456789". -func (r *ExclusionsService) Create(parent string, logexclusion *LogExclusion) *ExclusionsCreateCall { - c := &ExclusionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.logexclusion = logexclusion +// Copy: Copies a set of log entries from a log bucket to a Cloud +// Storage bucket. +func (r *EntriesService) Copy(copylogentriesrequest *CopyLogEntriesRequest) *EntriesCopyCall { + c := &EntriesCopyCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.copylogentriesrequest = copylogentriesrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ExclusionsCreateCall) Fields(s ...googleapi.Field) *ExclusionsCreateCall { +func (c *EntriesCopyCall) Fields(s ...googleapi.Field) *EntriesCopyCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -11552,21 +12201,21 @@ func (c *ExclusionsCreateCall) Fields(s ...googleapi.Field) *ExclusionsCreateCal // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ExclusionsCreateCall) Context(ctx context.Context) *ExclusionsCreateCall { +func (c *EntriesCopyCall) Context(ctx context.Context) *EntriesCopyCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ExclusionsCreateCall) Header() http.Header { +func (c *EntriesCopyCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ExclusionsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *EntriesCopyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -11574,34 +12223,31 @@ func (c *ExclusionsCreateCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.copylogentriesrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/entries:copy") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, - }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.exclusions.create" call. -// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx +// Do executes the "logging.entries.copy" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either -// *LogExclusion.ServerResponse.Header or (if a response was returned at +// *Operation.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *ExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { +func (c *EntriesCopyCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -11620,7 +12266,7 @@ func (c *ExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogExclusion{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11632,28 +12278,18 @@ func (c *ExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, } return ret, nil // { - // "description": "Creates a new exclusion in the _Default sink in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.", - // "flatPath": "v2/{v2Id}/{v2Id1}/exclusions", + // "description": "Copies a set of log entries from a log bucket to a Cloud Storage bucket.", + // "flatPath": "v2/entries:copy", // "httpMethod": "POST", - // "id": "logging.exclusions.create", - // "parameterOrder": [ - // "parent" - // ], - // "parameters": { - // "parent": { - // "description": "Required. The parent resource in which to create the exclusion: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-logging-project\" \"organizations/123456789\"", - // "location": "path", - // "pattern": "^[^/]+/[^/]+$", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v2/{+parent}/exclusions", + // "id": "logging.entries.copy", + // "parameterOrder": [], + // "parameters": {}, + // "path": "v2/entries:copy", // "request": { - // "$ref": "LogExclusion" + // "$ref": "CopyLogEntriesRequest" // }, // "response": { - // "$ref": "LogExclusion" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -11663,34 +12299,30 @@ func (c *ExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, } -// method id "logging.exclusions.delete": +// method id "logging.entries.list": -type ExclusionsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type EntriesListCall struct { + s *Service + listlogentriesrequest *ListLogEntriesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes an exclusion in the _Default sink. -// -// - name: The resource name of an existing exclusion to delete: -// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" -// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" -// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For -// example:"projects/my-project/exclusions/my-exclusion". -func (r *ExclusionsService) Delete(name string) *ExclusionsDeleteCall { - c := &ExclusionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// List: Lists log entries. Use this method to retrieve log entries that +// originated from a project/folder/organization/billing account. For +// ways to export log entries, see Exporting Logs +// (https://cloud.google.com/logging/docs/export). +func (r *EntriesService) List(listlogentriesrequest *ListLogEntriesRequest) *EntriesListCall { + c := &EntriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.listlogentriesrequest = listlogentriesrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ExclusionsDeleteCall) Fields(s ...googleapi.Field) *ExclusionsDeleteCall { +func (c *EntriesListCall) Fields(s ...googleapi.Field) *EntriesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -11698,21 +12330,21 @@ func (c *ExclusionsDeleteCall) Fields(s ...googleapi.Field) *ExclusionsDeleteCal // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ExclusionsDeleteCall) Context(ctx context.Context) *ExclusionsDeleteCall { +func (c *EntriesListCall) Context(ctx context.Context) *EntriesListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ExclusionsDeleteCall) Header() http.Header { +func (c *EntriesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *EntriesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -11720,29 +12352,31 @@ func (c *ExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.listlogentriesrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/entries:list") 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, - }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.exclusions.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *ExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "logging.entries.list" call. +// Exactly one of *ListLogEntriesResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListLogEntriesResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EntriesListCall) Do(opts ...googleapi.CallOption) (*ListLogEntriesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -11761,7 +12395,7 @@ func (c *ExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &ListLogEntriesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11773,128 +12407,126 @@ func (c *ExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) } return ret, nil // { - // "description": "Deletes an exclusion in the _Default sink.", - // "flatPath": "v2/{v2Id}/{v2Id1}/exclusions/{exclusionsId}", - // "httpMethod": "DELETE", - // "id": "logging.exclusions.delete", - // "parameterOrder": [ - // "name" - // ], - // "parameters": { - // "name": { - // "description": "Required. The resource name of an existing exclusion to delete: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", - // "location": "path", - // "pattern": "^[^/]+/[^/]+/exclusions/[^/]+$", - // "required": true, - // "type": "string" - // } + // "description": "Lists log entries. Use this method to retrieve log entries that originated from a project/folder/organization/billing account. For ways to export log entries, see Exporting Logs (https://cloud.google.com/logging/docs/export).", + // "flatPath": "v2/entries:list", + // "httpMethod": "POST", + // "id": "logging.entries.list", + // "parameterOrder": [], + // "parameters": {}, + // "path": "v2/entries:list", + // "request": { + // "$ref": "ListLogEntriesRequest" // }, - // "path": "v2/{+name}", // "response": { - // "$ref": "Empty" + // "$ref": "ListLogEntriesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.exclusions.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 *EntriesListCall) Pages(ctx context.Context, f func(*ListLogEntriesResponse) error) error { + c.ctx_ = ctx + defer func(pt string) { c.listlogentriesrequest.PageToken = pt }(c.listlogentriesrequest.PageToken) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.listlogentriesrequest.PageToken = x.NextPageToken + } +} -type ExclusionsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// method id "logging.entries.tail": + +type EntriesTailCall struct { + s *Service + taillogentriesrequest *TailLogEntriesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets the description of an exclusion in the _Default sink. -// -// - name: The resource name of an existing exclusion: -// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" -// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" -// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For -// example:"projects/my-project/exclusions/my-exclusion". -func (r *ExclusionsService) Get(name string) *ExclusionsGetCall { - c := &ExclusionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// Tail: Streaming read of log entries as they are received. Until the +// stream is terminated, it will continue reading logs. +func (r *EntriesService) Tail(taillogentriesrequest *TailLogEntriesRequest) *EntriesTailCall { + c := &EntriesTailCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.taillogentriesrequest = taillogentriesrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ExclusionsGetCall) Fields(s ...googleapi.Field) *ExclusionsGetCall { +func (c *EntriesTailCall) Fields(s ...googleapi.Field) *EntriesTailCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ExclusionsGetCall) IfNoneMatch(entityTag string) *ExclusionsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ExclusionsGetCall) Context(ctx context.Context) *ExclusionsGetCall { +func (c *EntriesTailCall) Context(ctx context.Context) *EntriesTailCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ExclusionsGetCall) Header() http.Header { +func (c *EntriesTailCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ExclusionsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *EntriesTailCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.taillogentriesrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/entries:tail") 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, - }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.exclusions.get" call. -// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *LogExclusion.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *ExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { +// Do executes the "logging.entries.tail" call. +// Exactly one of *TailLogEntriesResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TailLogEntriesResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EntriesTailCall) Do(opts ...googleapi.CallOption) (*TailLogEntriesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -11913,7 +12545,7 @@ func (c *ExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, err if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogExclusion{ + ret := &TailLogEntriesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11925,25 +12557,18 @@ func (c *ExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, err } return ret, nil // { - // "description": "Gets the description of an exclusion in the _Default sink.", - // "flatPath": "v2/{v2Id}/{v2Id1}/exclusions/{exclusionsId}", - // "httpMethod": "GET", - // "id": "logging.exclusions.get", - // "parameterOrder": [ - // "name" - // ], - // "parameters": { - // "name": { - // "description": "Required. The resource name of an existing exclusion: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", - // "location": "path", - // "pattern": "^[^/]+/[^/]+/exclusions/[^/]+$", - // "required": true, - // "type": "string" - // } + // "description": "Streaming read of log entries as they are received. Until the stream is terminated, it will continue reading logs.", + // "flatPath": "v2/entries:tail", + // "httpMethod": "POST", + // "id": "logging.entries.tail", + // "parameterOrder": [], + // "parameters": {}, + // "path": "v2/entries:tail", + // "request": { + // "$ref": "TailLogEntriesRequest" // }, - // "path": "v2/{+name}", // "response": { - // "$ref": "LogExclusion" + // "$ref": "TailLogEntriesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -11955,117 +12580,87 @@ func (c *ExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, err } -// method id "logging.exclusions.list": - -type ExclusionsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// List: Lists all the exclusions on the _Default sink in a parent -// resource. -// -// - parent: The parent resource whose exclusions are to be listed. -// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]". -func (r *ExclusionsService) List(parent string) *ExclusionsListCall { - c := &ExclusionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} +// method id "logging.entries.write": -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return from this request. Non-positive values are -// ignored. The presence of nextPageToken in the response indicates that -// more results might be available. -func (c *ExclusionsListCall) PageSize(pageSize int64) *ExclusionsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c +type EntriesWriteCall struct { + s *Service + writelogentriesrequest *WriteLogEntriesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// PageToken sets the optional parameter "pageToken": If present, then -// retrieve the next batch of results from the preceding call to this -// method. pageToken must be the value of nextPageToken from the -// previous response. The values of other method parameters should be -// identical to those in the previous call. -func (c *ExclusionsListCall) PageToken(pageToken string) *ExclusionsListCall { - c.urlParams_.Set("pageToken", pageToken) +// Write: Writes log entries to Logging. This API method is the only way +// to send log entries to Logging. This method is used, directly or +// indirectly, by the Logging agent (fluentd) and all logging libraries +// configured to use Logging. A single request may contain log entries +// for a maximum of 1000 different resource names (projects, +// organizations, billing accounts or folders), where the resource name +// for a log entry is determined from its logName field. +func (r *EntriesService) Write(writelogentriesrequest *WriteLogEntriesRequest) *EntriesWriteCall { + c := &EntriesWriteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.writelogentriesrequest = writelogentriesrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ExclusionsListCall) Fields(s ...googleapi.Field) *ExclusionsListCall { +func (c *EntriesWriteCall) Fields(s ...googleapi.Field) *EntriesWriteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ExclusionsListCall) IfNoneMatch(entityTag string) *ExclusionsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ExclusionsListCall) Context(ctx context.Context) *ExclusionsListCall { +func (c *EntriesWriteCall) Context(ctx context.Context) *EntriesWriteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ExclusionsListCall) Header() http.Header { +func (c *EntriesWriteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ExclusionsListCall) doRequest(alt string) (*http.Response, error) { +func (c *EntriesWriteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.writelogentriesrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/entries:write") 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, - }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.exclusions.list" call. -// Exactly one of *ListExclusionsResponse or error will be non-nil. Any +// Do executes the "logging.entries.write" call. +// Exactly one of *WriteLogEntriesResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either -// *ListExclusionsResponse.ServerResponse.Header or (if a response was +// *WriteLogEntriesResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsResponse, error) { +func (c *EntriesWriteCall) Do(opts ...googleapi.CallOption) (*WriteLogEntriesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12084,7 +12679,7 @@ func (c *ExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsRe if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListExclusionsResponse{ + ret := &WriteLogEntriesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12096,111 +12691,58 @@ func (c *ExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsRe } return ret, nil // { - // "description": "Lists all the exclusions on the _Default sink in a parent resource.", - // "flatPath": "v2/{v2Id}/{v2Id1}/exclusions", - // "httpMethod": "GET", - // "id": "logging.exclusions.list", - // "parameterOrder": [ - // "parent" - // ], - // "parameters": { - // "pageSize": { - // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The parent resource whose exclusions are to be listed. \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ", - // "location": "path", - // "pattern": "^[^/]+/[^/]+$", - // "required": true, - // "type": "string" - // } + // "description": "Writes log entries to Logging. This API method is the only way to send log entries to Logging. This method is used, directly or indirectly, by the Logging agent (fluentd) and all logging libraries configured to use Logging. A single request may contain log entries for a maximum of 1000 different resource names (projects, organizations, billing accounts or folders), where the resource name for a log entry is determined from its logName field.", + // "flatPath": "v2/entries:write", + // "httpMethod": "POST", + // "id": "logging.entries.write", + // "parameterOrder": [], + // "parameters": {}, + // "path": "v2/entries:write", + // "request": { + // "$ref": "WriteLogEntriesRequest" // }, - // "path": "v2/{+parent}/exclusions", // "response": { - // "$ref": "ListExclusionsResponse" + // "$ref": "WriteLogEntriesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.write" // ] // } } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ExclusionsListCall) Pages(ctx context.Context, f func(*ListExclusionsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "logging.exclusions.patch": +// method id "logging.exclusions.create": -type ExclusionsPatchCall struct { +type ExclusionsCreateCall struct { s *Service - name string + parent string logexclusion *LogExclusion urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Patch: Changes one or more properties of an existing exclusion in the -// _Default sink. +// Create: Creates a new exclusion in the _Default sink in a specified +// parent resource. Only log entries belonging to that resource can be +// excluded. You can have up to 10 exclusions in a resource. // -// - name: The resource name of the exclusion to update: -// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" -// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" -// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For -// example:"projects/my-project/exclusions/my-exclusion". -func (r *ExclusionsService) Patch(name string, logexclusion *LogExclusion) *ExclusionsPatchCall { - c := &ExclusionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: The parent resource in which to create the exclusion: +// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For +// examples:"projects/my-logging-project" "organizations/123456789". +func (r *ExclusionsService) Create(parent string, logexclusion *LogExclusion) *ExclusionsCreateCall { + c := &ExclusionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent c.logexclusion = logexclusion return c } -// UpdateMask sets the optional parameter "updateMask": Required. A -// non-empty list of fields to change in the existing exclusion. New -// values for the fields are taken from the corresponding fields in the -// LogExclusion included in this request. Fields not mentioned in -// update_mask are not changed and are ignored in the request.For -// example, to change the filter and description of an exclusion, -// specify an update_mask of "filter,description". -func (c *ExclusionsPatchCall) UpdateMask(updateMask string) *ExclusionsPatchCall { - c.urlParams_.Set("updateMask", updateMask) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ExclusionsPatchCall) Fields(s ...googleapi.Field) *ExclusionsPatchCall { +func (c *ExclusionsCreateCall) Fields(s ...googleapi.Field) *ExclusionsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -12208,21 +12750,21 @@ func (c *ExclusionsPatchCall) Fields(s ...googleapi.Field) *ExclusionsPatchCall // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ExclusionsPatchCall) Context(ctx context.Context) *ExclusionsPatchCall { +func (c *ExclusionsCreateCall) Context(ctx context.Context) *ExclusionsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ExclusionsPatchCall) Header() http.Header { +func (c *ExclusionsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ExclusionsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *ExclusionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -12237,27 +12779,27 @@ func (c *ExclusionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.exclusions.patch" call. +// Do executes the "logging.exclusions.create" call. // Exactly one of *LogExclusion or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *LogExclusion.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *ExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { +func (c *ExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12288,29 +12830,23 @@ func (c *ExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclusion, e } return ret, nil // { - // "description": "Changes one or more properties of an existing exclusion in the _Default sink.", - // "flatPath": "v2/{v2Id}/{v2Id1}/exclusions/{exclusionsId}", - // "httpMethod": "PATCH", - // "id": "logging.exclusions.patch", + // "description": "Creates a new exclusion in the _Default sink in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.", + // "flatPath": "v2/{v2Id}/{v2Id1}/exclusions", + // "httpMethod": "POST", + // "id": "logging.exclusions.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The resource name of the exclusion to update: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", + // "parent": { + // "description": "Required. The parent resource in which to create the exclusion: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-logging-project\" \"organizations/123456789\"", // "location": "path", - // "pattern": "^[^/]+/[^/]+/exclusions/[^/]+$", + // "pattern": "^[^/]+/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "Required. A non-empty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of \"filter,description\".", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+parent}/exclusions", // "request": { // "$ref": "LogExclusion" // }, @@ -12325,38 +12861,26 @@ func (c *ExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclusion, e } -// method id "logging.folders.getCmekSettings": +// method id "logging.exclusions.delete": -type FoldersGetCmekSettingsCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ExclusionsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// GetCmekSettings: Gets the Logging CMEK settings for the given -// resource.Note: CMEK for the Log Router can be configured for Google -// Cloud projects, folders, organizations and billing accounts. Once -// configured for an organization, it applies to all projects and -// folders in the Google Cloud organization.See Enabling CMEK for Log -// Router -// (https://cloud.google.com/logging/docs/routing/managed-encryption) -// for more information. +// Delete: Deletes an exclusion in the _Default sink. // -// - name: The resource for which to retrieve CMEK settings. -// "projects/[PROJECT_ID]/cmekSettings" -// "organizations/[ORGANIZATION_ID]/cmekSettings" -// "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" -// "folders/[FOLDER_ID]/cmekSettings" For -// example:"organizations/12345/cmekSettings"Note: CMEK for the Log -// Router can be configured for Google Cloud projects, folders, -// organizations and billing accounts. Once configured for an -// organization, it applies to all projects and folders in the Google -// Cloud organization. -func (r *FoldersService) GetCmekSettings(name string) *FoldersGetCmekSettingsCall { - c := &FoldersGetCmekSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of an existing exclusion to delete: +// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" +// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" +// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For +// example:"projects/my-project/exclusions/my-exclusion". +func (r *ExclusionsService) Delete(name string) *ExclusionsDeleteCall { + c := &ExclusionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -12364,54 +12888,41 @@ func (r *FoldersService) GetCmekSettings(name string) *FoldersGetCmekSettingsCal // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersGetCmekSettingsCall) Fields(s ...googleapi.Field) *FoldersGetCmekSettingsCall { +func (c *ExclusionsDeleteCall) Fields(s ...googleapi.Field) *ExclusionsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *FoldersGetCmekSettingsCall) IfNoneMatch(entityTag string) *FoldersGetCmekSettingsCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersGetCmekSettingsCall) Context(ctx context.Context) *FoldersGetCmekSettingsCall { +func (c *ExclusionsDeleteCall) Context(ctx context.Context) *ExclusionsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersGetCmekSettingsCall) Header() http.Header { +func (c *ExclusionsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersGetCmekSettingsCall) doRequest(alt string) (*http.Response, error) { +func (c *ExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/cmekSettings") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -12422,14 +12933,14 @@ func (c *FoldersGetCmekSettingsCall) doRequest(alt string) (*http.Response, erro return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.getCmekSettings" call. -// Exactly one of *CmekSettings or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *CmekSettings.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *FoldersGetCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSettings, error) { +// Do executes the "logging.exclusions.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12448,7 +12959,7 @@ func (c *FoldersGetCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSett if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &CmekSettings{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12460,39 +12971,37 @@ func (c *FoldersGetCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSett } return ret, nil // { - // "description": "Gets the Logging CMEK settings for the given resource.Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", - // "flatPath": "v2/folders/{foldersId}/cmekSettings", - // "httpMethod": "GET", - // "id": "logging.folders.getCmekSettings", + // "description": "Deletes an exclusion in the _Default sink.", + // "flatPath": "v2/{v2Id}/{v2Id1}/exclusions/{exclusionsId}", + // "httpMethod": "DELETE", + // "id": "logging.exclusions.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource for which to retrieve CMEK settings. \"projects/[PROJECT_ID]/cmekSettings\" \"organizations/[ORGANIZATION_ID]/cmekSettings\" \"billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings\" \"folders/[FOLDER_ID]/cmekSettings\" For example:\"organizations/12345/cmekSettings\"Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.", + // "description": "Required. The resource name of an existing exclusion to delete: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", // "location": "path", - // "pattern": "^folders/[^/]+$", + // "pattern": "^[^/]+/[^/]+/exclusions/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}/cmekSettings", + // "path": "v2/{+name}", // "response": { - // "$ref": "CmekSettings" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// method id "logging.folders.getSettings": +// method id "logging.exclusions.get": -type FoldersGetSettingsCall struct { +type ExclusionsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -12501,28 +13010,16 @@ type FoldersGetSettingsCall struct { header_ http.Header } -// GetSettings: Gets the Log Router settings for the given -// resource.Note: Settings for the Log Router can be get for Google -// Cloud projects, folders, organizations and billing accounts. -// Currently it can only be configured for organizations. Once -// configured for an organization, it applies to all projects and -// folders in the Google Cloud organization.See Enabling CMEK for Log -// Router -// (https://cloud.google.com/logging/docs/routing/managed-encryption) -// for more information. +// Get: Gets the description of an exclusion in the _Default sink. // -// - name: The resource for which to retrieve settings. -// "projects/[PROJECT_ID]/settings" -// "organizations/[ORGANIZATION_ID]/settings" -// "billingAccounts/[BILLING_ACCOUNT_ID]/settings" -// "folders/[FOLDER_ID]/settings" For -// example:"organizations/12345/settings"Note: Settings for the Log -// Router can be get for Google Cloud projects, folders, organizations -// and billing accounts. Currently it can only be configured for -// organizations. Once configured for an organization, it applies to -// all projects and folders in the Google Cloud organization. -func (r *FoldersService) GetSettings(name string) *FoldersGetSettingsCall { - c := &FoldersGetSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of an existing exclusion: +// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" +// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" +// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For +// example:"projects/my-project/exclusions/my-exclusion". +func (r *ExclusionsService) Get(name string) *ExclusionsGetCall { + c := &ExclusionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -12530,7 +13027,7 @@ func (r *FoldersService) GetSettings(name string) *FoldersGetSettingsCall { // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersGetSettingsCall) Fields(s ...googleapi.Field) *FoldersGetSettingsCall { +func (c *ExclusionsGetCall) Fields(s ...googleapi.Field) *ExclusionsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -12540,7 +13037,7 @@ func (c *FoldersGetSettingsCall) Fields(s ...googleapi.Field) *FoldersGetSetting // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *FoldersGetSettingsCall) IfNoneMatch(entityTag string) *FoldersGetSettingsCall { +func (c *ExclusionsGetCall) IfNoneMatch(entityTag string) *ExclusionsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -12548,21 +13045,21 @@ func (c *FoldersGetSettingsCall) IfNoneMatch(entityTag string) *FoldersGetSettin // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersGetSettingsCall) Context(ctx context.Context) *FoldersGetSettingsCall { +func (c *ExclusionsGetCall) Context(ctx context.Context) *ExclusionsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersGetSettingsCall) Header() http.Header { +func (c *ExclusionsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersGetSettingsCall) doRequest(alt string) (*http.Response, error) { +func (c *ExclusionsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -12575,7 +13072,7 @@ func (c *FoldersGetSettingsCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/settings") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -12588,14 +13085,14 @@ func (c *FoldersGetSettingsCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.getSettings" call. -// Exactly one of *Settings or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Settings.ServerResponse.Header or (if a response was returned at +// Do executes the "logging.exclusions.get" call. +// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LogExclusion.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *FoldersGetSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, error) { +func (c *ExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12614,7 +13111,7 @@ func (c *FoldersGetSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, er if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Settings{ + ret := &LogExclusion{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12626,25 +13123,25 @@ func (c *FoldersGetSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, er } return ret, nil // { - // "description": "Gets the Log Router settings for the given resource.Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", - // "flatPath": "v2/folders/{foldersId}/settings", + // "description": "Gets the description of an exclusion in the _Default sink.", + // "flatPath": "v2/{v2Id}/{v2Id1}/exclusions/{exclusionsId}", // "httpMethod": "GET", - // "id": "logging.folders.getSettings", + // "id": "logging.exclusions.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource for which to retrieve settings. \"projects/[PROJECT_ID]/settings\" \"organizations/[ORGANIZATION_ID]/settings\" \"billingAccounts/[BILLING_ACCOUNT_ID]/settings\" \"folders/[FOLDER_ID]/settings\" For example:\"organizations/12345/settings\"Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.", + // "description": "Required. The resource name of an existing exclusion: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", // "location": "path", - // "pattern": "^folders/[^/]+$", + // "pattern": "^[^/]+/[^/]+/exclusions/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}/settings", + // "path": "v2/{+name}", // "response": { - // "$ref": "Settings" + // "$ref": "LogExclusion" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -12656,114 +13153,117 @@ func (c *FoldersGetSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, er } -// method id "logging.folders.updateSettings": +// method id "logging.exclusions.list": -type FoldersUpdateSettingsCall struct { - s *Service - name string - settings *Settings - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ExclusionsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// UpdateSettings: Updates the Log Router settings for the given -// resource.Note: Settings for the Log Router can currently only be -// configured for Google Cloud organizations. Once configured, it -// applies to all projects and folders in the Google Cloud -// organization.UpdateSettings will fail if 1) kms_key_name is invalid, -// or 2) the associated service account does not have the required -// roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, -// or 3) access to the key is disabled. 4) location_id is not supported -// by Logging. 5) location_id violate OrgPolicy.See Enabling CMEK for -// Log Router -// (https://cloud.google.com/logging/docs/routing/managed-encryption) -// for more information. +// List: Lists all the exclusions on the _Default sink in a parent +// resource. // -// - name: The resource name for the settings to update. -// "organizations/[ORGANIZATION_ID]/settings" For -// example:"organizations/12345/settings"Note: Settings for the Log -// Router can currently only be configured for Google Cloud -// organizations. Once configured, it applies to all projects and -// folders in the Google Cloud organization. -func (r *FoldersService) UpdateSettings(name string, settings *Settings) *FoldersUpdateSettingsCall { - c := &FoldersUpdateSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.settings = settings +// - parent: The parent resource whose exclusions are to be listed. +// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]". +func (r *ExclusionsService) List(parent string) *ExclusionsListCall { + c := &ExclusionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent return c } -// UpdateMask sets the optional parameter "updateMask": Field mask -// identifying which fields from settings should be updated. A field -// will be overwritten if and only if it is in the update mask. Output -// only fields cannot be updated.See FieldMask for more information.For -// example: "updateMask=kmsKeyName" -func (c *FoldersUpdateSettingsCall) UpdateMask(updateMask string) *FoldersUpdateSettingsCall { - c.urlParams_.Set("updateMask", updateMask) +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request. Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *ExclusionsListCall) PageSize(pageSize int64) *ExclusionsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *ExclusionsListCall) PageToken(pageToken string) *ExclusionsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersUpdateSettingsCall) Fields(s ...googleapi.Field) *FoldersUpdateSettingsCall { +func (c *ExclusionsListCall) Fields(s ...googleapi.Field) *ExclusionsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ExclusionsListCall) IfNoneMatch(entityTag string) *ExclusionsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersUpdateSettingsCall) Context(ctx context.Context) *FoldersUpdateSettingsCall { +func (c *ExclusionsListCall) Context(ctx context.Context) *ExclusionsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersUpdateSettingsCall) Header() http.Header { +func (c *ExclusionsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersUpdateSettingsCall) doRequest(alt string) (*http.Response, error) { +func (c *ExclusionsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.settings) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/settings") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.updateSettings" call. -// Exactly one of *Settings or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Settings.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *FoldersUpdateSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, error) { +// Do executes the "logging.exclusions.list" call. +// Exactly one of *ListExclusionsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListExclusionsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12782,7 +13282,7 @@ func (c *FoldersUpdateSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Settings{ + ret := &ListExclusionsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12794,73 +13294,111 @@ func (c *FoldersUpdateSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, } return ret, nil // { - // "description": "Updates the Log Router settings for the given resource.Note: Settings for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.UpdateSettings will fail if 1) kms_key_name is invalid, or 2) the associated service account does not have the required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, or 3) access to the key is disabled. 4) location_id is not supported by Logging. 5) location_id violate OrgPolicy.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", - // "flatPath": "v2/folders/{foldersId}/settings", - // "httpMethod": "PATCH", - // "id": "logging.folders.updateSettings", + // "description": "Lists all the exclusions on the _Default sink in a parent resource.", + // "flatPath": "v2/{v2Id}/{v2Id1}/exclusions", + // "httpMethod": "GET", + // "id": "logging.exclusions.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The resource name for the settings to update. \"organizations/[ORGANIZATION_ID]/settings\" For example:\"organizations/12345/settings\"Note: Settings for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.", - // "location": "path", - // "pattern": "^folders/[^/]+$", - // "required": true, - // "type": "string" + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "format": "int32", + // "location": "query", + // "type": "integer" // }, - // "updateMask": { - // "description": "Optional. Field mask identifying which fields from settings should be updated. A field will be overwritten if and only if it is in the update mask. Output only fields cannot be updated.See FieldMask for more information.For example: \"updateMask=kmsKeyName\"", - // "format": "google-fieldmask", + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", // "location": "query", // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent resource whose exclusions are to be listed. \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ", + // "location": "path", + // "pattern": "^[^/]+/[^/]+$", + // "required": true, + // "type": "string" // } // }, - // "path": "v2/{+name}/settings", - // "request": { - // "$ref": "Settings" - // }, + // "path": "v2/{+parent}/exclusions", // "response": { - // "$ref": "Settings" + // "$ref": "ListExclusionsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.folders.exclusions.create": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ExclusionsListCall) Pages(ctx context.Context, f func(*ListExclusionsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type FoldersExclusionsCreateCall struct { +// method id "logging.exclusions.patch": + +type ExclusionsPatchCall struct { s *Service - parent string + name string logexclusion *LogExclusion urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Create: Creates a new exclusion in the _Default sink in a specified -// parent resource. Only log entries belonging to that resource can be -// excluded. You can have up to 10 exclusions in a resource. +// Patch: Changes one or more properties of an existing exclusion in the +// _Default sink. // -// - parent: The parent resource in which to create the exclusion: -// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For -// examples:"projects/my-logging-project" "organizations/123456789". -func (r *FoldersExclusionsService) Create(parent string, logexclusion *LogExclusion) *FoldersExclusionsCreateCall { - c := &FoldersExclusionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent +// - name: The resource name of the exclusion to update: +// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" +// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" +// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For +// example:"projects/my-project/exclusions/my-exclusion". +func (r *ExclusionsService) Patch(name string, logexclusion *LogExclusion) *ExclusionsPatchCall { + c := &ExclusionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name c.logexclusion = logexclusion return c } +// UpdateMask sets the optional parameter "updateMask": Required. A +// non-empty list of fields to change in the existing exclusion. New +// values for the fields are taken from the corresponding fields in the +// LogExclusion included in this request. Fields not mentioned in +// update_mask are not changed and are ignored in the request.For +// example, to change the filter and description of an exclusion, +// specify an update_mask of "filter,description". +func (c *ExclusionsPatchCall) UpdateMask(updateMask string) *ExclusionsPatchCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersExclusionsCreateCall) Fields(s ...googleapi.Field) *FoldersExclusionsCreateCall { +func (c *ExclusionsPatchCall) Fields(s ...googleapi.Field) *ExclusionsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -12868,21 +13406,21 @@ func (c *FoldersExclusionsCreateCall) Fields(s ...googleapi.Field) *FoldersExclu // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersExclusionsCreateCall) Context(ctx context.Context) *FoldersExclusionsCreateCall { +func (c *ExclusionsPatchCall) Context(ctx context.Context) *ExclusionsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersExclusionsCreateCall) Header() http.Header { +func (c *ExclusionsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersExclusionsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *ExclusionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -12897,27 +13435,27 @@ func (c *FoldersExclusionsCreateCall) doRequest(alt string) (*http.Response, err reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.exclusions.create" call. +// Do executes the "logging.exclusions.patch" call. // Exactly one of *LogExclusion or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *LogExclusion.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *FoldersExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { +func (c *ExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12948,23 +13486,29 @@ func (c *FoldersExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExcl } return ret, nil // { - // "description": "Creates a new exclusion in the _Default sink in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.", - // "flatPath": "v2/folders/{foldersId}/exclusions", - // "httpMethod": "POST", - // "id": "logging.folders.exclusions.create", + // "description": "Changes one or more properties of an existing exclusion in the _Default sink.", + // "flatPath": "v2/{v2Id}/{v2Id1}/exclusions/{exclusionsId}", + // "httpMethod": "PATCH", + // "id": "logging.exclusions.patch", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. The parent resource in which to create the exclusion: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-logging-project\" \"organizations/123456789\"", + // "name": { + // "description": "Required. The resource name of the exclusion to update: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", // "location": "path", - // "pattern": "^folders/[^/]+$", + // "pattern": "^[^/]+/[^/]+/exclusions/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "Required. A non-empty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of \"filter,description\".", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+parent}/exclusions", + // "path": "v2/{+name}", // "request": { // "$ref": "LogExclusion" // }, @@ -12979,26 +13523,38 @@ func (c *FoldersExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExcl } -// method id "logging.folders.exclusions.delete": +// method id "logging.folders.getCmekSettings": -type FoldersExclusionsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersGetCmekSettingsCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes an exclusion in the _Default sink. +// GetCmekSettings: Gets the Logging CMEK settings for the given +// resource.Note: CMEK for the Log Router can be configured for Google +// Cloud projects, folders, organizations and billing accounts. Once +// configured for an organization, it applies to all projects and +// folders in the Google Cloud organization.See Enabling CMEK for Log +// Router +// (https://cloud.google.com/logging/docs/routing/managed-encryption) +// for more information. // -// - name: The resource name of an existing exclusion to delete: -// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" -// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" -// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For -// example:"projects/my-project/exclusions/my-exclusion". -func (r *FoldersExclusionsService) Delete(name string) *FoldersExclusionsDeleteCall { - c := &FoldersExclusionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource for which to retrieve CMEK settings. +// "projects/[PROJECT_ID]/cmekSettings" +// "organizations/[ORGANIZATION_ID]/cmekSettings" +// "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" +// "folders/[FOLDER_ID]/cmekSettings" For +// example:"organizations/12345/cmekSettings"Note: CMEK for the Log +// Router can be configured for Google Cloud projects, folders, +// organizations and billing accounts. Once configured for an +// organization, it applies to all projects and folders in the Google +// Cloud organization. +func (r *FoldersService) GetCmekSettings(name string) *FoldersGetCmekSettingsCall { + c := &FoldersGetCmekSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -13006,41 +13562,54 @@ func (r *FoldersExclusionsService) Delete(name string) *FoldersExclusionsDeleteC // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersExclusionsDeleteCall) Fields(s ...googleapi.Field) *FoldersExclusionsDeleteCall { +func (c *FoldersGetCmekSettingsCall) Fields(s ...googleapi.Field) *FoldersGetCmekSettingsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FoldersGetCmekSettingsCall) IfNoneMatch(entityTag string) *FoldersGetCmekSettingsCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersExclusionsDeleteCall) Context(ctx context.Context) *FoldersExclusionsDeleteCall { +func (c *FoldersGetCmekSettingsCall) Context(ctx context.Context) *FoldersGetCmekSettingsCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersExclusionsDeleteCall) Header() http.Header { +func (c *FoldersGetCmekSettingsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersGetCmekSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/cmekSettings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -13051,14 +13620,14 @@ func (c *FoldersExclusionsDeleteCall) doRequest(alt string) (*http.Response, err return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.exclusions.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *FoldersExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "logging.folders.getCmekSettings" call. +// Exactly one of *CmekSettings or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CmekSettings.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *FoldersGetCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSettings, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13077,7 +13646,7 @@ func (c *FoldersExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &CmekSettings{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13089,37 +13658,39 @@ func (c *FoldersExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, } return ret, nil // { - // "description": "Deletes an exclusion in the _Default sink.", - // "flatPath": "v2/folders/{foldersId}/exclusions/{exclusionsId}", - // "httpMethod": "DELETE", - // "id": "logging.folders.exclusions.delete", + // "description": "Gets the Logging CMEK settings for the given resource.Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", + // "flatPath": "v2/folders/{foldersId}/cmekSettings", + // "httpMethod": "GET", + // "id": "logging.folders.getCmekSettings", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource name of an existing exclusion to delete: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", + // "description": "Required. The resource for which to retrieve CMEK settings. \"projects/[PROJECT_ID]/cmekSettings\" \"organizations/[ORGANIZATION_ID]/cmekSettings\" \"billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings\" \"folders/[FOLDER_ID]/cmekSettings\" For example:\"organizations/12345/cmekSettings\"Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.", // "location": "path", - // "pattern": "^folders/[^/]+/exclusions/[^/]+$", + // "pattern": "^folders/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+name}/cmekSettings", // "response": { - // "$ref": "Empty" + // "$ref": "CmekSettings" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.folders.exclusions.get": +// method id "logging.folders.getSettings": -type FoldersExclusionsGetCall struct { +type FoldersGetSettingsCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -13128,16 +13699,28 @@ type FoldersExclusionsGetCall struct { header_ http.Header } -// Get: Gets the description of an exclusion in the _Default sink. +// GetSettings: Gets the Log Router settings for the given +// resource.Note: Settings for the Log Router can be get for Google +// Cloud projects, folders, organizations and billing accounts. +// Currently it can only be configured for organizations. Once +// configured for an organization, it applies to all projects and +// folders in the Google Cloud organization.See Enabling CMEK for Log +// Router +// (https://cloud.google.com/logging/docs/routing/managed-encryption) +// for more information. // -// - name: The resource name of an existing exclusion: -// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" -// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" -// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For -// example:"projects/my-project/exclusions/my-exclusion". -func (r *FoldersExclusionsService) Get(name string) *FoldersExclusionsGetCall { - c := &FoldersExclusionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource for which to retrieve settings. +// "projects/[PROJECT_ID]/settings" +// "organizations/[ORGANIZATION_ID]/settings" +// "billingAccounts/[BILLING_ACCOUNT_ID]/settings" +// "folders/[FOLDER_ID]/settings" For +// example:"organizations/12345/settings"Note: Settings for the Log +// Router can be get for Google Cloud projects, folders, organizations +// and billing accounts. Currently it can only be configured for +// organizations. Once configured for an organization, it applies to +// all projects and folders in the Google Cloud organization. +func (r *FoldersService) GetSettings(name string) *FoldersGetSettingsCall { + c := &FoldersGetSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -13145,7 +13728,7 @@ func (r *FoldersExclusionsService) Get(name string) *FoldersExclusionsGetCall { // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersExclusionsGetCall) Fields(s ...googleapi.Field) *FoldersExclusionsGetCall { +func (c *FoldersGetSettingsCall) Fields(s ...googleapi.Field) *FoldersGetSettingsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -13155,7 +13738,7 @@ func (c *FoldersExclusionsGetCall) Fields(s ...googleapi.Field) *FoldersExclusio // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *FoldersExclusionsGetCall) IfNoneMatch(entityTag string) *FoldersExclusionsGetCall { +func (c *FoldersGetSettingsCall) IfNoneMatch(entityTag string) *FoldersGetSettingsCall { c.ifNoneMatch_ = entityTag return c } @@ -13163,21 +13746,21 @@ func (c *FoldersExclusionsGetCall) IfNoneMatch(entityTag string) *FoldersExclusi // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersExclusionsGetCall) Context(ctx context.Context) *FoldersExclusionsGetCall { +func (c *FoldersGetSettingsCall) Context(ctx context.Context) *FoldersGetSettingsCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersExclusionsGetCall) Header() http.Header { +func (c *FoldersGetSettingsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersExclusionsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersGetSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -13190,7 +13773,7 @@ func (c *FoldersExclusionsGetCall) doRequest(alt string) (*http.Response, error) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/settings") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -13203,14 +13786,14 @@ func (c *FoldersExclusionsGetCall) doRequest(alt string) (*http.Response, error) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.exclusions.get" call. -// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *LogExclusion.ServerResponse.Header or (if a response was returned at +// Do executes the "logging.folders.getSettings" call. +// Exactly one of *Settings or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Settings.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *FoldersExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { +func (c *FoldersGetSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13229,7 +13812,7 @@ func (c *FoldersExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusi if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogExclusion{ + ret := &Settings{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13241,25 +13824,25 @@ func (c *FoldersExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusi } return ret, nil // { - // "description": "Gets the description of an exclusion in the _Default sink.", - // "flatPath": "v2/folders/{foldersId}/exclusions/{exclusionsId}", + // "description": "Gets the Log Router settings for the given resource.Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", + // "flatPath": "v2/folders/{foldersId}/settings", // "httpMethod": "GET", - // "id": "logging.folders.exclusions.get", + // "id": "logging.folders.getSettings", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource name of an existing exclusion: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", + // "description": "Required. The resource for which to retrieve settings. \"projects/[PROJECT_ID]/settings\" \"organizations/[ORGANIZATION_ID]/settings\" \"billingAccounts/[BILLING_ACCOUNT_ID]/settings\" \"folders/[FOLDER_ID]/settings\" For example:\"organizations/12345/settings\"Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.", // "location": "path", - // "pattern": "^folders/[^/]+/exclusions/[^/]+$", + // "pattern": "^folders/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+name}/settings", // "response": { - // "$ref": "LogExclusion" + // "$ref": "Settings" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -13271,117 +13854,114 @@ func (c *FoldersExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusi } -// method id "logging.folders.exclusions.list": +// method id "logging.folders.updateSettings": -type FoldersExclusionsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type FoldersUpdateSettingsCall struct { + s *Service + name string + settings *Settings + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists all the exclusions on the _Default sink in a parent -// resource. +// UpdateSettings: Updates the Log Router settings for the given +// resource.Note: Settings for the Log Router can currently only be +// configured for Google Cloud organizations. Once configured, it +// applies to all projects and folders in the Google Cloud +// organization.UpdateSettings will fail if 1) kms_key_name is invalid, +// or 2) the associated service account does not have the required +// roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, +// or 3) access to the key is disabled. 4) location_id is not supported +// by Logging. 5) location_id violate OrgPolicy.See Enabling CMEK for +// Log Router +// (https://cloud.google.com/logging/docs/routing/managed-encryption) +// for more information. // -// - parent: The parent resource whose exclusions are to be listed. -// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]". -func (r *FoldersExclusionsService) List(parent string) *FoldersExclusionsListCall { - c := &FoldersExclusionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return from this request. Non-positive values are -// ignored. The presence of nextPageToken in the response indicates that -// more results might be available. -func (c *FoldersExclusionsListCall) PageSize(pageSize int64) *FoldersExclusionsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) +// - name: The resource name for the settings to update. +// "organizations/[ORGANIZATION_ID]/settings" For +// example:"organizations/12345/settings"Note: Settings for the Log +// Router can currently only be configured for Google Cloud +// organizations. Once configured, it applies to all projects and +// folders in the Google Cloud organization. +func (r *FoldersService) UpdateSettings(name string, settings *Settings) *FoldersUpdateSettingsCall { + c := &FoldersUpdateSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.settings = settings return c } -// PageToken sets the optional parameter "pageToken": If present, then -// retrieve the next batch of results from the preceding call to this -// method. pageToken must be the value of nextPageToken from the -// previous response. The values of other method parameters should be -// identical to those in the previous call. -func (c *FoldersExclusionsListCall) PageToken(pageToken string) *FoldersExclusionsListCall { - c.urlParams_.Set("pageToken", pageToken) +// UpdateMask sets the optional parameter "updateMask": Field mask +// identifying which fields from settings should be updated. A field +// will be overwritten if and only if it is in the update mask. Output +// only fields cannot be updated.See FieldMask for more information.For +// example: "updateMask=kmsKeyName" +func (c *FoldersUpdateSettingsCall) UpdateMask(updateMask string) *FoldersUpdateSettingsCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersExclusionsListCall) Fields(s ...googleapi.Field) *FoldersExclusionsListCall { +func (c *FoldersUpdateSettingsCall) Fields(s ...googleapi.Field) *FoldersUpdateSettingsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *FoldersExclusionsListCall) IfNoneMatch(entityTag string) *FoldersExclusionsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersExclusionsListCall) Context(ctx context.Context) *FoldersExclusionsListCall { +func (c *FoldersUpdateSettingsCall) Context(ctx context.Context) *FoldersUpdateSettingsCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersExclusionsListCall) Header() http.Header { +func (c *FoldersUpdateSettingsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersExclusionsListCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersUpdateSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.settings) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/settings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.exclusions.list" call. -// Exactly one of *ListExclusionsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListExclusionsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *FoldersExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsResponse, error) { +// Do executes the "logging.folders.updateSettings" call. +// Exactly one of *Settings or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Settings.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *FoldersUpdateSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13400,7 +13980,7 @@ func (c *FoldersExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclu if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListExclusionsResponse{ + ret := &Settings{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13412,111 +13992,73 @@ func (c *FoldersExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclu } return ret, nil // { - // "description": "Lists all the exclusions on the _Default sink in a parent resource.", - // "flatPath": "v2/folders/{foldersId}/exclusions", - // "httpMethod": "GET", - // "id": "logging.folders.exclusions.list", + // "description": "Updates the Log Router settings for the given resource.Note: Settings for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.UpdateSettings will fail if 1) kms_key_name is invalid, or 2) the associated service account does not have the required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, or 3) access to the key is disabled. 4) location_id is not supported by Logging. 5) location_id violate OrgPolicy.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", + // "flatPath": "v2/folders/{foldersId}/settings", + // "httpMethod": "PATCH", + // "id": "logging.folders.updateSettings", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "pageSize": { - // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The parent resource whose exclusions are to be listed. \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ", + // "name": { + // "description": "Required. The resource name for the settings to update. \"organizations/[ORGANIZATION_ID]/settings\" For example:\"organizations/12345/settings\"Note: Settings for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.", // "location": "path", // "pattern": "^folders/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "Optional. Field mask identifying which fields from settings should be updated. A field will be overwritten if and only if it is in the update mask. Output only fields cannot be updated.See FieldMask for more information.For example: \"updateMask=kmsKeyName\"", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+parent}/exclusions", + // "path": "v2/{+name}/settings", + // "request": { + // "$ref": "Settings" + // }, // "response": { - // "$ref": "ListExclusionsResponse" + // "$ref": "Settings" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *FoldersExclusionsListCall) Pages(ctx context.Context, f func(*ListExclusionsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "logging.folders.exclusions.patch": +// method id "logging.folders.exclusions.create": -type FoldersExclusionsPatchCall struct { +type FoldersExclusionsCreateCall struct { s *Service - name string + parent string logexclusion *LogExclusion urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Patch: Changes one or more properties of an existing exclusion in the -// _Default sink. +// Create: Creates a new exclusion in the _Default sink in a specified +// parent resource. Only log entries belonging to that resource can be +// excluded. You can have up to 10 exclusions in a resource. // -// - name: The resource name of the exclusion to update: -// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" -// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" -// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For -// example:"projects/my-project/exclusions/my-exclusion". -func (r *FoldersExclusionsService) Patch(name string, logexclusion *LogExclusion) *FoldersExclusionsPatchCall { - c := &FoldersExclusionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: The parent resource in which to create the exclusion: +// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For +// examples:"projects/my-logging-project" "organizations/123456789". +func (r *FoldersExclusionsService) Create(parent string, logexclusion *LogExclusion) *FoldersExclusionsCreateCall { + c := &FoldersExclusionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent c.logexclusion = logexclusion return c } -// UpdateMask sets the optional parameter "updateMask": Required. A -// non-empty list of fields to change in the existing exclusion. New -// values for the fields are taken from the corresponding fields in the -// LogExclusion included in this request. Fields not mentioned in -// update_mask are not changed and are ignored in the request.For -// example, to change the filter and description of an exclusion, -// specify an update_mask of "filter,description". -func (c *FoldersExclusionsPatchCall) UpdateMask(updateMask string) *FoldersExclusionsPatchCall { - c.urlParams_.Set("updateMask", updateMask) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersExclusionsPatchCall) Fields(s ...googleapi.Field) *FoldersExclusionsPatchCall { +func (c *FoldersExclusionsCreateCall) Fields(s ...googleapi.Field) *FoldersExclusionsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -13524,21 +14066,21 @@ func (c *FoldersExclusionsPatchCall) Fields(s ...googleapi.Field) *FoldersExclus // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersExclusionsPatchCall) Context(ctx context.Context) *FoldersExclusionsPatchCall { +func (c *FoldersExclusionsCreateCall) Context(ctx context.Context) *FoldersExclusionsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersExclusionsPatchCall) Header() http.Header { +func (c *FoldersExclusionsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersExclusionsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersExclusionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -13553,27 +14095,27 @@ func (c *FoldersExclusionsPatchCall) doRequest(alt string) (*http.Response, erro reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.exclusions.patch" call. +// Do executes the "logging.folders.exclusions.create" call. // Exactly one of *LogExclusion or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *LogExclusion.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *FoldersExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { +func (c *FoldersExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13604,34 +14146,166 @@ func (c *FoldersExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclu } return ret, nil // { - // "description": "Changes one or more properties of an existing exclusion in the _Default sink.", + // "description": "Creates a new exclusion in the _Default sink in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.", + // "flatPath": "v2/folders/{foldersId}/exclusions", + // "httpMethod": "POST", + // "id": "logging.folders.exclusions.create", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. The parent resource in which to create the exclusion: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-logging-project\" \"organizations/123456789\"", + // "location": "path", + // "pattern": "^folders/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+parent}/exclusions", + // "request": { + // "$ref": "LogExclusion" + // }, + // "response": { + // "$ref": "LogExclusion" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.folders.exclusions.delete": + +type FoldersExclusionsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes an exclusion in the _Default sink. +// +// - name: The resource name of an existing exclusion to delete: +// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" +// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" +// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For +// example:"projects/my-project/exclusions/my-exclusion". +func (r *FoldersExclusionsService) Delete(name string) *FoldersExclusionsDeleteCall { + c := &FoldersExclusionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FoldersExclusionsDeleteCall) Fields(s ...googleapi.Field) *FoldersExclusionsDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *FoldersExclusionsDeleteCall) Context(ctx context.Context) *FoldersExclusionsDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *FoldersExclusionsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *FoldersExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "logging.folders.exclusions.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *FoldersExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes an exclusion in the _Default sink.", // "flatPath": "v2/folders/{foldersId}/exclusions/{exclusionsId}", - // "httpMethod": "PATCH", - // "id": "logging.folders.exclusions.patch", + // "httpMethod": "DELETE", + // "id": "logging.folders.exclusions.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource name of the exclusion to update: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", + // "description": "Required. The resource name of an existing exclusion to delete: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", // "location": "path", // "pattern": "^folders/[^/]+/exclusions/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "Required. A non-empty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of \"filter,description\".", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, // "path": "v2/{+name}", - // "request": { - // "$ref": "LogExclusion" - // }, // "response": { - // "$ref": "LogExclusion" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -13641,9 +14315,9 @@ func (c *FoldersExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclu } -// method id "logging.folders.locations.get": +// method id "logging.folders.exclusions.get": -type FoldersLocationsGetCall struct { +type FoldersExclusionsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -13652,11 +14326,16 @@ type FoldersLocationsGetCall struct { header_ http.Header } -// Get: Gets information about a location. +// Get: Gets the description of an exclusion in the _Default sink. // -// - name: Resource name for the location. -func (r *FoldersLocationsService) Get(name string) *FoldersLocationsGetCall { - c := &FoldersLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of an existing exclusion: +// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" +// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" +// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For +// example:"projects/my-project/exclusions/my-exclusion". +func (r *FoldersExclusionsService) Get(name string) *FoldersExclusionsGetCall { + c := &FoldersExclusionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -13664,7 +14343,7 @@ func (r *FoldersLocationsService) Get(name string) *FoldersLocationsGetCall { // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersLocationsGetCall) Fields(s ...googleapi.Field) *FoldersLocationsGetCall { +func (c *FoldersExclusionsGetCall) Fields(s ...googleapi.Field) *FoldersExclusionsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -13674,7 +14353,7 @@ func (c *FoldersLocationsGetCall) Fields(s ...googleapi.Field) *FoldersLocations // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *FoldersLocationsGetCall) IfNoneMatch(entityTag string) *FoldersLocationsGetCall { +func (c *FoldersExclusionsGetCall) IfNoneMatch(entityTag string) *FoldersExclusionsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -13682,21 +14361,21 @@ func (c *FoldersLocationsGetCall) IfNoneMatch(entityTag string) *FoldersLocation // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLocationsGetCall) Context(ctx context.Context) *FoldersLocationsGetCall { +func (c *FoldersExclusionsGetCall) Context(ctx context.Context) *FoldersExclusionsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLocationsGetCall) Header() http.Header { +func (c *FoldersExclusionsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLocationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersExclusionsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -13722,14 +14401,14 @@ func (c *FoldersLocationsGetCall) doRequest(alt string) (*http.Response, error) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.locations.get" call. -// Exactly one of *Location or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Location.ServerResponse.Header or (if a response was returned at +// Do executes the "logging.folders.exclusions.get" call. +// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LogExclusion.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *FoldersLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) { +func (c *FoldersExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13748,7 +14427,7 @@ func (c *FoldersLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, e if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Location{ + ret := &LogExclusion{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13760,25 +14439,25 @@ func (c *FoldersLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, e } return ret, nil // { - // "description": "Gets information about a location.", - // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}", + // "description": "Gets the description of an exclusion in the _Default sink.", + // "flatPath": "v2/folders/{foldersId}/exclusions/{exclusionsId}", // "httpMethod": "GET", - // "id": "logging.folders.locations.get", + // "id": "logging.folders.exclusions.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Resource name for the location.", + // "description": "Required. The resource name of an existing exclusion: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", // "location": "path", - // "pattern": "^folders/[^/]+/locations/[^/]+$", + // "pattern": "^folders/[^/]+/exclusions/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v2/{+name}", // "response": { - // "$ref": "Location" + // "$ref": "LogExclusion" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -13790,48 +14469,44 @@ func (c *FoldersLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, e } -// method id "logging.folders.locations.list": +// method id "logging.folders.exclusions.list": -type FoldersLocationsListCall struct { +type FoldersExclusionsListCall struct { s *Service - name string + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists information about the supported locations for this -// service. +// List: Lists all the exclusions on the _Default sink in a parent +// resource. // -// - name: The resource that owns the locations collection, if -// applicable. -func (r *FoldersLocationsService) List(name string) *FoldersLocationsListCall { - c := &FoldersLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - return c -} - -// Filter sets the optional parameter "filter": A filter to narrow down -// results to a preferred subset. The filtering language accepts strings -// like "displayName=tokyo", and is documented in more detail in AIP-160 -// (https://google.aip.dev/160). -func (c *FoldersLocationsListCall) Filter(filter string) *FoldersLocationsListCall { - c.urlParams_.Set("filter", filter) +// - parent: The parent resource whose exclusions are to be listed. +// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]". +func (r *FoldersExclusionsService) List(parent string) *FoldersExclusionsListCall { + c := &FoldersExclusionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent return c } // PageSize sets the optional parameter "pageSize": The maximum number -// of results to return. If not set, the service selects a default. -func (c *FoldersLocationsListCall) PageSize(pageSize int64) *FoldersLocationsListCall { +// of results to return from this request. Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *FoldersExclusionsListCall) PageSize(pageSize int64) *FoldersExclusionsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } -// PageToken sets the optional parameter "pageToken": A page token -// received from the next_page_token field in the response. Send that -// page token to receive the subsequent page. -func (c *FoldersLocationsListCall) PageToken(pageToken string) *FoldersLocationsListCall { +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *FoldersExclusionsListCall) PageToken(pageToken string) *FoldersExclusionsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -13839,7 +14514,7 @@ func (c *FoldersLocationsListCall) PageToken(pageToken string) *FoldersLocations // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersLocationsListCall) Fields(s ...googleapi.Field) *FoldersLocationsListCall { +func (c *FoldersExclusionsListCall) Fields(s ...googleapi.Field) *FoldersExclusionsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -13849,7 +14524,7 @@ func (c *FoldersLocationsListCall) Fields(s ...googleapi.Field) *FoldersLocation // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *FoldersLocationsListCall) IfNoneMatch(entityTag string) *FoldersLocationsListCall { +func (c *FoldersExclusionsListCall) IfNoneMatch(entityTag string) *FoldersExclusionsListCall { c.ifNoneMatch_ = entityTag return c } @@ -13857,21 +14532,21 @@ func (c *FoldersLocationsListCall) IfNoneMatch(entityTag string) *FoldersLocatio // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLocationsListCall) Context(ctx context.Context) *FoldersLocationsListCall { +func (c *FoldersExclusionsListCall) Context(ctx context.Context) *FoldersExclusionsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLocationsListCall) Header() http.Header { +func (c *FoldersExclusionsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLocationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersExclusionsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -13884,7 +14559,7 @@ func (c *FoldersLocationsListCall) doRequest(alt string) (*http.Response, error) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -13892,19 +14567,19 @@ func (c *FoldersLocationsListCall) doRequest(alt string) (*http.Response, error) } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.locations.list" call. -// Exactly one of *ListLocationsResponse or error will be non-nil. Any +// Do executes the "logging.folders.exclusions.list" call. +// Exactly one of *ListExclusionsResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either -// *ListLocationsResponse.ServerResponse.Header or (if a response was +// *ListExclusionsResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *FoldersLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) { +func (c *FoldersExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13923,7 +14598,7 @@ func (c *FoldersLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocati if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListLocationsResponse{ + ret := &ListExclusionsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13935,41 +14610,36 @@ func (c *FoldersLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocati } return ret, nil // { - // "description": "Lists information about the supported locations for this service.", - // "flatPath": "v2/folders/{foldersId}/locations", + // "description": "Lists all the exclusions on the _Default sink in a parent resource.", + // "flatPath": "v2/folders/{foldersId}/exclusions", // "httpMethod": "GET", - // "id": "logging.folders.locations.list", + // "id": "logging.folders.exclusions.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "filter": { - // "description": "A filter to narrow down results to a preferred subset. The filtering language accepts strings like \"displayName=tokyo\", and is documented in more detail in AIP-160 (https://google.aip.dev/160).", - // "location": "query", - // "type": "string" - // }, - // "name": { - // "description": "The resource that owns the locations collection, if applicable.", - // "location": "path", - // "pattern": "^folders/[^/]+$", - // "required": true, - // "type": "string" - // }, // "pageSize": { - // "description": "The maximum number of results to return. If not set, the service selects a default.", + // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "A page token received from the next_page_token field in the response. Send that page token to receive the subsequent page.", + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", // "location": "query", // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent resource whose exclusions are to be listed. \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ", + // "location": "path", + // "pattern": "^folders/[^/]+$", + // "required": true, + // "type": "string" // } // }, - // "path": "v2/{+name}/locations", + // "path": "v2/{+parent}/exclusions", // "response": { - // "$ref": "ListLocationsResponse" + // "$ref": "ListExclusionsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -13984,7 +14654,7 @@ func (c *FoldersLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocati // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *FoldersLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error { +func (c *FoldersExclusionsListCall) Pages(ctx context.Context, f func(*ListExclusionsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -14002,44 +14672,49 @@ func (c *FoldersLocationsListCall) Pages(ctx context.Context, f func(*ListLocati } } -// method id "logging.folders.locations.buckets.create": +// method id "logging.folders.exclusions.patch": -type FoldersLocationsBucketsCreateCall struct { - s *Service - parent string - logbucket *LogBucket - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersExclusionsPatchCall struct { + s *Service + name string + logexclusion *LogExclusion + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates a log bucket that can be used to store log entries. -// After a bucket has been created, the bucket's location cannot be -// changed. +// Patch: Changes one or more properties of an existing exclusion in the +// _Default sink. // -// - parent: The resource in which to create the log bucket: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For -// example:"projects/my-project/locations/global". -func (r *FoldersLocationsBucketsService) Create(parent string, logbucket *LogBucket) *FoldersLocationsBucketsCreateCall { - c := &FoldersLocationsBucketsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.logbucket = logbucket +// - name: The resource name of the exclusion to update: +// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" +// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" +// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For +// example:"projects/my-project/exclusions/my-exclusion". +func (r *FoldersExclusionsService) Patch(name string, logexclusion *LogExclusion) *FoldersExclusionsPatchCall { + c := &FoldersExclusionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.logexclusion = logexclusion return c } -// BucketId sets the optional parameter "bucketId": Required. A -// client-assigned identifier such as "my-bucket". Identifiers are -// limited to 100 characters and can include only letters, digits, -// underscores, hyphens, and periods. -func (c *FoldersLocationsBucketsCreateCall) BucketId(bucketId string) *FoldersLocationsBucketsCreateCall { - c.urlParams_.Set("bucketId", bucketId) +// UpdateMask sets the optional parameter "updateMask": Required. A +// non-empty list of fields to change in the existing exclusion. New +// values for the fields are taken from the corresponding fields in the +// LogExclusion included in this request. Fields not mentioned in +// update_mask are not changed and are ignored in the request.For +// example, to change the filter and description of an exclusion, +// specify an update_mask of "filter,description". +func (c *FoldersExclusionsPatchCall) UpdateMask(updateMask string) *FoldersExclusionsPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersLocationsBucketsCreateCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsCreateCall { +func (c *FoldersExclusionsPatchCall) Fields(s ...googleapi.Field) *FoldersExclusionsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -14047,21 +14722,21 @@ func (c *FoldersLocationsBucketsCreateCall) Fields(s ...googleapi.Field) *Folder // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLocationsBucketsCreateCall) Context(ctx context.Context) *FoldersLocationsBucketsCreateCall { +func (c *FoldersExclusionsPatchCall) Context(ctx context.Context) *FoldersExclusionsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLocationsBucketsCreateCall) Header() http.Header { +func (c *FoldersExclusionsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersExclusionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -14069,34 +14744,34 @@ func (c *FoldersLocationsBucketsCreateCall) doRequest(alt string) (*http.Respons } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.locations.buckets.create" call. -// Exactly one of *LogBucket or error will be non-nil. Any non-2xx +// Do executes the "logging.folders.exclusions.patch" call. +// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either -// *LogBucket.ServerResponse.Header or (if a response was returned at +// *LogExclusion.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *FoldersLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { +func (c *FoldersExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14115,7 +14790,7 @@ func (c *FoldersLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*L if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogBucket{ + ret := &LogExclusion{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14127,33 +14802,34 @@ func (c *FoldersLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*L } return ret, nil // { - // "description": "Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed.", - // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets", - // "httpMethod": "POST", - // "id": "logging.folders.locations.buckets.create", + // "description": "Changes one or more properties of an existing exclusion in the _Default sink.", + // "flatPath": "v2/folders/{foldersId}/exclusions/{exclusionsId}", + // "httpMethod": "PATCH", + // "id": "logging.folders.exclusions.patch", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "bucketId": { - // "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"", + // "name": { + // "description": "Required. The resource name of the exclusion to update: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", // "location": "path", - // "pattern": "^folders/[^/]+/locations/[^/]+$", + // "pattern": "^folders/[^/]+/exclusions/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "Required. A non-empty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of \"filter,description\".", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+parent}/buckets", + // "path": "v2/{+name}", // "request": { - // "$ref": "LogBucket" + // "$ref": "LogExclusion" // }, // "response": { - // "$ref": "LogBucket" + // "$ref": "LogExclusion" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -14163,101 +14839,95 @@ func (c *FoldersLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*L } -// method id "logging.folders.locations.buckets.createAsync": +// method id "logging.folders.locations.get": -type FoldersLocationsBucketsCreateAsyncCall struct { - s *Service - parent string - logbucket *LogBucket - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersLocationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// CreateAsync: Creates a log bucket asynchronously that can be used to -// store log entries.After a bucket has been created, the bucket's -// location cannot be changed. +// Get: Gets information about a location. // -// - parent: The resource in which to create the log bucket: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For -// example:"projects/my-project/locations/global". -func (r *FoldersLocationsBucketsService) CreateAsync(parent string, logbucket *LogBucket) *FoldersLocationsBucketsCreateAsyncCall { - c := &FoldersLocationsBucketsCreateAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.logbucket = logbucket - return c -} - -// BucketId sets the optional parameter "bucketId": Required. A -// client-assigned identifier such as "my-bucket". Identifiers are -// limited to 100 characters and can include only letters, digits, -// underscores, hyphens, and periods. -func (c *FoldersLocationsBucketsCreateAsyncCall) BucketId(bucketId string) *FoldersLocationsBucketsCreateAsyncCall { - c.urlParams_.Set("bucketId", bucketId) +// - name: Resource name for the location. +func (r *FoldersLocationsService) Get(name string) *FoldersLocationsGetCall { + c := &FoldersLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersLocationsBucketsCreateAsyncCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsCreateAsyncCall { +func (c *FoldersLocationsGetCall) Fields(s ...googleapi.Field) *FoldersLocationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FoldersLocationsGetCall) IfNoneMatch(entityTag string) *FoldersLocationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLocationsBucketsCreateAsyncCall) Context(ctx context.Context) *FoldersLocationsBucketsCreateAsyncCall { +func (c *FoldersLocationsGetCall) Context(ctx context.Context) *FoldersLocationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLocationsBucketsCreateAsyncCall) Header() http.Header { +func (c *FoldersLocationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLocationsBucketsCreateAsyncCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets:createAsync") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.locations.buckets.createAsync" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at +// Do executes the "logging.folders.locations.get" call. +// Exactly one of *Location or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Location.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *FoldersLocationsBucketsCreateAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *FoldersLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14276,7 +14946,7 @@ func (c *FoldersLocationsBucketsCreateAsyncCall) Do(opts ...googleapi.CallOption if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &Location{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14288,109 +14958,133 @@ func (c *FoldersLocationsBucketsCreateAsyncCall) Do(opts ...googleapi.CallOption } return ret, nil // { - // "description": "Creates a log bucket asynchronously that can be used to store log entries.After a bucket has been created, the bucket's location cannot be changed.", - // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets:createAsync", - // "httpMethod": "POST", - // "id": "logging.folders.locations.buckets.createAsync", + // "description": "Gets information about a location.", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}", + // "httpMethod": "GET", + // "id": "logging.folders.locations.get", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "bucketId": { - // "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"", + // "name": { + // "description": "Resource name for the location.", // "location": "path", // "pattern": "^folders/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/buckets:createAsync", - // "request": { - // "$ref": "LogBucket" - // }, + // "path": "v2/{+name}", // "response": { - // "$ref": "Operation" + // "$ref": "Location" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.folders.locations.buckets.delete": +// method id "logging.folders.locations.list": -type FoldersLocationsBucketsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersLocationsListCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a log bucket.Changes the bucket's lifecycle_state to -// the DELETE_REQUESTED state. After 7 days, the bucket will be purged -// and all log entries in the bucket will be permanently deleted. +// List: Lists information about the supported locations for this +// service. // -// - name: The full resource name of the bucket to delete. -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *FoldersLocationsBucketsService) Delete(name string) *FoldersLocationsBucketsDeleteCall { - c := &FoldersLocationsBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource that owns the locations collection, if +// applicable. +func (r *FoldersLocationsService) List(name string) *FoldersLocationsListCall { + c := &FoldersLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } +// Filter sets the optional parameter "filter": A filter to narrow down +// results to a preferred subset. The filtering language accepts strings +// like "displayName=tokyo", and is documented in more detail in AIP-160 +// (https://google.aip.dev/160). +func (c *FoldersLocationsListCall) Filter(filter string) *FoldersLocationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return. If not set, the service selects a default. +func (c *FoldersLocationsListCall) PageSize(pageSize int64) *FoldersLocationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token +// received from the next_page_token field in the response. Send that +// page token to receive the subsequent page. +func (c *FoldersLocationsListCall) PageToken(pageToken string) *FoldersLocationsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersLocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsDeleteCall { +func (c *FoldersLocationsListCall) Fields(s ...googleapi.Field) *FoldersLocationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FoldersLocationsListCall) IfNoneMatch(entityTag string) *FoldersLocationsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLocationsBucketsDeleteCall) Context(ctx context.Context) *FoldersLocationsBucketsDeleteCall { +func (c *FoldersLocationsListCall) Context(ctx context.Context) *FoldersLocationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLocationsBucketsDeleteCall) Header() http.Header { +func (c *FoldersLocationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -14401,14 +15095,14 @@ func (c *FoldersLocationsBucketsDeleteCall) doRequest(alt string) (*http.Respons return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.locations.buckets.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *FoldersLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "logging.folders.locations.list" call. +// Exactly one of *ListLocationsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListLocationsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FoldersLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14427,7 +15121,7 @@ func (c *FoldersLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*E if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &ListLocationsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14439,131 +15133,168 @@ func (c *FoldersLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*E } return ret, nil // { - // "description": "Deletes a log bucket.Changes the bucket's lifecycle_state to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted.", - // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}", - // "httpMethod": "DELETE", - // "id": "logging.folders.locations.buckets.delete", + // "description": "Lists information about the supported locations for this service.", + // "flatPath": "v2/folders/{foldersId}/locations", + // "httpMethod": "GET", + // "id": "logging.folders.locations.list", // "parameterOrder": [ // "name" // ], // "parameters": { + // "filter": { + // "description": "A filter to narrow down results to a preferred subset. The filtering language accepts strings like \"displayName=tokyo\", and is documented in more detail in AIP-160 (https://google.aip.dev/160).", + // "location": "query", + // "type": "string" + // }, // "name": { - // "description": "Required. The full resource name of the bucket to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "description": "The resource that owns the locations collection, if applicable.", // "location": "path", - // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "pattern": "^folders/[^/]+$", // "required": true, // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of results to return. If not set, the service selects a default.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token received from the next_page_token field in the response. Send that page token to receive the subsequent page.", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+name}/locations", // "response": { - // "$ref": "Empty" + // "$ref": "ListLocationsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.folders.locations.buckets.get": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *FoldersLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type FoldersLocationsBucketsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// method id "logging.folders.locations.buckets.create": + +type FoldersLocationsBucketsCreateCall struct { + s *Service + parent string + logbucket *LogBucket + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a log bucket. +// Create: Creates a log bucket that can be used to store log entries. +// After a bucket has been created, the bucket's location cannot be +// changed. // -// - name: The resource name of the bucket: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *FoldersLocationsBucketsService) Get(name string) *FoldersLocationsBucketsGetCall { - c := &FoldersLocationsBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: The resource in which to create the log bucket: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For +// example:"projects/my-project/locations/global". +func (r *FoldersLocationsBucketsService) Create(parent string, logbucket *LogBucket) *FoldersLocationsBucketsCreateCall { + c := &FoldersLocationsBucketsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.logbucket = logbucket + return c +} + +// BucketId sets the optional parameter "bucketId": Required. A +// client-assigned identifier such as "my-bucket". Identifiers are +// limited to 100 characters and can include only letters, digits, +// underscores, hyphens, and periods. +func (c *FoldersLocationsBucketsCreateCall) BucketId(bucketId string) *FoldersLocationsBucketsCreateCall { + c.urlParams_.Set("bucketId", bucketId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersLocationsBucketsGetCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsGetCall { +func (c *FoldersLocationsBucketsCreateCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsCreateCall { 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 *FoldersLocationsBucketsGetCall) IfNoneMatch(entityTag string) *FoldersLocationsBucketsGetCall { - 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 *FoldersLocationsBucketsGetCall) Context(ctx context.Context) *FoldersLocationsBucketsGetCall { +func (c *FoldersLocationsBucketsCreateCall) Context(ctx context.Context) *FoldersLocationsBucketsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLocationsBucketsGetCall) Header() http.Header { +func (c *FoldersLocationsBucketsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLocationsBucketsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.locations.buckets.get" call. +// Do executes the "logging.folders.locations.buckets.create" call. // Exactly one of *LogBucket or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *LogBucket.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *FoldersLocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { +func (c *FoldersLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14594,132 +15325,119 @@ func (c *FoldersLocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogB } return ret, nil // { - // "description": "Gets a log bucket.", - // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}", - // "httpMethod": "GET", - // "id": "logging.folders.locations.buckets.get", + // "description": "Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed.", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets", + // "httpMethod": "POST", + // "id": "logging.folders.locations.buckets.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The resource name of the bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "bucketId": { + // "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"", // "location": "path", - // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "pattern": "^folders/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+parent}/buckets", + // "request": { + // "$ref": "LogBucket" + // }, // "response": { // "$ref": "LogBucket" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// method id "logging.folders.locations.buckets.list": +// method id "logging.folders.locations.buckets.createAsync": -type FoldersLocationsBucketsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type FoldersLocationsBucketsCreateAsyncCall struct { + s *Service + parent string + logbucket *LogBucket + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists log buckets. +// CreateAsync: Creates a log bucket asynchronously that can be used to +// store log entries.After a bucket has been created, the bucket's +// location cannot be changed. // -// - parent: The parent resource whose buckets are to be listed: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" Note: The locations -// portion of the resource must be specified, but supplying the -// character - in place of LOCATION_ID will return all buckets. -func (r *FoldersLocationsBucketsService) List(parent string) *FoldersLocationsBucketsListCall { - c := &FoldersLocationsBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The resource in which to create the log bucket: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For +// example:"projects/my-project/locations/global". +func (r *FoldersLocationsBucketsService) CreateAsync(parent string, logbucket *LogBucket) *FoldersLocationsBucketsCreateAsyncCall { + c := &FoldersLocationsBucketsCreateAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent + c.logbucket = logbucket return c } -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return from this request. Non-positive values are -// ignored. The presence of nextPageToken in the response indicates that -// more results might be available. -func (c *FoldersLocationsBucketsListCall) PageSize(pageSize int64) *FoldersLocationsBucketsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": If present, then -// retrieve the next batch of results from the preceding call to this -// method. pageToken must be the value of nextPageToken from the -// previous response. The values of other method parameters should be -// identical to those in the previous call. -func (c *FoldersLocationsBucketsListCall) PageToken(pageToken string) *FoldersLocationsBucketsListCall { - c.urlParams_.Set("pageToken", pageToken) +// BucketId sets the optional parameter "bucketId": Required. A +// client-assigned identifier such as "my-bucket". Identifiers are +// limited to 100 characters and can include only letters, digits, +// underscores, hyphens, and periods. +func (c *FoldersLocationsBucketsCreateAsyncCall) BucketId(bucketId string) *FoldersLocationsBucketsCreateAsyncCall { + c.urlParams_.Set("bucketId", bucketId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersLocationsBucketsListCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsListCall { +func (c *FoldersLocationsBucketsCreateAsyncCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsCreateAsyncCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *FoldersLocationsBucketsListCall) IfNoneMatch(entityTag string) *FoldersLocationsBucketsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLocationsBucketsListCall) Context(ctx context.Context) *FoldersLocationsBucketsListCall { +func (c *FoldersLocationsBucketsCreateAsyncCall) Context(ctx context.Context) *FoldersLocationsBucketsCreateAsyncCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLocationsBucketsListCall) Header() http.Header { +func (c *FoldersLocationsBucketsCreateAsyncCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLocationsBucketsListCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsBucketsCreateAsyncCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets:createAsync") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -14730,14 +15448,14 @@ func (c *FoldersLocationsBucketsListCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.locations.buckets.list" call. -// Exactly one of *ListBucketsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListBucketsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *FoldersLocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucketsResponse, error) { +// Do executes the "logging.folders.locations.buckets.createAsync" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *FoldersLocationsBucketsCreateAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14756,7 +15474,7 @@ func (c *FoldersLocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*Lis if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListBucketsResponse{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14768,84 +15486,57 @@ func (c *FoldersLocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*Lis } return ret, nil // { - // "description": "Lists log buckets.", - // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets", - // "httpMethod": "GET", - // "id": "logging.folders.locations.buckets.list", + // "description": "Creates a log bucket asynchronously that can be used to store log entries.After a bucket has been created, the bucket's location cannot be changed.", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets:createAsync", + // "httpMethod": "POST", + // "id": "logging.folders.locations.buckets.createAsync", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "pageSize": { - // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "bucketId": { + // "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. The parent resource whose buckets are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets.", + // "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"", // "location": "path", // "pattern": "^folders/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/buckets", + // "path": "v2/{+parent}/buckets:createAsync", + // "request": { + // "$ref": "LogBucket" + // }, // "response": { - // "$ref": "ListBucketsResponse" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *FoldersLocationsBucketsListCall) Pages(ctx context.Context, f func(*ListBucketsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "logging.folders.locations.buckets.patch": +// method id "logging.folders.locations.buckets.delete": -type FoldersLocationsBucketsPatchCall struct { +type FoldersLocationsBucketsDeleteCall struct { s *Service name string - logbucket *LogBucket urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Patch: Updates a log bucket.If the bucket has a lifecycle_state of -// DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a -// bucket has been created, the bucket's location cannot be changed. +// Delete: Deletes a log bucket.Changes the bucket's lifecycle_state to +// the DELETE_REQUESTED state. After 7 days, the bucket will be purged +// and all log entries in the bucket will be permanently deleted. // -// - name: The full resource name of the bucket to update. +// - name: The full resource name of the bucket to delete. // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU // CKET_ID]" @@ -14854,29 +15545,16 @@ type FoldersLocationsBucketsPatchCall struct { // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" // For // example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *FoldersLocationsBucketsService) Patch(name string, logbucket *LogBucket) *FoldersLocationsBucketsPatchCall { - c := &FoldersLocationsBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *FoldersLocationsBucketsService) Delete(name string) *FoldersLocationsBucketsDeleteCall { + c := &FoldersLocationsBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.logbucket = logbucket - return c -} - -// UpdateMask sets the optional parameter "updateMask": Required. Field -// mask that specifies the fields in bucket that need an update. A -// bucket field will be overwritten if, and only if, it is in the update -// mask. name and output only fields cannot be updated.For a detailed -// FieldMask definition, see: -// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor -// example: updateMask=retention_days -func (c *FoldersLocationsBucketsPatchCall) UpdateMask(updateMask string) *FoldersLocationsBucketsPatchCall { - c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersLocationsBucketsPatchCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsPatchCall { +func (c *FoldersLocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -14884,21 +15562,21 @@ func (c *FoldersLocationsBucketsPatchCall) Fields(s ...googleapi.Field) *Folders // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLocationsBucketsPatchCall) Context(ctx context.Context) *FoldersLocationsBucketsPatchCall { +func (c *FoldersLocationsBucketsDeleteCall) Context(ctx context.Context) *FoldersLocationsBucketsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLocationsBucketsPatchCall) Header() http.Header { +func (c *FoldersLocationsBucketsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -14906,16 +15584,11 @@ func (c *FoldersLocationsBucketsPatchCall) doRequest(alt string) (*http.Response } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -14926,14 +15599,14 @@ func (c *FoldersLocationsBucketsPatchCall) doRequest(alt string) (*http.Response return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.locations.buckets.patch" call. -// Exactly one of *LogBucket or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *LogBucket.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *FoldersLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { +// Do executes the "logging.folders.locations.buckets.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *FoldersLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -14952,7 +15625,7 @@ func (c *FoldersLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*Lo if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogBucket{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -14964,34 +15637,25 @@ func (c *FoldersLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*Lo } return ret, nil // { - // "description": "Updates a log bucket.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.", + // "description": "Deletes a log bucket.Changes the bucket's lifecycle_state to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted.", // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}", - // "httpMethod": "PATCH", - // "id": "logging.folders.locations.buckets.patch", + // "httpMethod": "DELETE", + // "id": "logging.folders.locations.buckets.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "description": "Required. The full resource name of the bucket to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=retention_days", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, // "path": "v2/{+name}", - // "request": { - // "$ref": "LogBucket" - // }, // "response": { - // "$ref": "LogBucket" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -15001,21 +15665,20 @@ func (c *FoldersLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*Lo } -// method id "logging.folders.locations.buckets.undelete": +// method id "logging.folders.locations.buckets.get": -type FoldersLocationsBucketsUndeleteCall struct { - s *Service - name string - undeletebucketrequest *UndeleteBucketRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersLocationsBucketsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Undelete: Undeletes a log bucket. A bucket that has been deleted can -// be undeleted within the grace period of 7 days. +// Get: Gets a log bucket. // -// - name: The full resource name of the bucket to undelete. +// - name: The resource name of the bucket: // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU // CKET_ID]" @@ -15024,56 +15687,63 @@ type FoldersLocationsBucketsUndeleteCall struct { // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" // For // example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *FoldersLocationsBucketsService) Undelete(name string, undeletebucketrequest *UndeleteBucketRequest) *FoldersLocationsBucketsUndeleteCall { - c := &FoldersLocationsBucketsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *FoldersLocationsBucketsService) Get(name string) *FoldersLocationsBucketsGetCall { + c := &FoldersLocationsBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.undeletebucketrequest = undeletebucketrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersLocationsBucketsUndeleteCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsUndeleteCall { +func (c *FoldersLocationsBucketsGetCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsGetCall { 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 *FoldersLocationsBucketsGetCall) IfNoneMatch(entityTag string) *FoldersLocationsBucketsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLocationsBucketsUndeleteCall) Context(ctx context.Context) *FoldersLocationsBucketsUndeleteCall { +func (c *FoldersLocationsBucketsGetCall) Context(ctx context.Context) *FoldersLocationsBucketsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLocationsBucketsUndeleteCall) Header() http.Header { +func (c *FoldersLocationsBucketsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsBucketsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:undelete") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -15084,14 +15754,14 @@ func (c *FoldersLocationsBucketsUndeleteCall) doRequest(alt string) (*http.Respo return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.locations.buckets.undelete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *FoldersLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "logging.folders.locations.buckets.get" call. +// Exactly one of *LogBucket or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LogBucket.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *FoldersLocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15110,7 +15780,7 @@ func (c *FoldersLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) ( if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &LogBucket{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -15122,142 +15792,150 @@ func (c *FoldersLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) ( } return ret, nil // { - // "description": "Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period of 7 days.", - // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}:undelete", - // "httpMethod": "POST", - // "id": "logging.folders.locations.buckets.undelete", + // "description": "Gets a log bucket.", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}", + // "httpMethod": "GET", + // "id": "logging.folders.locations.buckets.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The full resource name of the bucket to undelete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "description": "Required. The resource name of the bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}:undelete", - // "request": { - // "$ref": "UndeleteBucketRequest" - // }, + // "path": "v2/{+name}", // "response": { - // "$ref": "Empty" + // "$ref": "LogBucket" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.folders.locations.buckets.updateAsync": +// method id "logging.folders.locations.buckets.list": -type FoldersLocationsBucketsUpdateAsyncCall struct { - s *Service - name string - logbucket *LogBucket - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersLocationsBucketsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// UpdateAsync: Updates a log bucket asynchronously.If the bucket has a -// lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be -// returned.After a bucket has been created, the bucket's location -// cannot be changed. +// List: Lists log buckets. // -// - name: The full resource name of the bucket to update. -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *FoldersLocationsBucketsService) UpdateAsync(name string, logbucket *LogBucket) *FoldersLocationsBucketsUpdateAsyncCall { - c := &FoldersLocationsBucketsUpdateAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.logbucket = logbucket +// - parent: The parent resource whose buckets are to be listed: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" Note: The locations +// portion of the resource must be specified, but supplying the +// character - in place of LOCATION_ID will return all buckets. +func (r *FoldersLocationsBucketsService) List(parent string) *FoldersLocationsBucketsListCall { + c := &FoldersLocationsBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent return c } -// UpdateMask sets the optional parameter "updateMask": Required. Field -// mask that specifies the fields in bucket that need an update. A -// bucket field will be overwritten if, and only if, it is in the update -// mask. name and output only fields cannot be updated.For a detailed -// FieldMask definition, see: -// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor -// example: updateMask=retention_days -func (c *FoldersLocationsBucketsUpdateAsyncCall) UpdateMask(updateMask string) *FoldersLocationsBucketsUpdateAsyncCall { - c.urlParams_.Set("updateMask", updateMask) +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request. Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *FoldersLocationsBucketsListCall) PageSize(pageSize int64) *FoldersLocationsBucketsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *FoldersLocationsBucketsListCall) PageToken(pageToken string) *FoldersLocationsBucketsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersLocationsBucketsUpdateAsyncCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsUpdateAsyncCall { +func (c *FoldersLocationsBucketsListCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FoldersLocationsBucketsListCall) IfNoneMatch(entityTag string) *FoldersLocationsBucketsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLocationsBucketsUpdateAsyncCall) Context(ctx context.Context) *FoldersLocationsBucketsUpdateAsyncCall { +func (c *FoldersLocationsBucketsListCall) Context(ctx context.Context) *FoldersLocationsBucketsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLocationsBucketsUpdateAsyncCall) Header() http.Header { +func (c *FoldersLocationsBucketsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLocationsBucketsUpdateAsyncCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsBucketsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:updateAsync") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.locations.buckets.updateAsync" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *FoldersLocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// Do executes the "logging.folders.locations.buckets.list" call. +// Exactly one of *ListBucketsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListBucketsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FoldersLocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucketsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15276,7 +15954,7 @@ func (c *FoldersLocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.CallOption if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &ListBucketsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -15288,85 +15966,115 @@ func (c *FoldersLocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.CallOption } return ret, nil // { - // "description": "Updates a log bucket asynchronously.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.", - // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}:updateAsync", - // "httpMethod": "POST", - // "id": "logging.folders.locations.buckets.updateAsync", + // "description": "Lists log buckets.", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets", + // "httpMethod": "GET", + // "id": "logging.folders.locations.buckets.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", - // "location": "path", - // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$", - // "required": true, - // "type": "string" + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "format": "int32", + // "location": "query", + // "type": "integer" // }, - // "updateMask": { - // "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=retention_days", - // "format": "google-fieldmask", + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", // "location": "query", // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent resource whose buckets are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets.", + // "location": "path", + // "pattern": "^folders/[^/]+/locations/[^/]+$", + // "required": true, + // "type": "string" // } // }, - // "path": "v2/{+name}:updateAsync", - // "request": { - // "$ref": "LogBucket" - // }, + // "path": "v2/{+parent}/buckets", // "response": { - // "$ref": "Operation" + // "$ref": "ListBucketsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.folders.locations.buckets.links.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 *FoldersLocationsBucketsListCall) Pages(ctx context.Context, f func(*ListBucketsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type FoldersLocationsBucketsLinksCreateCall struct { +// method id "logging.folders.locations.buckets.patch": + +type FoldersLocationsBucketsPatchCall struct { s *Service - parent string - link *Link + name string + logbucket *LogBucket urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Create: Asynchronously creates a linked dataset in BigQuery which -// makes it possible to use BigQuery to read the logs stored in the log -// bucket. A log bucket may currently only contain one link. +// Patch: Updates a log bucket.If the bucket has a lifecycle_state of +// DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a +// bucket has been created, the bucket's location cannot be changed. // -// - parent: The full resource name of the bucket to create a link for. +// - name: The full resource name of the bucket to update. // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU // CKET_ID]" // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket // s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]". -func (r *FoldersLocationsBucketsLinksService) Create(parent string, link *Link) *FoldersLocationsBucketsLinksCreateCall { - c := &FoldersLocationsBucketsLinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.link = link +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *FoldersLocationsBucketsService) Patch(name string, logbucket *LogBucket) *FoldersLocationsBucketsPatchCall { + c := &FoldersLocationsBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.logbucket = logbucket return c } -// LinkId sets the optional parameter "linkId": Required. The ID to use -// for the link. The link_id can have up to 100 characters. A valid -// link_id must only have alphanumeric characters and underscores within -// it. -func (c *FoldersLocationsBucketsLinksCreateCall) LinkId(linkId string) *FoldersLocationsBucketsLinksCreateCall { - c.urlParams_.Set("linkId", linkId) +// UpdateMask sets the optional parameter "updateMask": Required. Field +// mask that specifies the fields in bucket that need an update. A +// bucket field will be overwritten if, and only if, it is in the update +// mask. name and output only fields cannot be updated.For a detailed +// FieldMask definition, see: +// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor +// example: updateMask=retention_days +func (c *FoldersLocationsBucketsPatchCall) UpdateMask(updateMask string) *FoldersLocationsBucketsPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersLocationsBucketsLinksCreateCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsLinksCreateCall { +func (c *FoldersLocationsBucketsPatchCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -15374,21 +16082,21 @@ func (c *FoldersLocationsBucketsLinksCreateCall) Fields(s ...googleapi.Field) *F // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLocationsBucketsLinksCreateCall) Context(ctx context.Context) *FoldersLocationsBucketsLinksCreateCall { +func (c *FoldersLocationsBucketsPatchCall) Context(ctx context.Context) *FoldersLocationsBucketsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLocationsBucketsLinksCreateCall) Header() http.Header { +func (c *FoldersLocationsBucketsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLocationsBucketsLinksCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -15396,34 +16104,34 @@ func (c *FoldersLocationsBucketsLinksCreateCall) doRequest(alt string) (*http.Re } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.link) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/links") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.locations.buckets.links.create" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx +// Do executes the "logging.folders.locations.buckets.patch" call. +// Exactly one of *LogBucket or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at +// *LogBucket.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *FoldersLocationsBucketsLinksCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *FoldersLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15442,7 +16150,7 @@ func (c *FoldersLocationsBucketsLinksCreateCall) Do(opts ...googleapi.CallOption if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &LogBucket{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -15454,33 +16162,34 @@ func (c *FoldersLocationsBucketsLinksCreateCall) Do(opts ...googleapi.CallOption } return ret, nil // { - // "description": "Asynchronously creates a linked dataset in BigQuery which makes it possible to use BigQuery to read the logs stored in the log bucket. A log bucket may currently only contain one link.", - // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/links", - // "httpMethod": "POST", - // "id": "logging.folders.locations.buckets.links.create", + // "description": "Updates a log bucket.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}", + // "httpMethod": "PATCH", + // "id": "logging.folders.locations.buckets.patch", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "linkId": { - // "description": "Required. The ID to use for the link. The link_id can have up to 100 characters. A valid link_id must only have alphanumeric characters and underscores within it.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The full resource name of the bucket to create a link for. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", + // "name": { + // "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=retention_days", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+parent}/links", + // "path": "v2/{+name}", // "request": { - // "$ref": "Link" + // "$ref": "LogBucket" // }, // "response": { - // "$ref": "Operation" + // "$ref": "LogBucket" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -15490,38 +16199,40 @@ func (c *FoldersLocationsBucketsLinksCreateCall) Do(opts ...googleapi.CallOption } -// method id "logging.folders.locations.buckets.links.delete": +// method id "logging.folders.locations.buckets.undelete": -type FoldersLocationsBucketsLinksDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type FoldersLocationsBucketsUndeleteCall struct { + s *Service + name string + undeletebucketrequest *UndeleteBucketRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a link. This will also delete the corresponding -// BigQuery linked dataset. +// Undelete: Undeletes a log bucket. A bucket that has been deleted can +// be undeleted within the grace period of 7 days. // -// - name: The full resource name of the link to delete. -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/l -// inks/[LINK_ID]" +// - name: The full resource name of the bucket to undelete. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]/links/[LINK_ID]" +// CKET_ID]" // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]/links/[LINK_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/lin -// ks/[LINK_ID]". -func (r *FoldersLocationsBucketsLinksService) Delete(name string) *FoldersLocationsBucketsLinksDeleteCall { - c := &FoldersLocationsBucketsLinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *FoldersLocationsBucketsService) Undelete(name string, undeletebucketrequest *UndeleteBucketRequest) *FoldersLocationsBucketsUndeleteCall { + c := &FoldersLocationsBucketsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.undeletebucketrequest = undeletebucketrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersLocationsBucketsLinksDeleteCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsLinksDeleteCall { +func (c *FoldersLocationsBucketsUndeleteCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsUndeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -15529,21 +16240,21 @@ func (c *FoldersLocationsBucketsLinksDeleteCall) Fields(s ...googleapi.Field) *F // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLocationsBucketsLinksDeleteCall) Context(ctx context.Context) *FoldersLocationsBucketsLinksDeleteCall { +func (c *FoldersLocationsBucketsUndeleteCall) Context(ctx context.Context) *FoldersLocationsBucketsUndeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLocationsBucketsLinksDeleteCall) Header() http.Header { +func (c *FoldersLocationsBucketsUndeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLocationsBucketsLinksDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -15551,11 +16262,16 @@ func (c *FoldersLocationsBucketsLinksDeleteCall) doRequest(alt string) (*http.Re } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:undelete") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -15566,14 +16282,14 @@ func (c *FoldersLocationsBucketsLinksDeleteCall) doRequest(alt string) (*http.Re return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.locations.buckets.links.delete" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *FoldersLocationsBucketsLinksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// Do executes the "logging.folders.locations.buckets.undelete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *FoldersLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -15592,7 +16308,7 @@ func (c *FoldersLocationsBucketsLinksDeleteCall) Do(opts ...googleapi.CallOption if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -15604,26 +16320,508 @@ func (c *FoldersLocationsBucketsLinksDeleteCall) Do(opts ...googleapi.CallOption } return ret, nil // { - // "description": "Deletes a link. This will also delete the corresponding BigQuery linked dataset.", - // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/links/{linksId}", - // "httpMethod": "DELETE", - // "id": "logging.folders.locations.buckets.links.delete", + // "description": "Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period of 7 days.", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}:undelete", + // "httpMethod": "POST", + // "id": "logging.folders.locations.buckets.undelete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The full resource name of the link to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" ", + // "description": "Required. The full resource name of the bucket to undelete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", - // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+/links/[^/]+$", + // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}", - // "response": { - // "$ref": "Operation" - // }, + // "path": "v2/{+name}:undelete", + // "request": { + // "$ref": "UndeleteBucketRequest" + // }, + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.folders.locations.buckets.updateAsync": + +type FoldersLocationsBucketsUpdateAsyncCall struct { + s *Service + name string + logbucket *LogBucket + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// UpdateAsync: Updates a log bucket asynchronously.If the bucket has a +// lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be +// returned.After a bucket has been created, the bucket's location +// cannot be changed. +// +// - name: The full resource name of the bucket to update. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *FoldersLocationsBucketsService) UpdateAsync(name string, logbucket *LogBucket) *FoldersLocationsBucketsUpdateAsyncCall { + c := &FoldersLocationsBucketsUpdateAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.logbucket = logbucket + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. Field +// mask that specifies the fields in bucket that need an update. A +// bucket field will be overwritten if, and only if, it is in the update +// mask. name and output only fields cannot be updated.For a detailed +// FieldMask definition, see: +// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor +// example: updateMask=retention_days +func (c *FoldersLocationsBucketsUpdateAsyncCall) UpdateMask(updateMask string) *FoldersLocationsBucketsUpdateAsyncCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FoldersLocationsBucketsUpdateAsyncCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsUpdateAsyncCall { + 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 *FoldersLocationsBucketsUpdateAsyncCall) Context(ctx context.Context) *FoldersLocationsBucketsUpdateAsyncCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *FoldersLocationsBucketsUpdateAsyncCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *FoldersLocationsBucketsUpdateAsyncCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:updateAsync") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "logging.folders.locations.buckets.updateAsync" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *FoldersLocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + 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": "Updates a log bucket asynchronously.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}:updateAsync", + // "httpMethod": "POST", + // "id": "logging.folders.locations.buckets.updateAsync", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "location": "path", + // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "updateMask": { + // "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=retention_days", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v2/{+name}:updateAsync", + // "request": { + // "$ref": "LogBucket" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.folders.locations.buckets.links.create": + +type FoldersLocationsBucketsLinksCreateCall struct { + s *Service + parent string + link *Link + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Asynchronously creates a linked dataset in BigQuery which +// makes it possible to use BigQuery to read the logs stored in the log +// bucket. A log bucket may currently only contain one link. +// +// - parent: The full resource name of the bucket to create a link for. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]". +func (r *FoldersLocationsBucketsLinksService) Create(parent string, link *Link) *FoldersLocationsBucketsLinksCreateCall { + c := &FoldersLocationsBucketsLinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.link = link + return c +} + +// LinkId sets the optional parameter "linkId": Required. The ID to use +// for the link. The link_id can have up to 100 characters. A valid +// link_id must only have alphanumeric characters and underscores within +// it. +func (c *FoldersLocationsBucketsLinksCreateCall) LinkId(linkId string) *FoldersLocationsBucketsLinksCreateCall { + c.urlParams_.Set("linkId", linkId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FoldersLocationsBucketsLinksCreateCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsLinksCreateCall { + 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 *FoldersLocationsBucketsLinksCreateCall) Context(ctx context.Context) *FoldersLocationsBucketsLinksCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *FoldersLocationsBucketsLinksCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *FoldersLocationsBucketsLinksCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.link) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/links") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "logging.folders.locations.buckets.links.create" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *FoldersLocationsBucketsLinksCreateCall) 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": "Asynchronously creates a linked dataset in BigQuery which makes it possible to use BigQuery to read the logs stored in the log bucket. A log bucket may currently only contain one link.", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/links", + // "httpMethod": "POST", + // "id": "logging.folders.locations.buckets.links.create", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "linkId": { + // "description": "Required. The ID to use for the link. The link_id can have up to 100 characters. A valid link_id must only have alphanumeric characters and underscores within it.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The full resource name of the bucket to create a link for. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", + // "location": "path", + // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+parent}/links", + // "request": { + // "$ref": "Link" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.folders.locations.buckets.links.delete": + +type FoldersLocationsBucketsLinksDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a link. This will also delete the corresponding +// BigQuery linked dataset. +// +// - name: The full resource name of the link to delete. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/l +// inks/[LINK_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]/links/[LINK_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]/links/[LINK_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/lin +// ks/[LINK_ID]". +func (r *FoldersLocationsBucketsLinksService) Delete(name string) *FoldersLocationsBucketsLinksDeleteCall { + c := &FoldersLocationsBucketsLinksDeleteCall{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 *FoldersLocationsBucketsLinksDeleteCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsLinksDeleteCall { + 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 *FoldersLocationsBucketsLinksDeleteCall) Context(ctx context.Context) *FoldersLocationsBucketsLinksDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *FoldersLocationsBucketsLinksDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *FoldersLocationsBucketsLinksDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "logging.folders.locations.buckets.links.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *FoldersLocationsBucketsLinksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + 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": "Deletes a link. This will also delete the corresponding BigQuery linked dataset.", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/links/{linksId}", + // "httpMethod": "DELETE", + // "id": "logging.folders.locations.buckets.links.delete", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The full resource name of the link to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" ", + // "location": "path", + // "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+/links/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+name}", + // "response": { + // "$ref": "Operation" + // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", // "https://www.googleapis.com/auth/logging.admin" @@ -17554,153 +18752,9 @@ func (c *FoldersLocationsOperationsListCall) Pages(ctx context.Context, f func(* } } -// method id "logging.folders.logs.delete": - -type FoldersLogsDeleteCall struct { - s *Service - logName string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Delete: Deletes all the log entries in a log for the _Default Log -// Bucket. The log reappears if it receives new entries. Log entries -// written shortly before the delete operation might not be deleted. -// Entries received after the delete operation with a timestamp before -// the operation will be deleted. -// -// - logName: The resource name of the log to delete: -// projects/[PROJECT_ID]/logs/[LOG_ID] -// organizations/[ORGANIZATION_ID]/logs/[LOG_ID] -// billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID] -// folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For -// example, "projects/my-project-id/logs/syslog", -// "organizations/123/logs/cloudaudit.googleapis.com%2Factivity".For -// more information about log names, see LogEntry. -func (r *FoldersLogsService) Delete(logName string) *FoldersLogsDeleteCall { - c := &FoldersLogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.logName = logName - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *FoldersLogsDeleteCall) Fields(s ...googleapi.Field) *FoldersLogsDeleteCall { - 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 *FoldersLogsDeleteCall) Context(ctx context.Context) *FoldersLogsDeleteCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *FoldersLogsDeleteCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *FoldersLogsDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+logName}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "logName": c.logName, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "logging.folders.logs.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *FoldersLogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &Empty{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Deletes all the log entries in a log for the _Default Log Bucket. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted.", - // "flatPath": "v2/folders/{foldersId}/logs/{logsId}", - // "httpMethod": "DELETE", - // "id": "logging.folders.logs.delete", - // "parameterOrder": [ - // "logName" - // ], - // "parameters": { - // "logName": { - // "description": "Required. The resource name of the log to delete: projects/[PROJECT_ID]/logs/[LOG_ID] organizations/[ORGANIZATION_ID]/logs/[LOG_ID] billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID] folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/123/logs/cloudaudit.googleapis.com%2Factivity\".For more information about log names, see LogEntry.", - // "location": "path", - // "pattern": "^folders/[^/]+/logs/[^/]+$", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v2/{+logName}", - // "response": { - // "$ref": "Empty" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" - // ] - // } - -} - -// method id "logging.folders.logs.list": +// method id "logging.folders.locations.recentQueries.list": -type FoldersLogsListCall struct { +type FoldersLocationsRecentQueriesListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -17709,14 +18763,19 @@ type FoldersLogsListCall struct { header_ http.Header } -// List: Lists the logs in projects, organizations, folders, or billing -// accounts. Only logs that have entries are listed. +// List: Lists the RecentQueries that were created by the user making +// the request. // -// - parent: The resource name to list logs for: projects/[PROJECT_ID] -// organizations/[ORGANIZATION_ID] -// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]. -func (r *FoldersLogsService) List(parent string) *FoldersLogsListCall { - c := &FoldersLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The resource to which the listed queries belong. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" For +// example:projects/my-project/locations/us-central1Note: The location +// portion of the resource must be specified, but supplying the +// character - in place of LOCATION_ID will return all recent queries. +func (r *FoldersLocationsRecentQueriesService) List(parent string) *FoldersLocationsRecentQueriesListCall { + c := &FoldersLocationsRecentQueriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } @@ -17725,7 +18784,7 @@ func (r *FoldersLogsService) List(parent string) *FoldersLogsListCall { // of results to return from this request. Non-positive values are // ignored. The presence of nextPageToken in the response indicates that // more results might be available. -func (c *FoldersLogsListCall) PageSize(pageSize int64) *FoldersLogsListCall { +func (c *FoldersLocationsRecentQueriesListCall) PageSize(pageSize int64) *FoldersLocationsRecentQueriesListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } @@ -17735,33 +18794,15 @@ func (c *FoldersLogsListCall) PageSize(pageSize int64) *FoldersLogsListCall { // method. pageToken must be the value of nextPageToken from the // previous response. The values of other method parameters should be // identical to those in the previous call. -func (c *FoldersLogsListCall) PageToken(pageToken string) *FoldersLogsListCall { +func (c *FoldersLocationsRecentQueriesListCall) PageToken(pageToken string) *FoldersLocationsRecentQueriesListCall { c.urlParams_.Set("pageToken", pageToken) return c } -// ResourceNames sets the optional parameter "resourceNames": List of -// resource names to list logs for: -// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/view -// s/[VIEW_ID] -// organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKE -// T_ID]/views/[VIEW_ID] -// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[ -// BUCKET_ID]/views/[VIEW_ID] -// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/ -// [VIEW_ID]To support legacy queries, it could also be: -// projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] -// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]The resource -// name in the parent field is added to this list. -func (c *FoldersLogsListCall) ResourceNames(resourceNames ...string) *FoldersLogsListCall { - c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...)) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersLogsListCall) Fields(s ...googleapi.Field) *FoldersLogsListCall { +func (c *FoldersLocationsRecentQueriesListCall) Fields(s ...googleapi.Field) *FoldersLocationsRecentQueriesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -17771,7 +18812,7 @@ func (c *FoldersLogsListCall) Fields(s ...googleapi.Field) *FoldersLogsListCall // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *FoldersLogsListCall) IfNoneMatch(entityTag string) *FoldersLogsListCall { +func (c *FoldersLocationsRecentQueriesListCall) IfNoneMatch(entityTag string) *FoldersLocationsRecentQueriesListCall { c.ifNoneMatch_ = entityTag return c } @@ -17779,21 +18820,21 @@ func (c *FoldersLogsListCall) IfNoneMatch(entityTag string) *FoldersLogsListCall // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersLogsListCall) Context(ctx context.Context) *FoldersLogsListCall { +func (c *FoldersLocationsRecentQueriesListCall) Context(ctx context.Context) *FoldersLocationsRecentQueriesListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersLogsListCall) Header() http.Header { +func (c *FoldersLocationsRecentQueriesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersLogsListCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsRecentQueriesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -17806,7 +18847,7 @@ func (c *FoldersLogsListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/recentQueries") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -17819,14 +18860,14 @@ func (c *FoldersLogsListCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.logs.list" call. -// Exactly one of *ListLogsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListLogsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use +// Do executes the "logging.folders.locations.recentQueries.list" call. +// Exactly one of *ListRecentQueriesResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ListRecentQueriesResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *FoldersLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) { +func (c *FoldersLocationsRecentQueriesListCall) Do(opts ...googleapi.CallOption) (*ListRecentQueriesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -17845,7 +18886,7 @@ func (c *FoldersLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsRespons if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListLogsResponse{ + ret := &ListRecentQueriesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -17857,10 +18898,10 @@ func (c *FoldersLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsRespons } return ret, nil // { - // "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", - // "flatPath": "v2/folders/{foldersId}/logs", + // "description": "Lists the RecentQueries that were created by the user making the request.", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/recentQueries", // "httpMethod": "GET", - // "id": "logging.folders.logs.list", + // "id": "logging.folders.locations.recentQueries.list", // "parameterOrder": [ // "parent" // ], @@ -17877,22 +18918,16 @@ func (c *FoldersLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsRespons // "type": "string" // }, // "parent": { - // "description": "Required. The resource name to list logs for: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", + // "description": "Required. The resource to which the listed queries belong. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" For example:projects/my-project/locations/us-central1Note: The location portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all recent queries.", // "location": "path", - // "pattern": "^folders/[^/]+$", + // "pattern": "^folders/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" - // }, - // "resourceNames": { - // "description": "Optional. List of resource names to list logs for: projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]To support legacy queries, it could also be: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]The resource name in the parent field is added to this list.", - // "location": "query", - // "repeated": true, - // "type": "string" // } // }, - // "path": "v2/{+parent}/logs", + // "path": "v2/{+parent}/recentQueries", // "response": { - // "$ref": "ListLogsResponse" + // "$ref": "ListRecentQueriesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -17907,7 +18942,7 @@ func (c *FoldersLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsRespons // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *FoldersLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error { +func (c *FoldersLocationsRecentQueriesListCall) Pages(ctx context.Context, f func(*ListRecentQueriesResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -17925,66 +18960,50 @@ func (c *FoldersLogsListCall) Pages(ctx context.Context, f func(*ListLogsRespons } } -// method id "logging.folders.sinks.create": +// method id "logging.folders.locations.savedQueries.create": -type FoldersSinksCreateCall struct { +type FoldersLocationsSavedQueriesCreateCall struct { s *Service parent string - logsink *LogSink + savedquery *SavedQuery urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Create: Creates a sink that exports specified log entries to a -// destination. The export begins upon ingress, unless the sink's -// writer_identity is not permitted to write to the destination. A sink -// can export log entries only from the resource owning the sink. +// Create: Creates a new SavedQuery for the user making the request. // -// - parent: The resource in which to create the sink: -// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For -// examples:"projects/my-project" "organizations/123456789". -func (r *FoldersSinksService) Create(parent string, logsink *LogSink) *FoldersSinksCreateCall { - c := &FoldersSinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The parent resource in which to create the saved query: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" For example: +// "projects/my-project/locations/global" +// "organizations/123456789/locations/us-central1". +func (r *FoldersLocationsSavedQueriesService) Create(parent string, savedquery *SavedQuery) *FoldersLocationsSavedQueriesCreateCall { + c := &FoldersLocationsSavedQueriesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.logsink = logsink - return c -} - -// CustomWriterIdentity sets the optional parameter -// "customWriterIdentity": A service account provided by the caller that -// will be used to write the log entries. The format must be -// serviceAccount:some@email. This field can only be specified if you -// are routing logs to a destination outside this sink's project. If not -// specified, a Logging service account will automatically be generated. -func (c *FoldersSinksCreateCall) CustomWriterIdentity(customWriterIdentity string) *FoldersSinksCreateCall { - c.urlParams_.Set("customWriterIdentity", customWriterIdentity) + c.savedquery = savedquery return c } -// UniqueWriterIdentity sets the optional parameter -// "uniqueWriterIdentity": Determines the kind of IAM identity returned -// as writer_identity in the new sink. If this value is omitted or set -// to false, and if the sink's parent is a project, then the value -// returned as writer_identity is the same group or service account used -// by Cloud Logging before the addition of writer identities to this -// API. The sink's destination must be in the same project as the sink -// itself.If this field is set to true, or if the sink is owned by a -// non-project resource such as an organization, then the value of -// writer_identity will be a service agent -// (https://cloud.google.com/iam/docs/service-account-types#service-agents) -// used by the sinks with the same parent. For more information, see -// writer_identity in LogSink. -func (c *FoldersSinksCreateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *FoldersSinksCreateCall { - c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity)) +// SavedQueryId sets the optional parameter "savedQueryId": The ID to +// use for the saved query, which will become the final component of the +// saved query's resource name.If the saved_query_id is not provided, +// the system will generate an alphanumeric ID.The saved_query_id is +// limited to 100 characters and can include only the following +// characters: upper and lower-case alphanumeric characters, +// underscores, hyphens, and periods. First character has to be +// alphanumeric. +func (c *FoldersLocationsSavedQueriesCreateCall) SavedQueryId(savedQueryId string) *FoldersLocationsSavedQueriesCreateCall { + c.urlParams_.Set("savedQueryId", savedQueryId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersSinksCreateCall) Fields(s ...googleapi.Field) *FoldersSinksCreateCall { +func (c *FoldersLocationsSavedQueriesCreateCall) Fields(s ...googleapi.Field) *FoldersLocationsSavedQueriesCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -17992,21 +19011,21 @@ func (c *FoldersSinksCreateCall) Fields(s ...googleapi.Field) *FoldersSinksCreat // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersSinksCreateCall) Context(ctx context.Context) *FoldersSinksCreateCall { +func (c *FoldersLocationsSavedQueriesCreateCall) Context(ctx context.Context) *FoldersLocationsSavedQueriesCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersSinksCreateCall) Header() http.Header { +func (c *FoldersLocationsSavedQueriesCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSinksCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsSavedQueriesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -18014,14 +19033,14 @@ func (c *FoldersSinksCreateCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.savedquery) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/savedQueries") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -18034,14 +19053,14 @@ func (c *FoldersSinksCreateCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.sinks.create" call. -// Exactly one of *LogSink or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *LogSink.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *FoldersSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { +// Do executes the "logging.folders.locations.savedQueries.create" call. +// Exactly one of *SavedQuery or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SavedQuery.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *FoldersLocationsSavedQueriesCreateCall) Do(opts ...googleapi.CallOption) (*SavedQuery, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18060,7 +19079,7 @@ func (c *FoldersSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, err if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogSink{ + ret := &SavedQuery{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -18072,38 +19091,33 @@ func (c *FoldersSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, err } return ret, nil // { - // "description": "Creates a sink that exports specified log entries to a destination. The export begins upon ingress, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.", - // "flatPath": "v2/folders/{foldersId}/sinks", + // "description": "Creates a new SavedQuery for the user making the request.", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/savedQueries", // "httpMethod": "POST", - // "id": "logging.folders.sinks.create", + // "id": "logging.folders.locations.savedQueries.create", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "customWriterIdentity": { - // "description": "Optional. A service account provided by the caller that will be used to write the log entries. The format must be serviceAccount:some@email. This field can only be specified if you are routing logs to a destination outside this sink's project. If not specified, a Logging service account will automatically be generated.", - // "location": "query", - // "type": "string" - // }, // "parent": { - // "description": "Required. The resource in which to create the sink: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-project\" \"organizations/123456789\"", + // "description": "Required. The parent resource in which to create the saved query: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" For example: \"projects/my-project/locations/global\" \"organizations/123456789/locations/us-central1\" ", // "location": "path", - // "pattern": "^folders/[^/]+$", + // "pattern": "^folders/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // }, - // "uniqueWriterIdentity": { - // "description": "Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Cloud Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a service agent (https://cloud.google.com/iam/docs/service-account-types#service-agents) used by the sinks with the same parent. For more information, see writer_identity in LogSink.", + // "savedQueryId": { + // "description": "Optional. The ID to use for the saved query, which will become the final component of the saved query's resource name.If the saved_query_id is not provided, the system will generate an alphanumeric ID.The saved_query_id is limited to 100 characters and can include only the following characters: upper and lower-case alphanumeric characters, underscores, hyphens, and periods. First character has to be alphanumeric.", // "location": "query", - // "type": "boolean" + // "type": "string" // } // }, - // "path": "v2/{+parent}/sinks", + // "path": "v2/{+parent}/savedQueries", // "request": { - // "$ref": "LogSink" + // "$ref": "SavedQuery" // }, // "response": { - // "$ref": "LogSink" + // "$ref": "SavedQuery" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -18113,36 +19127,39 @@ func (c *FoldersSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, err } -// method id "logging.folders.sinks.delete": +// method id "logging.folders.locations.savedQueries.delete": -type FoldersSinksDeleteCall struct { +type FoldersLocationsSavedQueriesDeleteCall struct { s *Service - sinkNameid string + name string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Delete: Deletes a sink. If the sink has a unique writer_identity, -// then that service account is also deleted. +// Delete: Deletes an existing SavedQuery that was created by the user +// making the request. // -// - sinkName: The full resource name of the sink to delete, including -// the parent resource and the sink identifier: -// "projects/[PROJECT_ID]/sinks/[SINK_ID]" -// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" -// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For -// example:"projects/my-project/sinks/my-sink". -func (r *FoldersSinksService) Delete(sinkNameid string) *FoldersSinksDeleteCall { - c := &FoldersSinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.sinkNameid = sinkNameid +// - name: The full resource name of the saved query to delete. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_I +// D]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/savedQuerie +// s/[QUERY_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/savedQ +// ueries/[QUERY_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID] +// " For example: +// "projects/my-project/locations/global/savedQueries/my-saved-query". +func (r *FoldersLocationsSavedQueriesService) Delete(name string) *FoldersLocationsSavedQueriesDeleteCall { + c := &FoldersLocationsSavedQueriesDeleteCall{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 *FoldersSinksDeleteCall) Fields(s ...googleapi.Field) *FoldersSinksDeleteCall { +func (c *FoldersLocationsSavedQueriesDeleteCall) Fields(s ...googleapi.Field) *FoldersLocationsSavedQueriesDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -18150,21 +19167,21 @@ func (c *FoldersSinksDeleteCall) Fields(s ...googleapi.Field) *FoldersSinksDelet // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersSinksDeleteCall) Context(ctx context.Context) *FoldersSinksDeleteCall { +func (c *FoldersLocationsSavedQueriesDeleteCall) Context(ctx context.Context) *FoldersLocationsSavedQueriesDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersSinksDeleteCall) Header() http.Header { +func (c *FoldersLocationsSavedQueriesDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSinksDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsSavedQueriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -18174,7 +19191,7 @@ func (c *FoldersSinksDeleteCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("DELETE", urls, body) if err != nil { @@ -18182,19 +19199,19 @@ func (c *FoldersSinksDeleteCall) doRequest(alt string) (*http.Response, error) { } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "sinkName": c.sinkNameid, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.sinks.delete" call. +// Do executes the "logging.folders.locations.savedQueries.delete" call. // Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *Empty.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. -func (c *FoldersSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +func (c *FoldersLocationsSavedQueriesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18225,23 +19242,23 @@ func (c *FoldersSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error } return ret, nil // { - // "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.", - // "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}", + // "description": "Deletes an existing SavedQuery that was created by the user making the request.", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/savedQueries/{savedQueriesId}", // "httpMethod": "DELETE", - // "id": "logging.folders.sinks.delete", + // "id": "logging.folders.locations.savedQueries.delete", // "parameterOrder": [ - // "sinkName" + // "name" // ], // "parameters": { - // "sinkName": { - // "description": "Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", + // "name": { + // "description": "Required. The full resource name of the saved query to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]\" For example: \"projects/my-project/locations/global/savedQueries/my-saved-query\" ", // "location": "path", - // "pattern": "^folders/[^/]+/sinks/[^/]+$", + // "pattern": "^folders/[^/]+/locations/[^/]+/savedQueries/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+sinkName}", + // "path": "v2/{+name}", // "response": { // "$ref": "Empty" // }, @@ -18253,35 +19270,58 @@ func (c *FoldersSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error } -// method id "logging.folders.sinks.get": +// method id "logging.folders.locations.savedQueries.list": -type FoldersSinksGetCall struct { +type FoldersLocationsSavedQueriesListCall struct { s *Service - sinkName string + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Gets a sink. +// List: Lists the SavedQueries that were created by the user making the +// request. // -// - sinkName: The resource name of the sink: -// "projects/[PROJECT_ID]/sinks/[SINK_ID]" -// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" -// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For -// example:"projects/my-project/sinks/my-sink". -func (r *FoldersSinksService) Get(sinkName string) *FoldersSinksGetCall { - c := &FoldersSinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.sinkName = sinkName +// - parent: The resource to which the listed queries belong. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" For example: +// "projects/my-project/locations/us-central1" Note: The locations +// portion of the resource must be specified. To get a list of all +// saved queries, a wildcard character - can be used for LOCATION_ID, +// for example: "projects/my-project/locations/-". +func (r *FoldersLocationsSavedQueriesService) List(parent string) *FoldersLocationsSavedQueriesListCall { + c := &FoldersLocationsSavedQueriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request.Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *FoldersLocationsSavedQueriesListCall) PageSize(pageSize int64) *FoldersLocationsSavedQueriesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *FoldersLocationsSavedQueriesListCall) PageToken(pageToken string) *FoldersLocationsSavedQueriesListCall { + 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 *FoldersSinksGetCall) Fields(s ...googleapi.Field) *FoldersSinksGetCall { +func (c *FoldersLocationsSavedQueriesListCall) Fields(s ...googleapi.Field) *FoldersLocationsSavedQueriesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -18291,7 +19331,7 @@ func (c *FoldersSinksGetCall) Fields(s ...googleapi.Field) *FoldersSinksGetCall // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *FoldersSinksGetCall) IfNoneMatch(entityTag string) *FoldersSinksGetCall { +func (c *FoldersLocationsSavedQueriesListCall) IfNoneMatch(entityTag string) *FoldersLocationsSavedQueriesListCall { c.ifNoneMatch_ = entityTag return c } @@ -18299,21 +19339,21 @@ func (c *FoldersSinksGetCall) IfNoneMatch(entityTag string) *FoldersSinksGetCall // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersSinksGetCall) Context(ctx context.Context) *FoldersSinksGetCall { +func (c *FoldersLocationsSavedQueriesListCall) Context(ctx context.Context) *FoldersLocationsSavedQueriesListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersSinksGetCall) Header() http.Header { +func (c *FoldersLocationsSavedQueriesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSinksGetCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLocationsSavedQueriesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -18326,7 +19366,7 @@ func (c *FoldersSinksGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/savedQueries") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -18334,19 +19374,19 @@ func (c *FoldersSinksGetCall) doRequest(alt string) (*http.Response, error) { } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "sinkName": c.sinkName, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.sinks.get" call. -// Exactly one of *LogSink or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *LogSink.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *FoldersSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { +// Do executes the "logging.folders.locations.savedQueries.list" call. +// Exactly one of *ListSavedQueriesResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ListSavedQueriesResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FoldersLocationsSavedQueriesListCall) Do(opts ...googleapi.CallOption) (*ListSavedQueriesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18365,7 +19405,7 @@ func (c *FoldersSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, error) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogSink{ + ret := &ListSavedQueriesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -18377,25 +19417,36 @@ func (c *FoldersSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, error) } return ret, nil // { - // "description": "Gets a sink.", - // "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}", + // "description": "Lists the SavedQueries that were created by the user making the request.", + // "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/savedQueries", // "httpMethod": "GET", - // "id": "logging.folders.sinks.get", + // "id": "logging.folders.locations.savedQueries.list", // "parameterOrder": [ - // "sinkName" + // "parent" // ], // "parameters": { - // "sinkName": { - // "description": "Required. The resource name of the sink: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request.Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The resource to which the listed queries belong. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" For example: \"projects/my-project/locations/us-central1\" Note: The locations portion of the resource must be specified. To get a list of all saved queries, a wildcard character - can be used for LOCATION_ID, for example: \"projects/my-project/locations/-\" ", // "location": "path", - // "pattern": "^folders/[^/]+/sinks/[^/]+$", + // "pattern": "^folders/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+sinkName}", + // "path": "v2/{+parent}/savedQueries", // "response": { - // "$ref": "LogSink" + // "$ref": "ListSavedQueriesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -18407,117 +19458,114 @@ func (c *FoldersSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, error) } -// method id "logging.folders.sinks.list": - -type FoldersSinksListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *FoldersLocationsSavedQueriesListCall) Pages(ctx context.Context, f func(*ListSavedQueriesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } } -// List: Lists sinks. -// -// - parent: The parent resource whose sinks are to be listed: -// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]". -func (r *FoldersSinksService) List(parent string) *FoldersSinksListCall { - c := &FoldersSinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} +// method id "logging.folders.logs.delete": -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return from this request. Non-positive values are -// ignored. The presence of nextPageToken in the response indicates that -// more results might be available. -func (c *FoldersSinksListCall) PageSize(pageSize int64) *FoldersSinksListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c +type FoldersLogsDeleteCall struct { + s *Service + logName string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// PageToken sets the optional parameter "pageToken": If present, then -// retrieve the next batch of results from the preceding call to this -// method. pageToken must be the value of nextPageToken from the -// previous response. The values of other method parameters should be -// identical to those in the previous call. -func (c *FoldersSinksListCall) PageToken(pageToken string) *FoldersSinksListCall { - c.urlParams_.Set("pageToken", pageToken) +// Delete: Deletes all the log entries in a log for the _Default Log +// Bucket. The log reappears if it receives new entries. Log entries +// written shortly before the delete operation might not be deleted. +// Entries received after the delete operation with a timestamp before +// the operation will be deleted. +// +// - logName: The resource name of the log to delete: +// projects/[PROJECT_ID]/logs/[LOG_ID] +// organizations/[ORGANIZATION_ID]/logs/[LOG_ID] +// billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID] +// folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For +// example, "projects/my-project-id/logs/syslog", +// "organizations/123/logs/cloudaudit.googleapis.com%2Factivity".For +// more information about log names, see LogEntry. +func (r *FoldersLogsService) Delete(logName string) *FoldersLogsDeleteCall { + c := &FoldersLogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.logName = logName return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersSinksListCall) Fields(s ...googleapi.Field) *FoldersSinksListCall { +func (c *FoldersLogsDeleteCall) Fields(s ...googleapi.Field) *FoldersLogsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *FoldersSinksListCall) IfNoneMatch(entityTag string) *FoldersSinksListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersSinksListCall) Context(ctx context.Context) *FoldersSinksListCall { +func (c *FoldersLogsDeleteCall) Context(ctx context.Context) *FoldersLogsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersSinksListCall) Header() http.Header { +func (c *FoldersLogsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSinksListCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersLogsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+logName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "logName": c.logName, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.sinks.list" call. -// Exactly one of *ListSinksResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListSinksResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *FoldersSinksListCall) Do(opts ...googleapi.CallOption) (*ListSinksResponse, error) { - gensupport.SetOptions(c.urlParams_, opts...) +// Do executes the "logging.folders.logs.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *FoldersLogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { + gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { @@ -18535,7 +19583,7 @@ func (c *FoldersSinksListCall) Do(opts ...googleapi.CallOption) (*ListSinksRespo if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListSinksResponse{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -18547,10 +19595,197 @@ func (c *FoldersSinksListCall) Do(opts ...googleapi.CallOption) (*ListSinksRespo } return ret, nil // { - // "description": "Lists sinks.", - // "flatPath": "v2/folders/{foldersId}/sinks", + // "description": "Deletes all the log entries in a log for the _Default Log Bucket. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted.", + // "flatPath": "v2/folders/{foldersId}/logs/{logsId}", + // "httpMethod": "DELETE", + // "id": "logging.folders.logs.delete", + // "parameterOrder": [ + // "logName" + // ], + // "parameters": { + // "logName": { + // "description": "Required. The resource name of the log to delete: projects/[PROJECT_ID]/logs/[LOG_ID] organizations/[ORGANIZATION_ID]/logs/[LOG_ID] billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID] folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/123/logs/cloudaudit.googleapis.com%2Factivity\".For more information about log names, see LogEntry.", + // "location": "path", + // "pattern": "^folders/[^/]+/logs/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+logName}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.folders.logs.list": + +type FoldersLogsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists the logs in projects, organizations, folders, or billing +// accounts. Only logs that have entries are listed. +// +// - parent: The resource name to list logs for: projects/[PROJECT_ID] +// organizations/[ORGANIZATION_ID] +// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]. +func (r *FoldersLogsService) List(parent string) *FoldersLogsListCall { + c := &FoldersLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request. Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *FoldersLogsListCall) PageSize(pageSize int64) *FoldersLogsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *FoldersLogsListCall) PageToken(pageToken string) *FoldersLogsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ResourceNames sets the optional parameter "resourceNames": List of +// resource names to list logs for: +// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/view +// s/[VIEW_ID] +// organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKE +// T_ID]/views/[VIEW_ID] +// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[ +// BUCKET_ID]/views/[VIEW_ID] +// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/ +// [VIEW_ID]To support legacy queries, it could also be: +// projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] +// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]The resource +// name in the parent field is added to this list. +func (c *FoldersLogsListCall) ResourceNames(resourceNames ...string) *FoldersLogsListCall { + c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FoldersLogsListCall) Fields(s ...googleapi.Field) *FoldersLogsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FoldersLogsListCall) IfNoneMatch(entityTag string) *FoldersLogsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *FoldersLogsListCall) Context(ctx context.Context) *FoldersLogsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *FoldersLogsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *FoldersLogsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "logging.folders.logs.list" call. +// Exactly one of *ListLogsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListLogsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FoldersLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ListLogsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", + // "flatPath": "v2/folders/{foldersId}/logs", // "httpMethod": "GET", - // "id": "logging.folders.sinks.list", + // "id": "logging.folders.logs.list", // "parameterOrder": [ // "parent" // ], @@ -18567,16 +19802,22 @@ func (c *FoldersSinksListCall) Do(opts ...googleapi.CallOption) (*ListSinksRespo // "type": "string" // }, // "parent": { - // "description": "Required. The parent resource whose sinks are to be listed: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ", + // "description": "Required. The resource name to list logs for: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", // "location": "path", // "pattern": "^folders/[^/]+$", // "required": true, // "type": "string" + // }, + // "resourceNames": { + // "description": "Optional. List of resource names to list logs for: projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]To support legacy queries, it could also be: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]The resource name in the parent field is added to this list.", + // "location": "query", + // "repeated": true, + // "type": "string" // } // }, - // "path": "v2/{+parent}/sinks", + // "path": "v2/{+parent}/logs", // "response": { - // "$ref": "ListSinksResponse" + // "$ref": "ListLogsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -18591,7 +19832,7 @@ func (c *FoldersSinksListCall) Do(opts ...googleapi.CallOption) (*ListSinksRespo // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *FoldersSinksListCall) Pages(ctx context.Context, f func(*ListSinksResponse) error) error { +func (c *FoldersLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -18609,32 +19850,29 @@ func (c *FoldersSinksListCall) Pages(ctx context.Context, f func(*ListSinksRespo } } -// method id "logging.folders.sinks.patch": +// method id "logging.folders.sinks.create": -type FoldersSinksPatchCall struct { +type FoldersSinksCreateCall struct { s *Service - sinkNameid string + parent string logsink *LogSink urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Patch: Updates a sink. This method replaces the following fields in -// the existing sink with values from the new sink: destination, and -// filter.The updated sink might also have a new writer_identity; see -// the unique_writer_identity field. +// Create: Creates a sink that exports specified log entries to a +// destination. The export begins upon ingress, unless the sink's +// writer_identity is not permitted to write to the destination. A sink +// can export log entries only from the resource owning the sink. // -// - sinkName: The full resource name of the sink to update, including -// the parent resource and the sink identifier: -// "projects/[PROJECT_ID]/sinks/[SINK_ID]" -// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" -// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For -// example:"projects/my-project/sinks/my-sink". -func (r *FoldersSinksService) Patch(sinkNameid string, logsink *LogSink) *FoldersSinksPatchCall { - c := &FoldersSinksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.sinkNameid = sinkNameid +// - parent: The resource in which to create the sink: +// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For +// examples:"projects/my-project" "organizations/123456789". +func (r *FoldersSinksService) Create(parent string, logsink *LogSink) *FoldersSinksCreateCall { + c := &FoldersSinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent c.logsink = logsink return c } @@ -18645,46 +19883,33 @@ func (r *FoldersSinksService) Patch(sinkNameid string, logsink *LogSink) *Folder // serviceAccount:some@email. This field can only be specified if you // are routing logs to a destination outside this sink's project. If not // specified, a Logging service account will automatically be generated. -func (c *FoldersSinksPatchCall) CustomWriterIdentity(customWriterIdentity string) *FoldersSinksPatchCall { +func (c *FoldersSinksCreateCall) CustomWriterIdentity(customWriterIdentity string) *FoldersSinksCreateCall { c.urlParams_.Set("customWriterIdentity", customWriterIdentity) return c } // UniqueWriterIdentity sets the optional parameter -// "uniqueWriterIdentity": See sinks.create for a description of this -// field. When updating a sink, the effect of this field on the value of -// writer_identity in the updated sink depends on both the old and new -// values of this field: If the old and new values of this field are -// both false or both true, then there is no change to the sink's -// writer_identity. If the old value is false and the new value is true, -// then writer_identity is changed to a service agent +// "uniqueWriterIdentity": Determines the kind of IAM identity returned +// as writer_identity in the new sink. If this value is omitted or set +// to false, and if the sink's parent is a project, then the value +// returned as writer_identity is the same group or service account used +// by Cloud Logging before the addition of writer identities to this +// API. The sink's destination must be in the same project as the sink +// itself.If this field is set to true, or if the sink is owned by a +// non-project resource such as an organization, then the value of +// writer_identity will be a service agent // (https://cloud.google.com/iam/docs/service-account-types#service-agents) -// owned by Cloud Logging. It is an error if the old value is true and -// the new value is set to false or defaulted to false. -func (c *FoldersSinksPatchCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *FoldersSinksPatchCall { +// used by the sinks with the same parent. For more information, see +// writer_identity in LogSink. +func (c *FoldersSinksCreateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *FoldersSinksCreateCall { c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity)) return c } -// UpdateMask sets the optional parameter "updateMask": Field mask that -// specifies the fields in sink that need an update. A sink field will -// be overwritten if, and only if, it is in the update mask. name and -// output only fields cannot be updated.An empty updateMask is -// temporarily treated as using the following mask for backwards -// compatibility purposes:destination,filter,includeChildrenAt some -// point in the future, behavior will be removed and specifying an empty -// updateMask will be an error.For a detailed FieldMask definition, see -// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor -// example: updateMask=filter -func (c *FoldersSinksPatchCall) UpdateMask(updateMask string) *FoldersSinksPatchCall { - c.urlParams_.Set("updateMask", updateMask) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersSinksPatchCall) Fields(s ...googleapi.Field) *FoldersSinksPatchCall { +func (c *FoldersSinksCreateCall) Fields(s ...googleapi.Field) *FoldersSinksCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -18692,21 +19917,21 @@ func (c *FoldersSinksPatchCall) Fields(s ...googleapi.Field) *FoldersSinksPatchC // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersSinksPatchCall) Context(ctx context.Context) *FoldersSinksPatchCall { +func (c *FoldersSinksCreateCall) Context(ctx context.Context) *FoldersSinksCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersSinksPatchCall) Header() http.Header { +func (c *FoldersSinksCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSinksPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -18721,27 +19946,27 @@ func (c *FoldersSinksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "sinkName": c.sinkNameid, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.sinks.patch" call. +// Do executes the "logging.folders.sinks.create" call. // Exactly one of *LogSink or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *LogSink.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. -func (c *FoldersSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { +func (c *FoldersSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18772,12 +19997,12 @@ func (c *FoldersSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink, erro } return ret, nil // { - // "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field.", - // "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}", - // "httpMethod": "PATCH", - // "id": "logging.folders.sinks.patch", + // "description": "Creates a sink that exports specified log entries to a destination. The export begins upon ingress, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.", + // "flatPath": "v2/folders/{foldersId}/sinks", + // "httpMethod": "POST", + // "id": "logging.folders.sinks.create", // "parameterOrder": [ - // "sinkName" + // "parent" // ], // "parameters": { // "customWriterIdentity": { @@ -18785,26 +20010,20 @@ func (c *FoldersSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink, erro // "location": "query", // "type": "string" // }, - // "sinkName": { - // "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", + // "parent": { + // "description": "Required. The resource in which to create the sink: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-project\" \"organizations/123456789\"", // "location": "path", - // "pattern": "^folders/[^/]+/sinks/[^/]+$", + // "pattern": "^folders/[^/]+$", // "required": true, // "type": "string" // }, // "uniqueWriterIdentity": { - // "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a service agent (https://cloud.google.com/iam/docs/service-account-types#service-agents) owned by Cloud Logging. It is an error if the old value is true and the new value is set to false or defaulted to false.", + // "description": "Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Cloud Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a service agent (https://cloud.google.com/iam/docs/service-account-types#service-agents) used by the sinks with the same parent. For more information, see writer_identity in LogSink.", // "location": "query", // "type": "boolean" - // }, - // "updateMask": { - // "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes:destination,filter,includeChildrenAt some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+sinkName}", + // "path": "v2/{+parent}/sinks", // "request": { // "$ref": "LogSink" // }, @@ -18819,82 +20038,36 @@ func (c *FoldersSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink, erro } -// method id "logging.folders.sinks.update": +// method id "logging.folders.sinks.delete": -type FoldersSinksUpdateCall struct { +type FoldersSinksDeleteCall struct { s *Service sinkNameid string - logsink *LogSink urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Update: Updates a sink. This method replaces the following fields in -// the existing sink with values from the new sink: destination, and -// filter.The updated sink might also have a new writer_identity; see -// the unique_writer_identity field. +// Delete: Deletes a sink. If the sink has a unique writer_identity, +// then that service account is also deleted. // -// - sinkName: The full resource name of the sink to update, including +// - sinkName: The full resource name of the sink to delete, including // the parent resource and the sink identifier: // "projects/[PROJECT_ID]/sinks/[SINK_ID]" // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" // "folders/[FOLDER_ID]/sinks/[SINK_ID]" For // example:"projects/my-project/sinks/my-sink". -func (r *FoldersSinksService) Update(sinkNameid string, logsink *LogSink) *FoldersSinksUpdateCall { - c := &FoldersSinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *FoldersSinksService) Delete(sinkNameid string) *FoldersSinksDeleteCall { + c := &FoldersSinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.sinkNameid = sinkNameid - c.logsink = logsink - return c -} - -// CustomWriterIdentity sets the optional parameter -// "customWriterIdentity": A service account provided by the caller that -// will be used to write the log entries. The format must be -// serviceAccount:some@email. This field can only be specified if you -// are routing logs to a destination outside this sink's project. If not -// specified, a Logging service account will automatically be generated. -func (c *FoldersSinksUpdateCall) CustomWriterIdentity(customWriterIdentity string) *FoldersSinksUpdateCall { - c.urlParams_.Set("customWriterIdentity", customWriterIdentity) - return c -} - -// UniqueWriterIdentity sets the optional parameter -// "uniqueWriterIdentity": See sinks.create for a description of this -// field. When updating a sink, the effect of this field on the value of -// writer_identity in the updated sink depends on both the old and new -// values of this field: If the old and new values of this field are -// both false or both true, then there is no change to the sink's -// writer_identity. If the old value is false and the new value is true, -// then writer_identity is changed to a service agent -// (https://cloud.google.com/iam/docs/service-account-types#service-agents) -// owned by Cloud Logging. It is an error if the old value is true and -// the new value is set to false or defaulted to false. -func (c *FoldersSinksUpdateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *FoldersSinksUpdateCall { - c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity)) - return c -} - -// UpdateMask sets the optional parameter "updateMask": Field mask that -// specifies the fields in sink that need an update. A sink field will -// be overwritten if, and only if, it is in the update mask. name and -// output only fields cannot be updated.An empty updateMask is -// temporarily treated as using the following mask for backwards -// compatibility purposes:destination,filter,includeChildrenAt some -// point in the future, behavior will be removed and specifying an empty -// updateMask will be an error.For a detailed FieldMask definition, see -// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor -// example: updateMask=filter -func (c *FoldersSinksUpdateCall) UpdateMask(updateMask string) *FoldersSinksUpdateCall { - c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *FoldersSinksUpdateCall) Fields(s ...googleapi.Field) *FoldersSinksUpdateCall { +func (c *FoldersSinksDeleteCall) Fields(s ...googleapi.Field) *FoldersSinksDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -18902,21 +20075,21 @@ func (c *FoldersSinksUpdateCall) Fields(s ...googleapi.Field) *FoldersSinksUpdat // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *FoldersSinksUpdateCall) Context(ctx context.Context) *FoldersSinksUpdateCall { +func (c *FoldersSinksDeleteCall) Context(ctx context.Context) *FoldersSinksDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *FoldersSinksUpdateCall) Header() http.Header { +func (c *FoldersSinksDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *FoldersSinksUpdateCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -18924,16 +20097,11 @@ func (c *FoldersSinksUpdateCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -18944,14 +20112,14 @@ func (c *FoldersSinksUpdateCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.folders.sinks.update" call. -// Exactly one of *LogSink or error will be non-nil. Any non-2xx status +// Do executes the "logging.folders.sinks.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *LogSink.ServerResponse.Header or (if a response was returned at all) +// *Empty.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. -func (c *FoldersSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { +func (c *FoldersSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18970,7 +20138,7 @@ func (c *FoldersSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, err if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogSink{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -18982,44 +20150,25 @@ func (c *FoldersSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, err } return ret, nil // { - // "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field.", + // "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.", // "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}", - // "httpMethod": "PUT", - // "id": "logging.folders.sinks.update", + // "httpMethod": "DELETE", + // "id": "logging.folders.sinks.delete", // "parameterOrder": [ // "sinkName" // ], // "parameters": { - // "customWriterIdentity": { - // "description": "Optional. A service account provided by the caller that will be used to write the log entries. The format must be serviceAccount:some@email. This field can only be specified if you are routing logs to a destination outside this sink's project. If not specified, a Logging service account will automatically be generated.", - // "location": "query", - // "type": "string" - // }, // "sinkName": { - // "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", + // "description": "Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", // "location": "path", // "pattern": "^folders/[^/]+/sinks/[^/]+$", // "required": true, // "type": "string" - // }, - // "uniqueWriterIdentity": { - // "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a service agent (https://cloud.google.com/iam/docs/service-account-types#service-agents) owned by Cloud Logging. It is an error if the old value is true and the new value is set to false or defaulted to false.", - // "location": "query", - // "type": "boolean" - // }, - // "updateMask": { - // "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes:destination,filter,includeChildrenAt some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, // "path": "v2/{+sinkName}", - // "request": { - // "$ref": "LogSink" - // }, // "response": { - // "$ref": "LogSink" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -19029,30 +20178,35 @@ func (c *FoldersSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, err } -// method id "logging.locations.get": +// method id "logging.folders.sinks.get": -type LocationsGetCall struct { +type FoldersSinksGetCall struct { s *Service - name string + sinkName string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Gets information about a location. +// Get: Gets a sink. // -// - name: Resource name for the location. -func (r *LocationsService) Get(name string) *LocationsGetCall { - c := &LocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - sinkName: The resource name of the sink: +// "projects/[PROJECT_ID]/sinks/[SINK_ID]" +// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" +// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For +// example:"projects/my-project/sinks/my-sink". +func (r *FoldersSinksService) Get(sinkName string) *FoldersSinksGetCall { + c := &FoldersSinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.sinkName = sinkName return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsGetCall) Fields(s ...googleapi.Field) *LocationsGetCall { +func (c *FoldersSinksGetCall) Fields(s ...googleapi.Field) *FoldersSinksGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -19062,7 +20216,7 @@ func (c *LocationsGetCall) Fields(s ...googleapi.Field) *LocationsGetCall { // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *LocationsGetCall) IfNoneMatch(entityTag string) *LocationsGetCall { +func (c *FoldersSinksGetCall) IfNoneMatch(entityTag string) *FoldersSinksGetCall { c.ifNoneMatch_ = entityTag return c } @@ -19070,21 +20224,21 @@ func (c *LocationsGetCall) IfNoneMatch(entityTag string) *LocationsGetCall { // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsGetCall) Context(ctx context.Context) *LocationsGetCall { +func (c *FoldersSinksGetCall) Context(ctx context.Context) *FoldersSinksGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsGetCall) Header() http.Header { +func (c *FoldersSinksGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSinksGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -19097,7 +20251,7 @@ func (c *LocationsGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -19105,19 +20259,19 @@ func (c *LocationsGetCall) doRequest(alt string) (*http.Response, error) { } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "sinkName": c.sinkName, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.get" call. -// Exactly one of *Location or error will be non-nil. Any non-2xx status +// Do executes the "logging.folders.sinks.get" call. +// Exactly one of *LogSink or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *Location.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *LocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) { +// *LogSink.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *FoldersSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -19136,7 +20290,7 @@ func (c *LocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Location{ + ret := &LogSink{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -19148,25 +20302,25 @@ func (c *LocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) { } return ret, nil // { - // "description": "Gets information about a location.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}", + // "description": "Gets a sink.", + // "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}", // "httpMethod": "GET", - // "id": "logging.locations.get", + // "id": "logging.folders.sinks.get", // "parameterOrder": [ - // "name" + // "sinkName" // ], // "parameters": { - // "name": { - // "description": "Resource name for the location.", + // "sinkName": { + // "description": "Required. The resource name of the sink: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", // "location": "path", - // "pattern": "^[^/]+/[^/]+/locations/[^/]+$", + // "pattern": "^folders/[^/]+/sinks/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+sinkName}", // "response": { - // "$ref": "Location" + // "$ref": "LogSink" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -19178,48 +20332,43 @@ func (c *LocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) { } -// method id "logging.locations.list": +// method id "logging.folders.sinks.list": -type LocationsListCall struct { +type FoldersSinksListCall struct { s *Service - name string + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists information about the supported locations for this -// service. +// List: Lists sinks. // -// - name: The resource that owns the locations collection, if -// applicable. -func (r *LocationsService) List(name string) *LocationsListCall { - c := &LocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - return c -} - -// Filter sets the optional parameter "filter": A filter to narrow down -// results to a preferred subset. The filtering language accepts strings -// like "displayName=tokyo", and is documented in more detail in AIP-160 -// (https://google.aip.dev/160). -func (c *LocationsListCall) Filter(filter string) *LocationsListCall { - c.urlParams_.Set("filter", filter) +// - parent: The parent resource whose sinks are to be listed: +// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]". +func (r *FoldersSinksService) List(parent string) *FoldersSinksListCall { + c := &FoldersSinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent return c } // PageSize sets the optional parameter "pageSize": The maximum number -// of results to return. If not set, the service selects a default. -func (c *LocationsListCall) PageSize(pageSize int64) *LocationsListCall { +// of results to return from this request. Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *FoldersSinksListCall) PageSize(pageSize int64) *FoldersSinksListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } -// PageToken sets the optional parameter "pageToken": A page token -// received from the next_page_token field in the response. Send that -// page token to receive the subsequent page. -func (c *LocationsListCall) PageToken(pageToken string) *LocationsListCall { +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *FoldersSinksListCall) PageToken(pageToken string) *FoldersSinksListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -19227,7 +20376,7 @@ func (c *LocationsListCall) PageToken(pageToken string) *LocationsListCall { // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsListCall) Fields(s ...googleapi.Field) *LocationsListCall { +func (c *FoldersSinksListCall) Fields(s ...googleapi.Field) *FoldersSinksListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -19237,7 +20386,7 @@ func (c *LocationsListCall) Fields(s ...googleapi.Field) *LocationsListCall { // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *LocationsListCall) IfNoneMatch(entityTag string) *LocationsListCall { +func (c *FoldersSinksListCall) IfNoneMatch(entityTag string) *FoldersSinksListCall { c.ifNoneMatch_ = entityTag return c } @@ -19245,21 +20394,21 @@ func (c *LocationsListCall) IfNoneMatch(entityTag string) *LocationsListCall { // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsListCall) Context(ctx context.Context) *LocationsListCall { +func (c *FoldersSinksListCall) Context(ctx context.Context) *FoldersSinksListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsListCall) Header() http.Header { +func (c *FoldersSinksListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSinksListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -19272,7 +20421,7 @@ func (c *LocationsListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -19280,19 +20429,19 @@ func (c *LocationsListCall) doRequest(alt string) (*http.Response, error) { } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.list" call. -// Exactly one of *ListLocationsResponse or error will be non-nil. Any +// Do executes the "logging.folders.sinks.list" call. +// Exactly one of *ListSinksResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either -// *ListLocationsResponse.ServerResponse.Header or (if a response was +// *ListSinksResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *LocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) { +func (c *FoldersSinksListCall) Do(opts ...googleapi.CallOption) (*ListSinksResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -19311,7 +20460,7 @@ func (c *LocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResp if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListLocationsResponse{ + ret := &ListSinksResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -19323,41 +20472,36 @@ func (c *LocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResp } return ret, nil // { - // "description": "Lists information about the supported locations for this service.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations", + // "description": "Lists sinks.", + // "flatPath": "v2/folders/{foldersId}/sinks", // "httpMethod": "GET", - // "id": "logging.locations.list", + // "id": "logging.folders.sinks.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "filter": { - // "description": "A filter to narrow down results to a preferred subset. The filtering language accepts strings like \"displayName=tokyo\", and is documented in more detail in AIP-160 (https://google.aip.dev/160).", - // "location": "query", - // "type": "string" - // }, - // "name": { - // "description": "The resource that owns the locations collection, if applicable.", - // "location": "path", - // "pattern": "^[^/]+/[^/]+$", - // "required": true, - // "type": "string" - // }, // "pageSize": { - // "description": "The maximum number of results to return. If not set, the service selects a default.", + // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "A page token received from the next_page_token field in the response. Send that page token to receive the subsequent page.", + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", // "location": "query", // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent resource whose sinks are to be listed: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ", + // "location": "path", + // "pattern": "^folders/[^/]+$", + // "required": true, + // "type": "string" // } // }, - // "path": "v2/{+name}/locations", + // "path": "v2/{+parent}/sinks", // "response": { - // "$ref": "ListLocationsResponse" + // "$ref": "ListSinksResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -19372,7 +20516,7 @@ func (c *LocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResp // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *LocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error { +func (c *FoldersSinksListCall) Pages(ctx context.Context, f func(*ListSinksResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -19390,44 +20534,82 @@ func (c *LocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResp } } -// method id "logging.locations.buckets.create": +// method id "logging.folders.sinks.patch": -type LocationsBucketsCreateCall struct { +type FoldersSinksPatchCall struct { s *Service - parent string - logbucket *LogBucket + sinkNameid string + logsink *LogSink urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Create: Creates a log bucket that can be used to store log entries. -// After a bucket has been created, the bucket's location cannot be -// changed. +// Patch: Updates a sink. This method replaces the following fields in +// the existing sink with values from the new sink: destination, and +// filter.The updated sink might also have a new writer_identity; see +// the unique_writer_identity field. // -// - parent: The resource in which to create the log bucket: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For -// example:"projects/my-project/locations/global". -func (r *LocationsBucketsService) Create(parent string, logbucket *LogBucket) *LocationsBucketsCreateCall { - c := &LocationsBucketsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.logbucket = logbucket +// - sinkName: The full resource name of the sink to update, including +// the parent resource and the sink identifier: +// "projects/[PROJECT_ID]/sinks/[SINK_ID]" +// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" +// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For +// example:"projects/my-project/sinks/my-sink". +func (r *FoldersSinksService) Patch(sinkNameid string, logsink *LogSink) *FoldersSinksPatchCall { + c := &FoldersSinksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.sinkNameid = sinkNameid + c.logsink = logsink return c } -// BucketId sets the optional parameter "bucketId": Required. A -// client-assigned identifier such as "my-bucket". Identifiers are -// limited to 100 characters and can include only letters, digits, -// underscores, hyphens, and periods. -func (c *LocationsBucketsCreateCall) BucketId(bucketId string) *LocationsBucketsCreateCall { - c.urlParams_.Set("bucketId", bucketId) +// CustomWriterIdentity sets the optional parameter +// "customWriterIdentity": A service account provided by the caller that +// will be used to write the log entries. The format must be +// serviceAccount:some@email. This field can only be specified if you +// are routing logs to a destination outside this sink's project. If not +// specified, a Logging service account will automatically be generated. +func (c *FoldersSinksPatchCall) CustomWriterIdentity(customWriterIdentity string) *FoldersSinksPatchCall { + c.urlParams_.Set("customWriterIdentity", customWriterIdentity) + return c +} + +// UniqueWriterIdentity sets the optional parameter +// "uniqueWriterIdentity": See sinks.create for a description of this +// field. When updating a sink, the effect of this field on the value of +// writer_identity in the updated sink depends on both the old and new +// values of this field: If the old and new values of this field are +// both false or both true, then there is no change to the sink's +// writer_identity. If the old value is false and the new value is true, +// then writer_identity is changed to a service agent +// (https://cloud.google.com/iam/docs/service-account-types#service-agents) +// owned by Cloud Logging. It is an error if the old value is true and +// the new value is set to false or defaulted to false. +func (c *FoldersSinksPatchCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *FoldersSinksPatchCall { + c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity)) + return c +} + +// UpdateMask sets the optional parameter "updateMask": Field mask that +// specifies the fields in sink that need an update. A sink field will +// be overwritten if, and only if, it is in the update mask. name and +// output only fields cannot be updated.An empty updateMask is +// temporarily treated as using the following mask for backwards +// compatibility purposes:destination,filter,includeChildrenAt some +// point in the future, behavior will be removed and specifying an empty +// updateMask will be an error.For a detailed FieldMask definition, see +// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor +// example: updateMask=filter +func (c *FoldersSinksPatchCall) UpdateMask(updateMask string) *FoldersSinksPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsBucketsCreateCall) Fields(s ...googleapi.Field) *LocationsBucketsCreateCall { +func (c *FoldersSinksPatchCall) Fields(s ...googleapi.Field) *FoldersSinksPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -19435,21 +20617,21 @@ func (c *LocationsBucketsCreateCall) Fields(s ...googleapi.Field) *LocationsBuck // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsBucketsCreateCall) Context(ctx context.Context) *LocationsBucketsCreateCall { +func (c *FoldersSinksPatchCall) Context(ctx context.Context) *FoldersSinksPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsBucketsCreateCall) Header() http.Header { +func (c *FoldersSinksPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSinksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -19457,34 +20639,34 @@ func (c *LocationsBucketsCreateCall) doRequest(alt string) (*http.Response, erro } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "sinkName": c.sinkNameid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.buckets.create" call. -// Exactly one of *LogBucket or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *LogBucket.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *LocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { +// Do executes the "logging.folders.sinks.patch" call. +// Exactly one of *LogSink or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogSink.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *FoldersSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -19503,7 +20685,7 @@ func (c *LocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucke if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogBucket{ + ret := &LogSink{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -19515,33 +20697,44 @@ func (c *LocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucke } return ret, nil // { - // "description": "Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets", - // "httpMethod": "POST", - // "id": "logging.locations.buckets.create", + // "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field.", + // "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}", + // "httpMethod": "PATCH", + // "id": "logging.folders.sinks.patch", // "parameterOrder": [ - // "parent" + // "sinkName" // ], // "parameters": { - // "bucketId": { - // "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", + // "customWriterIdentity": { + // "description": "Optional. A service account provided by the caller that will be used to write the log entries. The format must be serviceAccount:some@email. This field can only be specified if you are routing logs to a destination outside this sink's project. If not specified, a Logging service account will automatically be generated.", // "location": "query", // "type": "string" // }, - // "parent": { - // "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"", + // "sinkName": { + // "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", // "location": "path", - // "pattern": "^[^/]+/[^/]+/locations/[^/]+$", + // "pattern": "^folders/[^/]+/sinks/[^/]+$", // "required": true, // "type": "string" + // }, + // "uniqueWriterIdentity": { + // "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a service agent (https://cloud.google.com/iam/docs/service-account-types#service-agents) owned by Cloud Logging. It is an error if the old value is true and the new value is set to false or defaulted to false.", + // "location": "query", + // "type": "boolean" + // }, + // "updateMask": { + // "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes:destination,filter,includeChildrenAt some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+parent}/buckets", + // "path": "v2/{+sinkName}", // "request": { - // "$ref": "LogBucket" + // "$ref": "LogSink" // }, // "response": { - // "$ref": "LogBucket" + // "$ref": "LogSink" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -19551,44 +20744,82 @@ func (c *LocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucke } -// method id "logging.locations.buckets.createAsync": +// method id "logging.folders.sinks.update": -type LocationsBucketsCreateAsyncCall struct { +type FoldersSinksUpdateCall struct { s *Service - parent string - logbucket *LogBucket + sinkNameid string + logsink *LogSink urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// CreateAsync: Creates a log bucket asynchronously that can be used to -// store log entries.After a bucket has been created, the bucket's -// location cannot be changed. +// Update: Updates a sink. This method replaces the following fields in +// the existing sink with values from the new sink: destination, and +// filter.The updated sink might also have a new writer_identity; see +// the unique_writer_identity field. // -// - parent: The resource in which to create the log bucket: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For -// example:"projects/my-project/locations/global". -func (r *LocationsBucketsService) CreateAsync(parent string, logbucket *LogBucket) *LocationsBucketsCreateAsyncCall { - c := &LocationsBucketsCreateAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.logbucket = logbucket +// - sinkName: The full resource name of the sink to update, including +// the parent resource and the sink identifier: +// "projects/[PROJECT_ID]/sinks/[SINK_ID]" +// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" +// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For +// example:"projects/my-project/sinks/my-sink". +func (r *FoldersSinksService) Update(sinkNameid string, logsink *LogSink) *FoldersSinksUpdateCall { + c := &FoldersSinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.sinkNameid = sinkNameid + c.logsink = logsink return c } -// BucketId sets the optional parameter "bucketId": Required. A -// client-assigned identifier such as "my-bucket". Identifiers are -// limited to 100 characters and can include only letters, digits, -// underscores, hyphens, and periods. -func (c *LocationsBucketsCreateAsyncCall) BucketId(bucketId string) *LocationsBucketsCreateAsyncCall { - c.urlParams_.Set("bucketId", bucketId) +// CustomWriterIdentity sets the optional parameter +// "customWriterIdentity": A service account provided by the caller that +// will be used to write the log entries. The format must be +// serviceAccount:some@email. This field can only be specified if you +// are routing logs to a destination outside this sink's project. If not +// specified, a Logging service account will automatically be generated. +func (c *FoldersSinksUpdateCall) CustomWriterIdentity(customWriterIdentity string) *FoldersSinksUpdateCall { + c.urlParams_.Set("customWriterIdentity", customWriterIdentity) + return c +} + +// UniqueWriterIdentity sets the optional parameter +// "uniqueWriterIdentity": See sinks.create for a description of this +// field. When updating a sink, the effect of this field on the value of +// writer_identity in the updated sink depends on both the old and new +// values of this field: If the old and new values of this field are +// both false or both true, then there is no change to the sink's +// writer_identity. If the old value is false and the new value is true, +// then writer_identity is changed to a service agent +// (https://cloud.google.com/iam/docs/service-account-types#service-agents) +// owned by Cloud Logging. It is an error if the old value is true and +// the new value is set to false or defaulted to false. +func (c *FoldersSinksUpdateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *FoldersSinksUpdateCall { + c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity)) + return c +} + +// UpdateMask sets the optional parameter "updateMask": Field mask that +// specifies the fields in sink that need an update. A sink field will +// be overwritten if, and only if, it is in the update mask. name and +// output only fields cannot be updated.An empty updateMask is +// temporarily treated as using the following mask for backwards +// compatibility purposes:destination,filter,includeChildrenAt some +// point in the future, behavior will be removed and specifying an empty +// updateMask will be an error.For a detailed FieldMask definition, see +// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor +// example: updateMask=filter +func (c *FoldersSinksUpdateCall) UpdateMask(updateMask string) *FoldersSinksUpdateCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsBucketsCreateAsyncCall) Fields(s ...googleapi.Field) *LocationsBucketsCreateAsyncCall { +func (c *FoldersSinksUpdateCall) Fields(s ...googleapi.Field) *FoldersSinksUpdateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -19596,21 +20827,21 @@ func (c *LocationsBucketsCreateAsyncCall) Fields(s ...googleapi.Field) *Location // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsBucketsCreateAsyncCall) Context(ctx context.Context) *LocationsBucketsCreateAsyncCall { +func (c *FoldersSinksUpdateCall) Context(ctx context.Context) *FoldersSinksUpdateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsBucketsCreateAsyncCall) Header() http.Header { +func (c *FoldersSinksUpdateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsBucketsCreateAsyncCall) doRequest(alt string) (*http.Response, error) { +func (c *FoldersSinksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -19618,34 +20849,34 @@ func (c *LocationsBucketsCreateAsyncCall) doRequest(alt string) (*http.Response, } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets:createAsync") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PUT", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "sinkName": c.sinkNameid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.buckets.createAsync" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *LocationsBucketsCreateAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// Do executes the "logging.folders.sinks.update" call. +// Exactly one of *LogSink or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogSink.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *FoldersSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -19664,7 +20895,7 @@ func (c *LocationsBucketsCreateAsyncCall) Do(opts ...googleapi.CallOption) (*Ope if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &LogSink{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -19676,33 +20907,44 @@ func (c *LocationsBucketsCreateAsyncCall) Do(opts ...googleapi.CallOption) (*Ope } return ret, nil // { - // "description": "Creates a log bucket asynchronously that can be used to store log entries.After a bucket has been created, the bucket's location cannot be changed.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets:createAsync", - // "httpMethod": "POST", - // "id": "logging.locations.buckets.createAsync", + // "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field.", + // "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}", + // "httpMethod": "PUT", + // "id": "logging.folders.sinks.update", // "parameterOrder": [ - // "parent" + // "sinkName" // ], // "parameters": { - // "bucketId": { - // "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", + // "customWriterIdentity": { + // "description": "Optional. A service account provided by the caller that will be used to write the log entries. The format must be serviceAccount:some@email. This field can only be specified if you are routing logs to a destination outside this sink's project. If not specified, a Logging service account will automatically be generated.", // "location": "query", // "type": "string" // }, - // "parent": { - // "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"", + // "sinkName": { + // "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", // "location": "path", - // "pattern": "^[^/]+/[^/]+/locations/[^/]+$", + // "pattern": "^folders/[^/]+/sinks/[^/]+$", // "required": true, // "type": "string" + // }, + // "uniqueWriterIdentity": { + // "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a service agent (https://cloud.google.com/iam/docs/service-account-types#service-agents) owned by Cloud Logging. It is an error if the old value is true and the new value is set to false or defaulted to false.", + // "location": "query", + // "type": "boolean" + // }, + // "updateMask": { + // "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes:destination,filter,includeChildrenAt some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+parent}/buckets:createAsync", + // "path": "v2/{+sinkName}", // "request": { - // "$ref": "LogBucket" + // "$ref": "LogSink" // }, // "response": { - // "$ref": "Operation" + // "$ref": "LogSink" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -19712,31 +20954,22 @@ func (c *LocationsBucketsCreateAsyncCall) Do(opts ...googleapi.CallOption) (*Ope } -// method id "logging.locations.buckets.delete": +// method id "logging.locations.get": -type LocationsBucketsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type LocationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a log bucket.Changes the bucket's lifecycle_state to -// the DELETE_REQUESTED state. After 7 days, the bucket will be purged -// and all log entries in the bucket will be permanently deleted. +// Get: Gets information about a location. // -// - name: The full resource name of the bucket to delete. -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *LocationsBucketsService) Delete(name string) *LocationsBucketsDeleteCall { - c := &LocationsBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Resource name for the location. +func (r *LocationsService) Get(name string) *LocationsGetCall { + c := &LocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -19744,41 +20977,54 @@ func (r *LocationsBucketsService) Delete(name string) *LocationsBucketsDeleteCal // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *LocationsBucketsDeleteCall { +func (c *LocationsGetCall) Fields(s ...googleapi.Field) *LocationsGetCall { 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 *LocationsGetCall) IfNoneMatch(entityTag string) *LocationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsBucketsDeleteCall) Context(ctx context.Context) *LocationsBucketsDeleteCall { +func (c *LocationsGetCall) Context(ctx context.Context) *LocationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsBucketsDeleteCall) Header() http.Header { +func (c *LocationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -19789,14 +21035,14 @@ func (c *LocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, erro return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.buckets.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// Do executes the "logging.locations.get" call. +// Exactly one of *Location or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *LocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// *Location.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *LocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -19815,7 +21061,7 @@ func (c *LocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, e if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &Location{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -19827,37 +21073,39 @@ func (c *LocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, e } return ret, nil // { - // "description": "Deletes a log bucket.Changes the bucket's lifecycle_state to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}", - // "httpMethod": "DELETE", - // "id": "logging.locations.buckets.delete", + // "description": "Gets information about a location.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}", + // "httpMethod": "GET", + // "id": "logging.locations.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The full resource name of the bucket to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "description": "Resource name for the location.", // "location": "path", - // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v2/{+name}", // "response": { - // "$ref": "Empty" + // "$ref": "Location" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.locations.buckets.get": +// method id "logging.locations.list": -type LocationsBucketsGetCall struct { +type LocationsListCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -19866,27 +21114,45 @@ type LocationsBucketsGetCall struct { header_ http.Header } -// Get: Gets a log bucket. +// List: Lists information about the supported locations for this +// service. // -// - name: The resource name of the bucket: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *LocationsBucketsService) Get(name string) *LocationsBucketsGetCall { - c := &LocationsBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource that owns the locations collection, if +// applicable. +func (r *LocationsService) List(name string) *LocationsListCall { + c := &LocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } +// Filter sets the optional parameter "filter": A filter to narrow down +// results to a preferred subset. The filtering language accepts strings +// like "displayName=tokyo", and is documented in more detail in AIP-160 +// (https://google.aip.dev/160). +func (c *LocationsListCall) Filter(filter string) *LocationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return. If not set, the service selects a default. +func (c *LocationsListCall) PageSize(pageSize int64) *LocationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token +// received from the next_page_token field in the response. Send that +// page token to receive the subsequent page. +func (c *LocationsListCall) PageToken(pageToken string) *LocationsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsBucketsGetCall) Fields(s ...googleapi.Field) *LocationsBucketsGetCall { +func (c *LocationsListCall) Fields(s ...googleapi.Field) *LocationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -19896,7 +21162,7 @@ func (c *LocationsBucketsGetCall) Fields(s ...googleapi.Field) *LocationsBuckets // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *LocationsBucketsGetCall) IfNoneMatch(entityTag string) *LocationsBucketsGetCall { +func (c *LocationsListCall) IfNoneMatch(entityTag string) *LocationsListCall { c.ifNoneMatch_ = entityTag return c } @@ -19904,21 +21170,21 @@ func (c *LocationsBucketsGetCall) IfNoneMatch(entityTag string) *LocationsBucket // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsBucketsGetCall) Context(ctx context.Context) *LocationsBucketsGetCall { +func (c *LocationsListCall) Context(ctx context.Context) *LocationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsBucketsGetCall) Header() http.Header { +func (c *LocationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsBucketsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -19931,7 +21197,7 @@ func (c *LocationsBucketsGetCall) doRequest(alt string) (*http.Response, error) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -19944,14 +21210,14 @@ func (c *LocationsBucketsGetCall) doRequest(alt string) (*http.Response, error) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.buckets.get" call. -// Exactly one of *LogBucket or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *LogBucket.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *LocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { +// Do executes the "logging.locations.list" call. +// Exactly one of *ListLocationsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListLocationsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -19970,7 +21236,7 @@ func (c *LocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogBucket{ + ret := &ListLocationsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -19982,25 +21248,41 @@ func (c *LocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, } return ret, nil // { - // "description": "Gets a log bucket.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}", + // "description": "Lists information about the supported locations for this service.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations", // "httpMethod": "GET", - // "id": "logging.locations.buckets.get", + // "id": "logging.locations.list", // "parameterOrder": [ // "name" // ], // "parameters": { + // "filter": { + // "description": "A filter to narrow down results to a preferred subset. The filtering language accepts strings like \"displayName=tokyo\", and is documented in more detail in AIP-160 (https://google.aip.dev/160).", + // "location": "query", + // "type": "string" + // }, // "name": { - // "description": "Required. The resource name of the bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "description": "The resource that owns the locations collection, if applicable.", // "location": "path", - // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "pattern": "^[^/]+/[^/]+$", // "required": true, // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of results to return. If not set, the service selects a default.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token received from the next_page_token field in the response. Send that page token to receive the subsequent page.", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+name}/locations", // "response": { - // "$ref": "LogBucket" + // "$ref": "ListLocationsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -20012,102 +21294,104 @@ func (c *LocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, } -// method id "logging.locations.buckets.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 *LocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type LocationsBucketsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// method id "logging.locations.buckets.create": + +type LocationsBucketsCreateCall struct { + s *Service + parent string + logbucket *LogBucket + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists log buckets. +// Create: Creates a log bucket that can be used to store log entries. +// After a bucket has been created, the bucket's location cannot be +// changed. // -// - parent: The parent resource whose buckets are to be listed: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" Note: The locations -// portion of the resource must be specified, but supplying the -// character - in place of LOCATION_ID will return all buckets. -func (r *LocationsBucketsService) List(parent string) *LocationsBucketsListCall { - c := &LocationsBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The resource in which to create the log bucket: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For +// example:"projects/my-project/locations/global". +func (r *LocationsBucketsService) Create(parent string, logbucket *LogBucket) *LocationsBucketsCreateCall { + c := &LocationsBucketsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent + c.logbucket = logbucket return c } -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return from this request. Non-positive values are -// ignored. The presence of nextPageToken in the response indicates that -// more results might be available. -func (c *LocationsBucketsListCall) PageSize(pageSize int64) *LocationsBucketsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": If present, then -// retrieve the next batch of results from the preceding call to this -// method. pageToken must be the value of nextPageToken from the -// previous response. The values of other method parameters should be -// identical to those in the previous call. -func (c *LocationsBucketsListCall) PageToken(pageToken string) *LocationsBucketsListCall { - c.urlParams_.Set("pageToken", pageToken) +// BucketId sets the optional parameter "bucketId": Required. A +// client-assigned identifier such as "my-bucket". Identifiers are +// limited to 100 characters and can include only letters, digits, +// underscores, hyphens, and periods. +func (c *LocationsBucketsCreateCall) BucketId(bucketId string) *LocationsBucketsCreateCall { + c.urlParams_.Set("bucketId", bucketId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsBucketsListCall) Fields(s ...googleapi.Field) *LocationsBucketsListCall { +func (c *LocationsBucketsCreateCall) Fields(s ...googleapi.Field) *LocationsBucketsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *LocationsBucketsListCall) IfNoneMatch(entityTag string) *LocationsBucketsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsBucketsListCall) Context(ctx context.Context) *LocationsBucketsListCall { +func (c *LocationsBucketsCreateCall) Context(ctx context.Context) *LocationsBucketsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsBucketsListCall) Header() http.Header { +func (c *LocationsBucketsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsBucketsListCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -20118,14 +21402,14 @@ func (c *LocationsBucketsListCall) doRequest(alt string) (*http.Response, error) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.buckets.list" call. -// Exactly one of *ListBucketsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListBucketsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *LocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucketsResponse, error) { +// Do executes the "logging.locations.buckets.create" call. +// Exactly one of *LogBucket or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LogBucket.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *LocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -20144,7 +21428,7 @@ func (c *LocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucket if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListBucketsResponse{ + ret := &LogBucket{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -20156,27 +21440,21 @@ func (c *LocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucket } return ret, nil // { - // "description": "Lists log buckets.", + // "description": "Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed.", // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets", - // "httpMethod": "GET", - // "id": "logging.locations.buckets.list", + // "httpMethod": "POST", + // "id": "logging.locations.buckets.create", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "pageSize": { - // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "bucketId": { + // "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. The parent resource whose buckets are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets.", + // "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"", // "location": "path", // "pattern": "^[^/]+/[^/]+/locations/[^/]+$", // "required": true, @@ -20184,87 +21462,58 @@ func (c *LocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucket // } // }, // "path": "v2/{+parent}/buckets", + // "request": { + // "$ref": "LogBucket" + // }, // "response": { - // "$ref": "ListBucketsResponse" + // "$ref": "LogBucket" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *LocationsBucketsListCall) Pages(ctx context.Context, f func(*ListBucketsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "logging.locations.buckets.patch": +// method id "logging.locations.buckets.createAsync": -type LocationsBucketsPatchCall struct { +type LocationsBucketsCreateAsyncCall struct { s *Service - name string + parent string logbucket *LogBucket urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Patch: Updates a log bucket.If the bucket has a lifecycle_state of -// DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a -// bucket has been created, the bucket's location cannot be changed. +// CreateAsync: Creates a log bucket asynchronously that can be used to +// store log entries.After a bucket has been created, the bucket's +// location cannot be changed. // -// - name: The full resource name of the bucket to update. -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *LocationsBucketsService) Patch(name string, logbucket *LogBucket) *LocationsBucketsPatchCall { - c := &LocationsBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: The resource in which to create the log bucket: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For +// example:"projects/my-project/locations/global". +func (r *LocationsBucketsService) CreateAsync(parent string, logbucket *LogBucket) *LocationsBucketsCreateAsyncCall { + c := &LocationsBucketsCreateAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent c.logbucket = logbucket return c } -// UpdateMask sets the optional parameter "updateMask": Required. Field -// mask that specifies the fields in bucket that need an update. A -// bucket field will be overwritten if, and only if, it is in the update -// mask. name and output only fields cannot be updated.For a detailed -// FieldMask definition, see: -// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor -// example: updateMask=retention_days -func (c *LocationsBucketsPatchCall) UpdateMask(updateMask string) *LocationsBucketsPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// BucketId sets the optional parameter "bucketId": Required. A +// client-assigned identifier such as "my-bucket". Identifiers are +// limited to 100 characters and can include only letters, digits, +// underscores, hyphens, and periods. +func (c *LocationsBucketsCreateAsyncCall) BucketId(bucketId string) *LocationsBucketsCreateAsyncCall { + c.urlParams_.Set("bucketId", bucketId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsBucketsPatchCall) Fields(s ...googleapi.Field) *LocationsBucketsPatchCall { +func (c *LocationsBucketsCreateAsyncCall) Fields(s ...googleapi.Field) *LocationsBucketsCreateAsyncCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -20272,21 +21521,21 @@ func (c *LocationsBucketsPatchCall) Fields(s ...googleapi.Field) *LocationsBucke // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsBucketsPatchCall) Context(ctx context.Context) *LocationsBucketsPatchCall { +func (c *LocationsBucketsCreateAsyncCall) Context(ctx context.Context) *LocationsBucketsCreateAsyncCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsBucketsPatchCall) Header() http.Header { +func (c *LocationsBucketsCreateAsyncCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsBucketsCreateAsyncCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -20301,27 +21550,27 @@ func (c *LocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets:createAsync") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.buckets.patch" call. -// Exactly one of *LogBucket or error will be non-nil. Any non-2xx +// Do executes the "logging.locations.buckets.createAsync" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either -// *LogBucket.ServerResponse.Header or (if a response was returned at +// *Operation.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *LocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { +func (c *LocationsBucketsCreateAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -20340,7 +21589,7 @@ func (c *LocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogBucket{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -20352,34 +21601,33 @@ func (c *LocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket } return ret, nil // { - // "description": "Updates a log bucket.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}", - // "httpMethod": "PATCH", - // "id": "logging.locations.buckets.patch", + // "description": "Creates a log bucket asynchronously that can be used to store log entries.After a bucket has been created, the bucket's location cannot be changed.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets:createAsync", + // "httpMethod": "POST", + // "id": "logging.locations.buckets.createAsync", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", - // "location": "path", - // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$", - // "required": true, + // "bucketId": { + // "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", + // "location": "query", // "type": "string" // }, - // "updateMask": { - // "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=retention_days", - // "format": "google-fieldmask", - // "location": "query", + // "parent": { + // "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"", + // "location": "path", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+$", + // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+parent}/buckets:createAsync", // "request": { // "$ref": "LogBucket" // }, // "response": { - // "$ref": "LogBucket" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -20389,21 +21637,21 @@ func (c *LocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket } -// method id "logging.locations.buckets.undelete": +// method id "logging.locations.buckets.delete": -type LocationsBucketsUndeleteCall struct { - s *Service - name string - undeletebucketrequest *UndeleteBucketRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type LocationsBucketsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Undelete: Undeletes a log bucket. A bucket that has been deleted can -// be undeleted within the grace period of 7 days. +// Delete: Deletes a log bucket.Changes the bucket's lifecycle_state to +// the DELETE_REQUESTED state. After 7 days, the bucket will be purged +// and all log entries in the bucket will be permanently deleted. // -// - name: The full resource name of the bucket to undelete. +// - name: The full resource name of the bucket to delete. // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU // CKET_ID]" @@ -20412,17 +21660,16 @@ type LocationsBucketsUndeleteCall struct { // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" // For // example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *LocationsBucketsService) Undelete(name string, undeletebucketrequest *UndeleteBucketRequest) *LocationsBucketsUndeleteCall { - c := &LocationsBucketsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *LocationsBucketsService) Delete(name string) *LocationsBucketsDeleteCall { + c := &LocationsBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.undeletebucketrequest = undeletebucketrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsBucketsUndeleteCall) Fields(s ...googleapi.Field) *LocationsBucketsUndeleteCall { +func (c *LocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *LocationsBucketsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -20430,21 +21677,21 @@ func (c *LocationsBucketsUndeleteCall) Fields(s ...googleapi.Field) *LocationsBu // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsBucketsUndeleteCall) Context(ctx context.Context) *LocationsBucketsUndeleteCall { +func (c *LocationsBucketsDeleteCall) Context(ctx context.Context) *LocationsBucketsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsBucketsUndeleteCall) Header() http.Header { +func (c *LocationsBucketsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -20452,16 +21699,11 @@ func (c *LocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, er } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:undelete") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -20472,14 +21714,14 @@ func (c *LocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, er return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.buckets.undelete" call. +// Do executes the "logging.locations.buckets.delete" call. // Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *Empty.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. -func (c *LocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +func (c *LocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -20510,26 +21752,23 @@ func (c *LocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, } return ret, nil // { - // "description": "Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period of 7 days.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}:undelete", - // "httpMethod": "POST", - // "id": "logging.locations.buckets.undelete", + // "description": "Deletes a log bucket.Changes the bucket's lifecycle_state to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}", + // "httpMethod": "DELETE", + // "id": "logging.locations.buckets.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The full resource name of the bucket to undelete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "description": "Required. The full resource name of the bucket to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}:undelete", - // "request": { - // "$ref": "UndeleteBucketRequest" - // }, + // "path": "v2/{+name}", // "response": { // "$ref": "Empty" // }, @@ -20541,23 +21780,20 @@ func (c *LocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, } -// method id "logging.locations.buckets.updateAsync": +// method id "logging.locations.buckets.get": -type LocationsBucketsUpdateAsyncCall struct { - s *Service - name string - logbucket *LogBucket - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type LocationsBucketsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// UpdateAsync: Updates a log bucket asynchronously.If the bucket has a -// lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be -// returned.After a bucket has been created, the bucket's location -// cannot be changed. +// Get: Gets a log bucket. // -// - name: The full resource name of the bucket to update. +// - name: The resource name of the bucket: // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU // CKET_ID]" @@ -20566,68 +21802,63 @@ type LocationsBucketsUpdateAsyncCall struct { // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" // For // example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *LocationsBucketsService) UpdateAsync(name string, logbucket *LogBucket) *LocationsBucketsUpdateAsyncCall { - c := &LocationsBucketsUpdateAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *LocationsBucketsService) Get(name string) *LocationsBucketsGetCall { + c := &LocationsBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.logbucket = logbucket - return c -} - -// UpdateMask sets the optional parameter "updateMask": Required. Field -// mask that specifies the fields in bucket that need an update. A -// bucket field will be overwritten if, and only if, it is in the update -// mask. name and output only fields cannot be updated.For a detailed -// FieldMask definition, see: -// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor -// example: updateMask=retention_days -func (c *LocationsBucketsUpdateAsyncCall) UpdateMask(updateMask string) *LocationsBucketsUpdateAsyncCall { - c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsBucketsUpdateAsyncCall) Fields(s ...googleapi.Field) *LocationsBucketsUpdateAsyncCall { +func (c *LocationsBucketsGetCall) Fields(s ...googleapi.Field) *LocationsBucketsGetCall { 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 *LocationsBucketsGetCall) IfNoneMatch(entityTag string) *LocationsBucketsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsBucketsUpdateAsyncCall) Context(ctx context.Context) *LocationsBucketsUpdateAsyncCall { +func (c *LocationsBucketsGetCall) Context(ctx context.Context) *LocationsBucketsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsBucketsUpdateAsyncCall) Header() http.Header { +func (c *LocationsBucketsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsBucketsUpdateAsyncCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsBucketsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:updateAsync") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -20638,14 +21869,14 @@ func (c *LocationsBucketsUpdateAsyncCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.buckets.updateAsync" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx +// Do executes the "logging.locations.buckets.get" call. +// Exactly one of *LogBucket or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at +// *LogBucket.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *LocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *LocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -20664,7 +21895,7 @@ func (c *LocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.CallOption) (*Ope if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &LogBucket{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -20676,124 +21907,132 @@ func (c *LocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.CallOption) (*Ope } return ret, nil // { - // "description": "Updates a log bucket asynchronously.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}:updateAsync", - // "httpMethod": "POST", - // "id": "logging.locations.buckets.updateAsync", - // "parameterOrder": [ - // "name" + // "description": "Gets a log bucket.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}", + // "httpMethod": "GET", + // "id": "logging.locations.buckets.get", + // "parameterOrder": [ + // "name" // ], // "parameters": { // "name": { - // "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "description": "Required. The resource name of the bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=retention_days", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+name}:updateAsync", - // "request": { - // "$ref": "LogBucket" - // }, + // "path": "v2/{+name}", // "response": { - // "$ref": "Operation" + // "$ref": "LogBucket" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.locations.buckets.links.create": +// method id "logging.locations.buckets.list": -type LocationsBucketsLinksCreateCall struct { - s *Service - parent string - link *Link - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type LocationsBucketsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Create: Asynchronously creates a linked dataset in BigQuery which -// makes it possible to use BigQuery to read the logs stored in the log -// bucket. A log bucket may currently only contain one link. +// List: Lists log buckets. // -// - parent: The full resource name of the bucket to create a link for. -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]". -func (r *LocationsBucketsLinksService) Create(parent string, link *Link) *LocationsBucketsLinksCreateCall { - c := &LocationsBucketsLinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The parent resource whose buckets are to be listed: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" Note: The locations +// portion of the resource must be specified, but supplying the +// character - in place of LOCATION_ID will return all buckets. +func (r *LocationsBucketsService) List(parent string) *LocationsBucketsListCall { + c := &LocationsBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.link = link return c } -// LinkId sets the optional parameter "linkId": Required. The ID to use -// for the link. The link_id can have up to 100 characters. A valid -// link_id must only have alphanumeric characters and underscores within -// it. -func (c *LocationsBucketsLinksCreateCall) LinkId(linkId string) *LocationsBucketsLinksCreateCall { - c.urlParams_.Set("linkId", linkId) +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request. Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *LocationsBucketsListCall) PageSize(pageSize int64) *LocationsBucketsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *LocationsBucketsListCall) PageToken(pageToken string) *LocationsBucketsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsBucketsLinksCreateCall) Fields(s ...googleapi.Field) *LocationsBucketsLinksCreateCall { +func (c *LocationsBucketsListCall) Fields(s ...googleapi.Field) *LocationsBucketsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LocationsBucketsListCall) IfNoneMatch(entityTag string) *LocationsBucketsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsBucketsLinksCreateCall) Context(ctx context.Context) *LocationsBucketsLinksCreateCall { +func (c *LocationsBucketsListCall) Context(ctx context.Context) *LocationsBucketsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsBucketsLinksCreateCall) Header() http.Header { +func (c *LocationsBucketsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsBucketsLinksCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsBucketsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.link) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/links") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -20804,14 +22043,14 @@ func (c *LocationsBucketsLinksCreateCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.buckets.links.create" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *LocationsBucketsLinksCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// Do executes the "logging.locations.buckets.list" call. +// Exactly one of *ListBucketsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListBucketsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucketsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -20830,7 +22069,7 @@ func (c *LocationsBucketsLinksCreateCall) Do(opts ...googleapi.CallOption) (*Ope if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &ListBucketsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -20842,74 +22081,115 @@ func (c *LocationsBucketsLinksCreateCall) Do(opts ...googleapi.CallOption) (*Ope } return ret, nil // { - // "description": "Asynchronously creates a linked dataset in BigQuery which makes it possible to use BigQuery to read the logs stored in the log bucket. A log bucket may currently only contain one link.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/links", - // "httpMethod": "POST", - // "id": "logging.locations.buckets.links.create", + // "description": "Lists log buckets.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets", + // "httpMethod": "GET", + // "id": "logging.locations.buckets.list", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "linkId": { - // "description": "Required. The ID to use for the link. The link_id can have up to 100 characters. A valid link_id must only have alphanumeric characters and underscores within it.", + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. The full resource name of the bucket to create a link for. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", + // "description": "Required. The parent resource whose buckets are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets.", // "location": "path", - // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/links", - // "request": { - // "$ref": "Link" - // }, + // "path": "v2/{+parent}/buckets", // "response": { - // "$ref": "Operation" + // "$ref": "ListBucketsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.locations.buckets.links.delete": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *LocationsBucketsListCall) Pages(ctx context.Context, f func(*ListBucketsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type LocationsBucketsLinksDeleteCall struct { +// method id "logging.locations.buckets.patch": + +type LocationsBucketsPatchCall struct { s *Service name string + logbucket *LogBucket urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Delete: Deletes a link. This will also delete the corresponding -// BigQuery linked dataset. +// Patch: Updates a log bucket.If the bucket has a lifecycle_state of +// DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a +// bucket has been created, the bucket's location cannot be changed. // -// - name: The full resource name of the link to delete. -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/l -// inks/[LINK_ID]" +// - name: The full resource name of the bucket to update. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]/links/[LINK_ID]" +// CKET_ID]" // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]/links/[LINK_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/lin -// ks/[LINK_ID]". -func (r *LocationsBucketsLinksService) Delete(name string) *LocationsBucketsLinksDeleteCall { - c := &LocationsBucketsLinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *LocationsBucketsService) Patch(name string, logbucket *LogBucket) *LocationsBucketsPatchCall { + c := &LocationsBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.logbucket = logbucket + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. Field +// mask that specifies the fields in bucket that need an update. A +// bucket field will be overwritten if, and only if, it is in the update +// mask. name and output only fields cannot be updated.For a detailed +// FieldMask definition, see: +// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor +// example: updateMask=retention_days +func (c *LocationsBucketsPatchCall) UpdateMask(updateMask string) *LocationsBucketsPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsBucketsLinksDeleteCall) Fields(s ...googleapi.Field) *LocationsBucketsLinksDeleteCall { +func (c *LocationsBucketsPatchCall) Fields(s ...googleapi.Field) *LocationsBucketsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -20917,21 +22197,21 @@ func (c *LocationsBucketsLinksDeleteCall) Fields(s ...googleapi.Field) *Location // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsBucketsLinksDeleteCall) Context(ctx context.Context) *LocationsBucketsLinksDeleteCall { +func (c *LocationsBucketsPatchCall) Context(ctx context.Context) *LocationsBucketsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsBucketsLinksDeleteCall) Header() http.Header { +func (c *LocationsBucketsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsBucketsLinksDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -20939,11 +22219,16 @@ func (c *LocationsBucketsLinksDeleteCall) doRequest(alt string) (*http.Response, } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -20954,14 +22239,14 @@ func (c *LocationsBucketsLinksDeleteCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.buckets.links.delete" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx +// Do executes the "logging.locations.buckets.patch" call. +// Exactly one of *LogBucket or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at +// *LogBucket.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *LocationsBucketsLinksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *LocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -20980,7 +22265,7 @@ func (c *LocationsBucketsLinksDeleteCall) Do(opts ...googleapi.CallOption) (*Ope if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &LogBucket{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -20992,25 +22277,34 @@ func (c *LocationsBucketsLinksDeleteCall) Do(opts ...googleapi.CallOption) (*Ope } return ret, nil // { - // "description": "Deletes a link. This will also delete the corresponding BigQuery linked dataset.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/links/{linksId}", - // "httpMethod": "DELETE", - // "id": "logging.locations.buckets.links.delete", + // "description": "Updates a log bucket.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}", + // "httpMethod": "PATCH", + // "id": "logging.locations.buckets.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The full resource name of the link to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" ", + // "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", - // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+/links/[^/]+$", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=retention_days", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, // "path": "v2/{+name}", + // "request": { + // "$ref": "LogBucket" + // }, // "response": { - // "$ref": "Operation" + // "$ref": "LogBucket" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -21020,85 +22314,79 @@ func (c *LocationsBucketsLinksDeleteCall) Do(opts ...googleapi.CallOption) (*Ope } -// method id "logging.locations.buckets.links.get": +// method id "logging.locations.buckets.undelete": -type LocationsBucketsLinksGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type LocationsBucketsUndeleteCall struct { + s *Service + name string + undeletebucketrequest *UndeleteBucketRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a link. +// Undelete: Undeletes a log bucket. A bucket that has been deleted can +// be undeleted within the grace period of 7 days. // -// - name: The resource name of the link: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/l -// inks/[LINK_ID]" +// - name: The full resource name of the bucket to undelete. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]/links/[LINK_ID]" +// CKET_ID]" // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]/links/[LINK_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/lin -// ks/[LINK_ID]". -func (r *LocationsBucketsLinksService) Get(name string) *LocationsBucketsLinksGetCall { - c := &LocationsBucketsLinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *LocationsBucketsService) Undelete(name string, undeletebucketrequest *UndeleteBucketRequest) *LocationsBucketsUndeleteCall { + c := &LocationsBucketsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.undeletebucketrequest = undeletebucketrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsBucketsLinksGetCall) Fields(s ...googleapi.Field) *LocationsBucketsLinksGetCall { +func (c *LocationsBucketsUndeleteCall) Fields(s ...googleapi.Field) *LocationsBucketsUndeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *LocationsBucketsLinksGetCall) IfNoneMatch(entityTag string) *LocationsBucketsLinksGetCall { - 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 *LocationsBucketsLinksGetCall) Context(ctx context.Context) *LocationsBucketsLinksGetCall { +func (c *LocationsBucketsUndeleteCall) Context(ctx context.Context) *LocationsBucketsUndeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsBucketsLinksGetCall) Header() http.Header { +func (c *LocationsBucketsUndeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsBucketsLinksGetCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:undelete") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -21109,14 +22397,14 @@ func (c *LocationsBucketsLinksGetCall) doRequest(alt string) (*http.Response, er return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.buckets.links.get" call. -// Exactly one of *Link or error will be non-nil. Any non-2xx status +// Do executes the "logging.locations.buckets.undelete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *Link.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *LocationsBucketsLinksGetCall) Do(opts ...googleapi.CallOption) (*Link, error) { +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *LocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -21135,7 +22423,7 @@ func (c *LocationsBucketsLinksGetCall) Do(opts ...googleapi.CallOption) (*Link, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Link{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -21147,147 +22435,142 @@ func (c *LocationsBucketsLinksGetCall) Do(opts ...googleapi.CallOption) (*Link, } return ret, nil // { - // "description": "Gets a link.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/links/{linksId}", - // "httpMethod": "GET", - // "id": "logging.locations.buckets.links.get", + // "description": "Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period of 7 days.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}:undelete", + // "httpMethod": "POST", + // "id": "logging.locations.buckets.undelete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource name of the link: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" ", + // "description": "Required. The full resource name of the bucket to undelete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", - // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+/links/[^/]+$", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+name}:undelete", + // "request": { + // "$ref": "UndeleteBucketRequest" + // }, // "response": { - // "$ref": "Link" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// method id "logging.locations.buckets.links.list": +// method id "logging.locations.buckets.updateAsync": -type LocationsBucketsLinksListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type LocationsBucketsUpdateAsyncCall struct { + s *Service + name string + logbucket *LogBucket + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists links. +// UpdateAsync: Updates a log bucket asynchronously.If the bucket has a +// lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be +// returned.After a bucket has been created, the bucket's location +// cannot be changed. // -// - parent: The parent resource whose links are to be listed: +// - name: The full resource name of the bucket to update. // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU // CKET_ID]" // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket // s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]". -func (r *LocationsBucketsLinksService) List(parent string) *LocationsBucketsLinksListCall { - c := &LocationsBucketsLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return from this request. -func (c *LocationsBucketsLinksListCall) PageSize(pageSize int64) *LocationsBucketsLinksListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *LocationsBucketsService) UpdateAsync(name string, logbucket *LogBucket) *LocationsBucketsUpdateAsyncCall { + c := &LocationsBucketsUpdateAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.logbucket = logbucket return c } -// PageToken sets the optional parameter "pageToken": If present, then -// retrieve the next batch of results from the preceding call to this -// method. pageToken must be the value of nextPageToken from the -// previous response. -func (c *LocationsBucketsLinksListCall) PageToken(pageToken string) *LocationsBucketsLinksListCall { - c.urlParams_.Set("pageToken", pageToken) +// UpdateMask sets the optional parameter "updateMask": Required. Field +// mask that specifies the fields in bucket that need an update. A +// bucket field will be overwritten if, and only if, it is in the update +// mask. name and output only fields cannot be updated.For a detailed +// FieldMask definition, see: +// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor +// example: updateMask=retention_days +func (c *LocationsBucketsUpdateAsyncCall) UpdateMask(updateMask string) *LocationsBucketsUpdateAsyncCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsBucketsLinksListCall) Fields(s ...googleapi.Field) *LocationsBucketsLinksListCall { +func (c *LocationsBucketsUpdateAsyncCall) Fields(s ...googleapi.Field) *LocationsBucketsUpdateAsyncCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *LocationsBucketsLinksListCall) IfNoneMatch(entityTag string) *LocationsBucketsLinksListCall { - 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 *LocationsBucketsLinksListCall) Context(ctx context.Context) *LocationsBucketsLinksListCall { +func (c *LocationsBucketsUpdateAsyncCall) Context(ctx context.Context) *LocationsBucketsUpdateAsyncCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsBucketsLinksListCall) Header() http.Header { +func (c *LocationsBucketsUpdateAsyncCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsBucketsLinksListCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsBucketsUpdateAsyncCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/links") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:updateAsync") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.buckets.links.list" call. -// Exactly one of *ListLinksResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListLinksResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *LocationsBucketsLinksListCall) Do(opts ...googleapi.CallOption) (*ListLinksResponse, error) { +// Do executes the "logging.locations.buckets.updateAsync" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *LocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -21306,7 +22589,7 @@ func (c *LocationsBucketsLinksListCall) Do(opts ...googleapi.CallOption) (*ListL if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListLinksResponse{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -21318,106 +22601,85 @@ func (c *LocationsBucketsLinksListCall) Do(opts ...googleapi.CallOption) (*ListL } return ret, nil // { - // "description": "Lists links.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/links", - // "httpMethod": "GET", - // "id": "logging.locations.buckets.links.list", + // "description": "Updates a log bucket asynchronously.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}:updateAsync", + // "httpMethod": "POST", + // "id": "logging.locations.buckets.updateAsync", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "pageSize": { - // "description": "Optional. The maximum number of results to return from this request.", - // "format": "int32", - // "location": "query", - // "type": "integer" + // "name": { + // "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "location": "path", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "required": true, + // "type": "string" // }, - // "pageToken": { - // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response.", + // "updateMask": { + // "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=retention_days", + // "format": "google-fieldmask", // "location": "query", // "type": "string" - // }, - // "parent": { - // "description": "Required. The parent resource whose links are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", - // "location": "path", - // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$", - // "required": true, - // "type": "string" // } // }, - // "path": "v2/{+parent}/links", + // "path": "v2/{+name}:updateAsync", + // "request": { + // "$ref": "LogBucket" + // }, // "response": { - // "$ref": "ListLinksResponse" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *LocationsBucketsLinksListCall) Pages(ctx context.Context, f func(*ListLinksResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "logging.locations.buckets.views.create": +// method id "logging.locations.buckets.links.create": -type LocationsBucketsViewsCreateCall struct { +type LocationsBucketsLinksCreateCall struct { s *Service parent string - logview *LogView + link *Link urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Create: Creates a view over log entries in a log bucket. A bucket may -// contain a maximum of 30 views. +// Create: Asynchronously creates a linked dataset in BigQuery which +// makes it possible to use BigQuery to read the logs stored in the log +// bucket. A log bucket may currently only contain one link. // -// - parent: The bucket in which to create the view +// - parent: The full resource name of the bucket to create a link for. // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// ` For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *LocationsBucketsViewsService) Create(parent string, logview *LogView) *LocationsBucketsViewsCreateCall { - c := &LocationsBucketsViewsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]". +func (r *LocationsBucketsLinksService) Create(parent string, link *Link) *LocationsBucketsLinksCreateCall { + c := &LocationsBucketsLinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.logview = logview + c.link = link return c } -// ViewId sets the optional parameter "viewId": Required. A -// client-assigned identifier such as "my-view". Identifiers are limited -// to 100 characters and can include only letters, digits, underscores, -// hyphens, and periods. -func (c *LocationsBucketsViewsCreateCall) ViewId(viewId string) *LocationsBucketsViewsCreateCall { - c.urlParams_.Set("viewId", viewId) +// LinkId sets the optional parameter "linkId": Required. The ID to use +// for the link. The link_id can have up to 100 characters. A valid +// link_id must only have alphanumeric characters and underscores within +// it. +func (c *LocationsBucketsLinksCreateCall) LinkId(linkId string) *LocationsBucketsLinksCreateCall { + c.urlParams_.Set("linkId", linkId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsBucketsViewsCreateCall) Fields(s ...googleapi.Field) *LocationsBucketsViewsCreateCall { +func (c *LocationsBucketsLinksCreateCall) Fields(s ...googleapi.Field) *LocationsBucketsLinksCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -21425,21 +22687,21 @@ func (c *LocationsBucketsViewsCreateCall) Fields(s ...googleapi.Field) *Location // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsBucketsViewsCreateCall) Context(ctx context.Context) *LocationsBucketsViewsCreateCall { +func (c *LocationsBucketsLinksCreateCall) Context(ctx context.Context) *LocationsBucketsLinksCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsBucketsViewsCreateCall) Header() http.Header { +func (c *LocationsBucketsLinksCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsBucketsLinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -21447,14 +22709,14 @@ func (c *LocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.link) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/links") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -21467,14 +22729,14 @@ func (c *LocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.buckets.views.create" call. -// Exactly one of *LogView or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *LogView.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *LocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption) (*LogView, error) { +// Do executes the "logging.locations.buckets.links.create" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *LocationsBucketsLinksCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -21493,7 +22755,7 @@ func (c *LocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption) (*Log if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogView{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -21505,33 +22767,33 @@ func (c *LocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption) (*Log } return ret, nil // { - // "description": "Creates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/views", + // "description": "Asynchronously creates a linked dataset in BigQuery which makes it possible to use BigQuery to read the logs stored in the log bucket. A log bucket may currently only contain one link.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/links", // "httpMethod": "POST", - // "id": "logging.locations.buckets.views.create", + // "id": "logging.locations.buckets.links.create", // "parameterOrder": [ // "parent" // ], // "parameters": { + // "linkId": { + // "description": "Required. The ID to use for the link. The link_id can have up to 100 characters. A valid link_id must only have alphanumeric characters and underscores within it.", + // "location": "query", + // "type": "string" + // }, // "parent": { - // "description": "Required. The bucket in which to create the view `\"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\"` For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "description": "Required. The full resource name of the bucket to create a link for. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", // "location": "path", // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" - // }, - // "viewId": { - // "description": "Required. A client-assigned identifier such as \"my-view\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+parent}/views", + // "path": "v2/{+parent}/links", // "request": { - // "$ref": "LogView" + // "$ref": "Link" // }, // "response": { - // "$ref": "LogView" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -21541,9 +22803,9 @@ func (c *LocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption) (*Log } -// method id "logging.locations.buckets.views.delete": +// method id "logging.locations.buckets.links.delete": -type LocationsBucketsViewsDeleteCall struct { +type LocationsBucketsLinksDeleteCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -21551,17 +22813,20 @@ type LocationsBucketsViewsDeleteCall struct { header_ http.Header } -// Delete: Deletes a view on a log bucket. If an UNAVAILABLE error is -// returned, this indicates that system is not in a state where it can -// delete the view. If this occurs, please try again in a few minutes. +// Delete: Deletes a link. This will also delete the corresponding +// BigQuery linked dataset. // -// - name: The full resource name of the view to delete: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v -// iews/[VIEW_ID]" For -// example:"projects/my-project/locations/global/buckets/my-bucket/view -// s/my-view". -func (r *LocationsBucketsViewsService) Delete(name string) *LocationsBucketsViewsDeleteCall { - c := &LocationsBucketsViewsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The full resource name of the link to delete. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/l +// inks/[LINK_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]/links/[LINK_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]/links/[LINK_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/lin +// ks/[LINK_ID]". +func (r *LocationsBucketsLinksService) Delete(name string) *LocationsBucketsLinksDeleteCall { + c := &LocationsBucketsLinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -21569,7 +22834,7 @@ func (r *LocationsBucketsViewsService) Delete(name string) *LocationsBucketsView // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsBucketsViewsDeleteCall) Fields(s ...googleapi.Field) *LocationsBucketsViewsDeleteCall { +func (c *LocationsBucketsLinksDeleteCall) Fields(s ...googleapi.Field) *LocationsBucketsLinksDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -21577,21 +22842,21 @@ func (c *LocationsBucketsViewsDeleteCall) Fields(s ...googleapi.Field) *Location // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsBucketsViewsDeleteCall) Context(ctx context.Context) *LocationsBucketsViewsDeleteCall { +func (c *LocationsBucketsLinksDeleteCall) Context(ctx context.Context) *LocationsBucketsLinksDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsBucketsViewsDeleteCall) Header() http.Header { +func (c *LocationsBucketsLinksDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsBucketsLinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -21614,14 +22879,14 @@ func (c *LocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.buckets.views.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *LocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "logging.locations.buckets.links.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *LocationsBucketsLinksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -21640,7 +22905,7 @@ func (c *LocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Emp if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -21652,25 +22917,25 @@ func (c *LocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Emp } return ret, nil // { - // "description": "Deletes a view on a log bucket. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", + // "description": "Deletes a link. This will also delete the corresponding BigQuery linked dataset.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/links/{linksId}", // "httpMethod": "DELETE", - // "id": "logging.locations.buckets.views.delete", + // "id": "logging.locations.buckets.links.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The full resource name of the view to delete: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", + // "description": "Required. The full resource name of the link to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" ", // "location": "path", - // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+/links/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v2/{+name}", // "response": { - // "$ref": "Empty" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -21680,9 +22945,9 @@ func (c *LocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Emp } -// method id "logging.locations.buckets.views.get": +// method id "logging.locations.buckets.links.get": -type LocationsBucketsViewsGetCall struct { +type LocationsBucketsLinksGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -21691,15 +22956,19 @@ type LocationsBucketsViewsGetCall struct { header_ http.Header } -// Get: Gets a view on a log bucket. +// Get: Gets a link. // -// - name: The resource name of the policy: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v -// iews/[VIEW_ID]" For -// example:"projects/my-project/locations/global/buckets/my-bucket/view -// s/my-view". -func (r *LocationsBucketsViewsService) Get(name string) *LocationsBucketsViewsGetCall { - c := &LocationsBucketsViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of the link: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/l +// inks/[LINK_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]/links/[LINK_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]/links/[LINK_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/lin +// ks/[LINK_ID]". +func (r *LocationsBucketsLinksService) Get(name string) *LocationsBucketsLinksGetCall { + c := &LocationsBucketsLinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -21707,7 +22976,7 @@ func (r *LocationsBucketsViewsService) Get(name string) *LocationsBucketsViewsGe // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsBucketsViewsGetCall) Fields(s ...googleapi.Field) *LocationsBucketsViewsGetCall { +func (c *LocationsBucketsLinksGetCall) Fields(s ...googleapi.Field) *LocationsBucketsLinksGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -21717,7 +22986,7 @@ func (c *LocationsBucketsViewsGetCall) Fields(s ...googleapi.Field) *LocationsBu // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *LocationsBucketsViewsGetCall) IfNoneMatch(entityTag string) *LocationsBucketsViewsGetCall { +func (c *LocationsBucketsLinksGetCall) IfNoneMatch(entityTag string) *LocationsBucketsLinksGetCall { c.ifNoneMatch_ = entityTag return c } @@ -21725,21 +22994,21 @@ func (c *LocationsBucketsViewsGetCall) IfNoneMatch(entityTag string) *LocationsB // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsBucketsViewsGetCall) Context(ctx context.Context) *LocationsBucketsViewsGetCall { +func (c *LocationsBucketsLinksGetCall) Context(ctx context.Context) *LocationsBucketsLinksGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsBucketsViewsGetCall) Header() http.Header { +func (c *LocationsBucketsLinksGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsBucketsViewsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsBucketsLinksGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -21765,14 +23034,14 @@ func (c *LocationsBucketsViewsGetCall) doRequest(alt string) (*http.Response, er return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.buckets.views.get" call. -// Exactly one of *LogView or error will be non-nil. Any non-2xx status +// Do executes the "logging.locations.buckets.links.get" call. +// Exactly one of *Link or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *LogView.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *LocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogView, error) { +// *Link.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *LocationsBucketsLinksGetCall) Do(opts ...googleapi.CallOption) (*Link, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -21791,7 +23060,7 @@ func (c *LocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogVie if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogView{ + ret := &Link{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -21803,25 +23072,25 @@ func (c *LocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogVie } return ret, nil // { - // "description": "Gets a view on a log bucket.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", + // "description": "Gets a link.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/links/{linksId}", // "httpMethod": "GET", - // "id": "logging.locations.buckets.views.get", + // "id": "logging.locations.buckets.links.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource name of the policy: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", + // "description": "Required. The resource name of the link: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" ", // "location": "path", - // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+/links/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v2/{+name}", // "response": { - // "$ref": "LogView" + // "$ref": "Link" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -21833,9 +23102,9 @@ func (c *LocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogVie } -// method id "logging.locations.buckets.views.list": +// method id "logging.locations.buckets.links.list": -type LocationsBucketsViewsListCall struct { +type LocationsBucketsLinksListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -21844,21 +23113,24 @@ type LocationsBucketsViewsListCall struct { header_ http.Header } -// List: Lists views on a log bucket. +// List: Lists links. // -// - parent: The bucket whose views are to be listed: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]". -func (r *LocationsBucketsViewsService) List(parent string) *LocationsBucketsViewsListCall { - c := &LocationsBucketsViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The parent resource whose links are to be listed: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]". +func (r *LocationsBucketsLinksService) List(parent string) *LocationsBucketsLinksListCall { + c := &LocationsBucketsLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } // PageSize sets the optional parameter "pageSize": The maximum number -// of results to return from this request.Non-positive values are -// ignored. The presence of nextPageToken in the response indicates that -// more results might be available. -func (c *LocationsBucketsViewsListCall) PageSize(pageSize int64) *LocationsBucketsViewsListCall { +// of results to return from this request. +func (c *LocationsBucketsLinksListCall) PageSize(pageSize int64) *LocationsBucketsLinksListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } @@ -21866,9 +23138,8 @@ func (c *LocationsBucketsViewsListCall) PageSize(pageSize int64) *LocationsBucke // PageToken sets the optional parameter "pageToken": If present, then // retrieve the next batch of results from the preceding call to this // method. pageToken must be the value of nextPageToken from the -// previous response. The values of other method parameters should be -// identical to those in the previous call. -func (c *LocationsBucketsViewsListCall) PageToken(pageToken string) *LocationsBucketsViewsListCall { +// previous response. +func (c *LocationsBucketsLinksListCall) PageToken(pageToken string) *LocationsBucketsLinksListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -21876,7 +23147,7 @@ func (c *LocationsBucketsViewsListCall) PageToken(pageToken string) *LocationsBu // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsBucketsViewsListCall) Fields(s ...googleapi.Field) *LocationsBucketsViewsListCall { +func (c *LocationsBucketsLinksListCall) Fields(s ...googleapi.Field) *LocationsBucketsLinksListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -21886,7 +23157,7 @@ func (c *LocationsBucketsViewsListCall) Fields(s ...googleapi.Field) *LocationsB // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *LocationsBucketsViewsListCall) IfNoneMatch(entityTag string) *LocationsBucketsViewsListCall { +func (c *LocationsBucketsLinksListCall) IfNoneMatch(entityTag string) *LocationsBucketsLinksListCall { c.ifNoneMatch_ = entityTag return c } @@ -21894,21 +23165,21 @@ func (c *LocationsBucketsViewsListCall) IfNoneMatch(entityTag string) *Locations // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsBucketsViewsListCall) Context(ctx context.Context) *LocationsBucketsViewsListCall { +func (c *LocationsBucketsLinksListCall) Context(ctx context.Context) *LocationsBucketsLinksListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsBucketsViewsListCall) Header() http.Header { +func (c *LocationsBucketsLinksListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsBucketsViewsListCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsBucketsLinksListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -21921,7 +23192,7 @@ func (c *LocationsBucketsViewsListCall) doRequest(alt string) (*http.Response, e var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/links") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -21934,14 +23205,14 @@ func (c *LocationsBucketsViewsListCall) doRequest(alt string) (*http.Response, e return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.buckets.views.list" call. -// Exactly one of *ListViewsResponse or error will be non-nil. Any +// Do executes the "logging.locations.buckets.links.list" call. +// Exactly one of *ListLinksResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either -// *ListViewsResponse.ServerResponse.Header or (if a response was +// *ListLinksResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *LocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) (*ListViewsResponse, error) { +func (c *LocationsBucketsLinksListCall) Do(opts ...googleapi.CallOption) (*ListLinksResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -21960,7 +23231,7 @@ func (c *LocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) (*ListV if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListViewsResponse{ + ret := &ListLinksResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -21972,36 +23243,36 @@ func (c *LocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) (*ListV } return ret, nil // { - // "description": "Lists views on a log bucket.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/views", + // "description": "Lists links.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/links", // "httpMethod": "GET", - // "id": "logging.locations.buckets.views.list", + // "id": "logging.locations.buckets.links.list", // "parameterOrder": [ // "parent" // ], // "parameters": { // "pageSize": { - // "description": "Optional. The maximum number of results to return from this request.Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "description": "Optional. The maximum number of results to return from this request.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. The bucket whose views are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", + // "description": "Required. The parent resource whose links are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", // "location": "path", // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/views", + // "path": "v2/{+parent}/links", // "response": { - // "$ref": "ListViewsResponse" + // "$ref": "ListLinksResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -22016,7 +23287,7 @@ func (c *LocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) (*ListV // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *LocationsBucketsViewsListCall) Pages(ctx context.Context, f func(*ListViewsResponse) error) error { +func (c *LocationsBucketsLinksListCall) Pages(ctx context.Context, f func(*ListLinksResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -22034,51 +23305,44 @@ func (c *LocationsBucketsViewsListCall) Pages(ctx context.Context, f func(*ListV } } -// method id "logging.locations.buckets.views.patch": +// method id "logging.locations.buckets.views.create": -type LocationsBucketsViewsPatchCall struct { +type LocationsBucketsViewsCreateCall struct { s *Service - name string + parent string logview *LogView urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Patch: Updates a view on a log bucket. This method replaces the -// following fields in the existing view with values from the new view: -// filter. If an UNAVAILABLE error is returned, this indicates that -// system is not in a state where it can update the view. If this -// occurs, please try again in a few minutes. +// Create: Creates a view over log entries in a log bucket. A bucket may +// contain a maximum of 30 views. // -// - name: The full resource name of the view to update -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v -// iews/[VIEW_ID]" For -// example:"projects/my-project/locations/global/buckets/my-bucket/view -// s/my-view". -func (r *LocationsBucketsViewsService) Patch(name string, logview *LogView) *LocationsBucketsViewsPatchCall { - c := &LocationsBucketsViewsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: The bucket in which to create the view +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// ` For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *LocationsBucketsViewsService) Create(parent string, logview *LogView) *LocationsBucketsViewsCreateCall { + c := &LocationsBucketsViewsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent c.logview = logview return c } -// UpdateMask sets the optional parameter "updateMask": Field mask that -// specifies the fields in view that need an update. A field will be -// overwritten if, and only if, it is in the update mask. name and -// output only fields cannot be updated.For a detailed FieldMask -// definition, see -// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor -// example: updateMask=filter -func (c *LocationsBucketsViewsPatchCall) UpdateMask(updateMask string) *LocationsBucketsViewsPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// ViewId sets the optional parameter "viewId": Required. A +// client-assigned identifier such as "my-view". Identifiers are limited +// to 100 characters and can include only letters, digits, underscores, +// hyphens, and periods. +func (c *LocationsBucketsViewsCreateCall) ViewId(viewId string) *LocationsBucketsViewsCreateCall { + c.urlParams_.Set("viewId", viewId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsBucketsViewsPatchCall) Fields(s ...googleapi.Field) *LocationsBucketsViewsPatchCall { +func (c *LocationsBucketsViewsCreateCall) Fields(s ...googleapi.Field) *LocationsBucketsViewsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -22086,21 +23350,21 @@ func (c *LocationsBucketsViewsPatchCall) Fields(s ...googleapi.Field) *Locations // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsBucketsViewsPatchCall) Context(ctx context.Context) *LocationsBucketsViewsPatchCall { +func (c *LocationsBucketsViewsCreateCall) Context(ctx context.Context) *LocationsBucketsViewsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsBucketsViewsPatchCall) Header() http.Header { +func (c *LocationsBucketsViewsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -22115,27 +23379,27 @@ func (c *LocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.buckets.views.patch" call. +// Do executes the "logging.locations.buckets.views.create" call. // Exactly one of *LogView or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *LogView.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. -func (c *LocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) (*LogView, error) { +func (c *LocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption) (*LogView, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -22166,29 +23430,28 @@ func (c *LocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) (*LogV } return ret, nil // { - // "description": "Updates a view on a log bucket. This method replaces the following fields in the existing view with values from the new view: filter. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can update the view. If this occurs, please try again in a few minutes.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", - // "httpMethod": "PATCH", - // "id": "logging.locations.buckets.views.patch", + // "description": "Creates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/views", + // "httpMethod": "POST", + // "id": "logging.locations.buckets.views.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The full resource name of the view to update \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", + // "parent": { + // "description": "Required. The bucket in which to create the view `\"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\"` For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", - // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" // }, - // "updateMask": { - // "description": "Optional. Field mask that specifies the fields in view that need an update. A field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", - // "format": "google-fieldmask", + // "viewId": { + // "description": "Required. A client-assigned identifier such as \"my-view\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", // "location": "query", // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+parent}/views", // "request": { // "$ref": "LogView" // }, @@ -22203,40 +23466,35 @@ func (c *LocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) (*LogV } -// method id "logging.locations.operations.cancel": +// method id "logging.locations.buckets.views.delete": -type LocationsOperationsCancelCall struct { - s *Service - name string - canceloperationrequest *CancelOperationRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type LocationsBucketsViewsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Cancel: Starts asynchronous cancellation on a long-running operation. -// The server makes a best effort to cancel the operation, but success -// is not guaranteed. If the server doesn't support this method, it -// returns google.rpc.Code.UNIMPLEMENTED. Clients can use -// Operations.GetOperation or other methods to check whether the -// cancellation succeeded or whether the operation completed despite -// cancellation. On successful cancellation, the operation is not -// deleted; instead, it becomes an operation with an Operation.error -// value with a google.rpc.Status.code of 1, corresponding to -// Code.CANCELLED. +// Delete: Deletes a view on a log bucket. If an UNAVAILABLE error is +// returned, this indicates that system is not in a state where it can +// delete the view. If this occurs, please try again in a few minutes. // -// - name: The name of the operation resource to be cancelled. -func (r *LocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *LocationsOperationsCancelCall { - c := &LocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The full resource name of the view to delete: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v +// iews/[VIEW_ID]" For +// example:"projects/my-project/locations/global/buckets/my-bucket/view +// s/my-view". +func (r *LocationsBucketsViewsService) Delete(name string) *LocationsBucketsViewsDeleteCall { + c := &LocationsBucketsViewsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.canceloperationrequest = canceloperationrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsOperationsCancelCall) Fields(s ...googleapi.Field) *LocationsOperationsCancelCall { +func (c *LocationsBucketsViewsDeleteCall) Fields(s ...googleapi.Field) *LocationsBucketsViewsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -22244,21 +23502,21 @@ func (c *LocationsOperationsCancelCall) Fields(s ...googleapi.Field) *LocationsO // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsOperationsCancelCall) Context(ctx context.Context) *LocationsOperationsCancelCall { +func (c *LocationsBucketsViewsDeleteCall) Context(ctx context.Context) *LocationsBucketsViewsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsOperationsCancelCall) Header() http.Header { +func (c *LocationsBucketsViewsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -22266,16 +23524,11 @@ func (c *LocationsOperationsCancelCall) doRequest(alt string) (*http.Response, e } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:cancel") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -22286,14 +23539,14 @@ func (c *LocationsOperationsCancelCall) doRequest(alt string) (*http.Response, e return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.operations.cancel" call. +// Do executes the "logging.locations.buckets.views.delete" call. // Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *Empty.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. -func (c *LocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +func (c *LocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -22324,26 +23577,23 @@ func (c *LocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty } return ret, nil // { - // "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/operations/{operationsId}:cancel", - // "httpMethod": "POST", - // "id": "logging.locations.operations.cancel", + // "description": "Deletes a view on a log bucket. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", + // "httpMethod": "DELETE", + // "id": "logging.locations.buckets.views.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "The name of the operation resource to be cancelled.", + // "description": "Required. The full resource name of the view to delete: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", // "location": "path", - // "pattern": "^[^/]+/[^/]+/locations/[^/]+/operations/[^/]+$", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}:cancel", - // "request": { - // "$ref": "CancelOperationRequest" - // }, + // "path": "v2/{+name}", // "response": { // "$ref": "Empty" // }, @@ -22355,9 +23605,9 @@ func (c *LocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty } -// method id "logging.locations.operations.get": +// method id "logging.locations.buckets.views.get": -type LocationsOperationsGetCall struct { +type LocationsBucketsViewsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -22366,13 +23616,15 @@ type LocationsOperationsGetCall struct { 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. +// Get: Gets a view on a log bucket. // -// - name: The name of the operation resource. -func (r *LocationsOperationsService) Get(name string) *LocationsOperationsGetCall { - c := &LocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of the policy: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v +// iews/[VIEW_ID]" For +// example:"projects/my-project/locations/global/buckets/my-bucket/view +// s/my-view". +func (r *LocationsBucketsViewsService) Get(name string) *LocationsBucketsViewsGetCall { + c := &LocationsBucketsViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -22380,7 +23632,7 @@ func (r *LocationsOperationsService) Get(name string) *LocationsOperationsGetCal // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsOperationsGetCall) Fields(s ...googleapi.Field) *LocationsOperationsGetCall { +func (c *LocationsBucketsViewsGetCall) Fields(s ...googleapi.Field) *LocationsBucketsViewsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -22390,7 +23642,7 @@ func (c *LocationsOperationsGetCall) Fields(s ...googleapi.Field) *LocationsOper // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *LocationsOperationsGetCall) IfNoneMatch(entityTag string) *LocationsOperationsGetCall { +func (c *LocationsBucketsViewsGetCall) IfNoneMatch(entityTag string) *LocationsBucketsViewsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -22398,21 +23650,21 @@ func (c *LocationsOperationsGetCall) IfNoneMatch(entityTag string) *LocationsOpe // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsOperationsGetCall) Context(ctx context.Context) *LocationsOperationsGetCall { +func (c *LocationsBucketsViewsGetCall) Context(ctx context.Context) *LocationsBucketsViewsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsOperationsGetCall) Header() http.Header { +func (c *LocationsBucketsViewsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsBucketsViewsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -22438,14 +23690,14 @@ func (c *LocationsOperationsGetCall) doRequest(alt string) (*http.Response, erro return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.locations.operations.get" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *LocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// Do executes the "logging.locations.buckets.views.get" call. +// Exactly one of *LogView or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogView.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *LocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogView, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -22464,7 +23716,7 @@ func (c *LocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operatio if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &LogView{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -22476,25 +23728,25 @@ func (c *LocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operatio } return ret, nil // { - // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/operations/{operationsId}", + // "description": "Gets a view on a log bucket.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", // "httpMethod": "GET", - // "id": "logging.locations.operations.get", + // "id": "logging.locations.buckets.views.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "The name of the operation resource.", + // "description": "Required. The resource name of the policy: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", // "location": "path", - // "pattern": "^[^/]+/[^/]+/locations/[^/]+/operations/[^/]+$", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v2/{+name}", // "response": { - // "$ref": "Operation" + // "$ref": "LogView" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -22506,45 +23758,42 @@ func (c *LocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operatio } -// method id "logging.locations.operations.list": +// method id "logging.locations.buckets.views.list": -type LocationsOperationsListCall struct { +type LocationsBucketsViewsListCall struct { s *Service - name string + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists operations that match the specified filter in the -// request. If the server doesn't support this method, it returns -// UNIMPLEMENTED. +// List: Lists views on a log bucket. // -// - name: The name of the operation's parent resource. -func (r *LocationsOperationsService) List(name string) *LocationsOperationsListCall { - c := &LocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - return c -} - -// Filter sets the optional parameter "filter": The standard list -// filter. -func (c *LocationsOperationsListCall) Filter(filter string) *LocationsOperationsListCall { - c.urlParams_.Set("filter", filter) +// - parent: The bucket whose views are to be listed: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]". +func (r *LocationsBucketsViewsService) List(parent string) *LocationsBucketsViewsListCall { + c := &LocationsBucketsViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent return c } -// PageSize sets the optional parameter "pageSize": The standard list -// page size. -func (c *LocationsOperationsListCall) PageSize(pageSize int64) *LocationsOperationsListCall { +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request.Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *LocationsBucketsViewsListCall) PageSize(pageSize int64) *LocationsBucketsViewsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } -// PageToken sets the optional parameter "pageToken": The standard list -// page token. -func (c *LocationsOperationsListCall) PageToken(pageToken string) *LocationsOperationsListCall { +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *LocationsBucketsViewsListCall) PageToken(pageToken string) *LocationsBucketsViewsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -22552,7 +23801,7 @@ func (c *LocationsOperationsListCall) PageToken(pageToken string) *LocationsOper // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LocationsOperationsListCall) Fields(s ...googleapi.Field) *LocationsOperationsListCall { +func (c *LocationsBucketsViewsListCall) Fields(s ...googleapi.Field) *LocationsBucketsViewsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -22562,7 +23811,7 @@ func (c *LocationsOperationsListCall) Fields(s ...googleapi.Field) *LocationsOpe // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *LocationsOperationsListCall) IfNoneMatch(entityTag string) *LocationsOperationsListCall { +func (c *LocationsBucketsViewsListCall) IfNoneMatch(entityTag string) *LocationsBucketsViewsListCall { c.ifNoneMatch_ = entityTag return c } @@ -22570,21 +23819,21 @@ func (c *LocationsOperationsListCall) IfNoneMatch(entityTag string) *LocationsOp // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LocationsOperationsListCall) Context(ctx context.Context) *LocationsOperationsListCall { +func (c *LocationsBucketsViewsListCall) Context(ctx context.Context) *LocationsBucketsViewsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LocationsOperationsListCall) Header() http.Header { +func (c *LocationsBucketsViewsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LocationsOperationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsBucketsViewsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -22597,7 +23846,7 @@ func (c *LocationsOperationsListCall) doRequest(alt string) (*http.Response, err var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -22605,19 +23854,19 @@ func (c *LocationsOperationsListCall) 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 "logging.locations.operations.list" call. -// Exactly one of *ListOperationsResponse or error will be non-nil. Any +// Do executes the "logging.locations.buckets.views.list" call. +// Exactly one of *ListViewsResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either -// *ListOperationsResponse.ServerResponse.Header or (if a response was +// *ListViewsResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *LocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { +func (c *LocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) (*ListViewsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -22636,7 +23885,7 @@ func (c *LocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOpe if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListOperationsResponse{ + ret := &ListViewsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -22648,41 +23897,36 @@ func (c *LocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOpe } return ret, nil // { - // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.", - // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/operations", + // "description": "Lists views on a log bucket.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/views", // "httpMethod": "GET", - // "id": "logging.locations.operations.list", + // "id": "logging.locations.buckets.views.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "filter": { - // "description": "The standard list filter.", - // "location": "query", - // "type": "string" - // }, - // "name": { - // "description": "The name of the operation's parent resource.", - // "location": "path", - // "pattern": "^[^/]+/[^/]+/locations/[^/]+$", - // "required": true, - // "type": "string" - // }, // "pageSize": { - // "description": "The standard list page size.", + // "description": "Optional. The maximum number of results to return from this request.Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "The standard list page token.", + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", // "location": "query", // "type": "string" + // }, + // "parent": { + // "description": "Required. The bucket whose views are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", + // "location": "path", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "required": true, + // "type": "string" // } // }, - // "path": "v2/{+name}/operations", + // "path": "v2/{+parent}/views", // "response": { - // "$ref": "ListOperationsResponse" + // "$ref": "ListViewsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -22697,7 +23941,7 @@ func (c *LocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOpe // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *LocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { +func (c *LocationsBucketsViewsListCall) Pages(ctx context.Context, f func(*ListViewsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -22715,40 +23959,51 @@ func (c *LocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOpe } } -// method id "logging.logs.delete": +// method id "logging.locations.buckets.views.patch": -type LogsDeleteCall struct { +type LocationsBucketsViewsPatchCall struct { s *Service - logName string + name string + logview *LogView urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Delete: Deletes all the log entries in a log for the _Default Log -// Bucket. The log reappears if it receives new entries. Log entries -// written shortly before the delete operation might not be deleted. -// Entries received after the delete operation with a timestamp before -// the operation will be deleted. +// Patch: Updates a view on a log bucket. This method replaces the +// following fields in the existing view with values from the new view: +// filter. If an UNAVAILABLE error is returned, this indicates that +// system is not in a state where it can update the view. If this +// occurs, please try again in a few minutes. // -// - logName: The resource name of the log to delete: -// projects/[PROJECT_ID]/logs/[LOG_ID] -// organizations/[ORGANIZATION_ID]/logs/[LOG_ID] -// billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID] -// folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For -// example, "projects/my-project-id/logs/syslog", -// "organizations/123/logs/cloudaudit.googleapis.com%2Factivity".For -// more information about log names, see LogEntry. -func (r *LogsService) Delete(logName string) *LogsDeleteCall { - c := &LogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.logName = logName +// - name: The full resource name of the view to update +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v +// iews/[VIEW_ID]" For +// example:"projects/my-project/locations/global/buckets/my-bucket/view +// s/my-view". +func (r *LocationsBucketsViewsService) Patch(name string, logview *LogView) *LocationsBucketsViewsPatchCall { + c := &LocationsBucketsViewsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.logview = logview + return c +} + +// UpdateMask sets the optional parameter "updateMask": Field mask that +// specifies the fields in view that need an update. A field will be +// overwritten if, and only if, it is in the update mask. name and +// output only fields cannot be updated.For a detailed FieldMask +// definition, see +// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor +// example: updateMask=filter +func (c *LocationsBucketsViewsPatchCall) UpdateMask(updateMask string) *LocationsBucketsViewsPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LogsDeleteCall) Fields(s ...googleapi.Field) *LogsDeleteCall { +func (c *LocationsBucketsViewsPatchCall) Fields(s ...googleapi.Field) *LocationsBucketsViewsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -22756,21 +24011,21 @@ func (c *LogsDeleteCall) Fields(s ...googleapi.Field) *LogsDeleteCall { // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LogsDeleteCall) Context(ctx context.Context) *LogsDeleteCall { +func (c *LocationsBucketsViewsPatchCall) Context(ctx context.Context) *LocationsBucketsViewsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LogsDeleteCall) Header() http.Header { +func (c *LocationsBucketsViewsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LogsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -22778,29 +24033,34 @@ func (c *LogsDeleteCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+logName}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "logName": c.logName, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.logs.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// Do executes the "logging.locations.buckets.views.patch" call. +// Exactly one of *LogView or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) +// *LogView.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. -func (c *LogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +func (c *LocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) (*LogView, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -22819,7 +24079,7 @@ func (c *LogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &LogView{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -22831,25 +24091,34 @@ func (c *LogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { } return ret, nil // { - // "description": "Deletes all the log entries in a log for the _Default Log Bucket. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted.", - // "flatPath": "v2/{v2Id}/{v2Id1}/logs/{logsId}", - // "httpMethod": "DELETE", - // "id": "logging.logs.delete", + // "description": "Updates a view on a log bucket. This method replaces the following fields in the existing view with values from the new view: filter. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can update the view. If this occurs, please try again in a few minutes.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", + // "httpMethod": "PATCH", + // "id": "logging.locations.buckets.views.patch", // "parameterOrder": [ - // "logName" + // "name" // ], // "parameters": { - // "logName": { - // "description": "Required. The resource name of the log to delete: projects/[PROJECT_ID]/logs/[LOG_ID] organizations/[ORGANIZATION_ID]/logs/[LOG_ID] billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID] folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/123/logs/cloudaudit.googleapis.com%2Factivity\".For more information about log names, see LogEntry.", + // "name": { + // "description": "Required. The full resource name of the view to update \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", // "location": "path", - // "pattern": "^[^/]+/[^/]+/logs/[^/]+$", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "Optional. Field mask that specifies the fields in view that need an update. A field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+logName}", + // "path": "v2/{+name}", + // "request": { + // "$ref": "LogView" + // }, // "response": { - // "$ref": "Empty" + // "$ref": "LogView" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -22859,135 +24128,97 @@ func (c *LogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { } -// method id "logging.logs.list": +// method id "logging.locations.operations.cancel": -type LogsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type LocationsOperationsCancelCall struct { + s *Service + name string + canceloperationrequest *CancelOperationRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists the logs in projects, organizations, folders, or billing -// accounts. Only logs that have entries are listed. +// Cancel: Starts asynchronous cancellation on a long-running operation. +// The server makes a best effort to cancel the operation, but success +// is not guaranteed. If the server doesn't support this method, it +// returns google.rpc.Code.UNIMPLEMENTED. Clients can use +// Operations.GetOperation or other methods to check whether the +// cancellation succeeded or whether the operation completed despite +// cancellation. On successful cancellation, the operation is not +// deleted; instead, it becomes an operation with an Operation.error +// value with a google.rpc.Status.code of 1, corresponding to +// Code.CANCELLED. // -// - parent: The resource name to list logs for: projects/[PROJECT_ID] -// organizations/[ORGANIZATION_ID] -// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]. -func (r *LogsService) List(parent string) *LogsListCall { - c := &LogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return from this request. Non-positive values are -// ignored. The presence of nextPageToken in the response indicates that -// more results might be available. -func (c *LogsListCall) PageSize(pageSize int64) *LogsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": If present, then -// retrieve the next batch of results from the preceding call to this -// method. pageToken must be the value of nextPageToken from the -// previous response. The values of other method parameters should be -// identical to those in the previous call. -func (c *LogsListCall) PageToken(pageToken string) *LogsListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// ResourceNames sets the optional parameter "resourceNames": List of -// resource names to list logs for: -// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/view -// s/[VIEW_ID] -// organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKE -// T_ID]/views/[VIEW_ID] -// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[ -// BUCKET_ID]/views/[VIEW_ID] -// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/ -// [VIEW_ID]To support legacy queries, it could also be: -// projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] -// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]The resource -// name in the parent field is added to this list. -func (c *LogsListCall) ResourceNames(resourceNames ...string) *LogsListCall { - c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...)) +// - name: The name of the operation resource to be cancelled. +func (r *LocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *LocationsOperationsCancelCall { + c := &LocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.canceloperationrequest = canceloperationrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *LogsListCall) Fields(s ...googleapi.Field) *LogsListCall { +func (c *LocationsOperationsCancelCall) Fields(s ...googleapi.Field) *LocationsOperationsCancelCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *LogsListCall) IfNoneMatch(entityTag string) *LogsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *LogsListCall) Context(ctx context.Context) *LogsListCall { +func (c *LocationsOperationsCancelCall) Context(ctx context.Context) *LocationsOperationsCancelCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *LogsListCall) Header() http.Header { +func (c *LocationsOperationsCancelCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LogsListCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { 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.canceloperationrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+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 } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.logs.list" call. -// Exactly one of *ListLogsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListLogsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *LogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) { +// Do executes the "logging.locations.operations.cancel" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *LocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -23006,7 +24237,7 @@ func (c *LogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, erro if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListLogsResponse{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -23018,114 +24249,63 @@ func (c *LogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, erro } return ret, nil // { - // "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", - // "flatPath": "v2/{v2Id}/{v2Id1}/logs", - // "httpMethod": "GET", - // "id": "logging.logs.list", + // "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/operations/{operationsId}:cancel", + // "httpMethod": "POST", + // "id": "logging.locations.operations.cancel", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "pageSize": { - // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The resource name to list logs for: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", + // "name": { + // "description": "The name of the operation resource to be cancelled.", // "location": "path", - // "pattern": "^[^/]+/[^/]+$", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+/operations/[^/]+$", // "required": true, // "type": "string" - // }, - // "resourceNames": { - // "description": "Optional. List of resource names to list logs for: projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]To support legacy queries, it could also be: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]The resource name in the parent field is added to this list.", - // "location": "query", - // "repeated": true, - // "type": "string" // } // }, - // "path": "v2/{+parent}/logs", + // "path": "v2/{+name}:cancel", + // "request": { + // "$ref": "CancelOperationRequest" + // }, // "response": { - // "$ref": "ListLogsResponse" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *LogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "logging.monitoredResourceDescriptors.list": +// method id "logging.locations.operations.get": -type MonitoredResourceDescriptorsListCall struct { +type LocationsOperationsGetCall struct { s *Service + name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists the descriptors for monitored resource types used by -// Logging. -func (r *MonitoredResourceDescriptorsService) List() *MonitoredResourceDescriptorsListCall { - c := &MonitoredResourceDescriptorsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return from this request. Non-positive values are -// ignored. The presence of nextPageToken in the response indicates that -// more results might be available. -func (c *MonitoredResourceDescriptorsListCall) PageSize(pageSize int64) *MonitoredResourceDescriptorsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": If present, then -// retrieve the next batch of results from the preceding call to this -// method. pageToken must be the value of nextPageToken from the -// previous response. The values of other method parameters should be -// identical to those in the previous call. -func (c *MonitoredResourceDescriptorsListCall) PageToken(pageToken string) *MonitoredResourceDescriptorsListCall { - c.urlParams_.Set("pageToken", pageToken) +// 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 name of the operation resource. +func (r *LocationsOperationsService) Get(name string) *LocationsOperationsGetCall { + c := &LocationsOperationsGetCall{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 *MonitoredResourceDescriptorsListCall) Fields(s ...googleapi.Field) *MonitoredResourceDescriptorsListCall { +func (c *LocationsOperationsGetCall) Fields(s ...googleapi.Field) *LocationsOperationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -23135,7 +24315,7 @@ func (c *MonitoredResourceDescriptorsListCall) Fields(s ...googleapi.Field) *Mon // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *MonitoredResourceDescriptorsListCall) IfNoneMatch(entityTag string) *MonitoredResourceDescriptorsListCall { +func (c *LocationsOperationsGetCall) IfNoneMatch(entityTag string) *LocationsOperationsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -23143,21 +24323,21 @@ func (c *MonitoredResourceDescriptorsListCall) IfNoneMatch(entityTag string) *Mo // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *MonitoredResourceDescriptorsListCall) Context(ctx context.Context) *MonitoredResourceDescriptorsListCall { +func (c *LocationsOperationsGetCall) Context(ctx context.Context) *LocationsOperationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *MonitoredResourceDescriptorsListCall) Header() http.Header { +func (c *LocationsOperationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *MonitoredResourceDescriptorsListCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -23170,26 +24350,27 @@ func (c *MonitoredResourceDescriptorsListCall) doRequest(alt string) (*http.Resp var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/monitoredResourceDescriptors") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.monitoredResourceDescriptors.list" call. -// Exactly one of *ListMonitoredResourceDescriptorsResponse or error -// will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *ListMonitoredResourceDescriptorsResponse.ServerResponse.Header or -// (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *MonitoredResourceDescriptorsListCall) Do(opts ...googleapi.CallOption) (*ListMonitoredResourceDescriptorsResponse, error) { +// Do executes the "logging.locations.operations.get" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *LocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -23208,7 +24389,7 @@ func (c *MonitoredResourceDescriptorsListCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListMonitoredResourceDescriptorsResponse{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -23220,27 +24401,25 @@ func (c *MonitoredResourceDescriptorsListCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Lists the descriptors for monitored resource types used by Logging.", - // "flatPath": "v2/monitoredResourceDescriptors", + // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/operations/{operationsId}", // "httpMethod": "GET", - // "id": "logging.monitoredResourceDescriptors.list", - // "parameterOrder": [], + // "id": "logging.locations.operations.get", + // "parameterOrder": [ + // "name" + // ], // "parameters": { - // "pageSize": { - // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", - // "location": "query", + // "name": { + // "description": "The name of the operation resource.", + // "location": "path", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+/operations/[^/]+$", + // "required": true, // "type": "string" // } // }, - // "path": "v2/monitoredResourceDescriptors", + // "path": "v2/{+name}", // "response": { - // "$ref": "ListMonitoredResourceDescriptorsResponse" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -23252,30 +24431,9 @@ func (c *MonitoredResourceDescriptorsListCall) Do(opts ...googleapi.CallOption) } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *MonitoredResourceDescriptorsListCall) Pages(ctx context.Context, f func(*ListMonitoredResourceDescriptorsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "logging.organizations.getCmekSettings": +// method id "logging.locations.operations.list": -type OrganizationsGetCmekSettingsCall struct { +type LocationsOperationsListCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -23284,35 +24442,42 @@ type OrganizationsGetCmekSettingsCall struct { header_ http.Header } -// GetCmekSettings: Gets the Logging CMEK settings for the given -// resource.Note: CMEK for the Log Router can be configured for Google -// Cloud projects, folders, organizations and billing accounts. Once -// configured for an organization, it applies to all projects and -// folders in the Google Cloud organization.See Enabling CMEK for Log -// Router -// (https://cloud.google.com/logging/docs/routing/managed-encryption) -// for more information. +// List: Lists operations that match the specified filter in the +// request. If the server doesn't support this method, it returns +// UNIMPLEMENTED. // -// - name: The resource for which to retrieve CMEK settings. -// "projects/[PROJECT_ID]/cmekSettings" -// "organizations/[ORGANIZATION_ID]/cmekSettings" -// "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" -// "folders/[FOLDER_ID]/cmekSettings" For -// example:"organizations/12345/cmekSettings"Note: CMEK for the Log -// Router can be configured for Google Cloud projects, folders, -// organizations and billing accounts. Once configured for an -// organization, it applies to all projects and folders in the Google -// Cloud organization. -func (r *OrganizationsService) GetCmekSettings(name string) *OrganizationsGetCmekSettingsCall { - c := &OrganizationsGetCmekSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the operation's parent resource. +func (r *LocationsOperationsService) List(name string) *LocationsOperationsListCall { + c := &LocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } +// Filter sets the optional parameter "filter": The standard list +// filter. +func (c *LocationsOperationsListCall) Filter(filter string) *LocationsOperationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The standard list +// page size. +func (c *LocationsOperationsListCall) PageSize(pageSize int64) *LocationsOperationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The standard list +// page token. +func (c *LocationsOperationsListCall) PageToken(pageToken string) *LocationsOperationsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsGetCmekSettingsCall) Fields(s ...googleapi.Field) *OrganizationsGetCmekSettingsCall { +func (c *LocationsOperationsListCall) Fields(s ...googleapi.Field) *LocationsOperationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -23322,7 +24487,7 @@ func (c *OrganizationsGetCmekSettingsCall) Fields(s ...googleapi.Field) *Organiz // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsGetCmekSettingsCall) IfNoneMatch(entityTag string) *OrganizationsGetCmekSettingsCall { +func (c *LocationsOperationsListCall) IfNoneMatch(entityTag string) *LocationsOperationsListCall { c.ifNoneMatch_ = entityTag return c } @@ -23330,21 +24495,21 @@ func (c *OrganizationsGetCmekSettingsCall) IfNoneMatch(entityTag string) *Organi // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsGetCmekSettingsCall) Context(ctx context.Context) *OrganizationsGetCmekSettingsCall { +func (c *LocationsOperationsListCall) Context(ctx context.Context) *LocationsOperationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsGetCmekSettingsCall) Header() http.Header { +func (c *LocationsOperationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsGetCmekSettingsCall) doRequest(alt string) (*http.Response, error) { +func (c *LocationsOperationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -23357,7 +24522,7 @@ func (c *OrganizationsGetCmekSettingsCall) doRequest(alt string) (*http.Response var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/cmekSettings") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -23370,14 +24535,14 @@ func (c *OrganizationsGetCmekSettingsCall) doRequest(alt string) (*http.Response return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.getCmekSettings" call. -// Exactly one of *CmekSettings or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *CmekSettings.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *OrganizationsGetCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSettings, error) { +// Do executes the "logging.locations.operations.list" call. +// Exactly one of *ListOperationsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListOperationsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -23396,7 +24561,7 @@ func (c *OrganizationsGetCmekSettingsCall) Do(opts ...googleapi.CallOption) (*Cm if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &CmekSettings{ + ret := &ListOperationsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -23408,25 +24573,41 @@ func (c *OrganizationsGetCmekSettingsCall) Do(opts ...googleapi.CallOption) (*Cm } return ret, nil // { - // "description": "Gets the Logging CMEK settings for the given resource.Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", - // "flatPath": "v2/organizations/{organizationsId}/cmekSettings", + // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.", + // "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/operations", // "httpMethod": "GET", - // "id": "logging.organizations.getCmekSettings", + // "id": "logging.locations.operations.list", // "parameterOrder": [ // "name" // ], // "parameters": { + // "filter": { + // "description": "The standard list filter.", + // "location": "query", + // "type": "string" + // }, // "name": { - // "description": "Required. The resource for which to retrieve CMEK settings. \"projects/[PROJECT_ID]/cmekSettings\" \"organizations/[ORGANIZATION_ID]/cmekSettings\" \"billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings\" \"folders/[FOLDER_ID]/cmekSettings\" For example:\"organizations/12345/cmekSettings\"Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.", + // "description": "The name of the operation's parent resource.", // "location": "path", - // "pattern": "^organizations/[^/]+$", + // "pattern": "^[^/]+/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" + // }, + // "pageSize": { + // "description": "The standard list page size.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The standard list page token.", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+name}/cmekSettings", + // "path": "v2/{+name}/operations", // "response": { - // "$ref": "CmekSettings" + // "$ref": "ListOperationsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -23438,112 +24619,113 @@ func (c *OrganizationsGetCmekSettingsCall) Do(opts ...googleapi.CallOption) (*Cm } -// method id "logging.organizations.getSettings": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *LocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type OrganizationsGetSettingsCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// method id "logging.logs.delete": + +type LogsDeleteCall struct { + s *Service + logName string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// GetSettings: Gets the Log Router settings for the given -// resource.Note: Settings for the Log Router can be get for Google -// Cloud projects, folders, organizations and billing accounts. -// Currently it can only be configured for organizations. Once -// configured for an organization, it applies to all projects and -// folders in the Google Cloud organization.See Enabling CMEK for Log -// Router -// (https://cloud.google.com/logging/docs/routing/managed-encryption) -// for more information. +// Delete: Deletes all the log entries in a log for the _Default Log +// Bucket. The log reappears if it receives new entries. Log entries +// written shortly before the delete operation might not be deleted. +// Entries received after the delete operation with a timestamp before +// the operation will be deleted. // -// - name: The resource for which to retrieve settings. -// "projects/[PROJECT_ID]/settings" -// "organizations/[ORGANIZATION_ID]/settings" -// "billingAccounts/[BILLING_ACCOUNT_ID]/settings" -// "folders/[FOLDER_ID]/settings" For -// example:"organizations/12345/settings"Note: Settings for the Log -// Router can be get for Google Cloud projects, folders, organizations -// and billing accounts. Currently it can only be configured for -// organizations. Once configured for an organization, it applies to -// all projects and folders in the Google Cloud organization. -func (r *OrganizationsService) GetSettings(name string) *OrganizationsGetSettingsCall { - c := &OrganizationsGetSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - logName: The resource name of the log to delete: +// projects/[PROJECT_ID]/logs/[LOG_ID] +// organizations/[ORGANIZATION_ID]/logs/[LOG_ID] +// billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID] +// folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For +// example, "projects/my-project-id/logs/syslog", +// "organizations/123/logs/cloudaudit.googleapis.com%2Factivity".For +// more information about log names, see LogEntry. +func (r *LogsService) Delete(logName string) *LogsDeleteCall { + c := &LogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.logName = logName return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsGetSettingsCall) Fields(s ...googleapi.Field) *OrganizationsGetSettingsCall { +func (c *LogsDeleteCall) Fields(s ...googleapi.Field) *LogsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *OrganizationsGetSettingsCall) IfNoneMatch(entityTag string) *OrganizationsGetSettingsCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsGetSettingsCall) Context(ctx context.Context) *OrganizationsGetSettingsCall { +func (c *LogsDeleteCall) Context(ctx context.Context) *LogsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsGetSettingsCall) Header() http.Header { +func (c *LogsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsGetSettingsCall) doRequest(alt string) (*http.Response, error) { +func (c *LogsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/settings") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+logName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "logName": c.logName, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.getSettings" call. -// Exactly one of *Settings or error will be non-nil. Any non-2xx status +// Do executes the "logging.logs.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *Settings.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *OrganizationsGetSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, error) { +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *LogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -23562,7 +24744,7 @@ func (c *OrganizationsGetSettingsCall) Do(opts ...googleapi.CallOption) (*Settin if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Settings{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -23574,146 +24756,163 @@ func (c *OrganizationsGetSettingsCall) Do(opts ...googleapi.CallOption) (*Settin } return ret, nil // { - // "description": "Gets the Log Router settings for the given resource.Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", - // "flatPath": "v2/organizations/{organizationsId}/settings", - // "httpMethod": "GET", - // "id": "logging.organizations.getSettings", + // "description": "Deletes all the log entries in a log for the _Default Log Bucket. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted.", + // "flatPath": "v2/{v2Id}/{v2Id1}/logs/{logsId}", + // "httpMethod": "DELETE", + // "id": "logging.logs.delete", // "parameterOrder": [ - // "name" + // "logName" // ], // "parameters": { - // "name": { - // "description": "Required. The resource for which to retrieve settings. \"projects/[PROJECT_ID]/settings\" \"organizations/[ORGANIZATION_ID]/settings\" \"billingAccounts/[BILLING_ACCOUNT_ID]/settings\" \"folders/[FOLDER_ID]/settings\" For example:\"organizations/12345/settings\"Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.", + // "logName": { + // "description": "Required. The resource name of the log to delete: projects/[PROJECT_ID]/logs/[LOG_ID] organizations/[ORGANIZATION_ID]/logs/[LOG_ID] billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID] folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/123/logs/cloudaudit.googleapis.com%2Factivity\".For more information about log names, see LogEntry.", // "location": "path", - // "pattern": "^organizations/[^/]+$", + // "pattern": "^[^/]+/[^/]+/logs/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}/settings", + // "path": "v2/{+logName}", // "response": { - // "$ref": "Settings" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// method id "logging.organizations.updateCmekSettings": +// method id "logging.logs.list": -type OrganizationsUpdateCmekSettingsCall struct { +type LogsListCall struct { s *Service - name string - cmeksettings *CmekSettings + parent string urlParams_ gensupport.URLParams + ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// UpdateCmekSettings: Updates the Log Router CMEK settings for the -// given resource.Note: CMEK for the Log Router can currently only be -// configured for Google Cloud organizations. Once configured, it -// applies to all projects and folders in the Google Cloud -// organization.UpdateCmekSettings will fail if 1) kms_key_name is -// invalid, or 2) the associated service account does not have the -// required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for -// the key, or 3) access to the key is disabled.See Enabling CMEK for -// Log Router -// (https://cloud.google.com/logging/docs/routing/managed-encryption) -// for more information. +// List: Lists the logs in projects, organizations, folders, or billing +// accounts. Only logs that have entries are listed. // -// - name: The resource name for the CMEK settings to update. -// "projects/[PROJECT_ID]/cmekSettings" -// "organizations/[ORGANIZATION_ID]/cmekSettings" -// "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" -// "folders/[FOLDER_ID]/cmekSettings" For -// example:"organizations/12345/cmekSettings"Note: CMEK for the Log -// Router can currently only be configured for Google Cloud -// organizations. Once configured, it applies to all projects and -// folders in the Google Cloud organization. -func (r *OrganizationsService) UpdateCmekSettings(name string, cmeksettings *CmekSettings) *OrganizationsUpdateCmekSettingsCall { - c := &OrganizationsUpdateCmekSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.cmeksettings = cmeksettings +// - parent: The resource name to list logs for: projects/[PROJECT_ID] +// organizations/[ORGANIZATION_ID] +// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]. +func (r *LogsService) List(parent string) *LogsListCall { + c := &LogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent return c } -// UpdateMask sets the optional parameter "updateMask": Field mask -// identifying which fields from cmek_settings should be updated. A -// field will be overwritten if and only if it is in the update mask. -// Output only fields cannot be updated.See FieldMask for more -// information.For example: "updateMask=kmsKeyName" -func (c *OrganizationsUpdateCmekSettingsCall) UpdateMask(updateMask string) *OrganizationsUpdateCmekSettingsCall { - c.urlParams_.Set("updateMask", updateMask) +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request. Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *LogsListCall) PageSize(pageSize int64) *LogsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *LogsListCall) PageToken(pageToken string) *LogsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ResourceNames sets the optional parameter "resourceNames": List of +// resource names to list logs for: +// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/view +// s/[VIEW_ID] +// organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKE +// T_ID]/views/[VIEW_ID] +// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[ +// BUCKET_ID]/views/[VIEW_ID] +// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/ +// [VIEW_ID]To support legacy queries, it could also be: +// projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] +// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]The resource +// name in the parent field is added to this list. +func (c *LogsListCall) ResourceNames(resourceNames ...string) *LogsListCall { + c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsUpdateCmekSettingsCall) Fields(s ...googleapi.Field) *OrganizationsUpdateCmekSettingsCall { +func (c *LogsListCall) Fields(s ...googleapi.Field) *LogsListCall { 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 *OrganizationsUpdateCmekSettingsCall) Context(ctx context.Context) *OrganizationsUpdateCmekSettingsCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LogsListCall) IfNoneMatch(entityTag string) *LogsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *LogsListCall) Context(ctx context.Context) *LogsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsUpdateCmekSettingsCall) Header() http.Header { +func (c *LogsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsUpdateCmekSettingsCall) doRequest(alt string) (*http.Response, error) { +func (c *LogsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.cmeksettings) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/cmekSettings") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.updateCmekSettings" call. -// Exactly one of *CmekSettings or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *CmekSettings.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *OrganizationsUpdateCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSettings, error) { +// Do executes the "logging.logs.list" call. +// Exactly one of *ListLogsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListLogsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -23732,7 +24931,7 @@ func (c *OrganizationsUpdateCmekSettingsCall) Do(opts ...googleapi.CallOption) ( if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &CmekSettings{ + ret := &ListLogsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -23744,151 +24943,178 @@ func (c *OrganizationsUpdateCmekSettingsCall) Do(opts ...googleapi.CallOption) ( } return ret, nil // { - // "description": "Updates the Log Router CMEK settings for the given resource.Note: CMEK for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.UpdateCmekSettings will fail if 1) kms_key_name is invalid, or 2) the associated service account does not have the required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, or 3) access to the key is disabled.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", - // "flatPath": "v2/organizations/{organizationsId}/cmekSettings", - // "httpMethod": "PATCH", - // "id": "logging.organizations.updateCmekSettings", + // "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", + // "flatPath": "v2/{v2Id}/{v2Id1}/logs", + // "httpMethod": "GET", + // "id": "logging.logs.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The resource name for the CMEK settings to update. \"projects/[PROJECT_ID]/cmekSettings\" \"organizations/[ORGANIZATION_ID]/cmekSettings\" \"billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings\" \"folders/[FOLDER_ID]/cmekSettings\" For example:\"organizations/12345/cmekSettings\"Note: CMEK for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.", + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The resource name to list logs for: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", // "location": "path", - // "pattern": "^organizations/[^/]+$", + // "pattern": "^[^/]+/[^/]+$", // "required": true, // "type": "string" // }, - // "updateMask": { - // "description": "Optional. Field mask identifying which fields from cmek_settings should be updated. A field will be overwritten if and only if it is in the update mask. Output only fields cannot be updated.See FieldMask for more information.For example: \"updateMask=kmsKeyName\"", - // "format": "google-fieldmask", + // "resourceNames": { + // "description": "Optional. List of resource names to list logs for: projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]To support legacy queries, it could also be: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]The resource name in the parent field is added to this list.", // "location": "query", + // "repeated": true, // "type": "string" // } // }, - // "path": "v2/{+name}/cmekSettings", - // "request": { - // "$ref": "CmekSettings" - // }, + // "path": "v2/{+parent}/logs", // "response": { - // "$ref": "CmekSettings" + // "$ref": "ListLogsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.organizations.updateSettings": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *LogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type OrganizationsUpdateSettingsCall struct { - s *Service - name string - settings *Settings - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "logging.monitoredResourceDescriptors.list": + +type MonitoredResourceDescriptorsListCall struct { + s *Service + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// UpdateSettings: Updates the Log Router settings for the given -// resource.Note: Settings for the Log Router can currently only be -// configured for Google Cloud organizations. Once configured, it -// applies to all projects and folders in the Google Cloud -// organization.UpdateSettings will fail if 1) kms_key_name is invalid, -// or 2) the associated service account does not have the required -// roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, -// or 3) access to the key is disabled. 4) location_id is not supported -// by Logging. 5) location_id violate OrgPolicy.See Enabling CMEK for -// Log Router -// (https://cloud.google.com/logging/docs/routing/managed-encryption) -// for more information. -// -// - name: The resource name for the settings to update. -// "organizations/[ORGANIZATION_ID]/settings" For -// example:"organizations/12345/settings"Note: Settings for the Log -// Router can currently only be configured for Google Cloud -// organizations. Once configured, it applies to all projects and -// folders in the Google Cloud organization. -func (r *OrganizationsService) UpdateSettings(name string, settings *Settings) *OrganizationsUpdateSettingsCall { - c := &OrganizationsUpdateSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.settings = settings +// List: Lists the descriptors for monitored resource types used by +// Logging. +func (r *MonitoredResourceDescriptorsService) List() *MonitoredResourceDescriptorsListCall { + c := &MonitoredResourceDescriptorsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} return c } -// UpdateMask sets the optional parameter "updateMask": Field mask -// identifying which fields from settings should be updated. A field -// will be overwritten if and only if it is in the update mask. Output -// only fields cannot be updated.See FieldMask for more information.For -// example: "updateMask=kmsKeyName" -func (c *OrganizationsUpdateSettingsCall) UpdateMask(updateMask string) *OrganizationsUpdateSettingsCall { - c.urlParams_.Set("updateMask", updateMask) +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request. Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *MonitoredResourceDescriptorsListCall) PageSize(pageSize int64) *MonitoredResourceDescriptorsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *MonitoredResourceDescriptorsListCall) PageToken(pageToken string) *MonitoredResourceDescriptorsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsUpdateSettingsCall) Fields(s ...googleapi.Field) *OrganizationsUpdateSettingsCall { +func (c *MonitoredResourceDescriptorsListCall) Fields(s ...googleapi.Field) *MonitoredResourceDescriptorsListCall { 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 *MonitoredResourceDescriptorsListCall) IfNoneMatch(entityTag string) *MonitoredResourceDescriptorsListCall { + 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 *OrganizationsUpdateSettingsCall) Context(ctx context.Context) *OrganizationsUpdateSettingsCall { +func (c *MonitoredResourceDescriptorsListCall) Context(ctx context.Context) *MonitoredResourceDescriptorsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsUpdateSettingsCall) Header() http.Header { +func (c *MonitoredResourceDescriptorsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsUpdateSettingsCall) doRequest(alt string) (*http.Response, error) { +func (c *MonitoredResourceDescriptorsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.settings) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/settings") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/monitoredResourceDescriptors") 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, - }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.updateSettings" call. -// Exactly one of *Settings or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Settings.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *OrganizationsUpdateSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, error) { +// Do executes the "logging.monitoredResourceDescriptors.list" call. +// Exactly one of *ListMonitoredResourceDescriptorsResponse or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *ListMonitoredResourceDescriptorsResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *MonitoredResourceDescriptorsListCall) Do(opts ...googleapi.CallOption) (*ListMonitoredResourceDescriptorsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -23907,7 +25133,7 @@ func (c *OrganizationsUpdateSettingsCall) Do(opts ...googleapi.CallOption) (*Set if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Settings{ + ret := &ListMonitoredResourceDescriptorsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -23919,130 +25145,164 @@ func (c *OrganizationsUpdateSettingsCall) Do(opts ...googleapi.CallOption) (*Set } return ret, nil // { - // "description": "Updates the Log Router settings for the given resource.Note: Settings for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.UpdateSettings will fail if 1) kms_key_name is invalid, or 2) the associated service account does not have the required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, or 3) access to the key is disabled. 4) location_id is not supported by Logging. 5) location_id violate OrgPolicy.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", - // "flatPath": "v2/organizations/{organizationsId}/settings", - // "httpMethod": "PATCH", - // "id": "logging.organizations.updateSettings", - // "parameterOrder": [ - // "name" - // ], + // "description": "Lists the descriptors for monitored resource types used by Logging.", + // "flatPath": "v2/monitoredResourceDescriptors", + // "httpMethod": "GET", + // "id": "logging.monitoredResourceDescriptors.list", + // "parameterOrder": [], // "parameters": { - // "name": { - // "description": "Required. The resource name for the settings to update. \"organizations/[ORGANIZATION_ID]/settings\" For example:\"organizations/12345/settings\"Note: Settings for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.", - // "location": "path", - // "pattern": "^organizations/[^/]+$", - // "required": true, - // "type": "string" + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "format": "int32", + // "location": "query", + // "type": "integer" // }, - // "updateMask": { - // "description": "Optional. Field mask identifying which fields from settings should be updated. A field will be overwritten if and only if it is in the update mask. Output only fields cannot be updated.See FieldMask for more information.For example: \"updateMask=kmsKeyName\"", - // "format": "google-fieldmask", + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", // "location": "query", // "type": "string" // } // }, - // "path": "v2/{+name}/settings", - // "request": { - // "$ref": "Settings" - // }, + // "path": "v2/monitoredResourceDescriptors", // "response": { - // "$ref": "Settings" + // "$ref": "ListMonitoredResourceDescriptorsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.organizations.exclusions.create": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *MonitoredResourceDescriptorsListCall) Pages(ctx context.Context, f func(*ListMonitoredResourceDescriptorsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type OrganizationsExclusionsCreateCall struct { +// method id "logging.organizations.getCmekSettings": + +type OrganizationsGetCmekSettingsCall struct { s *Service - parent string - logexclusion *LogExclusion + name string urlParams_ gensupport.URLParams + ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Create: Creates a new exclusion in the _Default sink in a specified -// parent resource. Only log entries belonging to that resource can be -// excluded. You can have up to 10 exclusions in a resource. +// GetCmekSettings: Gets the Logging CMEK settings for the given +// resource.Note: CMEK for the Log Router can be configured for Google +// Cloud projects, folders, organizations and billing accounts. Once +// configured for an organization, it applies to all projects and +// folders in the Google Cloud organization.See Enabling CMEK for Log +// Router +// (https://cloud.google.com/logging/docs/routing/managed-encryption) +// for more information. // -// - parent: The parent resource in which to create the exclusion: -// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For -// examples:"projects/my-logging-project" "organizations/123456789". -func (r *OrganizationsExclusionsService) Create(parent string, logexclusion *LogExclusion) *OrganizationsExclusionsCreateCall { - c := &OrganizationsExclusionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.logexclusion = logexclusion +// - name: The resource for which to retrieve CMEK settings. +// "projects/[PROJECT_ID]/cmekSettings" +// "organizations/[ORGANIZATION_ID]/cmekSettings" +// "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" +// "folders/[FOLDER_ID]/cmekSettings" For +// example:"organizations/12345/cmekSettings"Note: CMEK for the Log +// Router can be configured for Google Cloud projects, folders, +// organizations and billing accounts. Once configured for an +// organization, it applies to all projects and folders in the Google +// Cloud organization. +func (r *OrganizationsService) GetCmekSettings(name string) *OrganizationsGetCmekSettingsCall { + c := &OrganizationsGetCmekSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsExclusionsCreateCall) Fields(s ...googleapi.Field) *OrganizationsExclusionsCreateCall { +func (c *OrganizationsGetCmekSettingsCall) Fields(s ...googleapi.Field) *OrganizationsGetCmekSettingsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsGetCmekSettingsCall) IfNoneMatch(entityTag string) *OrganizationsGetCmekSettingsCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsExclusionsCreateCall) Context(ctx context.Context) *OrganizationsExclusionsCreateCall { +func (c *OrganizationsGetCmekSettingsCall) Context(ctx context.Context) *OrganizationsGetCmekSettingsCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsExclusionsCreateCall) Header() http.Header { +func (c *OrganizationsGetCmekSettingsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsExclusionsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsGetCmekSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/cmekSettings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.exclusions.create" call. -// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx +// Do executes the "logging.organizations.getCmekSettings" call. +// Exactly one of *CmekSettings or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either -// *LogExclusion.ServerResponse.Header or (if a response was returned at +// *CmekSettings.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *OrganizationsExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { +func (c *OrganizationsGetCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSettings, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -24061,7 +25321,7 @@ func (c *OrganizationsExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*L if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogExclusion{ + ret := &CmekSettings{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -24073,57 +25333,69 @@ func (c *OrganizationsExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*L } return ret, nil // { - // "description": "Creates a new exclusion in the _Default sink in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.", - // "flatPath": "v2/organizations/{organizationsId}/exclusions", - // "httpMethod": "POST", - // "id": "logging.organizations.exclusions.create", + // "description": "Gets the Logging CMEK settings for the given resource.Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", + // "flatPath": "v2/organizations/{organizationsId}/cmekSettings", + // "httpMethod": "GET", + // "id": "logging.organizations.getCmekSettings", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. The parent resource in which to create the exclusion: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-logging-project\" \"organizations/123456789\"", + // "name": { + // "description": "Required. The resource for which to retrieve CMEK settings. \"projects/[PROJECT_ID]/cmekSettings\" \"organizations/[ORGANIZATION_ID]/cmekSettings\" \"billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings\" \"folders/[FOLDER_ID]/cmekSettings\" For example:\"organizations/12345/cmekSettings\"Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.", // "location": "path", // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/exclusions", - // "request": { - // "$ref": "LogExclusion" - // }, + // "path": "v2/{+name}/cmekSettings", // "response": { - // "$ref": "LogExclusion" + // "$ref": "CmekSettings" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.organizations.exclusions.delete": +// method id "logging.organizations.getSettings": -type OrganizationsExclusionsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsGetSettingsCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes an exclusion in the _Default sink. +// GetSettings: Gets the Log Router settings for the given +// resource.Note: Settings for the Log Router can be get for Google +// Cloud projects, folders, organizations and billing accounts. +// Currently it can only be configured for organizations. Once +// configured for an organization, it applies to all projects and +// folders in the Google Cloud organization.See Enabling CMEK for Log +// Router +// (https://cloud.google.com/logging/docs/routing/managed-encryption) +// for more information. // -// - name: The resource name of an existing exclusion to delete: -// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" -// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" -// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For -// example:"projects/my-project/exclusions/my-exclusion". -func (r *OrganizationsExclusionsService) Delete(name string) *OrganizationsExclusionsDeleteCall { - c := &OrganizationsExclusionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource for which to retrieve settings. +// "projects/[PROJECT_ID]/settings" +// "organizations/[ORGANIZATION_ID]/settings" +// "billingAccounts/[BILLING_ACCOUNT_ID]/settings" +// "folders/[FOLDER_ID]/settings" For +// example:"organizations/12345/settings"Note: Settings for the Log +// Router can be get for Google Cloud projects, folders, organizations +// and billing accounts. Currently it can only be configured for +// organizations. Once configured for an organization, it applies to +// all projects and folders in the Google Cloud organization. +func (r *OrganizationsService) GetSettings(name string) *OrganizationsGetSettingsCall { + c := &OrganizationsGetSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -24131,41 +25403,54 @@ func (r *OrganizationsExclusionsService) Delete(name string) *OrganizationsExclu // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsExclusionsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsExclusionsDeleteCall { +func (c *OrganizationsGetSettingsCall) Fields(s ...googleapi.Field) *OrganizationsGetSettingsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsGetSettingsCall) IfNoneMatch(entityTag string) *OrganizationsGetSettingsCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsExclusionsDeleteCall) Context(ctx context.Context) *OrganizationsExclusionsDeleteCall { +func (c *OrganizationsGetSettingsCall) Context(ctx context.Context) *OrganizationsGetSettingsCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsExclusionsDeleteCall) Header() http.Header { +func (c *OrganizationsGetSettingsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsGetSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/settings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -24176,14 +25461,14 @@ func (c *OrganizationsExclusionsDeleteCall) doRequest(alt string) (*http.Respons return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.exclusions.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// Do executes the "logging.organizations.getSettings" call. +// Exactly one of *Settings or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *OrganizationsExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// *Settings.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *OrganizationsGetSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -24202,7 +25487,7 @@ func (c *OrganizationsExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*E if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &Settings{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -24214,110 +25499,128 @@ func (c *OrganizationsExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*E } return ret, nil // { - // "description": "Deletes an exclusion in the _Default sink.", - // "flatPath": "v2/organizations/{organizationsId}/exclusions/{exclusionsId}", - // "httpMethod": "DELETE", - // "id": "logging.organizations.exclusions.delete", + // "description": "Gets the Log Router settings for the given resource.Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", + // "flatPath": "v2/organizations/{organizationsId}/settings", + // "httpMethod": "GET", + // "id": "logging.organizations.getSettings", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource name of an existing exclusion to delete: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", + // "description": "Required. The resource for which to retrieve settings. \"projects/[PROJECT_ID]/settings\" \"organizations/[ORGANIZATION_ID]/settings\" \"billingAccounts/[BILLING_ACCOUNT_ID]/settings\" \"folders/[FOLDER_ID]/settings\" For example:\"organizations/12345/settings\"Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.", // "location": "path", - // "pattern": "^organizations/[^/]+/exclusions/[^/]+$", + // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+name}/settings", // "response": { - // "$ref": "Empty" + // "$ref": "Settings" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.organizations.exclusions.get": +// method id "logging.organizations.updateCmekSettings": -type OrganizationsExclusionsGetCall struct { +type OrganizationsUpdateCmekSettingsCall struct { s *Service name string + cmeksettings *CmekSettings urlParams_ gensupport.URLParams - ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Gets the description of an exclusion in the _Default sink. +// UpdateCmekSettings: Updates the Log Router CMEK settings for the +// given resource.Note: CMEK for the Log Router can currently only be +// configured for Google Cloud organizations. Once configured, it +// applies to all projects and folders in the Google Cloud +// organization.UpdateCmekSettings will fail if 1) kms_key_name is +// invalid, or 2) the associated service account does not have the +// required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for +// the key, or 3) access to the key is disabled.See Enabling CMEK for +// Log Router +// (https://cloud.google.com/logging/docs/routing/managed-encryption) +// for more information. // -// - name: The resource name of an existing exclusion: -// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" -// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" -// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For -// example:"projects/my-project/exclusions/my-exclusion". -func (r *OrganizationsExclusionsService) Get(name string) *OrganizationsExclusionsGetCall { - c := &OrganizationsExclusionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name for the CMEK settings to update. +// "projects/[PROJECT_ID]/cmekSettings" +// "organizations/[ORGANIZATION_ID]/cmekSettings" +// "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" +// "folders/[FOLDER_ID]/cmekSettings" For +// example:"organizations/12345/cmekSettings"Note: CMEK for the Log +// Router can currently only be configured for Google Cloud +// organizations. Once configured, it applies to all projects and +// folders in the Google Cloud organization. +func (r *OrganizationsService) UpdateCmekSettings(name string, cmeksettings *CmekSettings) *OrganizationsUpdateCmekSettingsCall { + c := &OrganizationsUpdateCmekSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.cmeksettings = cmeksettings + return c +} + +// UpdateMask sets the optional parameter "updateMask": Field mask +// identifying which fields from cmek_settings should be updated. A +// field will be overwritten if and only if it is in the update mask. +// Output only fields cannot be updated.See FieldMask for more +// information.For example: "updateMask=kmsKeyName" +func (c *OrganizationsUpdateCmekSettingsCall) UpdateMask(updateMask string) *OrganizationsUpdateCmekSettingsCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsExclusionsGetCall) Fields(s ...googleapi.Field) *OrganizationsExclusionsGetCall { +func (c *OrganizationsUpdateCmekSettingsCall) Fields(s ...googleapi.Field) *OrganizationsUpdateCmekSettingsCall { 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 *OrganizationsExclusionsGetCall) IfNoneMatch(entityTag string) *OrganizationsExclusionsGetCall { - 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 *OrganizationsExclusionsGetCall) Context(ctx context.Context) *OrganizationsExclusionsGetCall { +func (c *OrganizationsUpdateCmekSettingsCall) Context(ctx context.Context) *OrganizationsUpdateCmekSettingsCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsExclusionsGetCall) Header() http.Header { +func (c *OrganizationsUpdateCmekSettingsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsExclusionsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsUpdateCmekSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { 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.cmeksettings) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/cmekSettings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -24328,14 +25631,14 @@ func (c *OrganizationsExclusionsGetCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.exclusions.get" call. -// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx +// Do executes the "logging.organizations.updateCmekSettings" call. +// Exactly one of *CmekSettings or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either -// *LogExclusion.ServerResponse.Header or (if a response was returned at +// *CmekSettings.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *OrganizationsExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { +func (c *OrganizationsUpdateCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSettings, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -24354,7 +25657,7 @@ func (c *OrganizationsExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogE if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogExclusion{ + ret := &CmekSettings{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -24366,147 +25669,151 @@ func (c *OrganizationsExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogE } return ret, nil // { - // "description": "Gets the description of an exclusion in the _Default sink.", - // "flatPath": "v2/organizations/{organizationsId}/exclusions/{exclusionsId}", - // "httpMethod": "GET", - // "id": "logging.organizations.exclusions.get", + // "description": "Updates the Log Router CMEK settings for the given resource.Note: CMEK for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.UpdateCmekSettings will fail if 1) kms_key_name is invalid, or 2) the associated service account does not have the required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, or 3) access to the key is disabled.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", + // "flatPath": "v2/organizations/{organizationsId}/cmekSettings", + // "httpMethod": "PATCH", + // "id": "logging.organizations.updateCmekSettings", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource name of an existing exclusion: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", + // "description": "Required. The resource name for the CMEK settings to update. \"projects/[PROJECT_ID]/cmekSettings\" \"organizations/[ORGANIZATION_ID]/cmekSettings\" \"billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings\" \"folders/[FOLDER_ID]/cmekSettings\" For example:\"organizations/12345/cmekSettings\"Note: CMEK for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.", // "location": "path", - // "pattern": "^organizations/[^/]+/exclusions/[^/]+$", + // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "Optional. Field mask identifying which fields from cmek_settings should be updated. A field will be overwritten if and only if it is in the update mask. Output only fields cannot be updated.See FieldMask for more information.For example: \"updateMask=kmsKeyName\"", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+name}/cmekSettings", + // "request": { + // "$ref": "CmekSettings" + // }, // "response": { - // "$ref": "LogExclusion" + // "$ref": "CmekSettings" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// method id "logging.organizations.exclusions.list": +// method id "logging.organizations.updateSettings": -type OrganizationsExclusionsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsUpdateSettingsCall struct { + s *Service + name string + settings *Settings + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists all the exclusions on the _Default sink in a parent -// resource. +// UpdateSettings: Updates the Log Router settings for the given +// resource.Note: Settings for the Log Router can currently only be +// configured for Google Cloud organizations. Once configured, it +// applies to all projects and folders in the Google Cloud +// organization.UpdateSettings will fail if 1) kms_key_name is invalid, +// or 2) the associated service account does not have the required +// roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, +// or 3) access to the key is disabled. 4) location_id is not supported +// by Logging. 5) location_id violate OrgPolicy.See Enabling CMEK for +// Log Router +// (https://cloud.google.com/logging/docs/routing/managed-encryption) +// for more information. // -// - parent: The parent resource whose exclusions are to be listed. -// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]". -func (r *OrganizationsExclusionsService) List(parent string) *OrganizationsExclusionsListCall { - c := &OrganizationsExclusionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return from this request. Non-positive values are -// ignored. The presence of nextPageToken in the response indicates that -// more results might be available. -func (c *OrganizationsExclusionsListCall) PageSize(pageSize int64) *OrganizationsExclusionsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) +// - name: The resource name for the settings to update. +// "organizations/[ORGANIZATION_ID]/settings" For +// example:"organizations/12345/settings"Note: Settings for the Log +// Router can currently only be configured for Google Cloud +// organizations. Once configured, it applies to all projects and +// folders in the Google Cloud organization. +func (r *OrganizationsService) UpdateSettings(name string, settings *Settings) *OrganizationsUpdateSettingsCall { + c := &OrganizationsUpdateSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.settings = settings return c } -// PageToken sets the optional parameter "pageToken": If present, then -// retrieve the next batch of results from the preceding call to this -// method. pageToken must be the value of nextPageToken from the -// previous response. The values of other method parameters should be -// identical to those in the previous call. -func (c *OrganizationsExclusionsListCall) PageToken(pageToken string) *OrganizationsExclusionsListCall { - c.urlParams_.Set("pageToken", pageToken) +// UpdateMask sets the optional parameter "updateMask": Field mask +// identifying which fields from settings should be updated. A field +// will be overwritten if and only if it is in the update mask. Output +// only fields cannot be updated.See FieldMask for more information.For +// example: "updateMask=kmsKeyName" +func (c *OrganizationsUpdateSettingsCall) UpdateMask(updateMask string) *OrganizationsUpdateSettingsCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsExclusionsListCall) Fields(s ...googleapi.Field) *OrganizationsExclusionsListCall { +func (c *OrganizationsUpdateSettingsCall) Fields(s ...googleapi.Field) *OrganizationsUpdateSettingsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *OrganizationsExclusionsListCall) IfNoneMatch(entityTag string) *OrganizationsExclusionsListCall { - 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 *OrganizationsExclusionsListCall) Context(ctx context.Context) *OrganizationsExclusionsListCall { +func (c *OrganizationsUpdateSettingsCall) Context(ctx context.Context) *OrganizationsUpdateSettingsCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsExclusionsListCall) Header() http.Header { +func (c *OrganizationsUpdateSettingsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsExclusionsListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsUpdateSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.settings) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/settings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.exclusions.list" call. -// Exactly one of *ListExclusionsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListExclusionsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsResponse, error) { +// Do executes the "logging.organizations.updateSettings" call. +// Exactly one of *Settings or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Settings.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *OrganizationsUpdateSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -24525,7 +25832,7 @@ func (c *OrganizationsExclusionsListCall) Do(opts ...googleapi.CallOption) (*Lis if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListExclusionsResponse{ + ret := &Settings{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -24537,111 +25844,73 @@ func (c *OrganizationsExclusionsListCall) Do(opts ...googleapi.CallOption) (*Lis } return ret, nil // { - // "description": "Lists all the exclusions on the _Default sink in a parent resource.", - // "flatPath": "v2/organizations/{organizationsId}/exclusions", - // "httpMethod": "GET", - // "id": "logging.organizations.exclusions.list", + // "description": "Updates the Log Router settings for the given resource.Note: Settings for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.UpdateSettings will fail if 1) kms_key_name is invalid, or 2) the associated service account does not have the required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, or 3) access to the key is disabled. 4) location_id is not supported by Logging. 5) location_id violate OrgPolicy.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", + // "flatPath": "v2/organizations/{organizationsId}/settings", + // "httpMethod": "PATCH", + // "id": "logging.organizations.updateSettings", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "pageSize": { - // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The parent resource whose exclusions are to be listed. \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ", + // "name": { + // "description": "Required. The resource name for the settings to update. \"organizations/[ORGANIZATION_ID]/settings\" For example:\"organizations/12345/settings\"Note: Settings for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.", // "location": "path", // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "Optional. Field mask identifying which fields from settings should be updated. A field will be overwritten if and only if it is in the update mask. Output only fields cannot be updated.See FieldMask for more information.For example: \"updateMask=kmsKeyName\"", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+parent}/exclusions", + // "path": "v2/{+name}/settings", + // "request": { + // "$ref": "Settings" + // }, // "response": { - // "$ref": "ListExclusionsResponse" + // "$ref": "Settings" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *OrganizationsExclusionsListCall) Pages(ctx context.Context, f func(*ListExclusionsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "logging.organizations.exclusions.patch": +// method id "logging.organizations.exclusions.create": -type OrganizationsExclusionsPatchCall struct { +type OrganizationsExclusionsCreateCall struct { s *Service - name string + parent string logexclusion *LogExclusion urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Patch: Changes one or more properties of an existing exclusion in the -// _Default sink. +// Create: Creates a new exclusion in the _Default sink in a specified +// parent resource. Only log entries belonging to that resource can be +// excluded. You can have up to 10 exclusions in a resource. // -// - name: The resource name of the exclusion to update: -// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" -// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" -// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For -// example:"projects/my-project/exclusions/my-exclusion". -func (r *OrganizationsExclusionsService) Patch(name string, logexclusion *LogExclusion) *OrganizationsExclusionsPatchCall { - c := &OrganizationsExclusionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: The parent resource in which to create the exclusion: +// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For +// examples:"projects/my-logging-project" "organizations/123456789". +func (r *OrganizationsExclusionsService) Create(parent string, logexclusion *LogExclusion) *OrganizationsExclusionsCreateCall { + c := &OrganizationsExclusionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent c.logexclusion = logexclusion return c } -// UpdateMask sets the optional parameter "updateMask": Required. A -// non-empty list of fields to change in the existing exclusion. New -// values for the fields are taken from the corresponding fields in the -// LogExclusion included in this request. Fields not mentioned in -// update_mask are not changed and are ignored in the request.For -// example, to change the filter and description of an exclusion, -// specify an update_mask of "filter,description". -func (c *OrganizationsExclusionsPatchCall) UpdateMask(updateMask string) *OrganizationsExclusionsPatchCall { - c.urlParams_.Set("updateMask", updateMask) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsExclusionsPatchCall) Fields(s ...googleapi.Field) *OrganizationsExclusionsPatchCall { +func (c *OrganizationsExclusionsCreateCall) Fields(s ...googleapi.Field) *OrganizationsExclusionsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -24649,21 +25918,21 @@ func (c *OrganizationsExclusionsPatchCall) Fields(s ...googleapi.Field) *Organiz // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsExclusionsPatchCall) Context(ctx context.Context) *OrganizationsExclusionsPatchCall { +func (c *OrganizationsExclusionsCreateCall) Context(ctx context.Context) *OrganizationsExclusionsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsExclusionsPatchCall) Header() http.Header { +func (c *OrganizationsExclusionsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsExclusionsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsExclusionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -24678,27 +25947,27 @@ func (c *OrganizationsExclusionsPatchCall) doRequest(alt string) (*http.Response reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.exclusions.patch" call. +// Do executes the "logging.organizations.exclusions.create" call. // Exactly one of *LogExclusion or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *LogExclusion.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *OrganizationsExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { +func (c *OrganizationsExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -24729,29 +25998,23 @@ func (c *OrganizationsExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*Lo } return ret, nil // { - // "description": "Changes one or more properties of an existing exclusion in the _Default sink.", - // "flatPath": "v2/organizations/{organizationsId}/exclusions/{exclusionsId}", - // "httpMethod": "PATCH", - // "id": "logging.organizations.exclusions.patch", + // "description": "Creates a new exclusion in the _Default sink in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.", + // "flatPath": "v2/organizations/{organizationsId}/exclusions", + // "httpMethod": "POST", + // "id": "logging.organizations.exclusions.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The resource name of the exclusion to update: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", + // "parent": { + // "description": "Required. The parent resource in which to create the exclusion: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-logging-project\" \"organizations/123456789\"", // "location": "path", - // "pattern": "^organizations/[^/]+/exclusions/[^/]+$", + // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "Required. A non-empty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of \"filter,description\".", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+parent}/exclusions", // "request": { // "$ref": "LogExclusion" // }, @@ -24766,22 +26029,26 @@ func (c *OrganizationsExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*Lo } -// method id "logging.organizations.locations.get": +// method id "logging.organizations.exclusions.delete": -type OrganizationsLocationsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsExclusionsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets information about a location. +// Delete: Deletes an exclusion in the _Default sink. // -// - name: Resource name for the location. -func (r *OrganizationsLocationsService) Get(name string) *OrganizationsLocationsGetCall { - c := &OrganizationsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of an existing exclusion to delete: +// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" +// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" +// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For +// example:"projects/my-project/exclusions/my-exclusion". +func (r *OrganizationsExclusionsService) Delete(name string) *OrganizationsExclusionsDeleteCall { + c := &OrganizationsExclusionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -24789,54 +26056,41 @@ func (r *OrganizationsLocationsService) Get(name string) *OrganizationsLocations // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsGetCall { +func (c *OrganizationsExclusionsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsExclusionsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *OrganizationsLocationsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsGetCall) Context(ctx context.Context) *OrganizationsLocationsGetCall { +func (c *OrganizationsExclusionsDeleteCall) Context(ctx context.Context) *OrganizationsExclusionsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsGetCall) Header() http.Header { +func (c *OrganizationsExclusionsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -24847,14 +26101,14 @@ func (c *OrganizationsLocationsGetCall) doRequest(alt string) (*http.Response, e return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.get" call. -// Exactly one of *Location or error will be non-nil. Any non-2xx status +// Do executes the "logging.organizations.exclusions.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *Location.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *OrganizationsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) { +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrganizationsExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -24873,7 +26127,7 @@ func (c *OrganizationsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Locat if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Location{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -24885,39 +26139,37 @@ func (c *OrganizationsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Locat } return ret, nil // { - // "description": "Gets information about a location.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}", - // "httpMethod": "GET", - // "id": "logging.organizations.locations.get", + // "description": "Deletes an exclusion in the _Default sink.", + // "flatPath": "v2/organizations/{organizationsId}/exclusions/{exclusionsId}", + // "httpMethod": "DELETE", + // "id": "logging.organizations.exclusions.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Resource name for the location.", + // "description": "Required. The resource name of an existing exclusion to delete: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+$", + // "pattern": "^organizations/[^/]+/exclusions/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v2/{+name}", // "response": { - // "$ref": "Location" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// method id "logging.organizations.locations.list": +// method id "logging.organizations.exclusions.get": -type OrganizationsLocationsListCall struct { +type OrganizationsExclusionsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -24926,45 +26178,24 @@ type OrganizationsLocationsListCall struct { header_ http.Header } -// List: Lists information about the supported locations for this -// service. +// Get: Gets the description of an exclusion in the _Default sink. // -// - name: The resource that owns the locations collection, if -// applicable. -func (r *OrganizationsLocationsService) List(name string) *OrganizationsLocationsListCall { - c := &OrganizationsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of an existing exclusion: +// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" +// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" +// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For +// example:"projects/my-project/exclusions/my-exclusion". +func (r *OrganizationsExclusionsService) Get(name string) *OrganizationsExclusionsGetCall { + c := &OrganizationsExclusionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } -// Filter sets the optional parameter "filter": A filter to narrow down -// results to a preferred subset. The filtering language accepts strings -// like "displayName=tokyo", and is documented in more detail in AIP-160 -// (https://google.aip.dev/160). -func (c *OrganizationsLocationsListCall) Filter(filter string) *OrganizationsLocationsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return. If not set, the service selects a default. -func (c *OrganizationsLocationsListCall) PageSize(pageSize int64) *OrganizationsLocationsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": A page token -// received from the next_page_token field in the response. Send that -// page token to receive the subsequent page. -func (c *OrganizationsLocationsListCall) PageToken(pageToken string) *OrganizationsLocationsListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsListCall { +func (c *OrganizationsExclusionsGetCall) Fields(s ...googleapi.Field) *OrganizationsExclusionsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -24974,7 +26205,7 @@ func (c *OrganizationsLocationsListCall) Fields(s ...googleapi.Field) *Organizat // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsLocationsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsListCall { +func (c *OrganizationsExclusionsGetCall) IfNoneMatch(entityTag string) *OrganizationsExclusionsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -24982,21 +26213,21 @@ func (c *OrganizationsLocationsListCall) IfNoneMatch(entityTag string) *Organiza // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsListCall) Context(ctx context.Context) *OrganizationsLocationsListCall { +func (c *OrganizationsExclusionsGetCall) Context(ctx context.Context) *OrganizationsExclusionsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsListCall) Header() http.Header { +func (c *OrganizationsExclusionsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsExclusionsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -25009,7 +26240,7 @@ func (c *OrganizationsLocationsListCall) doRequest(alt string) (*http.Response, var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -25022,14 +26253,14 @@ func (c *OrganizationsLocationsListCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.list" call. -// Exactly one of *ListLocationsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListLocationsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) { +// Do executes the "logging.organizations.exclusions.get" call. +// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LogExclusion.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *OrganizationsExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -25048,7 +26279,7 @@ func (c *OrganizationsLocationsListCall) Do(opts ...googleapi.CallOption) (*List if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListLocationsResponse{ + ret := &LogExclusion{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -25060,41 +26291,25 @@ func (c *OrganizationsLocationsListCall) Do(opts ...googleapi.CallOption) (*List } return ret, nil // { - // "description": "Lists information about the supported locations for this service.", - // "flatPath": "v2/organizations/{organizationsId}/locations", + // "description": "Gets the description of an exclusion in the _Default sink.", + // "flatPath": "v2/organizations/{organizationsId}/exclusions/{exclusionsId}", // "httpMethod": "GET", - // "id": "logging.organizations.locations.list", + // "id": "logging.organizations.exclusions.get", // "parameterOrder": [ // "name" // ], // "parameters": { - // "filter": { - // "description": "A filter to narrow down results to a preferred subset. The filtering language accepts strings like \"displayName=tokyo\", and is documented in more detail in AIP-160 (https://google.aip.dev/160).", - // "location": "query", - // "type": "string" - // }, // "name": { - // "description": "The resource that owns the locations collection, if applicable.", + // "description": "Required. The resource name of an existing exclusion: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", // "location": "path", - // "pattern": "^organizations/[^/]+$", + // "pattern": "^organizations/[^/]+/exclusions/[^/]+$", // "required": true, // "type": "string" - // }, - // "pageSize": { - // "description": "The maximum number of results to return. If not set, the service selects a default.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "A page token received from the next_page_token field in the response. Send that page token to receive the subsequent page.", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+name}/locations", + // "path": "v2/{+name}", // "response": { - // "$ref": "ListLocationsResponse" + // "$ref": "LogExclusion" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -25106,104 +26321,99 @@ func (c *OrganizationsLocationsListCall) 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 *OrganizationsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "logging.organizations.locations.buckets.create": +// method id "logging.organizations.exclusions.list": -type OrganizationsLocationsBucketsCreateCall struct { - s *Service - parent string - logbucket *LogBucket - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsExclusionsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Create: Creates a log bucket that can be used to store log entries. -// After a bucket has been created, the bucket's location cannot be -// changed. +// List: Lists all the exclusions on the _Default sink in a parent +// resource. // -// - parent: The resource in which to create the log bucket: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For -// example:"projects/my-project/locations/global". -func (r *OrganizationsLocationsBucketsService) Create(parent string, logbucket *LogBucket) *OrganizationsLocationsBucketsCreateCall { - c := &OrganizationsLocationsBucketsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The parent resource whose exclusions are to be listed. +// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]". +func (r *OrganizationsExclusionsService) List(parent string) *OrganizationsExclusionsListCall { + c := &OrganizationsExclusionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.logbucket = logbucket return c } -// BucketId sets the optional parameter "bucketId": Required. A -// client-assigned identifier such as "my-bucket". Identifiers are -// limited to 100 characters and can include only letters, digits, -// underscores, hyphens, and periods. -func (c *OrganizationsLocationsBucketsCreateCall) BucketId(bucketId string) *OrganizationsLocationsBucketsCreateCall { - c.urlParams_.Set("bucketId", bucketId) +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request. Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *OrganizationsExclusionsListCall) PageSize(pageSize int64) *OrganizationsExclusionsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *OrganizationsExclusionsListCall) PageToken(pageToken string) *OrganizationsExclusionsListCall { + 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 *OrganizationsLocationsBucketsCreateCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsCreateCall { +func (c *OrganizationsExclusionsListCall) Fields(s ...googleapi.Field) *OrganizationsExclusionsListCall { 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 *OrganizationsExclusionsListCall) IfNoneMatch(entityTag string) *OrganizationsExclusionsListCall { + 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 *OrganizationsLocationsBucketsCreateCall) Context(ctx context.Context) *OrganizationsLocationsBucketsCreateCall { +func (c *OrganizationsExclusionsListCall) Context(ctx context.Context) *OrganizationsExclusionsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsBucketsCreateCall) Header() http.Header { +func (c *OrganizationsExclusionsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsExclusionsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -25214,14 +26424,14 @@ func (c *OrganizationsLocationsBucketsCreateCall) doRequest(alt string) (*http.R return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.buckets.create" call. -// Exactly one of *LogBucket or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *LogBucket.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *OrganizationsLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { +// Do executes the "logging.organizations.exclusions.list" call. +// Exactly one of *ListExclusionsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListExclusionsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -25240,7 +26450,7 @@ func (c *OrganizationsLocationsBucketsCreateCall) Do(opts ...googleapi.CallOptio if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogBucket{ + ret := &ListExclusionsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -25252,80 +26462,111 @@ func (c *OrganizationsLocationsBucketsCreateCall) Do(opts ...googleapi.CallOptio } return ret, nil // { - // "description": "Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets", - // "httpMethod": "POST", - // "id": "logging.organizations.locations.buckets.create", + // "description": "Lists all the exclusions on the _Default sink in a parent resource.", + // "flatPath": "v2/organizations/{organizationsId}/exclusions", + // "httpMethod": "GET", + // "id": "logging.organizations.exclusions.list", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "bucketId": { - // "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"", + // "description": "Required. The parent resource whose exclusions are to be listed. \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ", // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+$", + // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/buckets", - // "request": { - // "$ref": "LogBucket" - // }, + // "path": "v2/{+parent}/exclusions", // "response": { - // "$ref": "LogBucket" + // "$ref": "ListExclusionsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.organizations.locations.buckets.createAsync": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *OrganizationsExclusionsListCall) Pages(ctx context.Context, f func(*ListExclusionsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + 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 OrganizationsLocationsBucketsCreateAsyncCall struct { - s *Service - parent string - logbucket *LogBucket - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "logging.organizations.exclusions.patch": + +type OrganizationsExclusionsPatchCall struct { + s *Service + name string + logexclusion *LogExclusion + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// CreateAsync: Creates a log bucket asynchronously that can be used to -// store log entries.After a bucket has been created, the bucket's -// location cannot be changed. +// Patch: Changes one or more properties of an existing exclusion in the +// _Default sink. // -// - parent: The resource in which to create the log bucket: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For -// example:"projects/my-project/locations/global". -func (r *OrganizationsLocationsBucketsService) CreateAsync(parent string, logbucket *LogBucket) *OrganizationsLocationsBucketsCreateAsyncCall { - c := &OrganizationsLocationsBucketsCreateAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.logbucket = logbucket +// - name: The resource name of the exclusion to update: +// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" +// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" +// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For +// example:"projects/my-project/exclusions/my-exclusion". +func (r *OrganizationsExclusionsService) Patch(name string, logexclusion *LogExclusion) *OrganizationsExclusionsPatchCall { + c := &OrganizationsExclusionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.logexclusion = logexclusion return c } -// BucketId sets the optional parameter "bucketId": Required. A -// client-assigned identifier such as "my-bucket". Identifiers are -// limited to 100 characters and can include only letters, digits, -// underscores, hyphens, and periods. -func (c *OrganizationsLocationsBucketsCreateAsyncCall) BucketId(bucketId string) *OrganizationsLocationsBucketsCreateAsyncCall { - c.urlParams_.Set("bucketId", bucketId) +// UpdateMask sets the optional parameter "updateMask": Required. A +// non-empty list of fields to change in the existing exclusion. New +// values for the fields are taken from the corresponding fields in the +// LogExclusion included in this request. Fields not mentioned in +// update_mask are not changed and are ignored in the request.For +// example, to change the filter and description of an exclusion, +// specify an update_mask of "filter,description". +func (c *OrganizationsExclusionsPatchCall) UpdateMask(updateMask string) *OrganizationsExclusionsPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsBucketsCreateAsyncCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsCreateAsyncCall { +func (c *OrganizationsExclusionsPatchCall) Fields(s ...googleapi.Field) *OrganizationsExclusionsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -25333,21 +26574,21 @@ func (c *OrganizationsLocationsBucketsCreateAsyncCall) Fields(s ...googleapi.Fie // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsBucketsCreateAsyncCall) Context(ctx context.Context) *OrganizationsLocationsBucketsCreateAsyncCall { +func (c *OrganizationsExclusionsPatchCall) Context(ctx context.Context) *OrganizationsExclusionsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsBucketsCreateAsyncCall) Header() http.Header { +func (c *OrganizationsExclusionsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsBucketsCreateAsyncCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsExclusionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -25355,34 +26596,34 @@ func (c *OrganizationsLocationsBucketsCreateAsyncCall) doRequest(alt string) (*h } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets:createAsync") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.buckets.createAsync" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx +// Do executes the "logging.organizations.exclusions.patch" call. +// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at +// *LogExclusion.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *OrganizationsLocationsBucketsCreateAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *OrganizationsExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -25401,7 +26642,7 @@ func (c *OrganizationsLocationsBucketsCreateAsyncCall) Do(opts ...googleapi.Call if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &LogExclusion{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -25413,33 +26654,34 @@ func (c *OrganizationsLocationsBucketsCreateAsyncCall) Do(opts ...googleapi.Call } return ret, nil // { - // "description": "Creates a log bucket asynchronously that can be used to store log entries.After a bucket has been created, the bucket's location cannot be changed.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets:createAsync", - // "httpMethod": "POST", - // "id": "logging.organizations.locations.buckets.createAsync", + // "description": "Changes one or more properties of an existing exclusion in the _Default sink.", + // "flatPath": "v2/organizations/{organizationsId}/exclusions/{exclusionsId}", + // "httpMethod": "PATCH", + // "id": "logging.organizations.exclusions.patch", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "bucketId": { - // "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"", + // "name": { + // "description": "Required. The resource name of the exclusion to update: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+$", + // "pattern": "^organizations/[^/]+/exclusions/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "Required. A non-empty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of \"filter,description\".", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+parent}/buckets:createAsync", + // "path": "v2/{+name}", // "request": { - // "$ref": "LogBucket" + // "$ref": "LogExclusion" // }, // "response": { - // "$ref": "Operation" + // "$ref": "LogExclusion" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -25449,31 +26691,22 @@ func (c *OrganizationsLocationsBucketsCreateAsyncCall) Do(opts ...googleapi.Call } -// method id "logging.organizations.locations.buckets.delete": +// method id "logging.organizations.locations.get": -type OrganizationsLocationsBucketsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsLocationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a log bucket.Changes the bucket's lifecycle_state to -// the DELETE_REQUESTED state. After 7 days, the bucket will be purged -// and all log entries in the bucket will be permanently deleted. +// Get: Gets information about a location. // -// - name: The full resource name of the bucket to delete. -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *OrganizationsLocationsBucketsService) Delete(name string) *OrganizationsLocationsBucketsDeleteCall { - c := &OrganizationsLocationsBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Resource name for the location. +func (r *OrganizationsLocationsService) Get(name string) *OrganizationsLocationsGetCall { + c := &OrganizationsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -25481,41 +26714,54 @@ func (r *OrganizationsLocationsBucketsService) Delete(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 *OrganizationsLocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsDeleteCall { +func (c *OrganizationsLocationsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsLocationsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsBucketsDeleteCall) Context(ctx context.Context) *OrganizationsLocationsBucketsDeleteCall { +func (c *OrganizationsLocationsGetCall) Context(ctx context.Context) *OrganizationsLocationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsBucketsDeleteCall) Header() http.Header { +func (c *OrganizationsLocationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -25526,14 +26772,14 @@ func (c *OrganizationsLocationsBucketsDeleteCall) doRequest(alt string) (*http.R return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.buckets.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// Do executes the "logging.organizations.locations.get" call. +// Exactly one of *Location or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *OrganizationsLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// *Location.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *OrganizationsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -25552,7 +26798,7 @@ func (c *OrganizationsLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOptio if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &Location{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -25564,37 +26810,39 @@ func (c *OrganizationsLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOptio } return ret, nil // { - // "description": "Deletes a log bucket.Changes the bucket's lifecycle_state to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}", - // "httpMethod": "DELETE", - // "id": "logging.organizations.locations.buckets.delete", + // "description": "Gets information about a location.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}", + // "httpMethod": "GET", + // "id": "logging.organizations.locations.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The full resource name of the bucket to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "description": "Resource name for the location.", // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "pattern": "^organizations/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v2/{+name}", // "response": { - // "$ref": "Empty" + // "$ref": "Location" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.organizations.locations.buckets.get": +// method id "logging.organizations.locations.list": -type OrganizationsLocationsBucketsGetCall struct { +type OrganizationsLocationsListCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -25603,27 +26851,45 @@ type OrganizationsLocationsBucketsGetCall struct { header_ http.Header } -// Get: Gets a log bucket. +// List: Lists information about the supported locations for this +// service. // -// - name: The resource name of the bucket: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *OrganizationsLocationsBucketsService) Get(name string) *OrganizationsLocationsBucketsGetCall { - c := &OrganizationsLocationsBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource that owns the locations collection, if +// applicable. +func (r *OrganizationsLocationsService) List(name string) *OrganizationsLocationsListCall { + c := &OrganizationsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } +// Filter sets the optional parameter "filter": A filter to narrow down +// results to a preferred subset. The filtering language accepts strings +// like "displayName=tokyo", and is documented in more detail in AIP-160 +// (https://google.aip.dev/160). +func (c *OrganizationsLocationsListCall) Filter(filter string) *OrganizationsLocationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return. If not set, the service selects a default. +func (c *OrganizationsLocationsListCall) PageSize(pageSize int64) *OrganizationsLocationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token +// received from the next_page_token field in the response. Send that +// page token to receive the subsequent page. +func (c *OrganizationsLocationsListCall) PageToken(pageToken string) *OrganizationsLocationsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsBucketsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsGetCall { +func (c *OrganizationsLocationsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -25633,7 +26899,7 @@ func (c *OrganizationsLocationsBucketsGetCall) 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 *OrganizationsLocationsBucketsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsGetCall { +func (c *OrganizationsLocationsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsListCall { c.ifNoneMatch_ = entityTag return c } @@ -25641,21 +26907,21 @@ func (c *OrganizationsLocationsBucketsGetCall) 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 *OrganizationsLocationsBucketsGetCall) Context(ctx context.Context) *OrganizationsLocationsBucketsGetCall { +func (c *OrganizationsLocationsListCall) Context(ctx context.Context) *OrganizationsLocationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsBucketsGetCall) Header() http.Header { +func (c *OrganizationsLocationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsBucketsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -25668,7 +26934,7 @@ func (c *OrganizationsLocationsBucketsGetCall) doRequest(alt string) (*http.Resp var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -25681,14 +26947,14 @@ func (c *OrganizationsLocationsBucketsGetCall) doRequest(alt string) (*http.Resp return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.buckets.get" call. -// Exactly one of *LogBucket or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *LogBucket.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *OrganizationsLocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { +// Do executes the "logging.organizations.locations.list" call. +// Exactly one of *ListLocationsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListLocationsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -25707,7 +26973,7 @@ func (c *OrganizationsLocationsBucketsGetCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogBucket{ + ret := &ListLocationsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -25719,25 +26985,1849 @@ func (c *OrganizationsLocationsBucketsGetCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Gets a log bucket.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}", + // "description": "Lists information about the supported locations for this service.", + // "flatPath": "v2/organizations/{organizationsId}/locations", + // "httpMethod": "GET", + // "id": "logging.organizations.locations.list", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "filter": { + // "description": "A filter to narrow down results to a preferred subset. The filtering language accepts strings like \"displayName=tokyo\", and is documented in more detail in AIP-160 (https://google.aip.dev/160).", + // "location": "query", + // "type": "string" + // }, + // "name": { + // "description": "The resource that owns the locations collection, if applicable.", + // "location": "path", + // "pattern": "^organizations/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of results to return. If not set, the service selects a default.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token received from the next_page_token field in the response. Send that page token to receive the subsequent page.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v2/{+name}/locations", + // "response": { + // "$ref": "ListLocationsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *OrganizationsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "logging.organizations.locations.buckets.create": + +type OrganizationsLocationsBucketsCreateCall struct { + s *Service + parent string + logbucket *LogBucket + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a log bucket that can be used to store log entries. +// After a bucket has been created, the bucket's location cannot be +// changed. +// +// - parent: The resource in which to create the log bucket: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For +// example:"projects/my-project/locations/global". +func (r *OrganizationsLocationsBucketsService) Create(parent string, logbucket *LogBucket) *OrganizationsLocationsBucketsCreateCall { + c := &OrganizationsLocationsBucketsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.logbucket = logbucket + return c +} + +// BucketId sets the optional parameter "bucketId": Required. A +// client-assigned identifier such as "my-bucket". Identifiers are +// limited to 100 characters and can include only letters, digits, +// underscores, hyphens, and periods. +func (c *OrganizationsLocationsBucketsCreateCall) BucketId(bucketId string) *OrganizationsLocationsBucketsCreateCall { + c.urlParams_.Set("bucketId", bucketId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsLocationsBucketsCreateCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsCreateCall { + 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 *OrganizationsLocationsBucketsCreateCall) Context(ctx context.Context) *OrganizationsLocationsBucketsCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsLocationsBucketsCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsLocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "logging.organizations.locations.buckets.create" call. +// Exactly one of *LogBucket or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LogBucket.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *OrganizationsLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &LogBucket{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets", + // "httpMethod": "POST", + // "id": "logging.organizations.locations.buckets.create", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "bucketId": { + // "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"", + // "location": "path", + // "pattern": "^organizations/[^/]+/locations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+parent}/buckets", + // "request": { + // "$ref": "LogBucket" + // }, + // "response": { + // "$ref": "LogBucket" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.organizations.locations.buckets.createAsync": + +type OrganizationsLocationsBucketsCreateAsyncCall struct { + s *Service + parent string + logbucket *LogBucket + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// CreateAsync: Creates a log bucket asynchronously that can be used to +// store log entries.After a bucket has been created, the bucket's +// location cannot be changed. +// +// - parent: The resource in which to create the log bucket: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For +// example:"projects/my-project/locations/global". +func (r *OrganizationsLocationsBucketsService) CreateAsync(parent string, logbucket *LogBucket) *OrganizationsLocationsBucketsCreateAsyncCall { + c := &OrganizationsLocationsBucketsCreateAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.logbucket = logbucket + return c +} + +// BucketId sets the optional parameter "bucketId": Required. A +// client-assigned identifier such as "my-bucket". Identifiers are +// limited to 100 characters and can include only letters, digits, +// underscores, hyphens, and periods. +func (c *OrganizationsLocationsBucketsCreateAsyncCall) BucketId(bucketId string) *OrganizationsLocationsBucketsCreateAsyncCall { + c.urlParams_.Set("bucketId", bucketId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsLocationsBucketsCreateAsyncCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsCreateAsyncCall { + 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 *OrganizationsLocationsBucketsCreateAsyncCall) Context(ctx context.Context) *OrganizationsLocationsBucketsCreateAsyncCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsLocationsBucketsCreateAsyncCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsLocationsBucketsCreateAsyncCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets:createAsync") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "logging.organizations.locations.buckets.createAsync" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *OrganizationsLocationsBucketsCreateAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + 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": "Creates a log bucket asynchronously that can be used to store log entries.After a bucket has been created, the bucket's location cannot be changed.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets:createAsync", + // "httpMethod": "POST", + // "id": "logging.organizations.locations.buckets.createAsync", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "bucketId": { + // "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"", + // "location": "path", + // "pattern": "^organizations/[^/]+/locations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+parent}/buckets:createAsync", + // "request": { + // "$ref": "LogBucket" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.organizations.locations.buckets.delete": + +type OrganizationsLocationsBucketsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a log bucket.Changes the bucket's lifecycle_state to +// the DELETE_REQUESTED state. After 7 days, the bucket will be purged +// and all log entries in the bucket will be permanently deleted. +// +// - name: The full resource name of the bucket to delete. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *OrganizationsLocationsBucketsService) Delete(name string) *OrganizationsLocationsBucketsDeleteCall { + c := &OrganizationsLocationsBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsLocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsDeleteCall { + 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 *OrganizationsLocationsBucketsDeleteCall) Context(ctx context.Context) *OrganizationsLocationsBucketsDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsLocationsBucketsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsLocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "logging.organizations.locations.buckets.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrganizationsLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a log bucket.Changes the bucket's lifecycle_state to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}", + // "httpMethod": "DELETE", + // "id": "logging.organizations.locations.buckets.delete", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The full resource name of the bucket to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "location": "path", + // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+name}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.organizations.locations.buckets.get": + +type OrganizationsLocationsBucketsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets a log bucket. +// +// - name: The resource name of the bucket: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *OrganizationsLocationsBucketsService) Get(name string) *OrganizationsLocationsBucketsGetCall { + c := &OrganizationsLocationsBucketsGetCall{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 *OrganizationsLocationsBucketsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsLocationsBucketsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *OrganizationsLocationsBucketsGetCall) Context(ctx context.Context) *OrganizationsLocationsBucketsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsLocationsBucketsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsLocationsBucketsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "logging.organizations.locations.buckets.get" call. +// Exactly one of *LogBucket or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LogBucket.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *OrganizationsLocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &LogBucket{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a log bucket.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}", + // "httpMethod": "GET", + // "id": "logging.organizations.locations.buckets.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The resource name of the bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "location": "path", + // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+name}", + // "response": { + // "$ref": "LogBucket" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" + // ] + // } + +} + +// method id "logging.organizations.locations.buckets.list": + +type OrganizationsLocationsBucketsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists log buckets. +// +// - parent: The parent resource whose buckets are to be listed: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" Note: The locations +// portion of the resource must be specified, but supplying the +// character - in place of LOCATION_ID will return all buckets. +func (r *OrganizationsLocationsBucketsService) List(parent string) *OrganizationsLocationsBucketsListCall { + c := &OrganizationsLocationsBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request. Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *OrganizationsLocationsBucketsListCall) PageSize(pageSize int64) *OrganizationsLocationsBucketsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *OrganizationsLocationsBucketsListCall) PageToken(pageToken string) *OrganizationsLocationsBucketsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsLocationsBucketsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsLocationsBucketsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *OrganizationsLocationsBucketsListCall) Context(ctx context.Context) *OrganizationsLocationsBucketsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsLocationsBucketsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsLocationsBucketsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "logging.organizations.locations.buckets.list" call. +// Exactly one of *ListBucketsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListBucketsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsLocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucketsResponse, error) { + 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 := &ListBucketsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists log buckets.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets", // "httpMethod": "GET", - // "id": "logging.organizations.locations.buckets.get", + // "id": "logging.organizations.locations.buckets.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent resource whose buckets are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets.", + // "location": "path", + // "pattern": "^organizations/[^/]+/locations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+parent}/buckets", + // "response": { + // "$ref": "ListBucketsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *OrganizationsLocationsBucketsListCall) Pages(ctx context.Context, f func(*ListBucketsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "logging.organizations.locations.buckets.patch": + +type OrganizationsLocationsBucketsPatchCall struct { + s *Service + name string + logbucket *LogBucket + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates a log bucket.If the bucket has a lifecycle_state of +// DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a +// bucket has been created, the bucket's location cannot be changed. +// +// - name: The full resource name of the bucket to update. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *OrganizationsLocationsBucketsService) Patch(name string, logbucket *LogBucket) *OrganizationsLocationsBucketsPatchCall { + c := &OrganizationsLocationsBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.logbucket = logbucket + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. Field +// mask that specifies the fields in bucket that need an update. A +// bucket field will be overwritten if, and only if, it is in the update +// mask. name and output only fields cannot be updated.For a detailed +// FieldMask definition, see: +// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor +// example: updateMask=retention_days +func (c *OrganizationsLocationsBucketsPatchCall) UpdateMask(updateMask string) *OrganizationsLocationsBucketsPatchCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsLocationsBucketsPatchCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *OrganizationsLocationsBucketsPatchCall) Context(ctx context.Context) *OrganizationsLocationsBucketsPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsLocationsBucketsPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsLocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "logging.organizations.locations.buckets.patch" call. +// Exactly one of *LogBucket or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LogBucket.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *OrganizationsLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &LogBucket{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a log bucket.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}", + // "httpMethod": "PATCH", + // "id": "logging.organizations.locations.buckets.patch", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "location": "path", + // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "updateMask": { + // "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=retention_days", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v2/{+name}", + // "request": { + // "$ref": "LogBucket" + // }, + // "response": { + // "$ref": "LogBucket" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.organizations.locations.buckets.undelete": + +type OrganizationsLocationsBucketsUndeleteCall struct { + s *Service + name string + undeletebucketrequest *UndeleteBucketRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Undelete: Undeletes a log bucket. A bucket that has been deleted can +// be undeleted within the grace period of 7 days. +// +// - name: The full resource name of the bucket to undelete. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *OrganizationsLocationsBucketsService) Undelete(name string, undeletebucketrequest *UndeleteBucketRequest) *OrganizationsLocationsBucketsUndeleteCall { + c := &OrganizationsLocationsBucketsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.undeletebucketrequest = undeletebucketrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsLocationsBucketsUndeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsUndeleteCall { + 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 *OrganizationsLocationsBucketsUndeleteCall) Context(ctx context.Context) *OrganizationsLocationsBucketsUndeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsLocationsBucketsUndeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsLocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:undelete") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "logging.organizations.locations.buckets.undelete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrganizationsLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period of 7 days.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}:undelete", + // "httpMethod": "POST", + // "id": "logging.organizations.locations.buckets.undelete", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The full resource name of the bucket to undelete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "location": "path", + // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+name}:undelete", + // "request": { + // "$ref": "UndeleteBucketRequest" + // }, + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.organizations.locations.buckets.updateAsync": + +type OrganizationsLocationsBucketsUpdateAsyncCall struct { + s *Service + name string + logbucket *LogBucket + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// UpdateAsync: Updates a log bucket asynchronously.If the bucket has a +// lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be +// returned.After a bucket has been created, the bucket's location +// cannot be changed. +// +// - name: The full resource name of the bucket to update. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *OrganizationsLocationsBucketsService) UpdateAsync(name string, logbucket *LogBucket) *OrganizationsLocationsBucketsUpdateAsyncCall { + c := &OrganizationsLocationsBucketsUpdateAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.logbucket = logbucket + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. Field +// mask that specifies the fields in bucket that need an update. A +// bucket field will be overwritten if, and only if, it is in the update +// mask. name and output only fields cannot be updated.For a detailed +// FieldMask definition, see: +// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor +// example: updateMask=retention_days +func (c *OrganizationsLocationsBucketsUpdateAsyncCall) UpdateMask(updateMask string) *OrganizationsLocationsBucketsUpdateAsyncCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsLocationsBucketsUpdateAsyncCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsUpdateAsyncCall { + 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 *OrganizationsLocationsBucketsUpdateAsyncCall) Context(ctx context.Context) *OrganizationsLocationsBucketsUpdateAsyncCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsLocationsBucketsUpdateAsyncCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsLocationsBucketsUpdateAsyncCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:updateAsync") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "logging.organizations.locations.buckets.updateAsync" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *OrganizationsLocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + 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": "Updates a log bucket asynchronously.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}:updateAsync", + // "httpMethod": "POST", + // "id": "logging.organizations.locations.buckets.updateAsync", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource name of the bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "location": "path", + // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "updateMask": { + // "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=retention_days", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v2/{+name}:updateAsync", + // "request": { + // "$ref": "LogBucket" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.organizations.locations.buckets.links.create": + +type OrganizationsLocationsBucketsLinksCreateCall struct { + s *Service + parent string + link *Link + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Asynchronously creates a linked dataset in BigQuery which +// makes it possible to use BigQuery to read the logs stored in the log +// bucket. A log bucket may currently only contain one link. +// +// - parent: The full resource name of the bucket to create a link for. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]". +func (r *OrganizationsLocationsBucketsLinksService) Create(parent string, link *Link) *OrganizationsLocationsBucketsLinksCreateCall { + c := &OrganizationsLocationsBucketsLinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.link = link + return c +} + +// LinkId sets the optional parameter "linkId": Required. The ID to use +// for the link. The link_id can have up to 100 characters. A valid +// link_id must only have alphanumeric characters and underscores within +// it. +func (c *OrganizationsLocationsBucketsLinksCreateCall) LinkId(linkId string) *OrganizationsLocationsBucketsLinksCreateCall { + c.urlParams_.Set("linkId", linkId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsLocationsBucketsLinksCreateCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsLinksCreateCall { + 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 *OrganizationsLocationsBucketsLinksCreateCall) Context(ctx context.Context) *OrganizationsLocationsBucketsLinksCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsLocationsBucketsLinksCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsLocationsBucketsLinksCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.link) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/links") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "logging.organizations.locations.buckets.links.create" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *OrganizationsLocationsBucketsLinksCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + 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": "Asynchronously creates a linked dataset in BigQuery which makes it possible to use BigQuery to read the logs stored in the log bucket. A log bucket may currently only contain one link.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/links", + // "httpMethod": "POST", + // "id": "logging.organizations.locations.buckets.links.create", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "linkId": { + // "description": "Required. The ID to use for the link. The link_id can have up to 100 characters. A valid link_id must only have alphanumeric characters and underscores within it.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The full resource name of the bucket to create a link for. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", // "location": "path", // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" // } // }, + // "path": "v2/{+parent}/links", + // "request": { + // "$ref": "Link" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.organizations.locations.buckets.links.delete": + +type OrganizationsLocationsBucketsLinksDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a link. This will also delete the corresponding +// BigQuery linked dataset. +// +// - name: The full resource name of the link to delete. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/l +// inks/[LINK_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]/links/[LINK_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]/links/[LINK_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/lin +// ks/[LINK_ID]". +func (r *OrganizationsLocationsBucketsLinksService) Delete(name string) *OrganizationsLocationsBucketsLinksDeleteCall { + c := &OrganizationsLocationsBucketsLinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsLocationsBucketsLinksDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsLinksDeleteCall { + 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 *OrganizationsLocationsBucketsLinksDeleteCall) Context(ctx context.Context) *OrganizationsLocationsBucketsLinksDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsLocationsBucketsLinksDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsLocationsBucketsLinksDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "logging.organizations.locations.buckets.links.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *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 *OrganizationsLocationsBucketsLinksDeleteCall) 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": "Deletes a link. This will also delete the corresponding BigQuery linked dataset.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/links/{linksId}", + // "httpMethod": "DELETE", + // "id": "logging.organizations.locations.buckets.links.delete", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The full resource name of the link to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" ", + // "location": "path", + // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+/links/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, // "path": "v2/{+name}", // "response": { - // "$ref": "LogBucket" + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.organizations.locations.buckets.links.get": + +type OrganizationsLocationsBucketsLinksGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets a link. +// +// - name: The resource name of the link: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/l +// inks/[LINK_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]/links/[LINK_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]/links/[LINK_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/lin +// ks/[LINK_ID]". +func (r *OrganizationsLocationsBucketsLinksService) Get(name string) *OrganizationsLocationsBucketsLinksGetCall { + c := &OrganizationsLocationsBucketsLinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsLocationsBucketsLinksGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsLinksGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsLocationsBucketsLinksGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsLinksGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *OrganizationsLocationsBucketsLinksGetCall) Context(ctx context.Context) *OrganizationsLocationsBucketsLinksGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsLocationsBucketsLinksGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsLocationsBucketsLinksGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "logging.organizations.locations.buckets.links.get" call. +// Exactly one of *Link or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Link.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrganizationsLocationsBucketsLinksGetCall) Do(opts ...googleapi.CallOption) (*Link, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + 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 := &Link{ + 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 link.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/links/{linksId}", + // "httpMethod": "GET", + // "id": "logging.organizations.locations.buckets.links.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The resource name of the link: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" ", + // "location": "path", + // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+/links/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+name}", + // "response": { + // "$ref": "Link" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -25749,9 +28839,9 @@ func (c *OrganizationsLocationsBucketsGetCall) Do(opts ...googleapi.CallOption) } -// method id "logging.organizations.locations.buckets.list": +// method id "logging.organizations.locations.buckets.links.list": -type OrganizationsLocationsBucketsListCall struct { +type OrganizationsLocationsBucketsLinksListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -25760,26 +28850,24 @@ type OrganizationsLocationsBucketsListCall struct { header_ http.Header } -// List: Lists log buckets. +// List: Lists links. // -// - parent: The parent resource whose buckets are to be listed: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" Note: The locations -// portion of the resource must be specified, but supplying the -// character - in place of LOCATION_ID will return all buckets. -func (r *OrganizationsLocationsBucketsService) List(parent string) *OrganizationsLocationsBucketsListCall { - c := &OrganizationsLocationsBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The parent resource whose links are to be listed: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]". +func (r *OrganizationsLocationsBucketsLinksService) List(parent string) *OrganizationsLocationsBucketsLinksListCall { + c := &OrganizationsLocationsBucketsLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } // PageSize sets the optional parameter "pageSize": The maximum number -// of results to return from this request. Non-positive values are -// ignored. The presence of nextPageToken in the response indicates that -// more results might be available. -func (c *OrganizationsLocationsBucketsListCall) PageSize(pageSize int64) *OrganizationsLocationsBucketsListCall { +// of results to return from this request. +func (c *OrganizationsLocationsBucketsLinksListCall) PageSize(pageSize int64) *OrganizationsLocationsBucketsLinksListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } @@ -25787,9 +28875,8 @@ func (c *OrganizationsLocationsBucketsListCall) PageSize(pageSize int64) *Organi // PageToken sets the optional parameter "pageToken": If present, then // retrieve the next batch of results from the preceding call to this // method. pageToken must be the value of nextPageToken from the -// previous response. The values of other method parameters should be -// identical to those in the previous call. -func (c *OrganizationsLocationsBucketsListCall) PageToken(pageToken string) *OrganizationsLocationsBucketsListCall { +// previous response. +func (c *OrganizationsLocationsBucketsLinksListCall) PageToken(pageToken string) *OrganizationsLocationsBucketsLinksListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -25797,7 +28884,7 @@ func (c *OrganizationsLocationsBucketsListCall) PageToken(pageToken string) *Org // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsBucketsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsListCall { +func (c *OrganizationsLocationsBucketsLinksListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsLinksListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -25807,7 +28894,7 @@ func (c *OrganizationsLocationsBucketsListCall) Fields(s ...googleapi.Field) *Or // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsLocationsBucketsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsListCall { +func (c *OrganizationsLocationsBucketsLinksListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsLinksListCall { c.ifNoneMatch_ = entityTag return c } @@ -25815,21 +28902,21 @@ func (c *OrganizationsLocationsBucketsListCall) IfNoneMatch(entityTag string) *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 *OrganizationsLocationsBucketsListCall) Context(ctx context.Context) *OrganizationsLocationsBucketsListCall { +func (c *OrganizationsLocationsBucketsLinksListCall) Context(ctx context.Context) *OrganizationsLocationsBucketsLinksListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsBucketsListCall) Header() http.Header { +func (c *OrganizationsLocationsBucketsLinksListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsBucketsListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsBucketsLinksListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -25842,7 +28929,7 @@ func (c *OrganizationsLocationsBucketsListCall) doRequest(alt string) (*http.Res var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/links") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -25855,14 +28942,14 @@ func (c *OrganizationsLocationsBucketsListCall) doRequest(alt string) (*http.Res return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.buckets.list" call. -// Exactly one of *ListBucketsResponse or error will be non-nil. Any +// Do executes the "logging.organizations.locations.buckets.links.list" call. +// Exactly one of *ListLinksResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either -// *ListBucketsResponse.ServerResponse.Header or (if a response was +// *ListLinksResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *OrganizationsLocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucketsResponse, error) { +func (c *OrganizationsLocationsBucketsLinksListCall) Do(opts ...googleapi.CallOption) (*ListLinksResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -25881,7 +28968,7 @@ func (c *OrganizationsLocationsBucketsListCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListBucketsResponse{ + ret := &ListLinksResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -25893,36 +28980,36 @@ func (c *OrganizationsLocationsBucketsListCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Lists log buckets.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets", + // "description": "Lists links.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/links", // "httpMethod": "GET", - // "id": "logging.organizations.locations.buckets.list", + // "id": "logging.organizations.locations.buckets.links.list", // "parameterOrder": [ // "parent" // ], // "parameters": { // "pageSize": { - // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "description": "Optional. The maximum number of results to return from this request.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. The parent resource whose buckets are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets.", + // "description": "Required. The parent resource whose links are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+$", + // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/buckets", + // "path": "v2/{+parent}/links", // "response": { - // "$ref": "ListBucketsResponse" + // "$ref": "ListLinksResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -25937,7 +29024,7 @@ func (c *OrganizationsLocationsBucketsListCall) 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 *OrganizationsLocationsBucketsListCall) Pages(ctx context.Context, f func(*ListBucketsResponse) error) error { +func (c *OrganizationsLocationsBucketsLinksListCall) Pages(ctx context.Context, f func(*ListLinksResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -25955,53 +29042,44 @@ func (c *OrganizationsLocationsBucketsListCall) Pages(ctx context.Context, f fun } } -// method id "logging.organizations.locations.buckets.patch": +// method id "logging.organizations.locations.buckets.views.create": -type OrganizationsLocationsBucketsPatchCall struct { +type OrganizationsLocationsBucketsViewsCreateCall struct { s *Service - name string - logbucket *LogBucket + parent string + logview *LogView urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Patch: Updates a log bucket.If the bucket has a lifecycle_state of -// DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a -// bucket has been created, the bucket's location cannot be changed. +// Create: Creates a view over log entries in a log bucket. A bucket may +// contain a maximum of 30 views. // -// - name: The full resource name of the bucket to update. +// - parent: The bucket in which to create the view // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// For +// ` For // example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *OrganizationsLocationsBucketsService) Patch(name string, logbucket *LogBucket) *OrganizationsLocationsBucketsPatchCall { - c := &OrganizationsLocationsBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.logbucket = logbucket +func (r *OrganizationsLocationsBucketsViewsService) Create(parent string, logview *LogView) *OrganizationsLocationsBucketsViewsCreateCall { + c := &OrganizationsLocationsBucketsViewsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.logview = logview return c } -// UpdateMask sets the optional parameter "updateMask": Required. Field -// mask that specifies the fields in bucket that need an update. A -// bucket field will be overwritten if, and only if, it is in the update -// mask. name and output only fields cannot be updated.For a detailed -// FieldMask definition, see: -// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor -// example: updateMask=retention_days -func (c *OrganizationsLocationsBucketsPatchCall) UpdateMask(updateMask string) *OrganizationsLocationsBucketsPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// ViewId sets the optional parameter "viewId": Required. A +// client-assigned identifier such as "my-view". Identifiers are limited +// to 100 characters and can include only letters, digits, underscores, +// hyphens, and periods. +func (c *OrganizationsLocationsBucketsViewsCreateCall) ViewId(viewId string) *OrganizationsLocationsBucketsViewsCreateCall { + c.urlParams_.Set("viewId", viewId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsBucketsPatchCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsPatchCall { +func (c *OrganizationsLocationsBucketsViewsCreateCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -26009,21 +29087,21 @@ func (c *OrganizationsLocationsBucketsPatchCall) 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 *OrganizationsLocationsBucketsPatchCall) Context(ctx context.Context) *OrganizationsLocationsBucketsPatchCall { +func (c *OrganizationsLocationsBucketsViewsCreateCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsBucketsPatchCall) Header() http.Header { +func (c *OrganizationsLocationsBucketsViewsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -26031,34 +29109,34 @@ func (c *OrganizationsLocationsBucketsPatchCall) doRequest(alt string) (*http.Re } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.buckets.patch" call. -// Exactly one of *LogBucket or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *LogBucket.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *OrganizationsLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { +// Do executes the "logging.organizations.locations.buckets.views.create" call. +// Exactly one of *LogView or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogView.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrganizationsLocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption) (*LogView, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -26077,7 +29155,7 @@ func (c *OrganizationsLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogBucket{ + ret := &LogView{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -26089,34 +29167,33 @@ func (c *OrganizationsLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption } return ret, nil // { - // "description": "Updates a log bucket.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}", - // "httpMethod": "PATCH", - // "id": "logging.organizations.locations.buckets.patch", + // "description": "Creates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views", + // "httpMethod": "POST", + // "id": "logging.organizations.locations.buckets.views.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "parent": { + // "description": "Required. The bucket in which to create the view `\"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\"` For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" // }, - // "updateMask": { - // "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=retention_days", - // "format": "google-fieldmask", + // "viewId": { + // "description": "Required. A client-assigned identifier such as \"my-view\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", // "location": "query", // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+parent}/views", // "request": { - // "$ref": "LogBucket" + // "$ref": "LogView" // }, // "response": { - // "$ref": "LogBucket" + // "$ref": "LogView" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -26126,97 +29203,407 @@ func (c *OrganizationsLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption } -// method id "logging.organizations.locations.buckets.undelete": +// method id "logging.organizations.locations.buckets.views.delete": -type OrganizationsLocationsBucketsUndeleteCall struct { - s *Service - name string - undeletebucketrequest *UndeleteBucketRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsLocationsBucketsViewsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Undelete: Undeletes a log bucket. A bucket that has been deleted can -// be undeleted within the grace period of 7 days. +// Delete: Deletes a view on a log bucket. If an UNAVAILABLE error is +// returned, this indicates that system is not in a state where it can +// delete the view. If this occurs, please try again in a few minutes. // -// - name: The full resource name of the bucket to undelete. -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *OrganizationsLocationsBucketsService) Undelete(name string, undeletebucketrequest *UndeleteBucketRequest) *OrganizationsLocationsBucketsUndeleteCall { - c := &OrganizationsLocationsBucketsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The full resource name of the view to delete: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v +// iews/[VIEW_ID]" For +// example:"projects/my-project/locations/global/buckets/my-bucket/view +// s/my-view". +func (r *OrganizationsLocationsBucketsViewsService) Delete(name string) *OrganizationsLocationsBucketsViewsDeleteCall { + c := &OrganizationsLocationsBucketsViewsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.undeletebucketrequest = undeletebucketrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsBucketsUndeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsUndeleteCall { +func (c *OrganizationsLocationsBucketsViewsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsDeleteCall { + 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 *OrganizationsLocationsBucketsViewsDeleteCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsLocationsBucketsViewsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsLocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "logging.organizations.locations.buckets.views.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrganizationsLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a view on a log bucket. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", + // "httpMethod": "DELETE", + // "id": "logging.organizations.locations.buckets.views.delete", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The full resource name of the view to delete: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", + // "location": "path", + // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+name}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.organizations.locations.buckets.views.get": + +type OrganizationsLocationsBucketsViewsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets a view on a log bucket. +// +// - name: The resource name of the policy: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v +// iews/[VIEW_ID]" For +// example:"projects/my-project/locations/global/buckets/my-bucket/view +// s/my-view". +func (r *OrganizationsLocationsBucketsViewsService) Get(name string) *OrganizationsLocationsBucketsViewsGetCall { + c := &OrganizationsLocationsBucketsViewsGetCall{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 *OrganizationsLocationsBucketsViewsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsLocationsBucketsViewsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsViewsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *OrganizationsLocationsBucketsViewsGetCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *OrganizationsLocationsBucketsViewsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsLocationsBucketsViewsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "logging.organizations.locations.buckets.views.get" call. +// Exactly one of *LogView or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogView.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrganizationsLocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogView, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &LogView{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a view on a log bucket.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", + // "httpMethod": "GET", + // "id": "logging.organizations.locations.buckets.views.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The resource name of the policy: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", + // "location": "path", + // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+name}", + // "response": { + // "$ref": "LogView" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" + // ] + // } + +} + +// method id "logging.organizations.locations.buckets.views.list": + +type OrganizationsLocationsBucketsViewsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists views on a log bucket. +// +// - parent: The bucket whose views are to be listed: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]". +func (r *OrganizationsLocationsBucketsViewsService) List(parent string) *OrganizationsLocationsBucketsViewsListCall { + c := &OrganizationsLocationsBucketsViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request.Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *OrganizationsLocationsBucketsViewsListCall) PageSize(pageSize int64) *OrganizationsLocationsBucketsViewsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *OrganizationsLocationsBucketsViewsListCall) PageToken(pageToken string) *OrganizationsLocationsBucketsViewsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsLocationsBucketsViewsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsLocationsBucketsViewsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsViewsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsBucketsUndeleteCall) Context(ctx context.Context) *OrganizationsLocationsBucketsUndeleteCall { +func (c *OrganizationsLocationsBucketsViewsListCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsBucketsUndeleteCall) Header() http.Header { +func (c *OrganizationsLocationsBucketsViewsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsBucketsViewsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:undelete") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.buckets.undelete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *OrganizationsLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "logging.organizations.locations.buckets.views.list" call. +// Exactly one of *ListViewsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListViewsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsLocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) (*ListViewsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -26235,7 +29622,7 @@ func (c *OrganizationsLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOpt if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &ListViewsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -26247,77 +29634,105 @@ func (c *OrganizationsLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOpt } return ret, nil // { - // "description": "Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period of 7 days.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}:undelete", - // "httpMethod": "POST", - // "id": "logging.organizations.locations.buckets.undelete", + // "description": "Lists views on a log bucket.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views", + // "httpMethod": "GET", + // "id": "logging.organizations.locations.buckets.views.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The full resource name of the bucket to undelete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request.Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The bucket whose views are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", // "location": "path", // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}:undelete", - // "request": { - // "$ref": "UndeleteBucketRequest" - // }, + // "path": "v2/{+parent}/views", // "response": { - // "$ref": "Empty" + // "$ref": "ListViewsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.organizations.locations.buckets.updateAsync": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *OrganizationsLocationsBucketsViewsListCall) Pages(ctx context.Context, f func(*ListViewsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type OrganizationsLocationsBucketsUpdateAsyncCall struct { +// method id "logging.organizations.locations.buckets.views.patch": + +type OrganizationsLocationsBucketsViewsPatchCall struct { s *Service name string - logbucket *LogBucket + logview *LogView urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// UpdateAsync: Updates a log bucket asynchronously.If the bucket has a -// lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be -// returned.After a bucket has been created, the bucket's location -// cannot be changed. +// Patch: Updates a view on a log bucket. This method replaces the +// following fields in the existing view with values from the new view: +// filter. If an UNAVAILABLE error is returned, this indicates that +// system is not in a state where it can update the view. If this +// occurs, please try again in a few minutes. // -// - name: The full resource name of the bucket to update. -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *OrganizationsLocationsBucketsService) UpdateAsync(name string, logbucket *LogBucket) *OrganizationsLocationsBucketsUpdateAsyncCall { - c := &OrganizationsLocationsBucketsUpdateAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The full resource name of the view to update +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v +// iews/[VIEW_ID]" For +// example:"projects/my-project/locations/global/buckets/my-bucket/view +// s/my-view". +func (r *OrganizationsLocationsBucketsViewsService) Patch(name string, logview *LogView) *OrganizationsLocationsBucketsViewsPatchCall { + c := &OrganizationsLocationsBucketsViewsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.logbucket = logbucket + c.logview = logview return c } -// UpdateMask sets the optional parameter "updateMask": Required. Field -// mask that specifies the fields in bucket that need an update. A -// bucket field will be overwritten if, and only if, it is in the update -// mask. name and output only fields cannot be updated.For a detailed -// FieldMask definition, see: +// UpdateMask sets the optional parameter "updateMask": Field mask that +// specifies the fields in view that need an update. A field will be +// overwritten if, and only if, it is in the update mask. name and +// output only fields cannot be updated.For a detailed FieldMask +// definition, see // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor -// example: updateMask=retention_days -func (c *OrganizationsLocationsBucketsUpdateAsyncCall) UpdateMask(updateMask string) *OrganizationsLocationsBucketsUpdateAsyncCall { +// example: updateMask=filter +func (c *OrganizationsLocationsBucketsViewsPatchCall) UpdateMask(updateMask string) *OrganizationsLocationsBucketsViewsPatchCall { c.urlParams_.Set("updateMask", updateMask) return c } @@ -26325,7 +29740,7 @@ func (c *OrganizationsLocationsBucketsUpdateAsyncCall) UpdateMask(updateMask str // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsBucketsUpdateAsyncCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsUpdateAsyncCall { +func (c *OrganizationsLocationsBucketsViewsPatchCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -26333,21 +29748,21 @@ func (c *OrganizationsLocationsBucketsUpdateAsyncCall) Fields(s ...googleapi.Fie // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsBucketsUpdateAsyncCall) Context(ctx context.Context) *OrganizationsLocationsBucketsUpdateAsyncCall { +func (c *OrganizationsLocationsBucketsViewsPatchCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsBucketsUpdateAsyncCall) Header() http.Header { +func (c *OrganizationsLocationsBucketsViewsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsBucketsUpdateAsyncCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -26355,16 +29770,16 @@ func (c *OrganizationsLocationsBucketsUpdateAsyncCall) doRequest(alt string) (*h } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:updateAsync") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -26375,14 +29790,14 @@ func (c *OrganizationsLocationsBucketsUpdateAsyncCall) doRequest(alt string) (*h return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.buckets.updateAsync" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *OrganizationsLocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// Do executes the "logging.organizations.locations.buckets.views.patch" call. +// Exactly one of *LogView or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogView.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrganizationsLocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) (*LogView, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -26401,7 +29816,7 @@ func (c *OrganizationsLocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.Call if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &LogView{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -26413,34 +29828,34 @@ func (c *OrganizationsLocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.Call } return ret, nil // { - // "description": "Updates a log bucket asynchronously.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}:updateAsync", - // "httpMethod": "POST", - // "id": "logging.organizations.locations.buckets.updateAsync", + // "description": "Updates a view on a log bucket. This method replaces the following fields in the existing view with values from the new view: filter. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can update the view. If this occurs, please try again in a few minutes.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", + // "httpMethod": "PATCH", + // "id": "logging.organizations.locations.buckets.views.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "description": "Required. The full resource name of the view to update \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", // "required": true, // "type": "string" // }, // "updateMask": { - // "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=retention_days", + // "description": "Optional. Field mask that specifies the fields in view that need an update. A field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", // "format": "google-fieldmask", // "location": "query", // "type": "string" // } // }, - // "path": "v2/{+name}:updateAsync", + // "path": "v2/{+name}", // "request": { - // "$ref": "LogBucket" + // "$ref": "LogView" // }, // "response": { - // "$ref": "Operation" + // "$ref": "LogView" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -26450,87 +29865,117 @@ func (c *OrganizationsLocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.Call } -// method id "logging.organizations.locations.buckets.links.create": +// method id "logging.organizations.locations.buckets.views.logs.list": -type OrganizationsLocationsBucketsLinksCreateCall struct { - s *Service - parent string - link *Link - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsLocationsBucketsViewsLogsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Create: Asynchronously creates a linked dataset in BigQuery which -// makes it possible to use BigQuery to read the logs stored in the log -// bucket. A log bucket may currently only contain one link. +// List: Lists the logs in projects, organizations, folders, or billing +// accounts. Only logs that have entries are listed. // -// - parent: The full resource name of the bucket to create a link for. -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]". -func (r *OrganizationsLocationsBucketsLinksService) Create(parent string, link *Link) *OrganizationsLocationsBucketsLinksCreateCall { - c := &OrganizationsLocationsBucketsLinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The resource name to list logs for: projects/[PROJECT_ID] +// organizations/[ORGANIZATION_ID] +// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]. +func (r *OrganizationsLocationsBucketsViewsLogsService) List(parent string) *OrganizationsLocationsBucketsViewsLogsListCall { + c := &OrganizationsLocationsBucketsViewsLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.link = link return c } -// LinkId sets the optional parameter "linkId": Required. The ID to use -// for the link. The link_id can have up to 100 characters. A valid -// link_id must only have alphanumeric characters and underscores within -// it. -func (c *OrganizationsLocationsBucketsLinksCreateCall) LinkId(linkId string) *OrganizationsLocationsBucketsLinksCreateCall { - c.urlParams_.Set("linkId", linkId) +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request. Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *OrganizationsLocationsBucketsViewsLogsListCall) PageSize(pageSize int64) *OrganizationsLocationsBucketsViewsLogsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *OrganizationsLocationsBucketsViewsLogsListCall) PageToken(pageToken string) *OrganizationsLocationsBucketsViewsLogsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ResourceNames sets the optional parameter "resourceNames": List of +// resource names to list logs for: +// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/view +// s/[VIEW_ID] +// organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKE +// T_ID]/views/[VIEW_ID] +// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[ +// BUCKET_ID]/views/[VIEW_ID] +// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/ +// [VIEW_ID]To support legacy queries, it could also be: +// projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] +// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]The resource +// name in the parent field is added to this list. +func (c *OrganizationsLocationsBucketsViewsLogsListCall) ResourceNames(resourceNames ...string) *OrganizationsLocationsBucketsViewsLogsListCall { + c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsBucketsLinksCreateCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsLinksCreateCall { +func (c *OrganizationsLocationsBucketsViewsLogsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsLogsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsLocationsBucketsViewsLogsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsViewsLogsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsBucketsLinksCreateCall) Context(ctx context.Context) *OrganizationsLocationsBucketsLinksCreateCall { +func (c *OrganizationsLocationsBucketsViewsLogsListCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsLogsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsBucketsLinksCreateCall) Header() http.Header { +func (c *OrganizationsLocationsBucketsViewsLogsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsBucketsLinksCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsBucketsViewsLogsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.link) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/links") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -26541,14 +29986,14 @@ func (c *OrganizationsLocationsBucketsLinksCreateCall) doRequest(alt string) (*h return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.buckets.links.create" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *OrganizationsLocationsBucketsLinksCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// Do executes the "logging.organizations.locations.buckets.views.logs.list" call. +// Exactly one of *ListLogsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListLogsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsLocationsBucketsViewsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -26567,7 +30012,7 @@ func (c *OrganizationsLocationsBucketsLinksCreateCall) Do(opts ...googleapi.Call if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &ListLogsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -26579,74 +30024,108 @@ func (c *OrganizationsLocationsBucketsLinksCreateCall) Do(opts ...googleapi.Call } return ret, nil // { - // "description": "Asynchronously creates a linked dataset in BigQuery which makes it possible to use BigQuery to read the logs stored in the log bucket. A log bucket may currently only contain one link.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/links", - // "httpMethod": "POST", - // "id": "logging.organizations.locations.buckets.links.create", + // "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}/logs", + // "httpMethod": "GET", + // "id": "logging.organizations.locations.buckets.views.logs.list", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "linkId": { - // "description": "Required. The ID to use for the link. The link_id can have up to 100 characters. A valid link_id must only have alphanumeric characters and underscores within it.", + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. The full resource name of the bucket to create a link for. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", + // "description": "Required. The resource name to list logs for: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", // "required": true, // "type": "string" + // }, + // "resourceNames": { + // "description": "Optional. List of resource names to list logs for: projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]To support legacy queries, it could also be: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]The resource name in the parent field is added to this list.", + // "location": "query", + // "repeated": true, + // "type": "string" // } // }, - // "path": "v2/{+parent}/links", - // "request": { - // "$ref": "Link" - // }, + // "path": "v2/{+parent}/logs", // "response": { - // "$ref": "Operation" + // "$ref": "ListLogsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.organizations.locations.buckets.links.delete": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *OrganizationsLocationsBucketsViewsLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type OrganizationsLocationsBucketsLinksDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "logging.organizations.locations.operations.cancel": + +type OrganizationsLocationsOperationsCancelCall struct { + s *Service + name string + canceloperationrequest *CancelOperationRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a link. This will also delete the corresponding -// BigQuery linked dataset. +// Cancel: Starts asynchronous cancellation on a long-running operation. +// The server makes a best effort to cancel the operation, but success +// is not guaranteed. If the server doesn't support this method, it +// returns google.rpc.Code.UNIMPLEMENTED. Clients can use +// Operations.GetOperation or other methods to check whether the +// cancellation succeeded or whether the operation completed despite +// cancellation. On successful cancellation, the operation is not +// deleted; instead, it becomes an operation with an Operation.error +// value with a google.rpc.Status.code of 1, corresponding to +// Code.CANCELLED. // -// - name: The full resource name of the link to delete. -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/l -// inks/[LINK_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]/links/[LINK_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]/links/[LINK_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/lin -// ks/[LINK_ID]". -func (r *OrganizationsLocationsBucketsLinksService) Delete(name string) *OrganizationsLocationsBucketsLinksDeleteCall { - c := &OrganizationsLocationsBucketsLinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the operation resource to be cancelled. +func (r *OrganizationsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *OrganizationsLocationsOperationsCancelCall { + c := &OrganizationsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.canceloperationrequest = canceloperationrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsBucketsLinksDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsLinksDeleteCall { +func (c *OrganizationsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *OrganizationsLocationsOperationsCancelCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -26654,21 +30133,21 @@ func (c *OrganizationsLocationsBucketsLinksDeleteCall) Fields(s ...googleapi.Fie // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsBucketsLinksDeleteCall) Context(ctx context.Context) *OrganizationsLocationsBucketsLinksDeleteCall { +func (c *OrganizationsLocationsOperationsCancelCall) Context(ctx context.Context) *OrganizationsLocationsOperationsCancelCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsBucketsLinksDeleteCall) Header() http.Header { +func (c *OrganizationsLocationsOperationsCancelCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsBucketsLinksDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -26676,11 +30155,16 @@ func (c *OrganizationsLocationsBucketsLinksDeleteCall) doRequest(alt string) (*h } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -26691,14 +30175,14 @@ func (c *OrganizationsLocationsBucketsLinksDeleteCall) doRequest(alt string) (*h return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.buckets.links.delete" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *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 *OrganizationsLocationsBucketsLinksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// Do executes the "logging.organizations.locations.operations.cancel" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrganizationsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -26717,7 +30201,7 @@ func (c *OrganizationsLocationsBucketsLinksDeleteCall) Do(opts ...googleapi.Call 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, @@ -26729,25 +30213,28 @@ func (c *OrganizationsLocationsBucketsLinksDeleteCall) Do(opts ...googleapi.Call } return ret, nil // { - // "description": "Deletes a link. This will also delete the corresponding BigQuery linked dataset.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/links/{linksId}", - // "httpMethod": "DELETE", - // "id": "logging.organizations.locations.buckets.links.delete", + // "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/operations/{operationsId}:cancel", + // "httpMethod": "POST", + // "id": "logging.organizations.locations.operations.cancel", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The full resource name of the link to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" ", + // "description": "The name of the operation resource to be cancelled.", // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+/links/[^/]+$", + // "pattern": "^organizations/[^/]+/locations/[^/]+/operations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+name}:cancel", + // "request": { + // "$ref": "CancelOperationRequest" + // }, // "response": { - // "$ref": "Operation" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -26757,9 +30244,9 @@ func (c *OrganizationsLocationsBucketsLinksDeleteCall) Do(opts ...googleapi.Call } -// method id "logging.organizations.locations.buckets.links.get": +// method id "logging.organizations.locations.operations.get": -type OrganizationsLocationsBucketsLinksGetCall struct { +type OrganizationsLocationsOperationsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -26768,19 +30255,13 @@ type OrganizationsLocationsBucketsLinksGetCall struct { header_ http.Header } -// Get: Gets a link. +// Get: Gets the latest state of a long-running operation. Clients can +// use this method to poll the operation result at intervals as +// recommended by the API service. // -// - name: The resource name of the link: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/l -// inks/[LINK_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]/links/[LINK_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]/links/[LINK_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/lin -// ks/[LINK_ID]". -func (r *OrganizationsLocationsBucketsLinksService) Get(name string) *OrganizationsLocationsBucketsLinksGetCall { - c := &OrganizationsLocationsBucketsLinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the operation resource. +func (r *OrganizationsLocationsOperationsService) Get(name string) *OrganizationsLocationsOperationsGetCall { + c := &OrganizationsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -26788,7 +30269,7 @@ func (r *OrganizationsLocationsBucketsLinksService) Get(name string) *Organizati // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsBucketsLinksGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsLinksGetCall { +func (c *OrganizationsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsOperationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -26798,7 +30279,7 @@ func (c *OrganizationsLocationsBucketsLinksGetCall) Fields(s ...googleapi.Field) // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsLocationsBucketsLinksGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsLinksGetCall { +func (c *OrganizationsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsOperationsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -26806,21 +30287,21 @@ func (c *OrganizationsLocationsBucketsLinksGetCall) IfNoneMatch(entityTag string // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsBucketsLinksGetCall) Context(ctx context.Context) *OrganizationsLocationsBucketsLinksGetCall { +func (c *OrganizationsLocationsOperationsGetCall) Context(ctx context.Context) *OrganizationsLocationsOperationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsBucketsLinksGetCall) Header() http.Header { +func (c *OrganizationsLocationsOperationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsBucketsLinksGetCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -26846,14 +30327,14 @@ func (c *OrganizationsLocationsBucketsLinksGetCall) doRequest(alt string) (*http return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.buckets.links.get" call. -// Exactly one of *Link or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Link.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *OrganizationsLocationsBucketsLinksGetCall) Do(opts ...googleapi.CallOption) (*Link, error) { +// Do executes the "logging.organizations.locations.operations.get" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *OrganizationsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -26872,7 +30353,7 @@ func (c *OrganizationsLocationsBucketsLinksGetCall) Do(opts ...googleapi.CallOpt if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Link{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -26884,25 +30365,25 @@ func (c *OrganizationsLocationsBucketsLinksGetCall) Do(opts ...googleapi.CallOpt } return ret, nil // { - // "description": "Gets a link.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/links/{linksId}", + // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/operations/{operationsId}", // "httpMethod": "GET", - // "id": "logging.organizations.locations.buckets.links.get", + // "id": "logging.organizations.locations.operations.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource name of the link: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" ", + // "description": "The name of the operation resource.", // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+/links/[^/]+$", + // "pattern": "^organizations/[^/]+/locations/[^/]+/operations/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v2/{+name}", // "response": { - // "$ref": "Link" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -26914,44 +30395,45 @@ func (c *OrganizationsLocationsBucketsLinksGetCall) Do(opts ...googleapi.CallOpt } -// method id "logging.organizations.locations.buckets.links.list": +// method id "logging.organizations.locations.operations.list": -type OrganizationsLocationsBucketsLinksListCall struct { +type OrganizationsLocationsOperationsListCall struct { s *Service - parent string + name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists links. +// List: Lists operations that match the specified filter in the +// request. If the server doesn't support this method, it returns +// UNIMPLEMENTED. // -// - parent: The parent resource whose links are to be listed: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]". -func (r *OrganizationsLocationsBucketsLinksService) List(parent string) *OrganizationsLocationsBucketsLinksListCall { - c := &OrganizationsLocationsBucketsLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent +// - name: The name of the operation's parent resource. +func (r *OrganizationsLocationsOperationsService) List(name string) *OrganizationsLocationsOperationsListCall { + c := &OrganizationsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return from this request. -func (c *OrganizationsLocationsBucketsLinksListCall) PageSize(pageSize int64) *OrganizationsLocationsBucketsLinksListCall { +// Filter sets the optional parameter "filter": The standard list +// filter. +func (c *OrganizationsLocationsOperationsListCall) Filter(filter string) *OrganizationsLocationsOperationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The standard list +// page size. +func (c *OrganizationsLocationsOperationsListCall) PageSize(pageSize int64) *OrganizationsLocationsOperationsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } -// PageToken sets the optional parameter "pageToken": If present, then -// retrieve the next batch of results from the preceding call to this -// method. pageToken must be the value of nextPageToken from the -// previous response. -func (c *OrganizationsLocationsBucketsLinksListCall) PageToken(pageToken string) *OrganizationsLocationsBucketsLinksListCall { +// PageToken sets the optional parameter "pageToken": The standard list +// page token. +func (c *OrganizationsLocationsOperationsListCall) PageToken(pageToken string) *OrganizationsLocationsOperationsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -26959,7 +30441,7 @@ func (c *OrganizationsLocationsBucketsLinksListCall) 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 *OrganizationsLocationsBucketsLinksListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsLinksListCall { +func (c *OrganizationsLocationsOperationsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsOperationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -26969,7 +30451,7 @@ func (c *OrganizationsLocationsBucketsLinksListCall) Fields(s ...googleapi.Field // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsLocationsBucketsLinksListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsLinksListCall { +func (c *OrganizationsLocationsOperationsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsOperationsListCall { c.ifNoneMatch_ = entityTag return c } @@ -26977,21 +30459,21 @@ func (c *OrganizationsLocationsBucketsLinksListCall) IfNoneMatch(entityTag strin // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsBucketsLinksListCall) Context(ctx context.Context) *OrganizationsLocationsBucketsLinksListCall { +func (c *OrganizationsLocationsOperationsListCall) Context(ctx context.Context) *OrganizationsLocationsOperationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsBucketsLinksListCall) Header() http.Header { +func (c *OrganizationsLocationsOperationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsBucketsLinksListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -27004,7 +30486,7 @@ func (c *OrganizationsLocationsBucketsLinksListCall) doRequest(alt string) (*htt var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/links") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -27012,19 +30494,19 @@ func (c *OrganizationsLocationsBucketsLinksListCall) doRequest(alt string) (*htt } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.buckets.links.list" call. -// Exactly one of *ListLinksResponse or error will be non-nil. Any +// Do executes the "logging.organizations.locations.operations.list" call. +// Exactly one of *ListOperationsResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either -// *ListLinksResponse.ServerResponse.Header or (if a response was +// *ListOperationsResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *OrganizationsLocationsBucketsLinksListCall) Do(opts ...googleapi.CallOption) (*ListLinksResponse, error) { +func (c *OrganizationsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -27043,7 +30525,7 @@ func (c *OrganizationsLocationsBucketsLinksListCall) Do(opts ...googleapi.CallOp if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListLinksResponse{ + ret := &ListOperationsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -27055,36 +30537,41 @@ func (c *OrganizationsLocationsBucketsLinksListCall) Do(opts ...googleapi.CallOp } return ret, nil // { - // "description": "Lists links.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/links", + // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/operations", // "httpMethod": "GET", - // "id": "logging.organizations.locations.buckets.links.list", + // "id": "logging.organizations.locations.operations.list", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { + // "filter": { + // "description": "The standard list filter.", + // "location": "query", + // "type": "string" + // }, + // "name": { + // "description": "The name of the operation's parent resource.", + // "location": "path", + // "pattern": "^organizations/[^/]+/locations/[^/]+$", + // "required": true, + // "type": "string" + // }, // "pageSize": { - // "description": "Optional. The maximum number of results to return from this request.", + // "description": "The standard list page size.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response.", + // "description": "The standard list page token.", // "location": "query", // "type": "string" - // }, - // "parent": { - // "description": "Required. The parent resource whose links are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", - // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$", - // "required": true, - // "type": "string" // } // }, - // "path": "v2/{+parent}/links", + // "path": "v2/{+name}/operations", // "response": { - // "$ref": "ListLinksResponse" + // "$ref": "ListOperationsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -27099,7 +30586,7 @@ func (c *OrganizationsLocationsBucketsLinksListCall) Do(opts ...googleapi.CallOp // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *OrganizationsLocationsBucketsLinksListCall) Pages(ctx context.Context, f func(*ListLinksResponse) error) error { +func (c *OrganizationsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -27117,83 +30604,104 @@ func (c *OrganizationsLocationsBucketsLinksListCall) Pages(ctx context.Context, } } -// method id "logging.organizations.locations.buckets.views.create": +// method id "logging.organizations.locations.recentQueries.list": -type OrganizationsLocationsBucketsViewsCreateCall struct { - s *Service - parent string - logview *LogView - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsLocationsRecentQueriesListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Create: Creates a view over log entries in a log bucket. A bucket may -// contain a maximum of 30 views. +// List: Lists the RecentQueries that were created by the user making +// the request. // -// - parent: The bucket in which to create the view -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// ` For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *OrganizationsLocationsBucketsViewsService) Create(parent string, logview *LogView) *OrganizationsLocationsBucketsViewsCreateCall { - c := &OrganizationsLocationsBucketsViewsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The resource to which the listed queries belong. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" For +// example:projects/my-project/locations/us-central1Note: The location +// portion of the resource must be specified, but supplying the +// character - in place of LOCATION_ID will return all recent queries. +func (r *OrganizationsLocationsRecentQueriesService) List(parent string) *OrganizationsLocationsRecentQueriesListCall { + c := &OrganizationsLocationsRecentQueriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.logview = logview return c } -// ViewId sets the optional parameter "viewId": Required. A -// client-assigned identifier such as "my-view". Identifiers are limited -// to 100 characters and can include only letters, digits, underscores, -// hyphens, and periods. -func (c *OrganizationsLocationsBucketsViewsCreateCall) ViewId(viewId string) *OrganizationsLocationsBucketsViewsCreateCall { - c.urlParams_.Set("viewId", viewId) +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request. Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *OrganizationsLocationsRecentQueriesListCall) PageSize(pageSize int64) *OrganizationsLocationsRecentQueriesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *OrganizationsLocationsRecentQueriesListCall) PageToken(pageToken string) *OrganizationsLocationsRecentQueriesListCall { + 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 *OrganizationsLocationsBucketsViewsCreateCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsCreateCall { +func (c *OrganizationsLocationsRecentQueriesListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsRecentQueriesListCall { 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 *OrganizationsLocationsRecentQueriesListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsRecentQueriesListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsBucketsViewsCreateCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsCreateCall { +func (c *OrganizationsLocationsRecentQueriesListCall) Context(ctx context.Context) *OrganizationsLocationsRecentQueriesListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsBucketsViewsCreateCall) Header() http.Header { +func (c *OrganizationsLocationsRecentQueriesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsRecentQueriesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/recentQueries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -27204,14 +30712,14 @@ func (c *OrganizationsLocationsBucketsViewsCreateCall) doRequest(alt string) (*h return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.buckets.views.create" call. -// Exactly one of *LogView or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *LogView.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *OrganizationsLocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption) (*LogView, error) { +// Do executes the "logging.organizations.locations.recentQueries.list" call. +// Exactly one of *ListRecentQueriesResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ListRecentQueriesResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsLocationsRecentQueriesListCall) Do(opts ...googleapi.CallOption) (*ListRecentQueriesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -27230,7 +30738,7 @@ func (c *OrganizationsLocationsBucketsViewsCreateCall) Do(opts ...googleapi.Call if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogView{ + ret := &ListRecentQueriesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -27242,71 +30750,112 @@ func (c *OrganizationsLocationsBucketsViewsCreateCall) Do(opts ...googleapi.Call } return ret, nil // { - // "description": "Creates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views", - // "httpMethod": "POST", - // "id": "logging.organizations.locations.buckets.views.create", + // "description": "Lists the RecentQueries that were created by the user making the request.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/recentQueries", + // "httpMethod": "GET", + // "id": "logging.organizations.locations.recentQueries.list", // "parameterOrder": [ // "parent" // ], // "parameters": { + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "location": "query", + // "type": "string" + // }, // "parent": { - // "description": "Required. The bucket in which to create the view `\"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\"` For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "description": "Required. The resource to which the listed queries belong. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" For example:projects/my-project/locations/us-central1Note: The location portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all recent queries.", // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "pattern": "^organizations/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" - // }, - // "viewId": { - // "description": "Required. A client-assigned identifier such as \"my-view\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+parent}/views", - // "request": { - // "$ref": "LogView" - // }, + // "path": "v2/{+parent}/recentQueries", // "response": { - // "$ref": "LogView" + // "$ref": "ListRecentQueriesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.organizations.locations.buckets.views.delete": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *OrganizationsLocationsRecentQueriesListCall) Pages(ctx context.Context, f func(*ListRecentQueriesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type OrganizationsLocationsBucketsViewsDeleteCall struct { +// method id "logging.organizations.locations.savedQueries.create": + +type OrganizationsLocationsSavedQueriesCreateCall struct { s *Service - name string + parent string + savedquery *SavedQuery urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Delete: Deletes a view on a log bucket. If an UNAVAILABLE error is -// returned, this indicates that system is not in a state where it can -// delete the view. If this occurs, please try again in a few minutes. +// Create: Creates a new SavedQuery for the user making the request. // -// - name: The full resource name of the view to delete: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v -// iews/[VIEW_ID]" For -// example:"projects/my-project/locations/global/buckets/my-bucket/view -// s/my-view". -func (r *OrganizationsLocationsBucketsViewsService) Delete(name string) *OrganizationsLocationsBucketsViewsDeleteCall { - c := &OrganizationsLocationsBucketsViewsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: The parent resource in which to create the saved query: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" For example: +// "projects/my-project/locations/global" +// "organizations/123456789/locations/us-central1". +func (r *OrganizationsLocationsSavedQueriesService) Create(parent string, savedquery *SavedQuery) *OrganizationsLocationsSavedQueriesCreateCall { + c := &OrganizationsLocationsSavedQueriesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.savedquery = savedquery + return c +} + +// SavedQueryId sets the optional parameter "savedQueryId": The ID to +// use for the saved query, which will become the final component of the +// saved query's resource name.If the saved_query_id is not provided, +// the system will generate an alphanumeric ID.The saved_query_id is +// limited to 100 characters and can include only the following +// characters: upper and lower-case alphanumeric characters, +// underscores, hyphens, and periods. First character has to be +// alphanumeric. +func (c *OrganizationsLocationsSavedQueriesCreateCall) SavedQueryId(savedQueryId string) *OrganizationsLocationsSavedQueriesCreateCall { + c.urlParams_.Set("savedQueryId", savedQueryId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsBucketsViewsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsDeleteCall { +func (c *OrganizationsLocationsSavedQueriesCreateCall) Fields(s ...googleapi.Field) *OrganizationsLocationsSavedQueriesCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -27314,21 +30863,21 @@ func (c *OrganizationsLocationsBucketsViewsDeleteCall) Fields(s ...googleapi.Fie // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsBucketsViewsDeleteCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsDeleteCall { +func (c *OrganizationsLocationsSavedQueriesCreateCall) Context(ctx context.Context) *OrganizationsLocationsSavedQueriesCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsBucketsViewsDeleteCall) Header() http.Header { +func (c *OrganizationsLocationsSavedQueriesCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsSavedQueriesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -27336,29 +30885,34 @@ func (c *OrganizationsLocationsBucketsViewsDeleteCall) doRequest(alt string) (*h } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.savedquery) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/savedQueries") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.buckets.views.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *OrganizationsLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "logging.organizations.locations.savedQueries.create" call. +// Exactly one of *SavedQuery or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SavedQuery.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *OrganizationsLocationsSavedQueriesCreateCall) Do(opts ...googleapi.CallOption) (*SavedQuery, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -27377,7 +30931,7 @@ func (c *OrganizationsLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.Call if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &SavedQuery{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -27389,25 +30943,33 @@ func (c *OrganizationsLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.Call } return ret, nil // { - // "description": "Deletes a view on a log bucket. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", - // "httpMethod": "DELETE", - // "id": "logging.organizations.locations.buckets.views.delete", + // "description": "Creates a new SavedQuery for the user making the request.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/savedQueries", + // "httpMethod": "POST", + // "id": "logging.organizations.locations.savedQueries.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The full resource name of the view to delete: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", + // "parent": { + // "description": "Required. The parent resource in which to create the saved query: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" For example: \"projects/my-project/locations/global\" \"organizations/123456789/locations/us-central1\" ", // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", + // "pattern": "^organizations/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" + // }, + // "savedQueryId": { + // "description": "Optional. The ID to use for the saved query, which will become the final component of the saved query's resource name.If the saved_query_id is not provided, the system will generate an alphanumeric ID.The saved_query_id is limited to 100 characters and can include only the following characters: upper and lower-case alphanumeric characters, underscores, hyphens, and periods. First character has to be alphanumeric.", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+parent}/savedQueries", + // "request": { + // "$ref": "SavedQuery" + // }, // "response": { - // "$ref": "Empty" + // "$ref": "SavedQuery" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -27417,26 +30979,31 @@ func (c *OrganizationsLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.Call } -// method id "logging.organizations.locations.buckets.views.get": +// method id "logging.organizations.locations.savedQueries.delete": -type OrganizationsLocationsBucketsViewsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsLocationsSavedQueriesDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a view on a log bucket. +// Delete: Deletes an existing SavedQuery that was created by the user +// making the request. // -// - name: The resource name of the policy: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v -// iews/[VIEW_ID]" For -// example:"projects/my-project/locations/global/buckets/my-bucket/view -// s/my-view". -func (r *OrganizationsLocationsBucketsViewsService) Get(name string) *OrganizationsLocationsBucketsViewsGetCall { - c := &OrganizationsLocationsBucketsViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The full resource name of the saved query to delete. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_I +// D]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/savedQuerie +// s/[QUERY_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/savedQ +// ueries/[QUERY_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID] +// " For example: +// "projects/my-project/locations/global/savedQueries/my-saved-query". +func (r *OrganizationsLocationsSavedQueriesService) Delete(name string) *OrganizationsLocationsSavedQueriesDeleteCall { + c := &OrganizationsLocationsSavedQueriesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -27444,54 +31011,41 @@ func (r *OrganizationsLocationsBucketsViewsService) Get(name string) *Organizati // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsBucketsViewsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsGetCall { +func (c *OrganizationsLocationsSavedQueriesDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsSavedQueriesDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *OrganizationsLocationsBucketsViewsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsViewsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsBucketsViewsGetCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsGetCall { +func (c *OrganizationsLocationsSavedQueriesDeleteCall) Context(ctx context.Context) *OrganizationsLocationsSavedQueriesDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsBucketsViewsGetCall) Header() http.Header { +func (c *OrganizationsLocationsSavedQueriesDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsBucketsViewsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsSavedQueriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -27502,14 +31056,14 @@ func (c *OrganizationsLocationsBucketsViewsGetCall) doRequest(alt string) (*http return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.buckets.views.get" call. -// Exactly one of *LogView or error will be non-nil. Any non-2xx status +// Do executes the "logging.organizations.locations.savedQueries.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *LogView.ServerResponse.Header or (if a response was returned at all) +// *Empty.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. -func (c *OrganizationsLocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogView, error) { +func (c *OrganizationsLocationsSavedQueriesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -27528,7 +31082,7 @@ func (c *OrganizationsLocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOpt if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogView{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -27540,39 +31094,37 @@ func (c *OrganizationsLocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOpt } return ret, nil // { - // "description": "Gets a view on a log bucket.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", - // "httpMethod": "GET", - // "id": "logging.organizations.locations.buckets.views.get", + // "description": "Deletes an existing SavedQuery that was created by the user making the request.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/savedQueries/{savedQueriesId}", + // "httpMethod": "DELETE", + // "id": "logging.organizations.locations.savedQueries.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource name of the policy: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", + // "description": "Required. The full resource name of the saved query to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]\" For example: \"projects/my-project/locations/global/savedQueries/my-saved-query\" ", // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", + // "pattern": "^organizations/[^/]+/locations/[^/]+/savedQueries/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v2/{+name}", // "response": { - // "$ref": "LogView" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// method id "logging.organizations.locations.buckets.views.list": +// method id "logging.organizations.locations.savedQueries.list": -type OrganizationsLocationsBucketsViewsListCall struct { +type OrganizationsLocationsSavedQueriesListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -27581,12 +31133,20 @@ type OrganizationsLocationsBucketsViewsListCall struct { header_ http.Header } -// List: Lists views on a log bucket. +// List: Lists the SavedQueries that were created by the user making the +// request. // -// - parent: The bucket whose views are to be listed: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]". -func (r *OrganizationsLocationsBucketsViewsService) List(parent string) *OrganizationsLocationsBucketsViewsListCall { - c := &OrganizationsLocationsBucketsViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The resource to which the listed queries belong. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" For example: +// "projects/my-project/locations/us-central1" Note: The locations +// portion of the resource must be specified. To get a list of all +// saved queries, a wildcard character - can be used for LOCATION_ID, +// for example: "projects/my-project/locations/-". +func (r *OrganizationsLocationsSavedQueriesService) List(parent string) *OrganizationsLocationsSavedQueriesListCall { + c := &OrganizationsLocationsSavedQueriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } @@ -27595,7 +31155,7 @@ func (r *OrganizationsLocationsBucketsViewsService) List(parent string) *Organiz // of results to return from this request.Non-positive values are // ignored. The presence of nextPageToken in the response indicates that // more results might be available. -func (c *OrganizationsLocationsBucketsViewsListCall) PageSize(pageSize int64) *OrganizationsLocationsBucketsViewsListCall { +func (c *OrganizationsLocationsSavedQueriesListCall) PageSize(pageSize int64) *OrganizationsLocationsSavedQueriesListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } @@ -27605,7 +31165,7 @@ func (c *OrganizationsLocationsBucketsViewsListCall) PageSize(pageSize int64) *O // method. pageToken must be the value of nextPageToken from the // previous response. The values of other method parameters should be // identical to those in the previous call. -func (c *OrganizationsLocationsBucketsViewsListCall) PageToken(pageToken string) *OrganizationsLocationsBucketsViewsListCall { +func (c *OrganizationsLocationsSavedQueriesListCall) PageToken(pageToken string) *OrganizationsLocationsSavedQueriesListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -27613,7 +31173,7 @@ func (c *OrganizationsLocationsBucketsViewsListCall) PageToken(pageToken string) // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsBucketsViewsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsListCall { +func (c *OrganizationsLocationsSavedQueriesListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsSavedQueriesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -27623,7 +31183,7 @@ func (c *OrganizationsLocationsBucketsViewsListCall) Fields(s ...googleapi.Field // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsLocationsBucketsViewsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsViewsListCall { +func (c *OrganizationsLocationsSavedQueriesListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsSavedQueriesListCall { c.ifNoneMatch_ = entityTag return c } @@ -27631,21 +31191,21 @@ func (c *OrganizationsLocationsBucketsViewsListCall) IfNoneMatch(entityTag strin // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsBucketsViewsListCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsListCall { +func (c *OrganizationsLocationsSavedQueriesListCall) Context(ctx context.Context) *OrganizationsLocationsSavedQueriesListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsBucketsViewsListCall) Header() http.Header { +func (c *OrganizationsLocationsSavedQueriesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsBucketsViewsListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLocationsSavedQueriesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -27658,7 +31218,7 @@ func (c *OrganizationsLocationsBucketsViewsListCall) doRequest(alt string) (*htt var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/savedQueries") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -27671,14 +31231,14 @@ func (c *OrganizationsLocationsBucketsViewsListCall) doRequest(alt string) (*htt return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.buckets.views.list" call. -// Exactly one of *ListViewsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListViewsResponse.ServerResponse.Header or (if a response was +// Do executes the "logging.organizations.locations.savedQueries.list" call. +// Exactly one of *ListSavedQueriesResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ListSavedQueriesResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *OrganizationsLocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) (*ListViewsResponse, error) { +func (c *OrganizationsLocationsSavedQueriesListCall) Do(opts ...googleapi.CallOption) (*ListSavedQueriesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -27697,7 +31257,7 @@ func (c *OrganizationsLocationsBucketsViewsListCall) Do(opts ...googleapi.CallOp if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListViewsResponse{ + ret := &ListSavedQueriesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -27709,10 +31269,10 @@ func (c *OrganizationsLocationsBucketsViewsListCall) Do(opts ...googleapi.CallOp } return ret, nil // { - // "description": "Lists views on a log bucket.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views", + // "description": "Lists the SavedQueries that were created by the user making the request.", + // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/savedQueries", // "httpMethod": "GET", - // "id": "logging.organizations.locations.buckets.views.list", + // "id": "logging.organizations.locations.savedQueries.list", // "parameterOrder": [ // "parent" // ], @@ -27729,16 +31289,16 @@ func (c *OrganizationsLocationsBucketsViewsListCall) Do(opts ...googleapi.CallOp // "type": "string" // }, // "parent": { - // "description": "Required. The bucket whose views are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", + // "description": "Required. The resource to which the listed queries belong. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" For example: \"projects/my-project/locations/us-central1\" Note: The locations portion of the resource must be specified. To get a list of all saved queries, a wildcard character - can be used for LOCATION_ID, for example: \"projects/my-project/locations/-\" ", // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "pattern": "^organizations/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/views", + // "path": "v2/{+parent}/savedQueries", // "response": { - // "$ref": "ListViewsResponse" + // "$ref": "ListSavedQueriesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -27753,7 +31313,7 @@ func (c *OrganizationsLocationsBucketsViewsListCall) Do(opts ...googleapi.CallOp // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *OrganizationsLocationsBucketsViewsListCall) Pages(ctx context.Context, f func(*ListViewsResponse) error) error { +func (c *OrganizationsLocationsSavedQueriesListCall) Pages(ctx context.Context, f func(*ListSavedQueriesResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -27771,51 +31331,40 @@ func (c *OrganizationsLocationsBucketsViewsListCall) Pages(ctx context.Context, } } -// method id "logging.organizations.locations.buckets.views.patch": +// method id "logging.organizations.logs.delete": -type OrganizationsLocationsBucketsViewsPatchCall struct { +type OrganizationsLogsDeleteCall struct { s *Service - name string - logview *LogView + logName string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Patch: Updates a view on a log bucket. This method replaces the -// following fields in the existing view with values from the new view: -// filter. If an UNAVAILABLE error is returned, this indicates that -// system is not in a state where it can update the view. If this -// occurs, please try again in a few minutes. +// Delete: Deletes all the log entries in a log for the _Default Log +// Bucket. The log reappears if it receives new entries. Log entries +// written shortly before the delete operation might not be deleted. +// Entries received after the delete operation with a timestamp before +// the operation will be deleted. // -// - name: The full resource name of the view to update -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v -// iews/[VIEW_ID]" For -// example:"projects/my-project/locations/global/buckets/my-bucket/view -// s/my-view". -func (r *OrganizationsLocationsBucketsViewsService) Patch(name string, logview *LogView) *OrganizationsLocationsBucketsViewsPatchCall { - c := &OrganizationsLocationsBucketsViewsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.logview = logview - return c -} - -// UpdateMask sets the optional parameter "updateMask": Field mask that -// specifies the fields in view that need an update. A field will be -// overwritten if, and only if, it is in the update mask. name and -// output only fields cannot be updated.For a detailed FieldMask -// definition, see -// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor -// example: updateMask=filter -func (c *OrganizationsLocationsBucketsViewsPatchCall) UpdateMask(updateMask string) *OrganizationsLocationsBucketsViewsPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// - logName: The resource name of the log to delete: +// projects/[PROJECT_ID]/logs/[LOG_ID] +// organizations/[ORGANIZATION_ID]/logs/[LOG_ID] +// billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID] +// folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For +// example, "projects/my-project-id/logs/syslog", +// "organizations/123/logs/cloudaudit.googleapis.com%2Factivity".For +// more information about log names, see LogEntry. +func (r *OrganizationsLogsService) Delete(logName string) *OrganizationsLogsDeleteCall { + c := &OrganizationsLogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.logName = logName return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsBucketsViewsPatchCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsPatchCall { +func (c *OrganizationsLogsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLogsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -27823,21 +31372,21 @@ func (c *OrganizationsLocationsBucketsViewsPatchCall) Fields(s ...googleapi.Fiel // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsBucketsViewsPatchCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsPatchCall { +func (c *OrganizationsLogsDeleteCall) Context(ctx context.Context) *OrganizationsLogsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsBucketsViewsPatchCall) Header() http.Header { +func (c *OrganizationsLogsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLogsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -27845,34 +31394,29 @@ func (c *OrganizationsLocationsBucketsViewsPatchCall) doRequest(alt string) (*ht } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+logName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "logName": c.logName, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.buckets.views.patch" call. -// Exactly one of *LogView or error will be non-nil. Any non-2xx status +// Do executes the "logging.organizations.logs.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *LogView.ServerResponse.Header or (if a response was returned at all) +// *Empty.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. -func (c *OrganizationsLocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) (*LogView, error) { +func (c *OrganizationsLogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -27891,7 +31435,7 @@ func (c *OrganizationsLocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallO if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogView{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -27903,34 +31447,25 @@ func (c *OrganizationsLocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallO } return ret, nil // { - // "description": "Updates a view on a log bucket. This method replaces the following fields in the existing view with values from the new view: filter. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can update the view. If this occurs, please try again in a few minutes.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", - // "httpMethod": "PATCH", - // "id": "logging.organizations.locations.buckets.views.patch", + // "description": "Deletes all the log entries in a log for the _Default Log Bucket. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted.", + // "flatPath": "v2/organizations/{organizationsId}/logs/{logsId}", + // "httpMethod": "DELETE", + // "id": "logging.organizations.logs.delete", // "parameterOrder": [ - // "name" + // "logName" // ], // "parameters": { - // "name": { - // "description": "Required. The full resource name of the view to update \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", + // "logName": { + // "description": "Required. The resource name of the log to delete: projects/[PROJECT_ID]/logs/[LOG_ID] organizations/[ORGANIZATION_ID]/logs/[LOG_ID] billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID] folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/123/logs/cloudaudit.googleapis.com%2Factivity\".For more information about log names, see LogEntry.", // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", + // "pattern": "^organizations/[^/]+/logs/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "Optional. Field mask that specifies the fields in view that need an update. A field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+name}", - // "request": { - // "$ref": "LogView" - // }, + // "path": "v2/{+logName}", // "response": { - // "$ref": "LogView" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -27940,9 +31475,9 @@ func (c *OrganizationsLocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallO } -// method id "logging.organizations.locations.buckets.views.logs.list": +// method id "logging.organizations.logs.list": -type OrganizationsLocationsBucketsViewsLogsListCall struct { +type OrganizationsLogsListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -27957,8 +31492,8 @@ type OrganizationsLocationsBucketsViewsLogsListCall struct { // - parent: The resource name to list logs for: projects/[PROJECT_ID] // organizations/[ORGANIZATION_ID] // billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]. -func (r *OrganizationsLocationsBucketsViewsLogsService) List(parent string) *OrganizationsLocationsBucketsViewsLogsListCall { - c := &OrganizationsLocationsBucketsViewsLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *OrganizationsLogsService) List(parent string) *OrganizationsLogsListCall { + c := &OrganizationsLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } @@ -27967,7 +31502,7 @@ func (r *OrganizationsLocationsBucketsViewsLogsService) List(parent string) *Org // of results to return from this request. Non-positive values are // ignored. The presence of nextPageToken in the response indicates that // more results might be available. -func (c *OrganizationsLocationsBucketsViewsLogsListCall) PageSize(pageSize int64) *OrganizationsLocationsBucketsViewsLogsListCall { +func (c *OrganizationsLogsListCall) PageSize(pageSize int64) *OrganizationsLogsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } @@ -27977,7 +31512,7 @@ func (c *OrganizationsLocationsBucketsViewsLogsListCall) PageSize(pageSize int64 // method. pageToken must be the value of nextPageToken from the // previous response. The values of other method parameters should be // identical to those in the previous call. -func (c *OrganizationsLocationsBucketsViewsLogsListCall) PageToken(pageToken string) *OrganizationsLocationsBucketsViewsLogsListCall { +func (c *OrganizationsLogsListCall) PageToken(pageToken string) *OrganizationsLogsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -27995,7 +31530,7 @@ func (c *OrganizationsLocationsBucketsViewsLogsListCall) PageToken(pageToken str // projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] // billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]The resource // name in the parent field is added to this list. -func (c *OrganizationsLocationsBucketsViewsLogsListCall) ResourceNames(resourceNames ...string) *OrganizationsLocationsBucketsViewsLogsListCall { +func (c *OrganizationsLogsListCall) ResourceNames(resourceNames ...string) *OrganizationsLogsListCall { c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...)) return c } @@ -28003,7 +31538,7 @@ func (c *OrganizationsLocationsBucketsViewsLogsListCall) ResourceNames(resourceN // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsBucketsViewsLogsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsLogsListCall { +func (c *OrganizationsLogsListCall) Fields(s ...googleapi.Field) *OrganizationsLogsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -28013,7 +31548,7 @@ func (c *OrganizationsLocationsBucketsViewsLogsListCall) Fields(s ...googleapi.F // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsLocationsBucketsViewsLogsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsViewsLogsListCall { +func (c *OrganizationsLogsListCall) IfNoneMatch(entityTag string) *OrganizationsLogsListCall { c.ifNoneMatch_ = entityTag return c } @@ -28021,21 +31556,21 @@ func (c *OrganizationsLocationsBucketsViewsLogsListCall) IfNoneMatch(entityTag s // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsBucketsViewsLogsListCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsLogsListCall { +func (c *OrganizationsLogsListCall) Context(ctx context.Context) *OrganizationsLogsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsBucketsViewsLogsListCall) Header() http.Header { +func (c *OrganizationsLogsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsBucketsViewsLogsListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsLogsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -28061,14 +31596,14 @@ func (c *OrganizationsLocationsBucketsViewsLogsListCall) doRequest(alt string) ( return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.buckets.views.logs.list" call. +// Do executes the "logging.organizations.logs.list" call. // Exactly one of *ListLogsResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either // *ListLogsResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *OrganizationsLocationsBucketsViewsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) { +func (c *OrganizationsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -28100,9 +31635,9 @@ func (c *OrganizationsLocationsBucketsViewsLogsListCall) Do(opts ...googleapi.Ca return ret, nil // { // "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}/logs", + // "flatPath": "v2/organizations/{organizationsId}/logs", // "httpMethod": "GET", - // "id": "logging.organizations.locations.buckets.views.logs.list", + // "id": "logging.organizations.logs.list", // "parameterOrder": [ // "parent" // ], @@ -28121,7 +31656,7 @@ func (c *OrganizationsLocationsBucketsViewsLogsListCall) Do(opts ...googleapi.Ca // "parent": { // "description": "Required. The resource name to list logs for: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", + // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" // }, @@ -28149,7 +31684,7 @@ func (c *OrganizationsLocationsBucketsViewsLogsListCall) Do(opts ...googleapi.Ca // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *OrganizationsLocationsBucketsViewsLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error { +func (c *OrganizationsLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -28167,40 +31702,66 @@ func (c *OrganizationsLocationsBucketsViewsLogsListCall) Pages(ctx context.Conte } } -// method id "logging.organizations.locations.operations.cancel": +// method id "logging.organizations.sinks.create": -type OrganizationsLocationsOperationsCancelCall struct { - s *Service - name string - canceloperationrequest *CancelOperationRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsSinksCreateCall struct { + s *Service + parent string + logsink *LogSink + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Cancel: Starts asynchronous cancellation on a long-running operation. -// The server makes a best effort to cancel the operation, but success -// is not guaranteed. If the server doesn't support this method, it -// returns google.rpc.Code.UNIMPLEMENTED. Clients can use -// Operations.GetOperation or other methods to check whether the -// cancellation succeeded or whether the operation completed despite -// cancellation. On successful cancellation, the operation is not -// deleted; instead, it becomes an operation with an Operation.error -// value with a google.rpc.Status.code of 1, corresponding to -// Code.CANCELLED. +// Create: Creates a sink that exports specified log entries to a +// destination. The export begins upon ingress, unless the sink's +// writer_identity is not permitted to write to the destination. A sink +// can export log entries only from the resource owning the sink. // -// - name: The name of the operation resource to be cancelled. -func (r *OrganizationsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *OrganizationsLocationsOperationsCancelCall { - c := &OrganizationsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.canceloperationrequest = canceloperationrequest +// - parent: The resource in which to create the sink: +// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For +// examples:"projects/my-project" "organizations/123456789". +func (r *OrganizationsSinksService) Create(parent string, logsink *LogSink) *OrganizationsSinksCreateCall { + c := &OrganizationsSinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.logsink = logsink + return c +} + +// CustomWriterIdentity sets the optional parameter +// "customWriterIdentity": A service account provided by the caller that +// will be used to write the log entries. The format must be +// serviceAccount:some@email. This field can only be specified if you +// are routing logs to a destination outside this sink's project. If not +// specified, a Logging service account will automatically be generated. +func (c *OrganizationsSinksCreateCall) CustomWriterIdentity(customWriterIdentity string) *OrganizationsSinksCreateCall { + c.urlParams_.Set("customWriterIdentity", customWriterIdentity) + return c +} + +// UniqueWriterIdentity sets the optional parameter +// "uniqueWriterIdentity": Determines the kind of IAM identity returned +// as writer_identity in the new sink. If this value is omitted or set +// to false, and if the sink's parent is a project, then the value +// returned as writer_identity is the same group or service account used +// by Cloud Logging before the addition of writer identities to this +// API. The sink's destination must be in the same project as the sink +// itself.If this field is set to true, or if the sink is owned by a +// non-project resource such as an organization, then the value of +// writer_identity will be a service agent +// (https://cloud.google.com/iam/docs/service-account-types#service-agents) +// used by the sinks with the same parent. For more information, see +// writer_identity in LogSink. +func (c *OrganizationsSinksCreateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *OrganizationsSinksCreateCall { + c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *OrganizationsLocationsOperationsCancelCall { +func (c *OrganizationsSinksCreateCall) Fields(s ...googleapi.Field) *OrganizationsSinksCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -28208,21 +31769,21 @@ func (c *OrganizationsLocationsOperationsCancelCall) 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 *OrganizationsLocationsOperationsCancelCall) Context(ctx context.Context) *OrganizationsLocationsOperationsCancelCall { +func (c *OrganizationsSinksCreateCall) Context(ctx context.Context) *OrganizationsSinksCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsOperationsCancelCall) Header() http.Header { +func (c *OrganizationsSinksCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -28230,14 +31791,14 @@ func (c *OrganizationsLocationsOperationsCancelCall) doRequest(alt string) (*htt } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:cancel") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -28245,19 +31806,19 @@ func (c *OrganizationsLocationsOperationsCancelCall) doRequest(alt string) (*htt } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.operations.cancel" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// Do executes the "logging.organizations.sinks.create" call. +// Exactly one of *LogSink or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) +// *LogSink.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. -func (c *OrganizationsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +func (c *OrganizationsSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -28276,7 +31837,7 @@ func (c *OrganizationsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOp if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &LogSink{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -28288,28 +31849,38 @@ func (c *OrganizationsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOp } return ret, nil // { - // "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/operations/{operationsId}:cancel", + // "description": "Creates a sink that exports specified log entries to a destination. The export begins upon ingress, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.", + // "flatPath": "v2/organizations/{organizationsId}/sinks", // "httpMethod": "POST", - // "id": "logging.organizations.locations.operations.cancel", + // "id": "logging.organizations.sinks.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "The name of the operation resource to be cancelled.", + // "customWriterIdentity": { + // "description": "Optional. A service account provided by the caller that will be used to write the log entries. The format must be serviceAccount:some@email. This field can only be specified if you are routing logs to a destination outside this sink's project. If not specified, a Logging service account will automatically be generated.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The resource in which to create the sink: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-project\" \"organizations/123456789\"", // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+/operations/[^/]+$", + // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" + // }, + // "uniqueWriterIdentity": { + // "description": "Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Cloud Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a service agent (https://cloud.google.com/iam/docs/service-account-types#service-agents) used by the sinks with the same parent. For more information, see writer_identity in LogSink.", + // "location": "query", + // "type": "boolean" // } // }, - // "path": "v2/{+name}:cancel", + // "path": "v2/{+parent}/sinks", // "request": { - // "$ref": "CancelOperationRequest" + // "$ref": "LogSink" // }, // "response": { - // "$ref": "Empty" + // "$ref": "LogSink" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -28319,269 +31890,88 @@ func (c *OrganizationsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOp } -// method id "logging.organizations.locations.operations.get": - -type OrganizationsLocationsOperationsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// Get: Gets the latest state of a long-running operation. Clients can -// use this method to poll the operation result at intervals as -// recommended by the API service. -// -// - name: The name of the operation resource. -func (r *OrganizationsLocationsOperationsService) Get(name string) *OrganizationsLocationsOperationsGetCall { - c := &OrganizationsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *OrganizationsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsOperationsGetCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *OrganizationsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsOperationsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *OrganizationsLocationsOperationsGetCall) Context(ctx context.Context) *OrganizationsLocationsOperationsGetCall { - c.ctx_ = ctx - return c -} - -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *OrganizationsLocationsOperationsGetCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *OrganizationsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "name": c.name, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "logging.organizations.locations.operations.get" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *OrganizationsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - 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": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/operations/{operationsId}", - // "httpMethod": "GET", - // "id": "logging.organizations.locations.operations.get", - // "parameterOrder": [ - // "name" - // ], - // "parameters": { - // "name": { - // "description": "The name of the operation resource.", - // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+/operations/[^/]+$", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v2/{+name}", - // "response": { - // "$ref": "Operation" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" - // ] - // } - -} - -// method id "logging.organizations.locations.operations.list": +// method id "logging.organizations.sinks.delete": -type OrganizationsLocationsOperationsListCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type OrganizationsSinksDeleteCall struct { + s *Service + sinkNameid string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists operations that match the specified filter in the -// request. If the server doesn't support this method, it returns -// UNIMPLEMENTED. +// Delete: Deletes a sink. If the sink has a unique writer_identity, +// then that service account is also deleted. // -// - name: The name of the operation's parent resource. -func (r *OrganizationsLocationsOperationsService) List(name string) *OrganizationsLocationsOperationsListCall { - c := &OrganizationsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - return c -} - -// Filter sets the optional parameter "filter": The standard list -// filter. -func (c *OrganizationsLocationsOperationsListCall) Filter(filter string) *OrganizationsLocationsOperationsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// PageSize sets the optional parameter "pageSize": The standard list -// page size. -func (c *OrganizationsLocationsOperationsListCall) PageSize(pageSize int64) *OrganizationsLocationsOperationsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The standard list -// page token. -func (c *OrganizationsLocationsOperationsListCall) PageToken(pageToken string) *OrganizationsLocationsOperationsListCall { - c.urlParams_.Set("pageToken", pageToken) +// - sinkName: The full resource name of the sink to delete, including +// the parent resource and the sink identifier: +// "projects/[PROJECT_ID]/sinks/[SINK_ID]" +// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" +// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For +// example:"projects/my-project/sinks/my-sink". +func (r *OrganizationsSinksService) Delete(sinkNameid string) *OrganizationsSinksDeleteCall { + c := &OrganizationsSinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.sinkNameid = sinkNameid return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLocationsOperationsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsOperationsListCall { +func (c *OrganizationsSinksDeleteCall) Fields(s ...googleapi.Field) *OrganizationsSinksDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *OrganizationsLocationsOperationsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsOperationsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLocationsOperationsListCall) Context(ctx context.Context) *OrganizationsLocationsOperationsListCall { +func (c *OrganizationsSinksDeleteCall) Context(ctx context.Context) *OrganizationsSinksDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLocationsOperationsListCall) Header() http.Header { +func (c *OrganizationsSinksDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "sinkName": c.sinkNameid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.locations.operations.list" call. -// Exactly one of *ListOperationsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListOperationsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { +// Do executes the "logging.organizations.sinks.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrganizationsSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -28600,7 +31990,7 @@ func (c *OrganizationsLocationsOperationsListCall) Do(opts ...googleapi.CallOpti if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListOperationsResponse{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -28612,159 +32002,128 @@ func (c *OrganizationsLocationsOperationsListCall) Do(opts ...googleapi.CallOpti } return ret, nil // { - // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.", - // "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/operations", - // "httpMethod": "GET", - // "id": "logging.organizations.locations.operations.list", + // "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.", + // "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}", + // "httpMethod": "DELETE", + // "id": "logging.organizations.sinks.delete", // "parameterOrder": [ - // "name" + // "sinkName" // ], // "parameters": { - // "filter": { - // "description": "The standard list filter.", - // "location": "query", - // "type": "string" - // }, - // "name": { - // "description": "The name of the operation's parent resource.", + // "sinkName": { + // "description": "Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", // "location": "path", - // "pattern": "^organizations/[^/]+/locations/[^/]+$", + // "pattern": "^organizations/[^/]+/sinks/[^/]+$", // "required": true, // "type": "string" - // }, - // "pageSize": { - // "description": "The standard list page size.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The standard list page token.", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+name}/operations", - // "response": { - // "$ref": "ListOperationsResponse" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" - // ] - // } - -} - -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *OrganizationsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } + // "path": "v2/{+sinkName}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + } -// method id "logging.organizations.logs.delete": +// method id "logging.organizations.sinks.get": -type OrganizationsLogsDeleteCall struct { - s *Service - logName string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type OrganizationsSinksGetCall struct { + s *Service + sinkName string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes all the log entries in a log for the _Default Log -// Bucket. The log reappears if it receives new entries. Log entries -// written shortly before the delete operation might not be deleted. -// Entries received after the delete operation with a timestamp before -// the operation will be deleted. +// Get: Gets a sink. // -// - logName: The resource name of the log to delete: -// projects/[PROJECT_ID]/logs/[LOG_ID] -// organizations/[ORGANIZATION_ID]/logs/[LOG_ID] -// billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID] -// folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For -// example, "projects/my-project-id/logs/syslog", -// "organizations/123/logs/cloudaudit.googleapis.com%2Factivity".For -// more information about log names, see LogEntry. -func (r *OrganizationsLogsService) Delete(logName string) *OrganizationsLogsDeleteCall { - c := &OrganizationsLogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.logName = logName +// - sinkName: The resource name of the sink: +// "projects/[PROJECT_ID]/sinks/[SINK_ID]" +// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" +// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For +// example:"projects/my-project/sinks/my-sink". +func (r *OrganizationsSinksService) Get(sinkName string) *OrganizationsSinksGetCall { + c := &OrganizationsSinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.sinkName = sinkName return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLogsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLogsDeleteCall { +func (c *OrganizationsSinksGetCall) Fields(s ...googleapi.Field) *OrganizationsSinksGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsSinksGetCall) IfNoneMatch(entityTag string) *OrganizationsSinksGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLogsDeleteCall) Context(ctx context.Context) *OrganizationsLogsDeleteCall { +func (c *OrganizationsSinksGetCall) Context(ctx context.Context) *OrganizationsSinksGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLogsDeleteCall) Header() http.Header { +func (c *OrganizationsSinksGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLogsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSinksGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+logName}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "logName": c.logName, + "sinkName": c.sinkName, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.logs.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// Do executes the "logging.organizations.sinks.get" call. +// Exactly one of *LogSink or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) +// *LogSink.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. -func (c *OrganizationsLogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +func (c *OrganizationsSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -28783,7 +32142,7 @@ func (c *OrganizationsLogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &LogSink{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -28795,37 +32154,39 @@ func (c *OrganizationsLogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, } return ret, nil // { - // "description": "Deletes all the log entries in a log for the _Default Log Bucket. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted.", - // "flatPath": "v2/organizations/{organizationsId}/logs/{logsId}", - // "httpMethod": "DELETE", - // "id": "logging.organizations.logs.delete", + // "description": "Gets a sink.", + // "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}", + // "httpMethod": "GET", + // "id": "logging.organizations.sinks.get", // "parameterOrder": [ - // "logName" + // "sinkName" // ], // "parameters": { - // "logName": { - // "description": "Required. The resource name of the log to delete: projects/[PROJECT_ID]/logs/[LOG_ID] organizations/[ORGANIZATION_ID]/logs/[LOG_ID] billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID] folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/123/logs/cloudaudit.googleapis.com%2Factivity\".For more information about log names, see LogEntry.", + // "sinkName": { + // "description": "Required. The resource name of the sink: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", // "location": "path", - // "pattern": "^organizations/[^/]+/logs/[^/]+$", + // "pattern": "^organizations/[^/]+/sinks/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+logName}", + // "path": "v2/{+sinkName}", // "response": { - // "$ref": "Empty" + // "$ref": "LogSink" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.organizations.logs.list": +// method id "logging.organizations.sinks.list": -type OrganizationsLogsListCall struct { +type OrganizationsSinksListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -28834,14 +32195,13 @@ type OrganizationsLogsListCall struct { header_ http.Header } -// List: Lists the logs in projects, organizations, folders, or billing -// accounts. Only logs that have entries are listed. +// List: Lists sinks. // -// - parent: The resource name to list logs for: projects/[PROJECT_ID] -// organizations/[ORGANIZATION_ID] -// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]. -func (r *OrganizationsLogsService) List(parent string) *OrganizationsLogsListCall { - c := &OrganizationsLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The parent resource whose sinks are to be listed: +// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]". +func (r *OrganizationsSinksService) List(parent string) *OrganizationsSinksListCall { + c := &OrganizationsSinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } @@ -28850,7 +32210,7 @@ func (r *OrganizationsLogsService) List(parent string) *OrganizationsLogsListCal // of results to return from this request. Non-positive values are // ignored. The presence of nextPageToken in the response indicates that // more results might be available. -func (c *OrganizationsLogsListCall) PageSize(pageSize int64) *OrganizationsLogsListCall { +func (c *OrganizationsSinksListCall) PageSize(pageSize int64) *OrganizationsSinksListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } @@ -28860,33 +32220,15 @@ func (c *OrganizationsLogsListCall) PageSize(pageSize int64) *OrganizationsLogsL // method. pageToken must be the value of nextPageToken from the // previous response. The values of other method parameters should be // identical to those in the previous call. -func (c *OrganizationsLogsListCall) PageToken(pageToken string) *OrganizationsLogsListCall { +func (c *OrganizationsSinksListCall) PageToken(pageToken string) *OrganizationsSinksListCall { c.urlParams_.Set("pageToken", pageToken) return c } -// ResourceNames sets the optional parameter "resourceNames": List of -// resource names to list logs for: -// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/view -// s/[VIEW_ID] -// organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKE -// T_ID]/views/[VIEW_ID] -// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[ -// BUCKET_ID]/views/[VIEW_ID] -// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/ -// [VIEW_ID]To support legacy queries, it could also be: -// projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] -// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]The resource -// name in the parent field is added to this list. -func (c *OrganizationsLogsListCall) ResourceNames(resourceNames ...string) *OrganizationsLogsListCall { - c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...)) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsLogsListCall) Fields(s ...googleapi.Field) *OrganizationsLogsListCall { +func (c *OrganizationsSinksListCall) Fields(s ...googleapi.Field) *OrganizationsSinksListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -28896,7 +32238,7 @@ func (c *OrganizationsLogsListCall) Fields(s ...googleapi.Field) *OrganizationsL // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsLogsListCall) IfNoneMatch(entityTag string) *OrganizationsLogsListCall { +func (c *OrganizationsSinksListCall) IfNoneMatch(entityTag string) *OrganizationsSinksListCall { c.ifNoneMatch_ = entityTag return c } @@ -28904,21 +32246,21 @@ func (c *OrganizationsLogsListCall) IfNoneMatch(entityTag string) *Organizations // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsLogsListCall) Context(ctx context.Context) *OrganizationsLogsListCall { +func (c *OrganizationsSinksListCall) Context(ctx context.Context) *OrganizationsSinksListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsLogsListCall) Header() http.Header { +func (c *OrganizationsSinksListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsLogsListCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSinksListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -28931,7 +32273,7 @@ func (c *OrganizationsLogsListCall) doRequest(alt string) (*http.Response, error var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -28944,14 +32286,14 @@ func (c *OrganizationsLogsListCall) doRequest(alt string) (*http.Response, error return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.logs.list" call. -// Exactly one of *ListLogsResponse or error will be non-nil. Any +// Do executes the "logging.organizations.sinks.list" call. +// Exactly one of *ListSinksResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either -// *ListLogsResponse.ServerResponse.Header or (if a response was +// *ListSinksResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *OrganizationsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) { +func (c *OrganizationsSinksListCall) Do(opts ...googleapi.CallOption) (*ListSinksResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -28970,7 +32312,7 @@ func (c *OrganizationsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsR if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListLogsResponse{ + ret := &ListSinksResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -28982,10 +32324,10 @@ func (c *OrganizationsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsR } return ret, nil // { - // "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", - // "flatPath": "v2/organizations/{organizationsId}/logs", + // "description": "Lists sinks.", + // "flatPath": "v2/organizations/{organizationsId}/sinks", // "httpMethod": "GET", - // "id": "logging.organizations.logs.list", + // "id": "logging.organizations.sinks.list", // "parameterOrder": [ // "parent" // ], @@ -29002,22 +32344,16 @@ func (c *OrganizationsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsR // "type": "string" // }, // "parent": { - // "description": "Required. The resource name to list logs for: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", + // "description": "Required. The parent resource whose sinks are to be listed: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ", // "location": "path", // "pattern": "^organizations/[^/]+$", // "required": true, // "type": "string" - // }, - // "resourceNames": { - // "description": "Optional. List of resource names to list logs for: projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]To support legacy queries, it could also be: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]The resource name in the parent field is added to this list.", - // "location": "query", - // "repeated": true, - // "type": "string" // } // }, - // "path": "v2/{+parent}/logs", + // "path": "v2/{+parent}/sinks", // "response": { - // "$ref": "ListLogsResponse" + // "$ref": "ListSinksResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -29032,7 +32368,7 @@ func (c *OrganizationsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsR // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *OrganizationsLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error { +func (c *OrganizationsSinksListCall) Pages(ctx context.Context, f func(*ListSinksResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -29050,29 +32386,32 @@ func (c *OrganizationsLogsListCall) Pages(ctx context.Context, f func(*ListLogsR } } -// method id "logging.organizations.sinks.create": +// method id "logging.organizations.sinks.patch": -type OrganizationsSinksCreateCall struct { +type OrganizationsSinksPatchCall struct { s *Service - parent string + sinkNameid string logsink *LogSink urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Create: Creates a sink that exports specified log entries to a -// destination. The export begins upon ingress, unless the sink's -// writer_identity is not permitted to write to the destination. A sink -// can export log entries only from the resource owning the sink. +// Patch: Updates a sink. This method replaces the following fields in +// the existing sink with values from the new sink: destination, and +// filter.The updated sink might also have a new writer_identity; see +// the unique_writer_identity field. // -// - parent: The resource in which to create the sink: -// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For -// examples:"projects/my-project" "organizations/123456789". -func (r *OrganizationsSinksService) Create(parent string, logsink *LogSink) *OrganizationsSinksCreateCall { - c := &OrganizationsSinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent +// - sinkName: The full resource name of the sink to update, including +// the parent resource and the sink identifier: +// "projects/[PROJECT_ID]/sinks/[SINK_ID]" +// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" +// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For +// example:"projects/my-project/sinks/my-sink". +func (r *OrganizationsSinksService) Patch(sinkNameid string, logsink *LogSink) *OrganizationsSinksPatchCall { + c := &OrganizationsSinksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.sinkNameid = sinkNameid c.logsink = logsink return c } @@ -29083,33 +32422,46 @@ func (r *OrganizationsSinksService) Create(parent string, logsink *LogSink) *Org // serviceAccount:some@email. This field can only be specified if you // are routing logs to a destination outside this sink's project. If not // specified, a Logging service account will automatically be generated. -func (c *OrganizationsSinksCreateCall) CustomWriterIdentity(customWriterIdentity string) *OrganizationsSinksCreateCall { +func (c *OrganizationsSinksPatchCall) CustomWriterIdentity(customWriterIdentity string) *OrganizationsSinksPatchCall { c.urlParams_.Set("customWriterIdentity", customWriterIdentity) return c } // UniqueWriterIdentity sets the optional parameter -// "uniqueWriterIdentity": Determines the kind of IAM identity returned -// as writer_identity in the new sink. If this value is omitted or set -// to false, and if the sink's parent is a project, then the value -// returned as writer_identity is the same group or service account used -// by Cloud Logging before the addition of writer identities to this -// API. The sink's destination must be in the same project as the sink -// itself.If this field is set to true, or if the sink is owned by a -// non-project resource such as an organization, then the value of -// writer_identity will be a service agent +// "uniqueWriterIdentity": See sinks.create for a description of this +// field. When updating a sink, the effect of this field on the value of +// writer_identity in the updated sink depends on both the old and new +// values of this field: If the old and new values of this field are +// both false or both true, then there is no change to the sink's +// writer_identity. If the old value is false and the new value is true, +// then writer_identity is changed to a service agent // (https://cloud.google.com/iam/docs/service-account-types#service-agents) -// used by the sinks with the same parent. For more information, see -// writer_identity in LogSink. -func (c *OrganizationsSinksCreateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *OrganizationsSinksCreateCall { +// owned by Cloud Logging. It is an error if the old value is true and +// the new value is set to false or defaulted to false. +func (c *OrganizationsSinksPatchCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *OrganizationsSinksPatchCall { c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity)) return c } +// UpdateMask sets the optional parameter "updateMask": Field mask that +// specifies the fields in sink that need an update. A sink field will +// be overwritten if, and only if, it is in the update mask. name and +// output only fields cannot be updated.An empty updateMask is +// temporarily treated as using the following mask for backwards +// compatibility purposes:destination,filter,includeChildrenAt some +// point in the future, behavior will be removed and specifying an empty +// updateMask will be an error.For a detailed FieldMask definition, see +// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor +// example: updateMask=filter +func (c *OrganizationsSinksPatchCall) UpdateMask(updateMask string) *OrganizationsSinksPatchCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSinksCreateCall) Fields(s ...googleapi.Field) *OrganizationsSinksCreateCall { +func (c *OrganizationsSinksPatchCall) Fields(s ...googleapi.Field) *OrganizationsSinksPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -29117,21 +32469,21 @@ func (c *OrganizationsSinksCreateCall) Fields(s ...googleapi.Field) *Organizatio // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSinksCreateCall) Context(ctx context.Context) *OrganizationsSinksCreateCall { +func (c *OrganizationsSinksPatchCall) Context(ctx context.Context) *OrganizationsSinksPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSinksCreateCall) Header() http.Header { +func (c *OrganizationsSinksPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSinksCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSinksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -29146,27 +32498,27 @@ func (c *OrganizationsSinksCreateCall) doRequest(alt string) (*http.Response, er reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "sinkName": c.sinkNameid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.sinks.create" call. +// Do executes the "logging.organizations.sinks.patch" call. // Exactly one of *LogSink or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *LogSink.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. -func (c *OrganizationsSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { +func (c *OrganizationsSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -29197,12 +32549,12 @@ func (c *OrganizationsSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSin } return ret, nil // { - // "description": "Creates a sink that exports specified log entries to a destination. The export begins upon ingress, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.", - // "flatPath": "v2/organizations/{organizationsId}/sinks", - // "httpMethod": "POST", - // "id": "logging.organizations.sinks.create", + // "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field.", + // "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}", + // "httpMethod": "PATCH", + // "id": "logging.organizations.sinks.patch", // "parameterOrder": [ - // "parent" + // "sinkName" // ], // "parameters": { // "customWriterIdentity": { @@ -29210,20 +32562,26 @@ func (c *OrganizationsSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSin // "location": "query", // "type": "string" // }, - // "parent": { - // "description": "Required. The resource in which to create the sink: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-project\" \"organizations/123456789\"", + // "sinkName": { + // "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", // "location": "path", - // "pattern": "^organizations/[^/]+$", + // "pattern": "^organizations/[^/]+/sinks/[^/]+$", // "required": true, // "type": "string" // }, // "uniqueWriterIdentity": { - // "description": "Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Cloud Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a service agent (https://cloud.google.com/iam/docs/service-account-types#service-agents) used by the sinks with the same parent. For more information, see writer_identity in LogSink.", + // "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a service agent (https://cloud.google.com/iam/docs/service-account-types#service-agents) owned by Cloud Logging. It is an error if the old value is true and the new value is set to false or defaulted to false.", // "location": "query", // "type": "boolean" + // }, + // "updateMask": { + // "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes:destination,filter,includeChildrenAt some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+parent}/sinks", + // "path": "v2/{+sinkName}", // "request": { // "$ref": "LogSink" // }, @@ -29238,36 +32596,82 @@ func (c *OrganizationsSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSin } -// method id "logging.organizations.sinks.delete": +// method id "logging.organizations.sinks.update": -type OrganizationsSinksDeleteCall struct { +type OrganizationsSinksUpdateCall struct { s *Service sinkNameid string + logsink *LogSink urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Delete: Deletes a sink. If the sink has a unique writer_identity, -// then that service account is also deleted. +// Update: Updates a sink. This method replaces the following fields in +// the existing sink with values from the new sink: destination, and +// filter.The updated sink might also have a new writer_identity; see +// the unique_writer_identity field. // -// - sinkName: The full resource name of the sink to delete, including +// - sinkName: The full resource name of the sink to update, including // the parent resource and the sink identifier: // "projects/[PROJECT_ID]/sinks/[SINK_ID]" // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" // "folders/[FOLDER_ID]/sinks/[SINK_ID]" For // example:"projects/my-project/sinks/my-sink". -func (r *OrganizationsSinksService) Delete(sinkNameid string) *OrganizationsSinksDeleteCall { - c := &OrganizationsSinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *OrganizationsSinksService) Update(sinkNameid string, logsink *LogSink) *OrganizationsSinksUpdateCall { + c := &OrganizationsSinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.sinkNameid = sinkNameid + c.logsink = logsink + return c +} + +// CustomWriterIdentity sets the optional parameter +// "customWriterIdentity": A service account provided by the caller that +// will be used to write the log entries. The format must be +// serviceAccount:some@email. This field can only be specified if you +// are routing logs to a destination outside this sink's project. If not +// specified, a Logging service account will automatically be generated. +func (c *OrganizationsSinksUpdateCall) CustomWriterIdentity(customWriterIdentity string) *OrganizationsSinksUpdateCall { + c.urlParams_.Set("customWriterIdentity", customWriterIdentity) + return c +} + +// UniqueWriterIdentity sets the optional parameter +// "uniqueWriterIdentity": See sinks.create for a description of this +// field. When updating a sink, the effect of this field on the value of +// writer_identity in the updated sink depends on both the old and new +// values of this field: If the old and new values of this field are +// both false or both true, then there is no change to the sink's +// writer_identity. If the old value is false and the new value is true, +// then writer_identity is changed to a service agent +// (https://cloud.google.com/iam/docs/service-account-types#service-agents) +// owned by Cloud Logging. It is an error if the old value is true and +// the new value is set to false or defaulted to false. +func (c *OrganizationsSinksUpdateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *OrganizationsSinksUpdateCall { + c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity)) + return c +} + +// UpdateMask sets the optional parameter "updateMask": Field mask that +// specifies the fields in sink that need an update. A sink field will +// be overwritten if, and only if, it is in the update mask. name and +// output only fields cannot be updated.An empty updateMask is +// temporarily treated as using the following mask for backwards +// compatibility purposes:destination,filter,includeChildrenAt some +// point in the future, behavior will be removed and specifying an empty +// updateMask will be an error.For a detailed FieldMask definition, see +// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor +// example: updateMask=filter +func (c *OrganizationsSinksUpdateCall) UpdateMask(updateMask string) *OrganizationsSinksUpdateCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSinksDeleteCall) Fields(s ...googleapi.Field) *OrganizationsSinksDeleteCall { +func (c *OrganizationsSinksUpdateCall) Fields(s ...googleapi.Field) *OrganizationsSinksUpdateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -29275,21 +32679,21 @@ func (c *OrganizationsSinksDeleteCall) Fields(s ...googleapi.Field) *Organizatio // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSinksDeleteCall) Context(ctx context.Context) *OrganizationsSinksDeleteCall { +func (c *OrganizationsSinksUpdateCall) Context(ctx context.Context) *OrganizationsSinksUpdateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSinksDeleteCall) Header() http.Header { +func (c *OrganizationsSinksUpdateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSinksDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *OrganizationsSinksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -29297,11 +32701,16 @@ func (c *OrganizationsSinksDeleteCall) doRequest(alt string) (*http.Response, er } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("PUT", urls, body) if err != nil { return nil, err } @@ -29312,14 +32721,14 @@ func (c *OrganizationsSinksDeleteCall) doRequest(alt string) (*http.Response, er return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.sinks.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// Do executes the "logging.organizations.sinks.update" call. +// Exactly one of *LogSink or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) +// *LogSink.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. -func (c *OrganizationsSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +func (c *OrganizationsSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -29338,7 +32747,7 @@ func (c *OrganizationsSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &LogSink{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -29350,25 +32759,44 @@ func (c *OrganizationsSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, } return ret, nil // { - // "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.", + // "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field.", // "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}", - // "httpMethod": "DELETE", - // "id": "logging.organizations.sinks.delete", + // "httpMethod": "PUT", + // "id": "logging.organizations.sinks.update", // "parameterOrder": [ // "sinkName" // ], // "parameters": { + // "customWriterIdentity": { + // "description": "Optional. A service account provided by the caller that will be used to write the log entries. The format must be serviceAccount:some@email. This field can only be specified if you are routing logs to a destination outside this sink's project. If not specified, a Logging service account will automatically be generated.", + // "location": "query", + // "type": "string" + // }, // "sinkName": { - // "description": "Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", + // "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", // "location": "path", // "pattern": "^organizations/[^/]+/sinks/[^/]+$", // "required": true, // "type": "string" + // }, + // "uniqueWriterIdentity": { + // "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a service agent (https://cloud.google.com/iam/docs/service-account-types#service-agents) owned by Cloud Logging. It is an error if the old value is true and the new value is set to false or defaulted to false.", + // "location": "query", + // "type": "boolean" + // }, + // "updateMask": { + // "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes:destination,filter,includeChildrenAt some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, // "path": "v2/{+sinkName}", + // "request": { + // "$ref": "LogSink" + // }, // "response": { - // "$ref": "Empty" + // "$ref": "LogSink" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -29378,35 +32806,46 @@ func (c *OrganizationsSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, } -// method id "logging.organizations.sinks.get": +// method id "logging.projects.getCmekSettings": -type OrganizationsSinksGetCall struct { +type ProjectsGetCmekSettingsCall struct { s *Service - sinkName string + name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Gets a sink. +// GetCmekSettings: Gets the Logging CMEK settings for the given +// resource.Note: CMEK for the Log Router can be configured for Google +// Cloud projects, folders, organizations and billing accounts. Once +// configured for an organization, it applies to all projects and +// folders in the Google Cloud organization.See Enabling CMEK for Log +// Router +// (https://cloud.google.com/logging/docs/routing/managed-encryption) +// for more information. // -// - sinkName: The resource name of the sink: -// "projects/[PROJECT_ID]/sinks/[SINK_ID]" -// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" -// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For -// example:"projects/my-project/sinks/my-sink". -func (r *OrganizationsSinksService) Get(sinkName string) *OrganizationsSinksGetCall { - c := &OrganizationsSinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.sinkName = sinkName +// - name: The resource for which to retrieve CMEK settings. +// "projects/[PROJECT_ID]/cmekSettings" +// "organizations/[ORGANIZATION_ID]/cmekSettings" +// "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" +// "folders/[FOLDER_ID]/cmekSettings" For +// example:"organizations/12345/cmekSettings"Note: CMEK for the Log +// Router can be configured for Google Cloud projects, folders, +// organizations and billing accounts. Once configured for an +// organization, it applies to all projects and folders in the Google +// Cloud organization. +func (r *ProjectsService) GetCmekSettings(name string) *ProjectsGetCmekSettingsCall { + c := &ProjectsGetCmekSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSinksGetCall) Fields(s ...googleapi.Field) *OrganizationsSinksGetCall { +func (c *ProjectsGetCmekSettingsCall) Fields(s ...googleapi.Field) *ProjectsGetCmekSettingsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -29416,7 +32855,7 @@ func (c *OrganizationsSinksGetCall) Fields(s ...googleapi.Field) *OrganizationsS // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsSinksGetCall) IfNoneMatch(entityTag string) *OrganizationsSinksGetCall { +func (c *ProjectsGetCmekSettingsCall) IfNoneMatch(entityTag string) *ProjectsGetCmekSettingsCall { c.ifNoneMatch_ = entityTag return c } @@ -29424,21 +32863,21 @@ func (c *OrganizationsSinksGetCall) IfNoneMatch(entityTag string) *Organizations // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSinksGetCall) Context(ctx context.Context) *OrganizationsSinksGetCall { +func (c *ProjectsGetCmekSettingsCall) Context(ctx context.Context) *ProjectsGetCmekSettingsCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSinksGetCall) Header() http.Header { +func (c *ProjectsGetCmekSettingsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSinksGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsGetCmekSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -29451,7 +32890,7 @@ func (c *OrganizationsSinksGetCall) doRequest(alt string) (*http.Response, error var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/cmekSettings") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -29459,19 +32898,19 @@ func (c *OrganizationsSinksGetCall) doRequest(alt string) (*http.Response, error } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "sinkName": c.sinkName, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.sinks.get" call. -// Exactly one of *LogSink or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *LogSink.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *OrganizationsSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { +// Do executes the "logging.projects.getCmekSettings" call. +// Exactly one of *CmekSettings or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CmekSettings.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsGetCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSettings, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -29490,7 +32929,7 @@ func (c *OrganizationsSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogSink{ + ret := &CmekSettings{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -29502,25 +32941,25 @@ func (c *OrganizationsSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, } return ret, nil // { - // "description": "Gets a sink.", - // "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}", + // "description": "Gets the Logging CMEK settings for the given resource.Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", + // "flatPath": "v2/projects/{projectsId}/cmekSettings", // "httpMethod": "GET", - // "id": "logging.organizations.sinks.get", + // "id": "logging.projects.getCmekSettings", // "parameterOrder": [ - // "sinkName" + // "name" // ], // "parameters": { - // "sinkName": { - // "description": "Required. The resource name of the sink: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", + // "name": { + // "description": "Required. The resource for which to retrieve CMEK settings. \"projects/[PROJECT_ID]/cmekSettings\" \"organizations/[ORGANIZATION_ID]/cmekSettings\" \"billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings\" \"folders/[FOLDER_ID]/cmekSettings\" For example:\"organizations/12345/cmekSettings\"Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.", // "location": "path", - // "pattern": "^organizations/[^/]+/sinks/[^/]+$", + // "pattern": "^projects/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+sinkName}", + // "path": "v2/{+name}/cmekSettings", // "response": { - // "$ref": "LogSink" + // "$ref": "CmekSettings" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -29532,51 +32971,47 @@ func (c *OrganizationsSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, } -// method id "logging.organizations.sinks.list": +// method id "logging.projects.getSettings": -type OrganizationsSinksListCall struct { +type ProjectsGetSettingsCall struct { s *Service - parent string + name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists sinks. +// GetSettings: Gets the Log Router settings for the given +// resource.Note: Settings for the Log Router can be get for Google +// Cloud projects, folders, organizations and billing accounts. +// Currently it can only be configured for organizations. Once +// configured for an organization, it applies to all projects and +// folders in the Google Cloud organization.See Enabling CMEK for Log +// Router +// (https://cloud.google.com/logging/docs/routing/managed-encryption) +// for more information. // -// - parent: The parent resource whose sinks are to be listed: -// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]". -func (r *OrganizationsSinksService) List(parent string) *OrganizationsSinksListCall { - c := &OrganizationsSinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return from this request. Non-positive values are -// ignored. The presence of nextPageToken in the response indicates that -// more results might be available. -func (c *OrganizationsSinksListCall) PageSize(pageSize int64) *OrganizationsSinksListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": If present, then -// retrieve the next batch of results from the preceding call to this -// method. pageToken must be the value of nextPageToken from the -// previous response. The values of other method parameters should be -// identical to those in the previous call. -func (c *OrganizationsSinksListCall) PageToken(pageToken string) *OrganizationsSinksListCall { - c.urlParams_.Set("pageToken", pageToken) +// - name: The resource for which to retrieve settings. +// "projects/[PROJECT_ID]/settings" +// "organizations/[ORGANIZATION_ID]/settings" +// "billingAccounts/[BILLING_ACCOUNT_ID]/settings" +// "folders/[FOLDER_ID]/settings" For +// example:"organizations/12345/settings"Note: Settings for the Log +// Router can be get for Google Cloud projects, folders, organizations +// and billing accounts. Currently it can only be configured for +// organizations. Once configured for an organization, it applies to +// all projects and folders in the Google Cloud organization. +func (r *ProjectsService) GetSettings(name string) *ProjectsGetSettingsCall { + c := &ProjectsGetSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSinksListCall) Fields(s ...googleapi.Field) *OrganizationsSinksListCall { +func (c *ProjectsGetSettingsCall) Fields(s ...googleapi.Field) *ProjectsGetSettingsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -29586,7 +33021,7 @@ func (c *OrganizationsSinksListCall) Fields(s ...googleapi.Field) *Organizations // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *OrganizationsSinksListCall) IfNoneMatch(entityTag string) *OrganizationsSinksListCall { +func (c *ProjectsGetSettingsCall) IfNoneMatch(entityTag string) *ProjectsGetSettingsCall { c.ifNoneMatch_ = entityTag return c } @@ -29594,21 +33029,21 @@ func (c *OrganizationsSinksListCall) IfNoneMatch(entityTag string) *Organization // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSinksListCall) Context(ctx context.Context) *OrganizationsSinksListCall { +func (c *ProjectsGetSettingsCall) Context(ctx context.Context) *ProjectsGetSettingsCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSinksListCall) Header() http.Header { +func (c *ProjectsGetSettingsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSinksListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsGetSettingsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -29621,7 +33056,7 @@ func (c *OrganizationsSinksListCall) doRequest(alt string) (*http.Response, erro var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/settings") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -29629,19 +33064,19 @@ func (c *OrganizationsSinksListCall) doRequest(alt string) (*http.Response, erro } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.sinks.list" call. -// Exactly one of *ListSinksResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListSinksResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *OrganizationsSinksListCall) Do(opts ...googleapi.CallOption) (*ListSinksResponse, error) { +// Do executes the "logging.projects.getSettings" call. +// Exactly one of *Settings or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Settings.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsGetSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -29660,7 +33095,7 @@ func (c *OrganizationsSinksListCall) Do(opts ...googleapi.CallOption) (*ListSink if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListSinksResponse{ + ret := &Settings{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -29672,36 +33107,25 @@ func (c *OrganizationsSinksListCall) Do(opts ...googleapi.CallOption) (*ListSink } return ret, nil // { - // "description": "Lists sinks.", - // "flatPath": "v2/organizations/{organizationsId}/sinks", + // "description": "Gets the Log Router settings for the given resource.Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", + // "flatPath": "v2/projects/{projectsId}/settings", // "httpMethod": "GET", - // "id": "logging.organizations.sinks.list", + // "id": "logging.projects.getSettings", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "pageSize": { - // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The parent resource whose sinks are to be listed: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ", + // "name": { + // "description": "Required. The resource for which to retrieve settings. \"projects/[PROJECT_ID]/settings\" \"organizations/[ORGANIZATION_ID]/settings\" \"billingAccounts/[BILLING_ACCOUNT_ID]/settings\" \"folders/[FOLDER_ID]/settings\" For example:\"organizations/12345/settings\"Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.", // "location": "path", - // "pattern": "^organizations/[^/]+$", + // "pattern": "^projects/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/sinks", + // "path": "v2/{+name}/settings", // "response": { - // "$ref": "ListSinksResponse" + // "$ref": "Settings" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -29713,103 +33137,36 @@ func (c *OrganizationsSinksListCall) Do(opts ...googleapi.CallOption) (*ListSink } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *OrganizationsSinksListCall) Pages(ctx context.Context, f func(*ListSinksResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "logging.organizations.sinks.patch": +// method id "logging.projects.exclusions.create": -type OrganizationsSinksPatchCall struct { - s *Service - sinkNameid string - logsink *LogSink - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsExclusionsCreateCall struct { + s *Service + parent string + logexclusion *LogExclusion + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates a sink. This method replaces the following fields in -// the existing sink with values from the new sink: destination, and -// filter.The updated sink might also have a new writer_identity; see -// the unique_writer_identity field. +// Create: Creates a new exclusion in the _Default sink in a specified +// parent resource. Only log entries belonging to that resource can be +// excluded. You can have up to 10 exclusions in a resource. // -// - sinkName: The full resource name of the sink to update, including -// the parent resource and the sink identifier: -// "projects/[PROJECT_ID]/sinks/[SINK_ID]" -// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" -// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For -// example:"projects/my-project/sinks/my-sink". -func (r *OrganizationsSinksService) Patch(sinkNameid string, logsink *LogSink) *OrganizationsSinksPatchCall { - c := &OrganizationsSinksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.sinkNameid = sinkNameid - c.logsink = logsink - return c -} - -// CustomWriterIdentity sets the optional parameter -// "customWriterIdentity": A service account provided by the caller that -// will be used to write the log entries. The format must be -// serviceAccount:some@email. This field can only be specified if you -// are routing logs to a destination outside this sink's project. If not -// specified, a Logging service account will automatically be generated. -func (c *OrganizationsSinksPatchCall) CustomWriterIdentity(customWriterIdentity string) *OrganizationsSinksPatchCall { - c.urlParams_.Set("customWriterIdentity", customWriterIdentity) - return c -} - -// UniqueWriterIdentity sets the optional parameter -// "uniqueWriterIdentity": See sinks.create for a description of this -// field. When updating a sink, the effect of this field on the value of -// writer_identity in the updated sink depends on both the old and new -// values of this field: If the old and new values of this field are -// both false or both true, then there is no change to the sink's -// writer_identity. If the old value is false and the new value is true, -// then writer_identity is changed to a service agent -// (https://cloud.google.com/iam/docs/service-account-types#service-agents) -// owned by Cloud Logging. It is an error if the old value is true and -// the new value is set to false or defaulted to false. -func (c *OrganizationsSinksPatchCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *OrganizationsSinksPatchCall { - c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity)) - return c -} - -// UpdateMask sets the optional parameter "updateMask": Field mask that -// specifies the fields in sink that need an update. A sink field will -// be overwritten if, and only if, it is in the update mask. name and -// output only fields cannot be updated.An empty updateMask is -// temporarily treated as using the following mask for backwards -// compatibility purposes:destination,filter,includeChildrenAt some -// point in the future, behavior will be removed and specifying an empty -// updateMask will be an error.For a detailed FieldMask definition, see -// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor -// example: updateMask=filter -func (c *OrganizationsSinksPatchCall) UpdateMask(updateMask string) *OrganizationsSinksPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// - parent: The parent resource in which to create the exclusion: +// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For +// examples:"projects/my-logging-project" "organizations/123456789". +func (r *ProjectsExclusionsService) Create(parent string, logexclusion *LogExclusion) *ProjectsExclusionsCreateCall { + c := &ProjectsExclusionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.logexclusion = logexclusion return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSinksPatchCall) Fields(s ...googleapi.Field) *OrganizationsSinksPatchCall { +func (c *ProjectsExclusionsCreateCall) Fields(s ...googleapi.Field) *ProjectsExclusionsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -29817,21 +33174,21 @@ func (c *OrganizationsSinksPatchCall) Fields(s ...googleapi.Field) *Organization // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSinksPatchCall) Context(ctx context.Context) *OrganizationsSinksPatchCall { +func (c *ProjectsExclusionsCreateCall) Context(ctx context.Context) *ProjectsExclusionsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSinksPatchCall) Header() http.Header { +func (c *ProjectsExclusionsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSinksPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsExclusionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -29839,34 +33196,34 @@ func (c *OrganizationsSinksPatchCall) doRequest(alt string) (*http.Response, err } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "sinkName": c.sinkNameid, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.sinks.patch" call. -// Exactly one of *LogSink or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *LogSink.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *OrganizationsSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { +// Do executes the "logging.projects.exclusions.create" call. +// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LogExclusion.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -29885,7 +33242,7 @@ func (c *OrganizationsSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogSink{ + ret := &LogExclusion{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -29897,44 +33254,28 @@ func (c *OrganizationsSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink } return ret, nil // { - // "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field.", - // "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}", - // "httpMethod": "PATCH", - // "id": "logging.organizations.sinks.patch", + // "description": "Creates a new exclusion in the _Default sink in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.", + // "flatPath": "v2/projects/{projectsId}/exclusions", + // "httpMethod": "POST", + // "id": "logging.projects.exclusions.create", // "parameterOrder": [ - // "sinkName" + // "parent" // ], // "parameters": { - // "customWriterIdentity": { - // "description": "Optional. A service account provided by the caller that will be used to write the log entries. The format must be serviceAccount:some@email. This field can only be specified if you are routing logs to a destination outside this sink's project. If not specified, a Logging service account will automatically be generated.", - // "location": "query", - // "type": "string" - // }, - // "sinkName": { - // "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", + // "parent": { + // "description": "Required. The parent resource in which to create the exclusion: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-logging-project\" \"organizations/123456789\"", // "location": "path", - // "pattern": "^organizations/[^/]+/sinks/[^/]+$", + // "pattern": "^projects/[^/]+$", // "required": true, // "type": "string" - // }, - // "uniqueWriterIdentity": { - // "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a service agent (https://cloud.google.com/iam/docs/service-account-types#service-agents) owned by Cloud Logging. It is an error if the old value is true and the new value is set to false or defaulted to false.", - // "location": "query", - // "type": "boolean" - // }, - // "updateMask": { - // "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes:destination,filter,includeChildrenAt some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+sinkName}", + // "path": "v2/{+parent}/exclusions", // "request": { - // "$ref": "LogSink" + // "$ref": "LogExclusion" // }, // "response": { - // "$ref": "LogSink" + // "$ref": "LogExclusion" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -29944,82 +33285,34 @@ func (c *OrganizationsSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink } -// method id "logging.organizations.sinks.update": +// method id "logging.projects.exclusions.delete": -type OrganizationsSinksUpdateCall struct { +type ProjectsExclusionsDeleteCall struct { s *Service - sinkNameid string - logsink *LogSink + name string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Update: Updates a sink. This method replaces the following fields in -// the existing sink with values from the new sink: destination, and -// filter.The updated sink might also have a new writer_identity; see -// the unique_writer_identity field. +// Delete: Deletes an exclusion in the _Default sink. // -// - sinkName: The full resource name of the sink to update, including -// the parent resource and the sink identifier: -// "projects/[PROJECT_ID]/sinks/[SINK_ID]" -// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" -// "folders/[FOLDER_ID]/sinks/[SINK_ID]" For -// example:"projects/my-project/sinks/my-sink". -func (r *OrganizationsSinksService) Update(sinkNameid string, logsink *LogSink) *OrganizationsSinksUpdateCall { - c := &OrganizationsSinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.sinkNameid = sinkNameid - c.logsink = logsink - return c -} - -// CustomWriterIdentity sets the optional parameter -// "customWriterIdentity": A service account provided by the caller that -// will be used to write the log entries. The format must be -// serviceAccount:some@email. This field can only be specified if you -// are routing logs to a destination outside this sink's project. If not -// specified, a Logging service account will automatically be generated. -func (c *OrganizationsSinksUpdateCall) CustomWriterIdentity(customWriterIdentity string) *OrganizationsSinksUpdateCall { - c.urlParams_.Set("customWriterIdentity", customWriterIdentity) - return c -} - -// UniqueWriterIdentity sets the optional parameter -// "uniqueWriterIdentity": See sinks.create for a description of this -// field. When updating a sink, the effect of this field on the value of -// writer_identity in the updated sink depends on both the old and new -// values of this field: If the old and new values of this field are -// both false or both true, then there is no change to the sink's -// writer_identity. If the old value is false and the new value is true, -// then writer_identity is changed to a service agent -// (https://cloud.google.com/iam/docs/service-account-types#service-agents) -// owned by Cloud Logging. It is an error if the old value is true and -// the new value is set to false or defaulted to false. -func (c *OrganizationsSinksUpdateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *OrganizationsSinksUpdateCall { - c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity)) - return c -} - -// UpdateMask sets the optional parameter "updateMask": Field mask that -// specifies the fields in sink that need an update. A sink field will -// be overwritten if, and only if, it is in the update mask. name and -// output only fields cannot be updated.An empty updateMask is -// temporarily treated as using the following mask for backwards -// compatibility purposes:destination,filter,includeChildrenAt some -// point in the future, behavior will be removed and specifying an empty -// updateMask will be an error.For a detailed FieldMask definition, see -// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor -// example: updateMask=filter -func (c *OrganizationsSinksUpdateCall) UpdateMask(updateMask string) *OrganizationsSinksUpdateCall { - c.urlParams_.Set("updateMask", updateMask) +// - name: The resource name of an existing exclusion to delete: +// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" +// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" +// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For +// example:"projects/my-project/exclusions/my-exclusion". +func (r *ProjectsExclusionsService) Delete(name string) *ProjectsExclusionsDeleteCall { + c := &ProjectsExclusionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *OrganizationsSinksUpdateCall) Fields(s ...googleapi.Field) *OrganizationsSinksUpdateCall { +func (c *ProjectsExclusionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsExclusionsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -30027,21 +33320,21 @@ func (c *OrganizationsSinksUpdateCall) Fields(s ...googleapi.Field) *Organizatio // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *OrganizationsSinksUpdateCall) Context(ctx context.Context) *OrganizationsSinksUpdateCall { +func (c *ProjectsExclusionsDeleteCall) Context(ctx context.Context) *ProjectsExclusionsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *OrganizationsSinksUpdateCall) Header() http.Header { +func (c *ProjectsExclusionsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *OrganizationsSinksUpdateCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -30049,34 +33342,29 @@ func (c *OrganizationsSinksUpdateCall) doRequest(alt string) (*http.Response, er } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "sinkName": c.sinkNameid, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.organizations.sinks.update" call. -// Exactly one of *LogSink or error will be non-nil. Any non-2xx status +// Do executes the "logging.projects.exclusions.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *LogSink.ServerResponse.Header or (if a response was returned at all) +// *Empty.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. -func (c *OrganizationsSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) { +func (c *ProjectsExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -30095,7 +33383,7 @@ func (c *OrganizationsSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSin if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogSink{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -30107,44 +33395,25 @@ func (c *OrganizationsSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSin } return ret, nil // { - // "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field.", - // "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}", - // "httpMethod": "PUT", - // "id": "logging.organizations.sinks.update", + // "description": "Deletes an exclusion in the _Default sink.", + // "flatPath": "v2/projects/{projectsId}/exclusions/{exclusionsId}", + // "httpMethod": "DELETE", + // "id": "logging.projects.exclusions.delete", // "parameterOrder": [ - // "sinkName" + // "name" // ], // "parameters": { - // "customWriterIdentity": { - // "description": "Optional. A service account provided by the caller that will be used to write the log entries. The format must be serviceAccount:some@email. This field can only be specified if you are routing logs to a destination outside this sink's project. If not specified, a Logging service account will automatically be generated.", - // "location": "query", - // "type": "string" - // }, - // "sinkName": { - // "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" For example:\"projects/my-project/sinks/my-sink\"", + // "name": { + // "description": "Required. The resource name of an existing exclusion to delete: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", // "location": "path", - // "pattern": "^organizations/[^/]+/sinks/[^/]+$", + // "pattern": "^projects/[^/]+/exclusions/[^/]+$", // "required": true, // "type": "string" - // }, - // "uniqueWriterIdentity": { - // "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a service agent (https://cloud.google.com/iam/docs/service-account-types#service-agents) owned by Cloud Logging. It is an error if the old value is true and the new value is set to false or defaulted to false.", - // "location": "query", - // "type": "boolean" - // }, - // "updateMask": { - // "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes:destination,filter,includeChildrenAt some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+sinkName}", - // "request": { - // "$ref": "LogSink" - // }, + // "path": "v2/{+name}", // "response": { - // "$ref": "LogSink" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -30154,9 +33423,9 @@ func (c *OrganizationsSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSin } -// method id "logging.projects.getCmekSettings": +// method id "logging.projects.exclusions.get": -type ProjectsGetCmekSettingsCall struct { +type ProjectsExclusionsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -30165,27 +33434,16 @@ type ProjectsGetCmekSettingsCall struct { header_ http.Header } -// GetCmekSettings: Gets the Logging CMEK settings for the given -// resource.Note: CMEK for the Log Router can be configured for Google -// Cloud projects, folders, organizations and billing accounts. Once -// configured for an organization, it applies to all projects and -// folders in the Google Cloud organization.See Enabling CMEK for Log -// Router -// (https://cloud.google.com/logging/docs/routing/managed-encryption) -// for more information. +// Get: Gets the description of an exclusion in the _Default sink. // -// - name: The resource for which to retrieve CMEK settings. -// "projects/[PROJECT_ID]/cmekSettings" -// "organizations/[ORGANIZATION_ID]/cmekSettings" -// "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" -// "folders/[FOLDER_ID]/cmekSettings" For -// example:"organizations/12345/cmekSettings"Note: CMEK for the Log -// Router can be configured for Google Cloud projects, folders, -// organizations and billing accounts. Once configured for an -// organization, it applies to all projects and folders in the Google -// Cloud organization. -func (r *ProjectsService) GetCmekSettings(name string) *ProjectsGetCmekSettingsCall { - c := &ProjectsGetCmekSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of an existing exclusion: +// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" +// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" +// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For +// example:"projects/my-project/exclusions/my-exclusion". +func (r *ProjectsExclusionsService) Get(name string) *ProjectsExclusionsGetCall { + c := &ProjectsExclusionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -30193,7 +33451,7 @@ func (r *ProjectsService) GetCmekSettings(name string) *ProjectsGetCmekSettingsC // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsGetCmekSettingsCall) Fields(s ...googleapi.Field) *ProjectsGetCmekSettingsCall { +func (c *ProjectsExclusionsGetCall) Fields(s ...googleapi.Field) *ProjectsExclusionsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -30203,7 +33461,7 @@ func (c *ProjectsGetCmekSettingsCall) Fields(s ...googleapi.Field) *ProjectsGetC // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsGetCmekSettingsCall) IfNoneMatch(entityTag string) *ProjectsGetCmekSettingsCall { +func (c *ProjectsExclusionsGetCall) IfNoneMatch(entityTag string) *ProjectsExclusionsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -30211,21 +33469,21 @@ func (c *ProjectsGetCmekSettingsCall) IfNoneMatch(entityTag string) *ProjectsGet // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsGetCmekSettingsCall) Context(ctx context.Context) *ProjectsGetCmekSettingsCall { +func (c *ProjectsExclusionsGetCall) Context(ctx context.Context) *ProjectsExclusionsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsGetCmekSettingsCall) Header() http.Header { +func (c *ProjectsExclusionsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsGetCmekSettingsCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsExclusionsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -30238,7 +33496,7 @@ func (c *ProjectsGetCmekSettingsCall) doRequest(alt string) (*http.Response, err var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/cmekSettings") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -30251,14 +33509,14 @@ func (c *ProjectsGetCmekSettingsCall) doRequest(alt string) (*http.Response, err return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.getCmekSettings" call. -// Exactly one of *CmekSettings or error will be non-nil. Any non-2xx +// Do executes the "logging.projects.exclusions.get" call. +// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either -// *CmekSettings.ServerResponse.Header or (if a response was returned at +// *LogExclusion.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *ProjectsGetCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSettings, error) { +func (c *ProjectsExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -30277,7 +33535,7 @@ func (c *ProjectsGetCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSet if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &CmekSettings{ + ret := &LogExclusion{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -30289,25 +33547,25 @@ func (c *ProjectsGetCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSet } return ret, nil // { - // "description": "Gets the Logging CMEK settings for the given resource.Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", - // "flatPath": "v2/projects/{projectsId}/cmekSettings", + // "description": "Gets the description of an exclusion in the _Default sink.", + // "flatPath": "v2/projects/{projectsId}/exclusions/{exclusionsId}", // "httpMethod": "GET", - // "id": "logging.projects.getCmekSettings", + // "id": "logging.projects.exclusions.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource for which to retrieve CMEK settings. \"projects/[PROJECT_ID]/cmekSettings\" \"organizations/[ORGANIZATION_ID]/cmekSettings\" \"billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings\" \"folders/[FOLDER_ID]/cmekSettings\" For example:\"organizations/12345/cmekSettings\"Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.", + // "description": "Required. The resource name of an existing exclusion: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", // "location": "path", - // "pattern": "^projects/[^/]+$", + // "pattern": "^projects/[^/]+/exclusions/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}/cmekSettings", + // "path": "v2/{+name}", // "response": { - // "$ref": "CmekSettings" + // "$ref": "LogExclusion" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -30319,47 +33577,52 @@ func (c *ProjectsGetCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSet } -// method id "logging.projects.getSettings": +// method id "logging.projects.exclusions.list": -type ProjectsGetSettingsCall struct { +type ProjectsExclusionsListCall struct { s *Service - name string + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// GetSettings: Gets the Log Router settings for the given -// resource.Note: Settings for the Log Router can be get for Google -// Cloud projects, folders, organizations and billing accounts. -// Currently it can only be configured for organizations. Once -// configured for an organization, it applies to all projects and -// folders in the Google Cloud organization.See Enabling CMEK for Log -// Router -// (https://cloud.google.com/logging/docs/routing/managed-encryption) -// for more information. -// -// - name: The resource for which to retrieve settings. -// "projects/[PROJECT_ID]/settings" -// "organizations/[ORGANIZATION_ID]/settings" -// "billingAccounts/[BILLING_ACCOUNT_ID]/settings" -// "folders/[FOLDER_ID]/settings" For -// example:"organizations/12345/settings"Note: Settings for the Log -// Router can be get for Google Cloud projects, folders, organizations -// and billing accounts. Currently it can only be configured for -// organizations. Once configured for an organization, it applies to -// all projects and folders in the Google Cloud organization. -func (r *ProjectsService) GetSettings(name string) *ProjectsGetSettingsCall { - c := &ProjectsGetSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// List: Lists all the exclusions on the _Default sink in a parent +// resource. +// +// - parent: The parent resource whose exclusions are to be listed. +// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]". +func (r *ProjectsExclusionsService) List(parent string) *ProjectsExclusionsListCall { + c := &ProjectsExclusionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request. Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *ProjectsExclusionsListCall) PageSize(pageSize int64) *ProjectsExclusionsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *ProjectsExclusionsListCall) PageToken(pageToken string) *ProjectsExclusionsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsGetSettingsCall) Fields(s ...googleapi.Field) *ProjectsGetSettingsCall { +func (c *ProjectsExclusionsListCall) Fields(s ...googleapi.Field) *ProjectsExclusionsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -30369,7 +33632,7 @@ func (c *ProjectsGetSettingsCall) Fields(s ...googleapi.Field) *ProjectsGetSetti // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsGetSettingsCall) IfNoneMatch(entityTag string) *ProjectsGetSettingsCall { +func (c *ProjectsExclusionsListCall) IfNoneMatch(entityTag string) *ProjectsExclusionsListCall { c.ifNoneMatch_ = entityTag return c } @@ -30377,21 +33640,21 @@ func (c *ProjectsGetSettingsCall) IfNoneMatch(entityTag string) *ProjectsGetSett // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsGetSettingsCall) Context(ctx context.Context) *ProjectsGetSettingsCall { +func (c *ProjectsExclusionsListCall) Context(ctx context.Context) *ProjectsExclusionsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsGetSettingsCall) Header() http.Header { +func (c *ProjectsExclusionsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsGetSettingsCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsExclusionsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -30404,7 +33667,7 @@ func (c *ProjectsGetSettingsCall) doRequest(alt string) (*http.Response, error) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/settings") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -30412,19 +33675,19 @@ func (c *ProjectsGetSettingsCall) doRequest(alt string) (*http.Response, error) } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.getSettings" call. -// Exactly one of *Settings or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Settings.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *ProjectsGetSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, error) { +// Do executes the "logging.projects.exclusions.list" call. +// Exactly one of *ListExclusionsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListExclusionsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -30443,7 +33706,7 @@ func (c *ProjectsGetSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, e if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Settings{ + ret := &ListExclusionsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -30455,25 +33718,36 @@ func (c *ProjectsGetSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, e } return ret, nil // { - // "description": "Gets the Log Router settings for the given resource.Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.", - // "flatPath": "v2/projects/{projectsId}/settings", + // "description": "Lists all the exclusions on the _Default sink in a parent resource.", + // "flatPath": "v2/projects/{projectsId}/exclusions", // "httpMethod": "GET", - // "id": "logging.projects.getSettings", + // "id": "logging.projects.exclusions.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The resource for which to retrieve settings. \"projects/[PROJECT_ID]/settings\" \"organizations/[ORGANIZATION_ID]/settings\" \"billingAccounts/[BILLING_ACCOUNT_ID]/settings\" \"folders/[FOLDER_ID]/settings\" For example:\"organizations/12345/settings\"Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.", + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent resource whose exclusions are to be listed. \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ", // "location": "path", // "pattern": "^projects/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}/settings", + // "path": "v2/{+parent}/exclusions", // "response": { - // "$ref": "Settings" + // "$ref": "ListExclusionsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -30485,36 +33759,70 @@ func (c *ProjectsGetSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, e } -// method id "logging.projects.exclusions.create": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsExclusionsListCall) Pages(ctx context.Context, f func(*ListExclusionsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type ProjectsExclusionsCreateCall struct { +// method id "logging.projects.exclusions.patch": + +type ProjectsExclusionsPatchCall struct { s *Service - parent string + name string logexclusion *LogExclusion urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Create: Creates a new exclusion in the _Default sink in a specified -// parent resource. Only log entries belonging to that resource can be -// excluded. You can have up to 10 exclusions in a resource. +// Patch: Changes one or more properties of an existing exclusion in the +// _Default sink. // -// - parent: The parent resource in which to create the exclusion: -// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For -// examples:"projects/my-logging-project" "organizations/123456789". -func (r *ProjectsExclusionsService) Create(parent string, logexclusion *LogExclusion) *ProjectsExclusionsCreateCall { - c := &ProjectsExclusionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent +// - name: The resource name of the exclusion to update: +// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" +// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" +// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For +// example:"projects/my-project/exclusions/my-exclusion". +func (r *ProjectsExclusionsService) Patch(name string, logexclusion *LogExclusion) *ProjectsExclusionsPatchCall { + c := &ProjectsExclusionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name c.logexclusion = logexclusion return c } +// UpdateMask sets the optional parameter "updateMask": Required. A +// non-empty list of fields to change in the existing exclusion. New +// values for the fields are taken from the corresponding fields in the +// LogExclusion included in this request. Fields not mentioned in +// update_mask are not changed and are ignored in the request.For +// example, to change the filter and description of an exclusion, +// specify an update_mask of "filter,description". +func (c *ProjectsExclusionsPatchCall) UpdateMask(updateMask string) *ProjectsExclusionsPatchCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsExclusionsCreateCall) Fields(s ...googleapi.Field) *ProjectsExclusionsCreateCall { +func (c *ProjectsExclusionsPatchCall) Fields(s ...googleapi.Field) *ProjectsExclusionsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -30522,21 +33830,21 @@ func (c *ProjectsExclusionsCreateCall) Fields(s ...googleapi.Field) *ProjectsExc // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsExclusionsCreateCall) Context(ctx context.Context) *ProjectsExclusionsCreateCall { +func (c *ProjectsExclusionsPatchCall) Context(ctx context.Context) *ProjectsExclusionsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsExclusionsCreateCall) Header() http.Header { +func (c *ProjectsExclusionsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsExclusionsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsExclusionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -30551,27 +33859,27 @@ func (c *ProjectsExclusionsCreateCall) doRequest(alt string) (*http.Response, er reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.exclusions.create" call. +// Do executes the "logging.projects.exclusions.patch" call. // Exactly one of *LogExclusion or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *LogExclusion.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *ProjectsExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { +func (c *ProjectsExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -30602,23 +33910,29 @@ func (c *ProjectsExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExc } return ret, nil // { - // "description": "Creates a new exclusion in the _Default sink in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.", - // "flatPath": "v2/projects/{projectsId}/exclusions", - // "httpMethod": "POST", - // "id": "logging.projects.exclusions.create", + // "description": "Changes one or more properties of an existing exclusion in the _Default sink.", + // "flatPath": "v2/projects/{projectsId}/exclusions/{exclusionsId}", + // "httpMethod": "PATCH", + // "id": "logging.projects.exclusions.patch", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. The parent resource in which to create the exclusion: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-logging-project\" \"organizations/123456789\"", + // "name": { + // "description": "Required. The resource name of the exclusion to update: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", // "location": "path", - // "pattern": "^projects/[^/]+$", + // "pattern": "^projects/[^/]+/exclusions/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "Required. A non-empty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of \"filter,description\".", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+parent}/exclusions", + // "path": "v2/{+name}", // "request": { // "$ref": "LogExclusion" // }, @@ -30633,26 +33947,22 @@ func (c *ProjectsExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExc } -// method id "logging.projects.exclusions.delete": +// method id "logging.projects.locations.get": -type ProjectsExclusionsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes an exclusion in the _Default sink. +// Get: Gets information about a location. // -// - name: The resource name of an existing exclusion to delete: -// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" -// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" -// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For -// example:"projects/my-project/exclusions/my-exclusion". -func (r *ProjectsExclusionsService) Delete(name string) *ProjectsExclusionsDeleteCall { - c := &ProjectsExclusionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Resource name for the location. +func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall { + c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -30660,41 +33970,54 @@ func (r *ProjectsExclusionsService) Delete(name string) *ProjectsExclusionsDelet // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsExclusionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsExclusionsDeleteCall { +func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsExclusionsDeleteCall) Context(ctx context.Context) *ProjectsExclusionsDeleteCall { +func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsExclusionsDeleteCall) Header() http.Header { +func (c *ProjectsLocationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -30705,14 +34028,14 @@ func (c *ProjectsExclusionsDeleteCall) doRequest(alt string) (*http.Response, er return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.exclusions.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// Do executes the "logging.projects.locations.get" call. +// Exactly one of *Location or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *ProjectsExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// *Location.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -30731,7 +34054,7 @@ func (c *ProjectsExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &Location{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -30743,37 +34066,39 @@ func (c *ProjectsExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, } return ret, nil // { - // "description": "Deletes an exclusion in the _Default sink.", - // "flatPath": "v2/projects/{projectsId}/exclusions/{exclusionsId}", - // "httpMethod": "DELETE", - // "id": "logging.projects.exclusions.delete", + // "description": "Gets information about a location.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}", + // "httpMethod": "GET", + // "id": "logging.projects.locations.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource name of an existing exclusion to delete: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", + // "description": "Resource name for the location.", // "location": "path", - // "pattern": "^projects/[^/]+/exclusions/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v2/{+name}", // "response": { - // "$ref": "Empty" + // "$ref": "Location" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.projects.exclusions.get": +// method id "logging.projects.locations.list": -type ProjectsExclusionsGetCall struct { +type ProjectsLocationsListCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -30782,24 +34107,45 @@ type ProjectsExclusionsGetCall struct { header_ http.Header } -// Get: Gets the description of an exclusion in the _Default sink. +// List: Lists information about the supported locations for this +// service. // -// - name: The resource name of an existing exclusion: -// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" -// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" -// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For -// example:"projects/my-project/exclusions/my-exclusion". -func (r *ProjectsExclusionsService) Get(name string) *ProjectsExclusionsGetCall { - c := &ProjectsExclusionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource that owns the locations collection, if +// applicable. +func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall { + c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } +// Filter sets the optional parameter "filter": A filter to narrow down +// results to a preferred subset. The filtering language accepts strings +// like "displayName=tokyo", and is documented in more detail in AIP-160 +// (https://google.aip.dev/160). +func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return. If not set, the service selects a default. +func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token +// received from the next_page_token field in the response. Send that +// page token to receive the subsequent page. +func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsExclusionsGetCall) Fields(s ...googleapi.Field) *ProjectsExclusionsGetCall { +func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -30809,7 +34155,7 @@ func (c *ProjectsExclusionsGetCall) Fields(s ...googleapi.Field) *ProjectsExclus // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsExclusionsGetCall) IfNoneMatch(entityTag string) *ProjectsExclusionsGetCall { +func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall { c.ifNoneMatch_ = entityTag return c } @@ -30817,21 +34163,21 @@ func (c *ProjectsExclusionsGetCall) IfNoneMatch(entityTag string) *ProjectsExclu // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsExclusionsGetCall) Context(ctx context.Context) *ProjectsExclusionsGetCall { +func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsExclusionsGetCall) Header() http.Header { +func (c *ProjectsLocationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsExclusionsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -30844,7 +34190,7 @@ func (c *ProjectsExclusionsGetCall) doRequest(alt string) (*http.Response, error var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -30857,14 +34203,14 @@ func (c *ProjectsExclusionsGetCall) doRequest(alt string) (*http.Response, error return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.exclusions.get" call. -// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *LogExclusion.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *ProjectsExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { +// Do executes the "logging.projects.locations.list" call. +// Exactly one of *ListLocationsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListLocationsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -30883,7 +34229,7 @@ func (c *ProjectsExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclus if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogExclusion{ + ret := &ListLocationsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -30895,25 +34241,41 @@ func (c *ProjectsExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclus } return ret, nil // { - // "description": "Gets the description of an exclusion in the _Default sink.", - // "flatPath": "v2/projects/{projectsId}/exclusions/{exclusionsId}", + // "description": "Lists information about the supported locations for this service.", + // "flatPath": "v2/projects/{projectsId}/locations", // "httpMethod": "GET", - // "id": "logging.projects.exclusions.get", + // "id": "logging.projects.locations.list", // "parameterOrder": [ // "name" // ], // "parameters": { + // "filter": { + // "description": "A filter to narrow down results to a preferred subset. The filtering language accepts strings like \"displayName=tokyo\", and is documented in more detail in AIP-160 (https://google.aip.dev/160).", + // "location": "query", + // "type": "string" + // }, // "name": { - // "description": "Required. The resource name of an existing exclusion: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", + // "description": "The resource that owns the locations collection, if applicable.", // "location": "path", - // "pattern": "^projects/[^/]+/exclusions/[^/]+$", + // "pattern": "^projects/[^/]+$", // "required": true, // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of results to return. If not set, the service selects a default.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token received from the next_page_token field in the response. Send that page token to receive the subsequent page.", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+name}/locations", // "response": { - // "$ref": "LogExclusion" + // "$ref": "ListLocationsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -30925,99 +34287,104 @@ func (c *ProjectsExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclus } -// method id "logging.projects.exclusions.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 *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type ProjectsExclusionsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// method id "logging.projects.locations.buckets.create": + +type ProjectsLocationsBucketsCreateCall struct { + s *Service + parent string + logbucket *LogBucket + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists all the exclusions on the _Default sink in a parent -// resource. +// Create: Creates a log bucket that can be used to store log entries. +// After a bucket has been created, the bucket's location cannot be +// changed. // -// - parent: The parent resource whose exclusions are to be listed. -// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]". -func (r *ProjectsExclusionsService) List(parent string) *ProjectsExclusionsListCall { - c := &ProjectsExclusionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The resource in which to create the log bucket: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For +// example:"projects/my-project/locations/global". +func (r *ProjectsLocationsBucketsService) Create(parent string, logbucket *LogBucket) *ProjectsLocationsBucketsCreateCall { + c := &ProjectsLocationsBucketsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent + c.logbucket = logbucket return c } -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return from this request. Non-positive values are -// ignored. The presence of nextPageToken in the response indicates that -// more results might be available. -func (c *ProjectsExclusionsListCall) PageSize(pageSize int64) *ProjectsExclusionsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": If present, then -// retrieve the next batch of results from the preceding call to this -// method. pageToken must be the value of nextPageToken from the -// previous response. The values of other method parameters should be -// identical to those in the previous call. -func (c *ProjectsExclusionsListCall) PageToken(pageToken string) *ProjectsExclusionsListCall { - c.urlParams_.Set("pageToken", pageToken) +// BucketId sets the optional parameter "bucketId": Required. A +// client-assigned identifier such as "my-bucket". Identifiers are +// limited to 100 characters and can include only letters, digits, +// underscores, hyphens, and periods. +func (c *ProjectsLocationsBucketsCreateCall) BucketId(bucketId string) *ProjectsLocationsBucketsCreateCall { + c.urlParams_.Set("bucketId", bucketId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsExclusionsListCall) Fields(s ...googleapi.Field) *ProjectsExclusionsListCall { +func (c *ProjectsLocationsBucketsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsCreateCall { 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 *ProjectsExclusionsListCall) IfNoneMatch(entityTag string) *ProjectsExclusionsListCall { - 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 *ProjectsExclusionsListCall) Context(ctx context.Context) *ProjectsExclusionsListCall { +func (c *ProjectsLocationsBucketsCreateCall) Context(ctx context.Context) *ProjectsLocationsBucketsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsExclusionsListCall) Header() http.Header { +func (c *ProjectsLocationsBucketsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsExclusionsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -31028,14 +34395,14 @@ func (c *ProjectsExclusionsListCall) doRequest(alt string) (*http.Response, erro return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.exclusions.list" call. -// Exactly one of *ListExclusionsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListExclusionsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsResponse, error) { +// Do executes the "logging.projects.locations.buckets.create" call. +// Exactly one of *LogBucket or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LogBucket.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -31054,7 +34421,7 @@ func (c *ProjectsExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExcl if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListExclusionsResponse{ + ret := &LogBucket{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -31066,111 +34433,80 @@ func (c *ProjectsExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExcl } return ret, nil // { - // "description": "Lists all the exclusions on the _Default sink in a parent resource.", - // "flatPath": "v2/projects/{projectsId}/exclusions", - // "httpMethod": "GET", - // "id": "logging.projects.exclusions.list", + // "description": "Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets", + // "httpMethod": "POST", + // "id": "logging.projects.locations.buckets.create", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "pageSize": { - // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "bucketId": { + // "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. The parent resource whose exclusions are to be listed. \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ", + // "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"", // "location": "path", - // "pattern": "^projects/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/exclusions", + // "path": "v2/{+parent}/buckets", + // "request": { + // "$ref": "LogBucket" + // }, // "response": { - // "$ref": "ListExclusionsResponse" + // "$ref": "LogBucket" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ProjectsExclusionsListCall) Pages(ctx context.Context, f func(*ListExclusionsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "logging.projects.exclusions.patch": +// method id "logging.projects.locations.buckets.createAsync": -type ProjectsExclusionsPatchCall struct { - s *Service - name string - logexclusion *LogExclusion - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsBucketsCreateAsyncCall struct { + s *Service + parent string + logbucket *LogBucket + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Changes one or more properties of an existing exclusion in the -// _Default sink. +// CreateAsync: Creates a log bucket asynchronously that can be used to +// store log entries.After a bucket has been created, the bucket's +// location cannot be changed. // -// - name: The resource name of the exclusion to update: -// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" -// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" -// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For -// example:"projects/my-project/exclusions/my-exclusion". -func (r *ProjectsExclusionsService) Patch(name string, logexclusion *LogExclusion) *ProjectsExclusionsPatchCall { - c := &ProjectsExclusionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.logexclusion = logexclusion +// - parent: The resource in which to create the log bucket: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For +// example:"projects/my-project/locations/global". +func (r *ProjectsLocationsBucketsService) CreateAsync(parent string, logbucket *LogBucket) *ProjectsLocationsBucketsCreateAsyncCall { + c := &ProjectsLocationsBucketsCreateAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.logbucket = logbucket return c } -// UpdateMask sets the optional parameter "updateMask": Required. A -// non-empty list of fields to change in the existing exclusion. New -// values for the fields are taken from the corresponding fields in the -// LogExclusion included in this request. Fields not mentioned in -// update_mask are not changed and are ignored in the request.For -// example, to change the filter and description of an exclusion, -// specify an update_mask of "filter,description". -func (c *ProjectsExclusionsPatchCall) UpdateMask(updateMask string) *ProjectsExclusionsPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// BucketId sets the optional parameter "bucketId": Required. A +// client-assigned identifier such as "my-bucket". Identifiers are +// limited to 100 characters and can include only letters, digits, +// underscores, hyphens, and periods. +func (c *ProjectsLocationsBucketsCreateAsyncCall) BucketId(bucketId string) *ProjectsLocationsBucketsCreateAsyncCall { + c.urlParams_.Set("bucketId", bucketId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsExclusionsPatchCall) Fields(s ...googleapi.Field) *ProjectsExclusionsPatchCall { +func (c *ProjectsLocationsBucketsCreateAsyncCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsCreateAsyncCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -31178,21 +34514,21 @@ func (c *ProjectsExclusionsPatchCall) Fields(s ...googleapi.Field) *ProjectsExcl // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsExclusionsPatchCall) Context(ctx context.Context) *ProjectsExclusionsPatchCall { +func (c *ProjectsLocationsBucketsCreateAsyncCall) Context(ctx context.Context) *ProjectsLocationsBucketsCreateAsyncCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsExclusionsPatchCall) Header() http.Header { +func (c *ProjectsLocationsBucketsCreateAsyncCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsExclusionsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsBucketsCreateAsyncCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -31200,34 +34536,34 @@ func (c *ProjectsExclusionsPatchCall) doRequest(alt string) (*http.Response, err } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets:createAsync") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.exclusions.patch" call. -// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx +// Do executes the "logging.projects.locations.buckets.createAsync" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either -// *LogExclusion.ServerResponse.Header or (if a response was returned at +// *Operation.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *ProjectsExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) { +func (c *ProjectsLocationsBucketsCreateAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -31246,7 +34582,7 @@ func (c *ProjectsExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExcl if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogExclusion{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -31258,34 +34594,33 @@ func (c *ProjectsExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExcl } return ret, nil // { - // "description": "Changes one or more properties of an existing exclusion in the _Default sink.", - // "flatPath": "v2/projects/{projectsId}/exclusions/{exclusionsId}", - // "httpMethod": "PATCH", - // "id": "logging.projects.exclusions.patch", + // "description": "Creates a log bucket asynchronously that can be used to store log entries.After a bucket has been created, the bucket's location cannot be changed.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets:createAsync", + // "httpMethod": "POST", + // "id": "logging.projects.locations.buckets.createAsync", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The resource name of the exclusion to update: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" For example:\"projects/my-project/exclusions/my-exclusion\"", - // "location": "path", - // "pattern": "^projects/[^/]+/exclusions/[^/]+$", - // "required": true, + // "bucketId": { + // "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", + // "location": "query", // "type": "string" // }, - // "updateMask": { - // "description": "Required. A non-empty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of \"filter,description\".", - // "format": "google-fieldmask", - // "location": "query", + // "parent": { + // "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+parent}/buckets:createAsync", // "request": { - // "$ref": "LogExclusion" + // "$ref": "LogBucket" // }, // "response": { - // "$ref": "LogExclusion" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -31295,22 +34630,31 @@ func (c *ProjectsExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExcl } -// method id "logging.projects.locations.get": +// method id "logging.projects.locations.buckets.delete": -type ProjectsLocationsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsBucketsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets information about a location. +// Delete: Deletes a log bucket.Changes the bucket's lifecycle_state to +// the DELETE_REQUESTED state. After 7 days, the bucket will be purged +// and all log entries in the bucket will be permanently deleted. // -// - name: Resource name for the location. -func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall { - c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The full resource name of the bucket to delete. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *ProjectsLocationsBucketsService) Delete(name string) *ProjectsLocationsBucketsDeleteCall { + c := &ProjectsLocationsBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -31318,54 +34662,41 @@ func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall { // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall { +func (c *ProjectsLocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall { +func (c *ProjectsLocationsBucketsDeleteCall) Context(ctx context.Context) *ProjectsLocationsBucketsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsGetCall) Header() http.Header { +func (c *ProjectsLocationsBucketsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -31376,14 +34707,14 @@ func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.locations.get" call. -// Exactly one of *Location or error will be non-nil. Any non-2xx status +// Do executes the "logging.projects.locations.buckets.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *Location.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) { +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -31402,7 +34733,7 @@ func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Location{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -31414,39 +34745,37 @@ func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, } return ret, nil // { - // "description": "Gets information about a location.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}", - // "httpMethod": "GET", - // "id": "logging.projects.locations.get", + // "description": "Deletes a log bucket.Changes the bucket's lifecycle_state to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}", + // "httpMethod": "DELETE", + // "id": "logging.projects.locations.buckets.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Resource name for the location.", + // "description": "Required. The full resource name of the bucket to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v2/{+name}", // "response": { - // "$ref": "Location" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// method id "logging.projects.locations.list": +// method id "logging.projects.locations.buckets.get": -type ProjectsLocationsListCall struct { +type ProjectsLocationsBucketsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -31455,45 +34784,27 @@ type ProjectsLocationsListCall struct { header_ http.Header } -// List: Lists information about the supported locations for this -// service. +// Get: Gets a log bucket. // -// - name: The resource that owns the locations collection, if -// applicable. -func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall { - c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of the bucket: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *ProjectsLocationsBucketsService) Get(name string) *ProjectsLocationsBucketsGetCall { + c := &ProjectsLocationsBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } -// Filter sets the optional parameter "filter": A filter to narrow down -// results to a preferred subset. The filtering language accepts strings -// like "displayName=tokyo", and is documented in more detail in AIP-160 -// (https://google.aip.dev/160). -func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return. If not set, the service selects a default. -func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": A page token -// received from the next_page_token field in the response. Send that -// page token to receive the subsequent page. -func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall { +func (c *ProjectsLocationsBucketsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -31503,7 +34814,7 @@ func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocati // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall { +func (c *ProjectsLocationsBucketsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsBucketsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -31511,21 +34822,21 @@ func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocat // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall { +func (c *ProjectsLocationsBucketsGetCall) Context(ctx context.Context) *ProjectsLocationsBucketsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsListCall) Header() http.Header { +func (c *ProjectsLocationsBucketsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsBucketsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -31538,7 +34849,7 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -31551,14 +34862,14 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.locations.list" call. -// Exactly one of *ListLocationsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListLocationsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) { +// Do executes the "logging.projects.locations.buckets.get" call. +// Exactly one of *LogBucket or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LogBucket.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -31577,7 +34888,7 @@ func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocat if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListLocationsResponse{ + ret := &LogBucket{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -31589,41 +34900,25 @@ func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocat } return ret, nil // { - // "description": "Lists information about the supported locations for this service.", - // "flatPath": "v2/projects/{projectsId}/locations", + // "description": "Gets a log bucket.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}", // "httpMethod": "GET", - // "id": "logging.projects.locations.list", + // "id": "logging.projects.locations.buckets.get", // "parameterOrder": [ // "name" // ], // "parameters": { - // "filter": { - // "description": "A filter to narrow down results to a preferred subset. The filtering language accepts strings like \"displayName=tokyo\", and is documented in more detail in AIP-160 (https://google.aip.dev/160).", - // "location": "query", - // "type": "string" - // }, // "name": { - // "description": "The resource that owns the locations collection, if applicable.", + // "description": "Required. The resource name of the bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", - // "pattern": "^projects/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" - // }, - // "pageSize": { - // "description": "The maximum number of results to return. If not set, the service selects a default.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "A page token received from the next_page_token field in the response. Send that page token to receive the subsequent page.", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+name}/locations", + // "path": "v2/{+name}", // "response": { - // "$ref": "ListLocationsResponse" + // "$ref": "LogBucket" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -31635,104 +34930,102 @@ func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocat } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "logging.projects.locations.buckets.create": +// method id "logging.projects.locations.buckets.list": -type ProjectsLocationsBucketsCreateCall struct { - s *Service - parent string - logbucket *LogBucket - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsBucketsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Create: Creates a log bucket that can be used to store log entries. -// After a bucket has been created, the bucket's location cannot be -// changed. +// List: Lists log buckets. // -// - parent: The resource in which to create the log bucket: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For -// example:"projects/my-project/locations/global". -func (r *ProjectsLocationsBucketsService) Create(parent string, logbucket *LogBucket) *ProjectsLocationsBucketsCreateCall { - c := &ProjectsLocationsBucketsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The parent resource whose buckets are to be listed: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" Note: The locations +// portion of the resource must be specified, but supplying the +// character - in place of LOCATION_ID will return all buckets. +func (r *ProjectsLocationsBucketsService) List(parent string) *ProjectsLocationsBucketsListCall { + c := &ProjectsLocationsBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.logbucket = logbucket return c } -// BucketId sets the optional parameter "bucketId": Required. A -// client-assigned identifier such as "my-bucket". Identifiers are -// limited to 100 characters and can include only letters, digits, -// underscores, hyphens, and periods. -func (c *ProjectsLocationsBucketsCreateCall) BucketId(bucketId string) *ProjectsLocationsBucketsCreateCall { - c.urlParams_.Set("bucketId", bucketId) +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request. Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *ProjectsLocationsBucketsListCall) PageSize(pageSize int64) *ProjectsLocationsBucketsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *ProjectsLocationsBucketsListCall) PageToken(pageToken string) *ProjectsLocationsBucketsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsBucketsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsCreateCall { +func (c *ProjectsLocationsBucketsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsBucketsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsBucketsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsBucketsCreateCall) Context(ctx context.Context) *ProjectsLocationsBucketsCreateCall { +func (c *ProjectsLocationsBucketsListCall) Context(ctx context.Context) *ProjectsLocationsBucketsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsBucketsCreateCall) Header() http.Header { +func (c *ProjectsLocationsBucketsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsBucketsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -31743,14 +35036,14 @@ func (c *ProjectsLocationsBucketsCreateCall) doRequest(alt string) (*http.Respon return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.locations.buckets.create" call. -// Exactly one of *LogBucket or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *LogBucket.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *ProjectsLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { +// Do executes the "logging.projects.locations.buckets.list" call. +// Exactly one of *ListBucketsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListBucketsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucketsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -31769,7 +35062,7 @@ func (c *ProjectsLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogBucket{ + ret := &ListBucketsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -31781,21 +35074,27 @@ func (c *ProjectsLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (* } return ret, nil // { - // "description": "Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed.", + // "description": "Lists log buckets.", // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets", - // "httpMethod": "POST", - // "id": "logging.projects.locations.buckets.create", + // "httpMethod": "GET", + // "id": "logging.projects.locations.buckets.list", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "bucketId": { - // "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"", + // "description": "Required. The parent resource whose buckets are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+$", // "required": true, @@ -31803,58 +35102,87 @@ func (c *ProjectsLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (* // } // }, // "path": "v2/{+parent}/buckets", - // "request": { - // "$ref": "LogBucket" - // }, // "response": { - // "$ref": "LogBucket" + // "$ref": "ListBucketsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.projects.locations.buckets.createAsync": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsBucketsListCall) Pages(ctx context.Context, f func(*ListBucketsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type ProjectsLocationsBucketsCreateAsyncCall struct { +// method id "logging.projects.locations.buckets.patch": + +type ProjectsLocationsBucketsPatchCall struct { s *Service - parent string + name string logbucket *LogBucket urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// CreateAsync: Creates a log bucket asynchronously that can be used to -// store log entries.After a bucket has been created, the bucket's -// location cannot be changed. +// Patch: Updates a log bucket.If the bucket has a lifecycle_state of +// DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a +// bucket has been created, the bucket's location cannot be changed. // -// - parent: The resource in which to create the log bucket: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For -// example:"projects/my-project/locations/global". -func (r *ProjectsLocationsBucketsService) CreateAsync(parent string, logbucket *LogBucket) *ProjectsLocationsBucketsCreateAsyncCall { - c := &ProjectsLocationsBucketsCreateAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent +// - name: The full resource name of the bucket to update. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *ProjectsLocationsBucketsService) Patch(name string, logbucket *LogBucket) *ProjectsLocationsBucketsPatchCall { + c := &ProjectsLocationsBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name c.logbucket = logbucket return c } -// BucketId sets the optional parameter "bucketId": Required. A -// client-assigned identifier such as "my-bucket". Identifiers are -// limited to 100 characters and can include only letters, digits, -// underscores, hyphens, and periods. -func (c *ProjectsLocationsBucketsCreateAsyncCall) BucketId(bucketId string) *ProjectsLocationsBucketsCreateAsyncCall { - c.urlParams_.Set("bucketId", bucketId) +// UpdateMask sets the optional parameter "updateMask": Required. Field +// mask that specifies the fields in bucket that need an update. A +// bucket field will be overwritten if, and only if, it is in the update +// mask. name and output only fields cannot be updated.For a detailed +// FieldMask definition, see: +// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor +// example: updateMask=retention_days +func (c *ProjectsLocationsBucketsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsBucketsPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsBucketsCreateAsyncCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsCreateAsyncCall { +func (c *ProjectsLocationsBucketsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -31862,21 +35190,21 @@ func (c *ProjectsLocationsBucketsCreateAsyncCall) Fields(s ...googleapi.Field) * // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsBucketsCreateAsyncCall) Context(ctx context.Context) *ProjectsLocationsBucketsCreateAsyncCall { +func (c *ProjectsLocationsBucketsPatchCall) Context(ctx context.Context) *ProjectsLocationsBucketsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsBucketsCreateAsyncCall) Header() http.Header { +func (c *ProjectsLocationsBucketsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsBucketsCreateAsyncCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -31891,27 +35219,27 @@ func (c *ProjectsLocationsBucketsCreateAsyncCall) doRequest(alt string) (*http.R reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets:createAsync") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.locations.buckets.createAsync" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx +// Do executes the "logging.projects.locations.buckets.patch" call. +// Exactly one of *LogBucket or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at +// *LogBucket.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *ProjectsLocationsBucketsCreateAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *ProjectsLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -31930,7 +35258,7 @@ func (c *ProjectsLocationsBucketsCreateAsyncCall) Do(opts ...googleapi.CallOptio if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &LogBucket{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -31942,33 +35270,34 @@ func (c *ProjectsLocationsBucketsCreateAsyncCall) Do(opts ...googleapi.CallOptio } return ret, nil // { - // "description": "Creates a log bucket asynchronously that can be used to store log entries.After a bucket has been created, the bucket's location cannot be changed.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets:createAsync", - // "httpMethod": "POST", - // "id": "logging.projects.locations.buckets.createAsync", + // "description": "Updates a log bucket.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}", + // "httpMethod": "PATCH", + // "id": "logging.projects.locations.buckets.patch", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "bucketId": { - // "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"", + // "name": { + // "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=retention_days", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+parent}/buckets:createAsync", + // "path": "v2/{+name}", // "request": { // "$ref": "LogBucket" // }, // "response": { - // "$ref": "Operation" + // "$ref": "LogBucket" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -31978,21 +35307,21 @@ func (c *ProjectsLocationsBucketsCreateAsyncCall) Do(opts ...googleapi.CallOptio } -// method id "logging.projects.locations.buckets.delete": +// method id "logging.projects.locations.buckets.undelete": -type ProjectsLocationsBucketsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsBucketsUndeleteCall struct { + s *Service + name string + undeletebucketrequest *UndeleteBucketRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a log bucket.Changes the bucket's lifecycle_state to -// the DELETE_REQUESTED state. After 7 days, the bucket will be purged -// and all log entries in the bucket will be permanently deleted. +// Undelete: Undeletes a log bucket. A bucket that has been deleted can +// be undeleted within the grace period of 7 days. // -// - name: The full resource name of the bucket to delete. +// - name: The full resource name of the bucket to undelete. // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU // CKET_ID]" @@ -32001,16 +35330,17 @@ type ProjectsLocationsBucketsDeleteCall struct { // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" // For // example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *ProjectsLocationsBucketsService) Delete(name string) *ProjectsLocationsBucketsDeleteCall { - c := &ProjectsLocationsBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsLocationsBucketsService) Undelete(name string, undeletebucketrequest *UndeleteBucketRequest) *ProjectsLocationsBucketsUndeleteCall { + c := &ProjectsLocationsBucketsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.undeletebucketrequest = undeletebucketrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsDeleteCall { +func (c *ProjectsLocationsBucketsUndeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsUndeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -32018,21 +35348,21 @@ func (c *ProjectsLocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *Proje // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsBucketsDeleteCall) Context(ctx context.Context) *ProjectsLocationsBucketsDeleteCall { +func (c *ProjectsLocationsBucketsUndeleteCall) Context(ctx context.Context) *ProjectsLocationsBucketsUndeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsBucketsDeleteCall) Header() http.Header { +func (c *ProjectsLocationsBucketsUndeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -32040,11 +35370,16 @@ func (c *ProjectsLocationsBucketsDeleteCall) doRequest(alt string) (*http.Respon } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:undelete") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -32055,14 +35390,14 @@ func (c *ProjectsLocationsBucketsDeleteCall) doRequest(alt string) (*http.Respon return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.locations.buckets.delete" call. +// Do executes the "logging.projects.locations.buckets.undelete" call. // Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *Empty.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. -func (c *ProjectsLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +func (c *ProjectsLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -32093,23 +35428,26 @@ func (c *ProjectsLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (* } return ret, nil // { - // "description": "Deletes a log bucket.Changes the bucket's lifecycle_state to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}", - // "httpMethod": "DELETE", - // "id": "logging.projects.locations.buckets.delete", + // "description": "Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period of 7 days.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}:undelete", + // "httpMethod": "POST", + // "id": "logging.projects.locations.buckets.undelete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The full resource name of the bucket to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "description": "Required. The full resource name of the bucket to undelete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+name}:undelete", + // "request": { + // "$ref": "UndeleteBucketRequest" + // }, // "response": { // "$ref": "Empty" // }, @@ -32121,20 +35459,23 @@ func (c *ProjectsLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (* } -// method id "logging.projects.locations.buckets.get": +// method id "logging.projects.locations.buckets.updateAsync": -type ProjectsLocationsBucketsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsBucketsUpdateAsyncCall struct { + s *Service + name string + logbucket *LogBucket + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a log bucket. +// UpdateAsync: Updates a log bucket asynchronously.If the bucket has a +// lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be +// returned.After a bucket has been created, the bucket's location +// cannot be changed. // -// - name: The resource name of the bucket: +// - name: The full resource name of the bucket to update. // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU // CKET_ID]" @@ -32143,63 +35484,68 @@ type ProjectsLocationsBucketsGetCall struct { // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" // For // example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *ProjectsLocationsBucketsService) Get(name string) *ProjectsLocationsBucketsGetCall { - c := &ProjectsLocationsBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsLocationsBucketsService) UpdateAsync(name string, logbucket *LogBucket) *ProjectsLocationsBucketsUpdateAsyncCall { + c := &ProjectsLocationsBucketsUpdateAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.logbucket = logbucket + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. Field +// mask that specifies the fields in bucket that need an update. A +// bucket field will be overwritten if, and only if, it is in the update +// mask. name and output only fields cannot be updated.For a detailed +// FieldMask definition, see: +// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor +// example: updateMask=retention_days +func (c *ProjectsLocationsBucketsUpdateAsyncCall) UpdateMask(updateMask string) *ProjectsLocationsBucketsUpdateAsyncCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsBucketsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsGetCall { +func (c *ProjectsLocationsBucketsUpdateAsyncCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsUpdateAsyncCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsBucketsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsBucketsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsBucketsGetCall) Context(ctx context.Context) *ProjectsLocationsBucketsGetCall { +func (c *ProjectsLocationsBucketsUpdateAsyncCall) Context(ctx context.Context) *ProjectsLocationsBucketsUpdateAsyncCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsBucketsGetCall) Header() http.Header { +func (c *ProjectsLocationsBucketsUpdateAsyncCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsBucketsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsBucketsUpdateAsyncCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:updateAsync") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -32210,14 +35556,14 @@ func (c *ProjectsLocationsBucketsGetCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.locations.buckets.get" call. -// Exactly one of *LogBucket or error will be non-nil. Any non-2xx +// Do executes the "logging.projects.locations.buckets.updateAsync" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either -// *LogBucket.ServerResponse.Header or (if a response was returned at +// *Operation.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *ProjectsLocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { +func (c *ProjectsLocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -32236,7 +35582,7 @@ func (c *ProjectsLocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*Log if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogBucket{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -32248,132 +35594,124 @@ func (c *ProjectsLocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*Log } return ret, nil // { - // "description": "Gets a log bucket.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}", - // "httpMethod": "GET", - // "id": "logging.projects.locations.buckets.get", + // "description": "Updates a log bucket asynchronously.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}:updateAsync", + // "httpMethod": "POST", + // "id": "logging.projects.locations.buckets.updateAsync", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource name of the bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=retention_days", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+name}", - // "response": { + // "path": "v2/{+name}:updateAsync", + // "request": { // "$ref": "LogBucket" // }, + // "response": { + // "$ref": "Operation" + // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// method id "logging.projects.locations.buckets.list": +// method id "logging.projects.locations.buckets.links.create": -type ProjectsLocationsBucketsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsBucketsLinksCreateCall struct { + s *Service + parent string + link *Link + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists log buckets. +// Create: Asynchronously creates a linked dataset in BigQuery which +// makes it possible to use BigQuery to read the logs stored in the log +// bucket. A log bucket may currently only contain one link. // -// - parent: The parent resource whose buckets are to be listed: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" Note: The locations -// portion of the resource must be specified, but supplying the -// character - in place of LOCATION_ID will return all buckets. -func (r *ProjectsLocationsBucketsService) List(parent string) *ProjectsLocationsBucketsListCall { - c := &ProjectsLocationsBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The full resource name of the bucket to create a link for. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU +// CKET_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket +// s/[BUCKET_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]". +func (r *ProjectsLocationsBucketsLinksService) Create(parent string, link *Link) *ProjectsLocationsBucketsLinksCreateCall { + c := &ProjectsLocationsBucketsLinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent + c.link = link return c } -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return from this request. Non-positive values are -// ignored. The presence of nextPageToken in the response indicates that -// more results might be available. -func (c *ProjectsLocationsBucketsListCall) PageSize(pageSize int64) *ProjectsLocationsBucketsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": If present, then -// retrieve the next batch of results from the preceding call to this -// method. pageToken must be the value of nextPageToken from the -// previous response. The values of other method parameters should be -// identical to those in the previous call. -func (c *ProjectsLocationsBucketsListCall) PageToken(pageToken string) *ProjectsLocationsBucketsListCall { - c.urlParams_.Set("pageToken", pageToken) +// LinkId sets the optional parameter "linkId": Required. The ID to use +// for the link. The link_id can have up to 100 characters. A valid +// link_id must only have alphanumeric characters and underscores within +// it. +func (c *ProjectsLocationsBucketsLinksCreateCall) LinkId(linkId string) *ProjectsLocationsBucketsLinksCreateCall { + c.urlParams_.Set("linkId", linkId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsBucketsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsListCall { +func (c *ProjectsLocationsBucketsLinksCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsLinksCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsBucketsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsBucketsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsBucketsListCall) Context(ctx context.Context) *ProjectsLocationsBucketsListCall { +func (c *ProjectsLocationsBucketsLinksCreateCall) Context(ctx context.Context) *ProjectsLocationsBucketsLinksCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsBucketsListCall) Header() http.Header { +func (c *ProjectsLocationsBucketsLinksCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsBucketsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsBucketsLinksCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.link) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/links") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -32384,14 +35722,14 @@ func (c *ProjectsLocationsBucketsListCall) doRequest(alt string) (*http.Response return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.locations.buckets.list" call. -// Exactly one of *ListBucketsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListBucketsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucketsResponse, error) { +// Do executes the "logging.projects.locations.buckets.links.create" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsBucketsLinksCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -32410,7 +35748,7 @@ func (c *ProjectsLocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*Li if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListBucketsResponse{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -32422,115 +35760,74 @@ func (c *ProjectsLocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*Li } return ret, nil // { - // "description": "Lists log buckets.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets", - // "httpMethod": "GET", - // "id": "logging.projects.locations.buckets.list", + // "description": "Asynchronously creates a linked dataset in BigQuery which makes it possible to use BigQuery to read the logs stored in the log bucket. A log bucket may currently only contain one link.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/links", + // "httpMethod": "POST", + // "id": "logging.projects.locations.buckets.links.create", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "pageSize": { - // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "linkId": { + // "description": "Required. The ID to use for the link. The link_id can have up to 100 characters. A valid link_id must only have alphanumeric characters and underscores within it.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. The parent resource whose buckets are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets.", + // "description": "Required. The full resource name of the bucket to create a link for. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/buckets", + // "path": "v2/{+parent}/links", + // "request": { + // "$ref": "Link" + // }, // "response": { - // "$ref": "ListBucketsResponse" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsBucketsListCall) Pages(ctx context.Context, f func(*ListBucketsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "logging.projects.locations.buckets.patch": +// method id "logging.projects.locations.buckets.links.delete": -type ProjectsLocationsBucketsPatchCall struct { +type ProjectsLocationsBucketsLinksDeleteCall struct { s *Service name string - logbucket *LogBucket urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Patch: Updates a log bucket.If the bucket has a lifecycle_state of -// DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a -// bucket has been created, the bucket's location cannot be changed. +// Delete: Deletes a link. This will also delete the corresponding +// BigQuery linked dataset. // -// - name: The full resource name of the bucket to update. -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// - name: The full resource name of the link to delete. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/l +// inks/[LINK_ID]" // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" +// CKET_ID]/links/[LINK_ID]" // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *ProjectsLocationsBucketsService) Patch(name string, logbucket *LogBucket) *ProjectsLocationsBucketsPatchCall { - c := &ProjectsLocationsBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// s/[BUCKET_ID]/links/[LINK_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/lin +// ks/[LINK_ID]". +func (r *ProjectsLocationsBucketsLinksService) Delete(name string) *ProjectsLocationsBucketsLinksDeleteCall { + c := &ProjectsLocationsBucketsLinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.logbucket = logbucket - return c -} - -// UpdateMask sets the optional parameter "updateMask": Required. Field -// mask that specifies the fields in bucket that need an update. A -// bucket field will be overwritten if, and only if, it is in the update -// mask. name and output only fields cannot be updated.For a detailed -// FieldMask definition, see: -// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor -// example: updateMask=retention_days -func (c *ProjectsLocationsBucketsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsBucketsPatchCall { - c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsBucketsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsPatchCall { +func (c *ProjectsLocationsBucketsLinksDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsLinksDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -32538,21 +35835,21 @@ func (c *ProjectsLocationsBucketsPatchCall) Fields(s ...googleapi.Field) *Projec // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsBucketsPatchCall) Context(ctx context.Context) *ProjectsLocationsBucketsPatchCall { +func (c *ProjectsLocationsBucketsLinksDeleteCall) Context(ctx context.Context) *ProjectsLocationsBucketsLinksDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsBucketsPatchCall) Header() http.Header { +func (c *ProjectsLocationsBucketsLinksDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsBucketsLinksDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -32560,16 +35857,11 @@ func (c *ProjectsLocationsBucketsPatchCall) doRequest(alt string) (*http.Respons } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -32580,14 +35872,14 @@ func (c *ProjectsLocationsBucketsPatchCall) doRequest(alt string) (*http.Respons return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.locations.buckets.patch" call. -// Exactly one of *LogBucket or error will be non-nil. Any non-2xx +// Do executes the "logging.projects.locations.buckets.links.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either -// *LogBucket.ServerResponse.Header or (if a response was returned at +// *Operation.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *ProjectsLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) { +func (c *ProjectsLocationsBucketsLinksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -32606,7 +35898,7 @@ func (c *ProjectsLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*L if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogBucket{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -32618,34 +35910,25 @@ func (c *ProjectsLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*L } return ret, nil // { - // "description": "Updates a log bucket.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}", - // "httpMethod": "PATCH", - // "id": "logging.projects.locations.buckets.patch", + // "description": "Deletes a link. This will also delete the corresponding BigQuery linked dataset.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/links/{linksId}", + // "httpMethod": "DELETE", + // "id": "logging.projects.locations.buckets.links.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "description": "Required. The full resource name of the link to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" ", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+/links/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=retention_days", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, // "path": "v2/{+name}", - // "request": { - // "$ref": "LogBucket" - // }, // "response": { - // "$ref": "LogBucket" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -32655,79 +35938,85 @@ func (c *ProjectsLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*L } -// method id "logging.projects.locations.buckets.undelete": +// method id "logging.projects.locations.buckets.links.get": -type ProjectsLocationsBucketsUndeleteCall struct { - s *Service - name string - undeletebucketrequest *UndeleteBucketRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsBucketsLinksGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Undelete: Undeletes a log bucket. A bucket that has been deleted can -// be undeleted within the grace period of 7 days. +// Get: Gets a link. // -// - name: The full resource name of the bucket to undelete. -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" +// - name: The resource name of the link: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/l +// inks/[LINK_ID]" // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" +// CKET_ID]/links/[LINK_ID]" // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *ProjectsLocationsBucketsService) Undelete(name string, undeletebucketrequest *UndeleteBucketRequest) *ProjectsLocationsBucketsUndeleteCall { - c := &ProjectsLocationsBucketsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// s/[BUCKET_ID]/links/[LINK_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/lin +// ks/[LINK_ID]". +func (r *ProjectsLocationsBucketsLinksService) Get(name string) *ProjectsLocationsBucketsLinksGetCall { + c := &ProjectsLocationsBucketsLinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.undeletebucketrequest = undeletebucketrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsBucketsUndeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsUndeleteCall { +func (c *ProjectsLocationsBucketsLinksGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsLinksGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsBucketsLinksGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsBucketsLinksGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsBucketsUndeleteCall) Context(ctx context.Context) *ProjectsLocationsBucketsUndeleteCall { +func (c *ProjectsLocationsBucketsLinksGetCall) Context(ctx context.Context) *ProjectsLocationsBucketsLinksGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsBucketsUndeleteCall) Header() http.Header { +func (c *ProjectsLocationsBucketsLinksGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsBucketsLinksGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:undelete") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -32738,14 +36027,14 @@ func (c *ProjectsLocationsBucketsUndeleteCall) doRequest(alt string) (*http.Resp return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.locations.buckets.undelete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// Do executes the "logging.projects.locations.buckets.links.get" call. +// Exactly one of *Link or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *ProjectsLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// *Link.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsBucketsLinksGetCall) Do(opts ...googleapi.CallOption) (*Link, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -32764,7 +36053,7 @@ func (c *ProjectsLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &Link{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -32776,142 +36065,147 @@ func (c *ProjectsLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period of 7 days.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}:undelete", - // "httpMethod": "POST", - // "id": "logging.projects.locations.buckets.undelete", + // "description": "Gets a link.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/links/{linksId}", + // "httpMethod": "GET", + // "id": "logging.projects.locations.buckets.links.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The full resource name of the bucket to undelete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "description": "Required. The resource name of the link: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" ", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+/links/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}:undelete", - // "request": { - // "$ref": "UndeleteBucketRequest" - // }, + // "path": "v2/{+name}", // "response": { - // "$ref": "Empty" + // "$ref": "Link" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.projects.locations.buckets.updateAsync": +// method id "logging.projects.locations.buckets.links.list": -type ProjectsLocationsBucketsUpdateAsyncCall struct { - s *Service - name string - logbucket *LogBucket - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsBucketsLinksListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// UpdateAsync: Updates a log bucket asynchronously.If the bucket has a -// lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be -// returned.After a bucket has been created, the bucket's location -// cannot be changed. +// List: Lists links. // -// - name: The full resource name of the bucket to update. +// - parent: The parent resource whose links are to be listed: // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU // CKET_ID]" // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket // s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *ProjectsLocationsBucketsService) UpdateAsync(name string, logbucket *LogBucket) *ProjectsLocationsBucketsUpdateAsyncCall { - c := &ProjectsLocationsBucketsUpdateAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.logbucket = logbucket +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]". +func (r *ProjectsLocationsBucketsLinksService) List(parent string) *ProjectsLocationsBucketsLinksListCall { + c := &ProjectsLocationsBucketsLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent return c } -// UpdateMask sets the optional parameter "updateMask": Required. Field -// mask that specifies the fields in bucket that need an update. A -// bucket field will be overwritten if, and only if, it is in the update -// mask. name and output only fields cannot be updated.For a detailed -// FieldMask definition, see: -// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor -// example: updateMask=retention_days -func (c *ProjectsLocationsBucketsUpdateAsyncCall) UpdateMask(updateMask string) *ProjectsLocationsBucketsUpdateAsyncCall { - c.urlParams_.Set("updateMask", updateMask) +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request. +func (c *ProjectsLocationsBucketsLinksListCall) PageSize(pageSize int64) *ProjectsLocationsBucketsLinksListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. +func (c *ProjectsLocationsBucketsLinksListCall) PageToken(pageToken string) *ProjectsLocationsBucketsLinksListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsBucketsUpdateAsyncCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsUpdateAsyncCall { +func (c *ProjectsLocationsBucketsLinksListCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsLinksListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsBucketsLinksListCall) IfNoneMatch(entityTag string) *ProjectsLocationsBucketsLinksListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsBucketsUpdateAsyncCall) Context(ctx context.Context) *ProjectsLocationsBucketsUpdateAsyncCall { +func (c *ProjectsLocationsBucketsLinksListCall) Context(ctx context.Context) *ProjectsLocationsBucketsLinksListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsBucketsUpdateAsyncCall) Header() http.Header { +func (c *ProjectsLocationsBucketsLinksListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsBucketsUpdateAsyncCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsBucketsLinksListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:updateAsync") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/links") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.locations.buckets.updateAsync" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *ProjectsLocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// Do executes the "logging.projects.locations.buckets.links.list" call. +// Exactly one of *ListLinksResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListLinksResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsBucketsLinksListCall) Do(opts ...googleapi.CallOption) (*ListLinksResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -32930,7 +36224,7 @@ func (c *ProjectsLocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.CallOptio if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &ListLinksResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -32942,85 +36236,106 @@ func (c *ProjectsLocationsBucketsUpdateAsyncCall) Do(opts ...googleapi.CallOptio } return ret, nil // { - // "description": "Updates a log bucket asynchronously.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}:updateAsync", - // "httpMethod": "POST", - // "id": "logging.projects.locations.buckets.updateAsync", + // "description": "Lists links.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/links", + // "httpMethod": "GET", + // "id": "logging.projects.locations.buckets.links.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent resource whose links are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=retention_days", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+name}:updateAsync", - // "request": { - // "$ref": "LogBucket" - // }, + // "path": "v2/{+parent}/links", // "response": { - // "$ref": "Operation" + // "$ref": "ListLinksResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.projects.locations.buckets.links.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 *ProjectsLocationsBucketsLinksListCall) Pages(ctx context.Context, f func(*ListLinksResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type ProjectsLocationsBucketsLinksCreateCall struct { +// method id "logging.projects.locations.buckets.views.create": + +type ProjectsLocationsBucketsViewsCreateCall struct { s *Service parent string - link *Link + logview *LogView urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Create: Asynchronously creates a linked dataset in BigQuery which -// makes it possible to use BigQuery to read the logs stored in the log -// bucket. A log bucket may currently only contain one link. +// Create: Creates a view over log entries in a log bucket. A bucket may +// contain a maximum of 30 views. // -// - parent: The full resource name of the bucket to create a link for. +// - parent: The bucket in which to create the view // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]". -func (r *ProjectsLocationsBucketsLinksService) Create(parent string, link *Link) *ProjectsLocationsBucketsLinksCreateCall { - c := &ProjectsLocationsBucketsLinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// ` For +// example:"projects/my-project/locations/global/buckets/my-bucket". +func (r *ProjectsLocationsBucketsViewsService) Create(parent string, logview *LogView) *ProjectsLocationsBucketsViewsCreateCall { + c := &ProjectsLocationsBucketsViewsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.link = link + c.logview = logview return c } -// LinkId sets the optional parameter "linkId": Required. The ID to use -// for the link. The link_id can have up to 100 characters. A valid -// link_id must only have alphanumeric characters and underscores within -// it. -func (c *ProjectsLocationsBucketsLinksCreateCall) LinkId(linkId string) *ProjectsLocationsBucketsLinksCreateCall { - c.urlParams_.Set("linkId", linkId) +// ViewId sets the optional parameter "viewId": Required. A +// client-assigned identifier such as "my-view". Identifiers are limited +// to 100 characters and can include only letters, digits, underscores, +// hyphens, and periods. +func (c *ProjectsLocationsBucketsViewsCreateCall) ViewId(viewId string) *ProjectsLocationsBucketsViewsCreateCall { + c.urlParams_.Set("viewId", viewId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsBucketsLinksCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsLinksCreateCall { +func (c *ProjectsLocationsBucketsViewsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsViewsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -33028,21 +36343,21 @@ func (c *ProjectsLocationsBucketsLinksCreateCall) 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 *ProjectsLocationsBucketsLinksCreateCall) Context(ctx context.Context) *ProjectsLocationsBucketsLinksCreateCall { +func (c *ProjectsLocationsBucketsViewsCreateCall) Context(ctx context.Context) *ProjectsLocationsBucketsViewsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsBucketsLinksCreateCall) Header() http.Header { +func (c *ProjectsLocationsBucketsViewsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsBucketsLinksCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -33050,14 +36365,14 @@ func (c *ProjectsLocationsBucketsLinksCreateCall) doRequest(alt string) (*http.R } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.link) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/links") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -33070,14 +36385,14 @@ func (c *ProjectsLocationsBucketsLinksCreateCall) doRequest(alt string) (*http.R return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.locations.buckets.links.create" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *ProjectsLocationsBucketsLinksCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// Do executes the "logging.projects.locations.buckets.views.create" call. +// Exactly one of *LogView or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogView.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsLocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption) (*LogView, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -33096,7 +36411,7 @@ func (c *ProjectsLocationsBucketsLinksCreateCall) Do(opts ...googleapi.CallOptio if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &LogView{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -33108,33 +36423,33 @@ func (c *ProjectsLocationsBucketsLinksCreateCall) Do(opts ...googleapi.CallOptio } return ret, nil // { - // "description": "Asynchronously creates a linked dataset in BigQuery which makes it possible to use BigQuery to read the logs stored in the log bucket. A log bucket may currently only contain one link.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/links", + // "description": "Creates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/views", // "httpMethod": "POST", - // "id": "logging.projects.locations.buckets.links.create", + // "id": "logging.projects.locations.buckets.views.create", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "linkId": { - // "description": "Required. The ID to use for the link. The link_id can have up to 100 characters. A valid link_id must only have alphanumeric characters and underscores within it.", - // "location": "query", - // "type": "string" - // }, // "parent": { - // "description": "Required. The full resource name of the bucket to create a link for. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", + // "description": "Required. The bucket in which to create the view `\"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\"` For example:\"projects/my-project/locations/global/buckets/my-bucket\"", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" + // }, + // "viewId": { + // "description": "Required. A client-assigned identifier such as \"my-view\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+parent}/links", + // "path": "v2/{+parent}/views", // "request": { - // "$ref": "Link" + // "$ref": "LogView" // }, // "response": { - // "$ref": "Operation" + // "$ref": "LogView" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -33144,9 +36459,9 @@ func (c *ProjectsLocationsBucketsLinksCreateCall) Do(opts ...googleapi.CallOptio } -// method id "logging.projects.locations.buckets.links.delete": +// method id "logging.projects.locations.buckets.views.delete": -type ProjectsLocationsBucketsLinksDeleteCall struct { +type ProjectsLocationsBucketsViewsDeleteCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -33154,20 +36469,17 @@ type ProjectsLocationsBucketsLinksDeleteCall struct { header_ http.Header } -// Delete: Deletes a link. This will also delete the corresponding -// BigQuery linked dataset. +// Delete: Deletes a view on a log bucket. If an UNAVAILABLE error is +// returned, this indicates that system is not in a state where it can +// delete the view. If this occurs, please try again in a few minutes. // -// - name: The full resource name of the link to delete. -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/l -// inks/[LINK_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]/links/[LINK_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]/links/[LINK_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/lin -// ks/[LINK_ID]". -func (r *ProjectsLocationsBucketsLinksService) Delete(name string) *ProjectsLocationsBucketsLinksDeleteCall { - c := &ProjectsLocationsBucketsLinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The full resource name of the view to delete: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v +// iews/[VIEW_ID]" For +// example:"projects/my-project/locations/global/buckets/my-bucket/view +// s/my-view". +func (r *ProjectsLocationsBucketsViewsService) Delete(name string) *ProjectsLocationsBucketsViewsDeleteCall { + c := &ProjectsLocationsBucketsViewsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -33175,7 +36487,7 @@ func (r *ProjectsLocationsBucketsLinksService) Delete(name string) *ProjectsLoca // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsBucketsLinksDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsLinksDeleteCall { +func (c *ProjectsLocationsBucketsViewsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsViewsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -33183,21 +36495,21 @@ func (c *ProjectsLocationsBucketsLinksDeleteCall) 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 *ProjectsLocationsBucketsLinksDeleteCall) Context(ctx context.Context) *ProjectsLocationsBucketsLinksDeleteCall { +func (c *ProjectsLocationsBucketsViewsDeleteCall) Context(ctx context.Context) *ProjectsLocationsBucketsViewsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsBucketsLinksDeleteCall) Header() http.Header { +func (c *ProjectsLocationsBucketsViewsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsBucketsLinksDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -33220,14 +36532,14 @@ func (c *ProjectsLocationsBucketsLinksDeleteCall) doRequest(alt string) (*http.R return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.locations.buckets.links.delete" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *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 *ProjectsLocationsBucketsLinksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// Do executes the "logging.projects.locations.buckets.views.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -33246,7 +36558,7 @@ func (c *ProjectsLocationsBucketsLinksDeleteCall) Do(opts ...googleapi.CallOptio 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, @@ -33258,25 +36570,25 @@ func (c *ProjectsLocationsBucketsLinksDeleteCall) Do(opts ...googleapi.CallOptio } return ret, nil // { - // "description": "Deletes a link. This will also delete the corresponding BigQuery linked dataset.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/links/{linksId}", + // "description": "Deletes a view on a log bucket. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", // "httpMethod": "DELETE", - // "id": "logging.projects.locations.buckets.links.delete", + // "id": "logging.projects.locations.buckets.views.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The full resource name of the link to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" ", + // "description": "Required. The full resource name of the view to delete: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+/links/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v2/{+name}", // "response": { - // "$ref": "Operation" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -33286,9 +36598,9 @@ func (c *ProjectsLocationsBucketsLinksDeleteCall) Do(opts ...googleapi.CallOptio } -// method id "logging.projects.locations.buckets.links.get": +// method id "logging.projects.locations.buckets.views.get": -type ProjectsLocationsBucketsLinksGetCall struct { +type ProjectsLocationsBucketsViewsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -33297,19 +36609,15 @@ type ProjectsLocationsBucketsLinksGetCall struct { header_ http.Header } -// Get: Gets a link. +// Get: Gets a view on a log bucket. // -// - name: The resource name of the link: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/l -// inks/[LINK_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]/links/[LINK_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]/links/[LINK_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/lin -// ks/[LINK_ID]". -func (r *ProjectsLocationsBucketsLinksService) Get(name string) *ProjectsLocationsBucketsLinksGetCall { - c := &ProjectsLocationsBucketsLinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of the policy: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v +// iews/[VIEW_ID]" For +// example:"projects/my-project/locations/global/buckets/my-bucket/view +// s/my-view". +func (r *ProjectsLocationsBucketsViewsService) Get(name string) *ProjectsLocationsBucketsViewsGetCall { + c := &ProjectsLocationsBucketsViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -33317,7 +36625,7 @@ func (r *ProjectsLocationsBucketsLinksService) Get(name string) *ProjectsLocatio // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsBucketsLinksGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsLinksGetCall { +func (c *ProjectsLocationsBucketsViewsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsViewsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -33327,7 +36635,7 @@ func (c *ProjectsLocationsBucketsLinksGetCall) Fields(s ...googleapi.Field) *Pro // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsBucketsLinksGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsBucketsLinksGetCall { +func (c *ProjectsLocationsBucketsViewsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsBucketsViewsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -33335,21 +36643,21 @@ func (c *ProjectsLocationsBucketsLinksGetCall) IfNoneMatch(entityTag string) *Pr // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsBucketsLinksGetCall) Context(ctx context.Context) *ProjectsLocationsBucketsLinksGetCall { +func (c *ProjectsLocationsBucketsViewsGetCall) Context(ctx context.Context) *ProjectsLocationsBucketsViewsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsBucketsLinksGetCall) Header() http.Header { +func (c *ProjectsLocationsBucketsViewsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsBucketsLinksGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsBucketsViewsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -33375,14 +36683,14 @@ func (c *ProjectsLocationsBucketsLinksGetCall) doRequest(alt string) (*http.Resp return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.locations.buckets.links.get" call. -// Exactly one of *Link or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Link.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *ProjectsLocationsBucketsLinksGetCall) Do(opts ...googleapi.CallOption) (*Link, error) { +// Do executes the "logging.projects.locations.buckets.views.get" call. +// Exactly one of *LogView or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogView.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsLocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogView, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -33401,7 +36709,7 @@ func (c *ProjectsLocationsBucketsLinksGetCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Link{ + ret := &LogView{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -33413,25 +36721,25 @@ func (c *ProjectsLocationsBucketsLinksGetCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Gets a link.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/links/{linksId}", + // "description": "Gets a view on a log bucket.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", // "httpMethod": "GET", - // "id": "logging.projects.locations.buckets.links.get", + // "id": "logging.projects.locations.buckets.views.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource name of the link: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]\" ", + // "description": "Required. The resource name of the policy: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+/links/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v2/{+name}", // "response": { - // "$ref": "Link" + // "$ref": "LogView" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -33443,9 +36751,9 @@ func (c *ProjectsLocationsBucketsLinksGetCall) Do(opts ...googleapi.CallOption) } -// method id "logging.projects.locations.buckets.links.list": +// method id "logging.projects.locations.buckets.views.list": -type ProjectsLocationsBucketsLinksListCall struct { +type ProjectsLocationsBucketsViewsListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -33454,24 +36762,21 @@ type ProjectsLocationsBucketsLinksListCall struct { header_ http.Header } -// List: Lists links. +// List: Lists views on a log bucket. // -// - parent: The parent resource whose links are to be listed: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU -// CKET_ID]" -// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket -// s/[BUCKET_ID]" -// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]". -func (r *ProjectsLocationsBucketsLinksService) List(parent string) *ProjectsLocationsBucketsLinksListCall { - c := &ProjectsLocationsBucketsLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The bucket whose views are to be listed: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]". +func (r *ProjectsLocationsBucketsViewsService) List(parent string) *ProjectsLocationsBucketsViewsListCall { + c := &ProjectsLocationsBucketsViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } // PageSize sets the optional parameter "pageSize": The maximum number -// of results to return from this request. -func (c *ProjectsLocationsBucketsLinksListCall) PageSize(pageSize int64) *ProjectsLocationsBucketsLinksListCall { +// of results to return from this request.Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *ProjectsLocationsBucketsViewsListCall) PageSize(pageSize int64) *ProjectsLocationsBucketsViewsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } @@ -33479,8 +36784,9 @@ func (c *ProjectsLocationsBucketsLinksListCall) PageSize(pageSize int64) *Projec // PageToken sets the optional parameter "pageToken": If present, then // retrieve the next batch of results from the preceding call to this // method. pageToken must be the value of nextPageToken from the -// previous response. -func (c *ProjectsLocationsBucketsLinksListCall) PageToken(pageToken string) *ProjectsLocationsBucketsLinksListCall { +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *ProjectsLocationsBucketsViewsListCall) PageToken(pageToken string) *ProjectsLocationsBucketsViewsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -33488,7 +36794,7 @@ func (c *ProjectsLocationsBucketsLinksListCall) PageToken(pageToken string) *Pro // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsBucketsLinksListCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsLinksListCall { +func (c *ProjectsLocationsBucketsViewsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsViewsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -33498,7 +36804,7 @@ func (c *ProjectsLocationsBucketsLinksListCall) Fields(s ...googleapi.Field) *Pr // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsBucketsLinksListCall) IfNoneMatch(entityTag string) *ProjectsLocationsBucketsLinksListCall { +func (c *ProjectsLocationsBucketsViewsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsBucketsViewsListCall { c.ifNoneMatch_ = entityTag return c } @@ -33506,21 +36812,21 @@ func (c *ProjectsLocationsBucketsLinksListCall) IfNoneMatch(entityTag string) *P // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsBucketsLinksListCall) Context(ctx context.Context) *ProjectsLocationsBucketsLinksListCall { +func (c *ProjectsLocationsBucketsViewsListCall) Context(ctx context.Context) *ProjectsLocationsBucketsViewsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsBucketsLinksListCall) Header() http.Header { +func (c *ProjectsLocationsBucketsViewsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsBucketsLinksListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsBucketsViewsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -33533,7 +36839,7 @@ func (c *ProjectsLocationsBucketsLinksListCall) doRequest(alt string) (*http.Res var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/links") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -33546,14 +36852,14 @@ func (c *ProjectsLocationsBucketsLinksListCall) doRequest(alt string) (*http.Res return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.locations.buckets.links.list" call. -// Exactly one of *ListLinksResponse or error will be non-nil. Any +// Do executes the "logging.projects.locations.buckets.views.list" call. +// Exactly one of *ListViewsResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either -// *ListLinksResponse.ServerResponse.Header or (if a response was +// *ListViewsResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsBucketsLinksListCall) Do(opts ...googleapi.CallOption) (*ListLinksResponse, error) { +func (c *ProjectsLocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) (*ListViewsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -33572,7 +36878,7 @@ func (c *ProjectsLocationsBucketsLinksListCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListLinksResponse{ + ret := &ListViewsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -33584,36 +36890,36 @@ func (c *ProjectsLocationsBucketsLinksListCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Lists links.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/links", + // "description": "Lists views on a log bucket.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/views", // "httpMethod": "GET", - // "id": "logging.projects.locations.buckets.links.list", + // "id": "logging.projects.locations.buckets.views.list", // "parameterOrder": [ // "parent" // ], // "parameters": { // "pageSize": { - // "description": "Optional. The maximum number of results to return from this request.", + // "description": "Optional. The maximum number of results to return from this request.Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response.", + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. The parent resource whose links are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", + // "description": "Required. The bucket whose views are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/links", + // "path": "v2/{+parent}/views", // "response": { - // "$ref": "ListLinksResponse" + // "$ref": "ListViewsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -33628,7 +36934,7 @@ func (c *ProjectsLocationsBucketsLinksListCall) 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 *ProjectsLocationsBucketsLinksListCall) Pages(ctx context.Context, f func(*ListLinksResponse) error) error { +func (c *ProjectsLocationsBucketsViewsListCall) Pages(ctx context.Context, f func(*ListViewsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -33646,44 +36952,51 @@ func (c *ProjectsLocationsBucketsLinksListCall) Pages(ctx context.Context, f fun } } -// method id "logging.projects.locations.buckets.views.create": +// method id "logging.projects.locations.buckets.views.patch": -type ProjectsLocationsBucketsViewsCreateCall struct { +type ProjectsLocationsBucketsViewsPatchCall struct { s *Service - parent string + name string logview *LogView urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Create: Creates a view over log entries in a log bucket. A bucket may -// contain a maximum of 30 views. +// Patch: Updates a view on a log bucket. This method replaces the +// following fields in the existing view with values from the new view: +// filter. If an UNAVAILABLE error is returned, this indicates that +// system is not in a state where it can update the view. If this +// occurs, please try again in a few minutes. // -// - parent: The bucket in which to create the view -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" -// ` For -// example:"projects/my-project/locations/global/buckets/my-bucket". -func (r *ProjectsLocationsBucketsViewsService) Create(parent string, logview *LogView) *ProjectsLocationsBucketsViewsCreateCall { - c := &ProjectsLocationsBucketsViewsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent +// - name: The full resource name of the view to update +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v +// iews/[VIEW_ID]" For +// example:"projects/my-project/locations/global/buckets/my-bucket/view +// s/my-view". +func (r *ProjectsLocationsBucketsViewsService) Patch(name string, logview *LogView) *ProjectsLocationsBucketsViewsPatchCall { + c := &ProjectsLocationsBucketsViewsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name c.logview = logview return c } -// ViewId sets the optional parameter "viewId": Required. A -// client-assigned identifier such as "my-view". Identifiers are limited -// to 100 characters and can include only letters, digits, underscores, -// hyphens, and periods. -func (c *ProjectsLocationsBucketsViewsCreateCall) ViewId(viewId string) *ProjectsLocationsBucketsViewsCreateCall { - c.urlParams_.Set("viewId", viewId) +// UpdateMask sets the optional parameter "updateMask": Field mask that +// specifies the fields in view that need an update. A field will be +// overwritten if, and only if, it is in the update mask. name and +// output only fields cannot be updated.For a detailed FieldMask +// definition, see +// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor +// example: updateMask=filter +func (c *ProjectsLocationsBucketsViewsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsBucketsViewsPatchCall { + 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 *ProjectsLocationsBucketsViewsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsViewsCreateCall { +func (c *ProjectsLocationsBucketsViewsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsViewsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -33691,21 +37004,21 @@ func (c *ProjectsLocationsBucketsViewsCreateCall) 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 *ProjectsLocationsBucketsViewsCreateCall) Context(ctx context.Context) *ProjectsLocationsBucketsViewsCreateCall { +func (c *ProjectsLocationsBucketsViewsPatchCall) Context(ctx context.Context) *ProjectsLocationsBucketsViewsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsBucketsViewsCreateCall) Header() http.Header { +func (c *ProjectsLocationsBucketsViewsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -33720,27 +37033,27 @@ func (c *ProjectsLocationsBucketsViewsCreateCall) doRequest(alt string) (*http.R reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.locations.buckets.views.create" call. +// Do executes the "logging.projects.locations.buckets.views.patch" call. // Exactly one of *LogView or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *LogView.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. -func (c *ProjectsLocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption) (*LogView, error) { +func (c *ProjectsLocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) (*LogView, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -33771,28 +37084,29 @@ func (c *ProjectsLocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOptio } return ret, nil // { - // "description": "Creates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/views", - // "httpMethod": "POST", - // "id": "logging.projects.locations.buckets.views.create", + // "description": "Updates a view on a log bucket. This method replaces the following fields in the existing view with values from the new view: filter. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can update the view. If this occurs, please try again in a few minutes.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", + // "httpMethod": "PATCH", + // "id": "logging.projects.locations.buckets.views.patch", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. The bucket in which to create the view `\"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\"` For example:\"projects/my-project/locations/global/buckets/my-bucket\"", + // "name": { + // "description": "Required. The full resource name of the view to update \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", // "required": true, // "type": "string" // }, - // "viewId": { - // "description": "Required. A client-assigned identifier such as \"my-view\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.", + // "updateMask": { + // "description": "Optional. Field mask that specifies the fields in view that need an update. A field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", + // "format": "google-fieldmask", // "location": "query", // "type": "string" // } // }, - // "path": "v2/{+parent}/views", + // "path": "v2/{+name}", // "request": { // "$ref": "LogView" // }, @@ -33807,87 +37121,135 @@ func (c *ProjectsLocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOptio } -// method id "logging.projects.locations.buckets.views.delete": +// method id "logging.projects.locations.buckets.views.logs.list": -type ProjectsLocationsBucketsViewsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsBucketsViewsLogsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a view on a log bucket. If an UNAVAILABLE error is -// returned, this indicates that system is not in a state where it can -// delete the view. If this occurs, please try again in a few minutes. +// List: Lists the logs in projects, organizations, folders, or billing +// accounts. Only logs that have entries are listed. // -// - name: The full resource name of the view to delete: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v -// iews/[VIEW_ID]" For -// example:"projects/my-project/locations/global/buckets/my-bucket/view -// s/my-view". -func (r *ProjectsLocationsBucketsViewsService) Delete(name string) *ProjectsLocationsBucketsViewsDeleteCall { - c := &ProjectsLocationsBucketsViewsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: The resource name to list logs for: projects/[PROJECT_ID] +// organizations/[ORGANIZATION_ID] +// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]. +func (r *ProjectsLocationsBucketsViewsLogsService) List(parent string) *ProjectsLocationsBucketsViewsLogsListCall { + c := &ProjectsLocationsBucketsViewsLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request. Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *ProjectsLocationsBucketsViewsLogsListCall) PageSize(pageSize int64) *ProjectsLocationsBucketsViewsLogsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *ProjectsLocationsBucketsViewsLogsListCall) PageToken(pageToken string) *ProjectsLocationsBucketsViewsLogsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ResourceNames sets the optional parameter "resourceNames": List of +// resource names to list logs for: +// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/view +// s/[VIEW_ID] +// organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKE +// T_ID]/views/[VIEW_ID] +// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[ +// BUCKET_ID]/views/[VIEW_ID] +// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/ +// [VIEW_ID]To support legacy queries, it could also be: +// projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] +// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]The resource +// name in the parent field is added to this list. +func (c *ProjectsLocationsBucketsViewsLogsListCall) ResourceNames(resourceNames ...string) *ProjectsLocationsBucketsViewsLogsListCall { + c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsBucketsViewsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsViewsDeleteCall { +func (c *ProjectsLocationsBucketsViewsLogsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsViewsLogsListCall { 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 *ProjectsLocationsBucketsViewsLogsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsBucketsViewsLogsListCall { + 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 *ProjectsLocationsBucketsViewsDeleteCall) Context(ctx context.Context) *ProjectsLocationsBucketsViewsDeleteCall { +func (c *ProjectsLocationsBucketsViewsLogsListCall) Context(ctx context.Context) *ProjectsLocationsBucketsViewsLogsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsBucketsViewsDeleteCall) Header() http.Header { +func (c *ProjectsLocationsBucketsViewsLogsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsBucketsViewsLogsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.locations.buckets.views.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *ProjectsLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "logging.projects.locations.buckets.views.logs.list" call. +// Exactly one of *ListLogsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListLogsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsBucketsViewsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -33906,7 +37268,7 @@ func (c *ProjectsLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOptio if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &ListLogsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -33918,109 +37280,147 @@ func (c *ProjectsLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOptio } return ret, nil // { - // "description": "Deletes a view on a log bucket. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", - // "httpMethod": "DELETE", - // "id": "logging.projects.locations.buckets.views.delete", + // "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}/logs", + // "httpMethod": "GET", + // "id": "logging.projects.locations.buckets.views.logs.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The full resource name of the view to delete: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", + // "pageSize": { + // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The resource name to list logs for: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", // "required": true, // "type": "string" + // }, + // "resourceNames": { + // "description": "Optional. List of resource names to list logs for: projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]To support legacy queries, it could also be: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]The resource name in the parent field is added to this list.", + // "location": "query", + // "repeated": true, + // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+parent}/logs", // "response": { - // "$ref": "Empty" + // "$ref": "ListLogsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.projects.locations.buckets.views.get": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsBucketsViewsLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type ProjectsLocationsBucketsViewsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// method id "logging.projects.locations.operations.cancel": + +type ProjectsLocationsOperationsCancelCall struct { + s *Service + name string + canceloperationrequest *CancelOperationRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a view on a log bucket. +// Cancel: Starts asynchronous cancellation on a long-running operation. +// The server makes a best effort to cancel the operation, but success +// is not guaranteed. If the server doesn't support this method, it +// returns google.rpc.Code.UNIMPLEMENTED. Clients can use +// Operations.GetOperation or other methods to check whether the +// cancellation succeeded or whether the operation completed despite +// cancellation. On successful cancellation, the operation is not +// deleted; instead, it becomes an operation with an Operation.error +// value with a google.rpc.Status.code of 1, corresponding to +// Code.CANCELLED. // -// - name: The resource name of the policy: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v -// iews/[VIEW_ID]" For -// example:"projects/my-project/locations/global/buckets/my-bucket/view -// s/my-view". -func (r *ProjectsLocationsBucketsViewsService) Get(name string) *ProjectsLocationsBucketsViewsGetCall { - c := &ProjectsLocationsBucketsViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the operation resource to be cancelled. +func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall { + c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.canceloperationrequest = canceloperationrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsBucketsViewsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsViewsGetCall { +func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall { 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 *ProjectsLocationsBucketsViewsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsBucketsViewsGetCall { - 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 *ProjectsLocationsBucketsViewsGetCall) Context(ctx context.Context) *ProjectsLocationsBucketsViewsGetCall { +func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsBucketsViewsGetCall) Header() http.Header { +func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsBucketsViewsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, 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.canceloperationrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:cancel") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -34031,14 +37431,14 @@ func (c *ProjectsLocationsBucketsViewsGetCall) doRequest(alt string) (*http.Resp return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.locations.buckets.views.get" call. -// Exactly one of *LogView or error will be non-nil. Any non-2xx status +// Do executes the "logging.projects.locations.operations.cancel" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either -// *LogView.ServerResponse.Header or (if a response was returned at all) +// *Empty.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. -func (c *ProjectsLocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogView, error) { +func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -34057,7 +37457,7 @@ func (c *ProjectsLocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogView{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -34069,80 +37469,63 @@ func (c *ProjectsLocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Gets a view on a log bucket.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", - // "httpMethod": "GET", - // "id": "logging.projects.locations.buckets.views.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": "v2/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}:cancel", + // "httpMethod": "POST", + // "id": "logging.projects.locations.operations.cancel", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The resource name of the policy: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", + // "description": "The name of the operation resource to be cancelled.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+name}:cancel", + // "request": { + // "$ref": "CancelOperationRequest" + // }, // "response": { - // "$ref": "LogView" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// method id "logging.projects.locations.buckets.views.list": +// method id "logging.projects.locations.operations.get": -type ProjectsLocationsBucketsViewsListCall struct { +type ProjectsLocationsOperationsGetCall struct { s *Service - parent string + name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists views on a log bucket. +// 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. // -// - parent: The bucket whose views are to be listed: -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]". -func (r *ProjectsLocationsBucketsViewsService) List(parent string) *ProjectsLocationsBucketsViewsListCall { - c := &ProjectsLocationsBucketsViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return from this request.Non-positive values are -// ignored. The presence of nextPageToken in the response indicates that -// more results might be available. -func (c *ProjectsLocationsBucketsViewsListCall) PageSize(pageSize int64) *ProjectsLocationsBucketsViewsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": If present, then -// retrieve the next batch of results from the preceding call to this -// method. pageToken must be the value of nextPageToken from the -// previous response. The values of other method parameters should be -// identical to those in the previous call. -func (c *ProjectsLocationsBucketsViewsListCall) PageToken(pageToken string) *ProjectsLocationsBucketsViewsListCall { - c.urlParams_.Set("pageToken", pageToken) +// - name: The name of the operation resource. +func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall { + c := &ProjectsLocationsOperationsGetCall{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 *ProjectsLocationsBucketsViewsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsViewsListCall { +func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -34152,7 +37535,7 @@ func (c *ProjectsLocationsBucketsViewsListCall) Fields(s ...googleapi.Field) *Pr // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsBucketsViewsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsBucketsViewsListCall { +func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -34160,21 +37543,21 @@ func (c *ProjectsLocationsBucketsViewsListCall) IfNoneMatch(entityTag string) *P // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsBucketsViewsListCall) Context(ctx context.Context) *ProjectsLocationsBucketsViewsListCall { +func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsBucketsViewsListCall) Header() http.Header { +func (c *ProjectsLocationsOperationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsBucketsViewsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -34187,7 +37570,7 @@ func (c *ProjectsLocationsBucketsViewsListCall) doRequest(alt string) (*http.Res var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -34195,19 +37578,19 @@ func (c *ProjectsLocationsBucketsViewsListCall) doRequest(alt string) (*http.Res } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } - -// Do executes the "logging.projects.locations.buckets.views.list" call. -// Exactly one of *ListViewsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListViewsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) (*ListViewsResponse, error) { + +// Do executes the "logging.projects.locations.operations.get" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -34226,7 +37609,7 @@ func (c *ProjectsLocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListViewsResponse{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -34238,36 +37621,25 @@ func (c *ProjectsLocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Lists views on a log bucket.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/views", + // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}", // "httpMethod": "GET", - // "id": "logging.projects.locations.buckets.views.list", + // "id": "logging.projects.locations.operations.get", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "pageSize": { - // "description": "Optional. The maximum number of results to return from this request.Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The bucket whose views are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ", + // "name": { + // "description": "The name of the operation resource.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/views", + // "path": "v2/{+name}", // "response": { - // "$ref": "ListViewsResponse" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -34279,111 +37651,100 @@ func (c *ProjectsLocationsBucketsViewsListCall) 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 *ProjectsLocationsBucketsViewsListCall) Pages(ctx context.Context, f func(*ListViewsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "logging.projects.locations.buckets.views.patch": +// method id "logging.projects.locations.operations.list": -type ProjectsLocationsBucketsViewsPatchCall struct { - s *Service - name string - logview *LogView - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsOperationsListCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Patch: Updates a view on a log bucket. This method replaces the -// following fields in the existing view with values from the new view: -// filter. If an UNAVAILABLE error is returned, this indicates that -// system is not in a state where it can update the view. If this -// occurs, please try again in a few minutes. +// List: Lists operations that match the specified filter in the +// request. If the server doesn't support this method, it returns +// UNIMPLEMENTED. // -// - name: The full resource name of the view to update -// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v -// iews/[VIEW_ID]" For -// example:"projects/my-project/locations/global/buckets/my-bucket/view -// s/my-view". -func (r *ProjectsLocationsBucketsViewsService) Patch(name string, logview *LogView) *ProjectsLocationsBucketsViewsPatchCall { - c := &ProjectsLocationsBucketsViewsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the operation's parent resource. +func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall { + c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.logview = logview return c } -// UpdateMask sets the optional parameter "updateMask": Field mask that -// specifies the fields in view that need an update. A field will be -// overwritten if, and only if, it is in the update mask. name and -// output only fields cannot be updated.For a detailed FieldMask -// definition, see -// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor -// example: updateMask=filter -func (c *ProjectsLocationsBucketsViewsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsBucketsViewsPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// Filter sets the optional parameter "filter": The standard list +// filter. +func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The standard list +// page size. +func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The standard list +// page token. +func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall { + 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 *ProjectsLocationsBucketsViewsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsViewsPatchCall { +func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall { 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 *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall { + 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 *ProjectsLocationsBucketsViewsPatchCall) Context(ctx context.Context) *ProjectsLocationsBucketsViewsPatchCall { +func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsBucketsViewsPatchCall) Header() http.Header { +func (c *ProjectsLocationsOperationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -34394,14 +37755,14 @@ func (c *ProjectsLocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Re return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.locations.buckets.views.patch" call. -// Exactly one of *LogView or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *LogView.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *ProjectsLocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) (*LogView, error) { +// Do executes the "logging.projects.locations.operations.list" call. +// Exactly one of *ListOperationsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListOperationsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -34420,7 +37781,7 @@ func (c *ProjectsLocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LogView{ + ret := &ListOperationsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -34432,46 +37793,76 @@ func (c *ProjectsLocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption } return ret, nil // { - // "description": "Updates a view on a log bucket. This method replaces the following fields in the existing view with values from the new view: filter. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can update the view. If this occurs, please try again in a few minutes.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}", - // "httpMethod": "PATCH", - // "id": "logging.projects.locations.buckets.views.patch", + // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/operations", + // "httpMethod": "GET", + // "id": "logging.projects.locations.operations.list", // "parameterOrder": [ // "name" // ], // "parameters": { + // "filter": { + // "description": "The standard list filter.", + // "location": "query", + // "type": "string" + // }, // "name": { - // "description": "Required. The full resource name of the view to update \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"", + // "description": "The name of the operation's parent resource.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // }, - // "updateMask": { - // "description": "Optional. Field mask that specifies the fields in view that need an update. A field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor example: updateMask=filter", - // "format": "google-fieldmask", + // "pageSize": { + // "description": "The standard list page size.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The standard list page token.", // "location": "query", // "type": "string" // } // }, - // "path": "v2/{+name}", - // "request": { - // "$ref": "LogView" - // }, + // "path": "v2/{+name}/operations", // "response": { - // "$ref": "LogView" + // "$ref": "ListOperationsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" // ] // } } -// method id "logging.projects.locations.buckets.views.logs.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 *ProjectsLocationsOperationsListCall) 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 ProjectsLocationsBucketsViewsLogsListCall struct { +// method id "logging.projects.locations.recentQueries.list": + +type ProjectsLocationsRecentQueriesListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -34480,14 +37871,19 @@ type ProjectsLocationsBucketsViewsLogsListCall struct { header_ http.Header } -// List: Lists the logs in projects, organizations, folders, or billing -// accounts. Only logs that have entries are listed. +// List: Lists the RecentQueries that were created by the user making +// the request. // -// - parent: The resource name to list logs for: projects/[PROJECT_ID] -// organizations/[ORGANIZATION_ID] -// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]. -func (r *ProjectsLocationsBucketsViewsLogsService) List(parent string) *ProjectsLocationsBucketsViewsLogsListCall { - c := &ProjectsLocationsBucketsViewsLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - parent: The resource to which the listed queries belong. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" For +// example:projects/my-project/locations/us-central1Note: The location +// portion of the resource must be specified, but supplying the +// character - in place of LOCATION_ID will return all recent queries. +func (r *ProjectsLocationsRecentQueriesService) List(parent string) *ProjectsLocationsRecentQueriesListCall { + c := &ProjectsLocationsRecentQueriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } @@ -34496,7 +37892,7 @@ func (r *ProjectsLocationsBucketsViewsLogsService) List(parent string) *Projects // of results to return from this request. Non-positive values are // ignored. The presence of nextPageToken in the response indicates that // more results might be available. -func (c *ProjectsLocationsBucketsViewsLogsListCall) PageSize(pageSize int64) *ProjectsLocationsBucketsViewsLogsListCall { +func (c *ProjectsLocationsRecentQueriesListCall) PageSize(pageSize int64) *ProjectsLocationsRecentQueriesListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } @@ -34506,33 +37902,15 @@ func (c *ProjectsLocationsBucketsViewsLogsListCall) PageSize(pageSize int64) *Pr // method. pageToken must be the value of nextPageToken from the // previous response. The values of other method parameters should be // identical to those in the previous call. -func (c *ProjectsLocationsBucketsViewsLogsListCall) PageToken(pageToken string) *ProjectsLocationsBucketsViewsLogsListCall { +func (c *ProjectsLocationsRecentQueriesListCall) PageToken(pageToken string) *ProjectsLocationsRecentQueriesListCall { c.urlParams_.Set("pageToken", pageToken) return c } -// ResourceNames sets the optional parameter "resourceNames": List of -// resource names to list logs for: -// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/view -// s/[VIEW_ID] -// organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKE -// T_ID]/views/[VIEW_ID] -// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[ -// BUCKET_ID]/views/[VIEW_ID] -// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/ -// [VIEW_ID]To support legacy queries, it could also be: -// projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] -// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]The resource -// name in the parent field is added to this list. -func (c *ProjectsLocationsBucketsViewsLogsListCall) ResourceNames(resourceNames ...string) *ProjectsLocationsBucketsViewsLogsListCall { - c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...)) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsBucketsViewsLogsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsViewsLogsListCall { +func (c *ProjectsLocationsRecentQueriesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsRecentQueriesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -34542,7 +37920,7 @@ func (c *ProjectsLocationsBucketsViewsLogsListCall) Fields(s ...googleapi.Field) // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsBucketsViewsLogsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsBucketsViewsLogsListCall { +func (c *ProjectsLocationsRecentQueriesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsRecentQueriesListCall { c.ifNoneMatch_ = entityTag return c } @@ -34550,21 +37928,21 @@ func (c *ProjectsLocationsBucketsViewsLogsListCall) IfNoneMatch(entityTag string // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsBucketsViewsLogsListCall) Context(ctx context.Context) *ProjectsLocationsBucketsViewsLogsListCall { +func (c *ProjectsLocationsRecentQueriesListCall) Context(ctx context.Context) *ProjectsLocationsRecentQueriesListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsBucketsViewsLogsListCall) Header() http.Header { +func (c *ProjectsLocationsRecentQueriesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsBucketsViewsLogsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsRecentQueriesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -34577,7 +37955,7 @@ func (c *ProjectsLocationsBucketsViewsLogsListCall) doRequest(alt string) (*http var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/recentQueries") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -34590,14 +37968,14 @@ func (c *ProjectsLocationsBucketsViewsLogsListCall) doRequest(alt string) (*http return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.locations.buckets.views.logs.list" call. -// Exactly one of *ListLogsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListLogsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use +// Do executes the "logging.projects.locations.recentQueries.list" call. +// Exactly one of *ListRecentQueriesResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ListRecentQueriesResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsBucketsViewsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) { +func (c *ProjectsLocationsRecentQueriesListCall) Do(opts ...googleapi.CallOption) (*ListRecentQueriesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -34616,7 +37994,7 @@ func (c *ProjectsLocationsBucketsViewsLogsListCall) Do(opts ...googleapi.CallOpt if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListLogsResponse{ + ret := &ListRecentQueriesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -34628,10 +38006,10 @@ func (c *ProjectsLocationsBucketsViewsLogsListCall) Do(opts ...googleapi.CallOpt } return ret, nil // { - // "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}/logs", + // "description": "Lists the RecentQueries that were created by the user making the request.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/recentQueries", // "httpMethod": "GET", - // "id": "logging.projects.locations.buckets.views.logs.list", + // "id": "logging.projects.locations.recentQueries.list", // "parameterOrder": [ // "parent" // ], @@ -34648,22 +38026,16 @@ func (c *ProjectsLocationsBucketsViewsLogsListCall) Do(opts ...googleapi.CallOpt // "type": "string" // }, // "parent": { - // "description": "Required. The resource name to list logs for: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]", + // "description": "Required. The resource to which the listed queries belong. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" For example:projects/my-project/locations/us-central1Note: The location portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all recent queries.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" - // }, - // "resourceNames": { - // "description": "Optional. List of resource names to list logs for: projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]To support legacy queries, it could also be: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]The resource name in the parent field is added to this list.", - // "location": "query", - // "repeated": true, - // "type": "string" // } // }, - // "path": "v2/{+parent}/logs", + // "path": "v2/{+parent}/recentQueries", // "response": { - // "$ref": "ListLogsResponse" + // "$ref": "ListRecentQueriesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -34678,7 +38050,7 @@ func (c *ProjectsLocationsBucketsViewsLogsListCall) 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 *ProjectsLocationsBucketsViewsLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error { +func (c *ProjectsLocationsRecentQueriesListCall) Pages(ctx context.Context, f func(*ListRecentQueriesResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -34696,40 +38068,50 @@ func (c *ProjectsLocationsBucketsViewsLogsListCall) Pages(ctx context.Context, f } } -// method id "logging.projects.locations.operations.cancel": +// method id "logging.projects.locations.savedQueries.create": -type ProjectsLocationsOperationsCancelCall struct { - s *Service - name string - canceloperationrequest *CancelOperationRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsSavedQueriesCreateCall struct { + s *Service + parent string + savedquery *SavedQuery + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Cancel: Starts asynchronous cancellation on a long-running operation. -// The server makes a best effort to cancel the operation, but success -// is not guaranteed. If the server doesn't support this method, it -// returns google.rpc.Code.UNIMPLEMENTED. Clients can use -// Operations.GetOperation or other methods to check whether the -// cancellation succeeded or whether the operation completed despite -// cancellation. On successful cancellation, the operation is not -// deleted; instead, it becomes an operation with an Operation.error -// value with a google.rpc.Status.code of 1, corresponding to -// Code.CANCELLED. +// Create: Creates a new SavedQuery for the user making the request. // -// - name: The name of the operation resource to be cancelled. -func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall { - c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.canceloperationrequest = canceloperationrequest +// - parent: The parent resource in which to create the saved query: +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" For example: +// "projects/my-project/locations/global" +// "organizations/123456789/locations/us-central1". +func (r *ProjectsLocationsSavedQueriesService) Create(parent string, savedquery *SavedQuery) *ProjectsLocationsSavedQueriesCreateCall { + c := &ProjectsLocationsSavedQueriesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.savedquery = savedquery + return c +} + +// SavedQueryId sets the optional parameter "savedQueryId": The ID to +// use for the saved query, which will become the final component of the +// saved query's resource name.If the saved_query_id is not provided, +// the system will generate an alphanumeric ID.The saved_query_id is +// limited to 100 characters and can include only the following +// characters: upper and lower-case alphanumeric characters, +// underscores, hyphens, and periods. First character has to be +// alphanumeric. +func (c *ProjectsLocationsSavedQueriesCreateCall) SavedQueryId(savedQueryId string) *ProjectsLocationsSavedQueriesCreateCall { + c.urlParams_.Set("savedQueryId", savedQueryId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall { +func (c *ProjectsLocationsSavedQueriesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsSavedQueriesCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -34737,21 +38119,21 @@ func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *Pr // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall { +func (c *ProjectsLocationsSavedQueriesCreateCall) Context(ctx context.Context) *ProjectsLocationsSavedQueriesCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { +func (c *ProjectsLocationsSavedQueriesCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsSavedQueriesCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -34759,14 +38141,14 @@ func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Res } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.savedquery) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:cancel") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/savedQueries") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -34774,19 +38156,19 @@ func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Res } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.locations.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 *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// Do executes the "logging.projects.locations.savedQueries.create" call. +// Exactly one of *SavedQuery or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SavedQuery.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsSavedQueriesCreateCall) Do(opts ...googleapi.CallOption) (*SavedQuery, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -34805,7 +38187,7 @@ func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &SavedQuery{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -34817,28 +38199,33 @@ func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}:cancel", + // "description": "Creates a new SavedQuery for the user making the request.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/savedQueries", // "httpMethod": "POST", - // "id": "logging.projects.locations.operations.cancel", + // "id": "logging.projects.locations.savedQueries.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "The name of the operation resource to be cancelled.", + // "parent": { + // "description": "Required. The parent resource in which to create the saved query: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" For example: \"projects/my-project/locations/global\" \"organizations/123456789/locations/us-central1\" ", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" + // }, + // "savedQueryId": { + // "description": "Optional. The ID to use for the saved query, which will become the final component of the saved query's resource name.If the saved_query_id is not provided, the system will generate an alphanumeric ID.The saved_query_id is limited to 100 characters and can include only the following characters: upper and lower-case alphanumeric characters, underscores, hyphens, and periods. First character has to be alphanumeric.", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+name}:cancel", + // "path": "v2/{+parent}/savedQueries", // "request": { - // "$ref": "CancelOperationRequest" + // "$ref": "SavedQuery" // }, // "response": { - // "$ref": "Empty" + // "$ref": "SavedQuery" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -34848,24 +38235,31 @@ func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) } -// method id "logging.projects.locations.operations.get": +// method id "logging.projects.locations.savedQueries.delete": -type ProjectsLocationsOperationsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsSavedQueriesDeleteCall 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 an existing SavedQuery that was created by the user +// making the request. // -// - name: The name of the operation resource. -func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall { - c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The full resource name of the saved query to delete. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_I +// D]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/savedQuerie +// s/[QUERY_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/savedQ +// ueries/[QUERY_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID] +// " For example: +// "projects/my-project/locations/global/savedQueries/my-saved-query". +func (r *ProjectsLocationsSavedQueriesService) Delete(name string) *ProjectsLocationsSavedQueriesDeleteCall { + c := &ProjectsLocationsSavedQueriesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -34873,54 +38267,41 @@ func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocations // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall { +func (c *ProjectsLocationsSavedQueriesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsSavedQueriesDeleteCall { 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 *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall { - 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 *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall { +func (c *ProjectsLocationsSavedQueriesDeleteCall) Context(ctx context.Context) *ProjectsLocationsSavedQueriesDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsOperationsGetCall) Header() http.Header { +func (c *ProjectsLocationsSavedQueriesDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsSavedQueriesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -34931,14 +38312,14 @@ func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Respon return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.locations.operations.get" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// Do executes the "logging.projects.locations.savedQueries.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 *ProjectsLocationsSavedQueriesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -34957,7 +38338,7 @@ func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &Empty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -34969,75 +38350,78 @@ func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (* } return ret, nil // { - // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}", - // "httpMethod": "GET", - // "id": "logging.projects.locations.operations.get", + // "description": "Deletes an existing SavedQuery that was created by the user making the request.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/savedQueries/{savedQueriesId}", + // "httpMethod": "DELETE", + // "id": "logging.projects.locations.savedQueries.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "The name of the operation resource.", + // "description": "Required. The full resource name of the saved query to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/savedQueries/[QUERY_ID]\" For example: \"projects/my-project/locations/global/savedQueries/my-saved-query\" ", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/savedQueries/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v2/{+name}", // "response": { - // "$ref": "Operation" + // "$ref": "Empty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" + // "https://www.googleapis.com/auth/logging.admin" // ] // } } -// method id "logging.projects.locations.operations.list": +// method id "logging.projects.locations.savedQueries.list": -type ProjectsLocationsOperationsListCall struct { +type ProjectsLocationsSavedQueriesListCall struct { s *Service - name string + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists operations that match the specified filter in the -// request. If the server doesn't support this method, it returns -// UNIMPLEMENTED. +// List: Lists the SavedQueries that were created by the user making the +// request. // -// - name: The name of the operation's parent resource. -func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall { - c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - return c -} - -// Filter sets the optional parameter "filter": The standard list -// filter. -func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall { - c.urlParams_.Set("filter", filter) +// - parent: The resource to which the listed queries belong. +// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" +// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" +// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" +// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" For example: +// "projects/my-project/locations/us-central1" Note: The locations +// portion of the resource must be specified. To get a list of all +// saved queries, a wildcard character - can be used for LOCATION_ID, +// for example: "projects/my-project/locations/-". +func (r *ProjectsLocationsSavedQueriesService) List(parent string) *ProjectsLocationsSavedQueriesListCall { + c := &ProjectsLocationsSavedQueriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent return c } -// PageSize sets the optional parameter "pageSize": The standard list -// page size. -func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall { +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return from this request.Non-positive values are +// ignored. The presence of nextPageToken in the response indicates that +// more results might be available. +func (c *ProjectsLocationsSavedQueriesListCall) PageSize(pageSize int64) *ProjectsLocationsSavedQueriesListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } -// PageToken sets the optional parameter "pageToken": The standard list -// page token. -func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall { +// PageToken sets the optional parameter "pageToken": If present, then +// retrieve the next batch of results from the preceding call to this +// method. pageToken must be the value of nextPageToken from the +// previous response. The values of other method parameters should be +// identical to those in the previous call. +func (c *ProjectsLocationsSavedQueriesListCall) PageToken(pageToken string) *ProjectsLocationsSavedQueriesListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -35045,7 +38429,7 @@ func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *Proje // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall { +func (c *ProjectsLocationsSavedQueriesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsSavedQueriesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -35055,7 +38439,7 @@ func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *Proj // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall { +func (c *ProjectsLocationsSavedQueriesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsSavedQueriesListCall { c.ifNoneMatch_ = entityTag return c } @@ -35063,21 +38447,21 @@ func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *Pro // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall { +func (c *ProjectsLocationsSavedQueriesListCall) Context(ctx context.Context) *ProjectsLocationsSavedQueriesListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsOperationsListCall) Header() http.Header { +func (c *ProjectsLocationsSavedQueriesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsSavedQueriesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -35090,7 +38474,7 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/savedQueries") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -35098,19 +38482,19 @@ func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Respo } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "logging.projects.locations.operations.list" call. -// Exactly one of *ListOperationsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListOperationsResponse.ServerResponse.Header or (if a response was +// Do executes the "logging.projects.locations.savedQueries.list" call. +// Exactly one of *ListSavedQueriesResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ListSavedQueriesResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { +func (c *ProjectsLocationsSavedQueriesListCall) Do(opts ...googleapi.CallOption) (*ListSavedQueriesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -35129,7 +38513,7 @@ func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) ( if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListOperationsResponse{ + ret := &ListSavedQueriesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -35141,41 +38525,36 @@ func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) ( } return ret, nil // { - // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/operations", + // "description": "Lists the SavedQueries that were created by the user making the request.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/savedQueries", // "httpMethod": "GET", - // "id": "logging.projects.locations.operations.list", + // "id": "logging.projects.locations.savedQueries.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "filter": { - // "description": "The standard list filter.", - // "location": "query", - // "type": "string" - // }, - // "name": { - // "description": "The name of the operation's parent resource.", - // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+$", - // "required": true, - // "type": "string" - // }, // "pageSize": { - // "description": "The standard list page size.", + // "description": "Optional. The maximum number of results to return from this request.Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "The standard list page token.", + // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.", // "location": "query", // "type": "string" + // }, + // "parent": { + // "description": "Required. The resource to which the listed queries belong. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" For example: \"projects/my-project/locations/us-central1\" Note: The locations portion of the resource must be specified. To get a list of all saved queries, a wildcard character - can be used for LOCATION_ID, for example: \"projects/my-project/locations/-\" ", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "required": true, + // "type": "string" // } // }, - // "path": "v2/{+name}/operations", + // "path": "v2/{+parent}/savedQueries", // "response": { - // "$ref": "ListOperationsResponse" + // "$ref": "ListSavedQueriesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform", @@ -35190,7 +38569,7 @@ func (c *ProjectsLocationsOperationsListCall) 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 *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { +func (c *ProjectsLocationsSavedQueriesListCall) Pages(ctx context.Context, f func(*ListSavedQueriesResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { diff --git a/monitoring/v3/monitoring-api.json b/monitoring/v3/monitoring-api.json index c78e1f581f5..bb3a695f7af 100644 --- a/monitoring/v3/monitoring-api.json +++ b/monitoring/v3/monitoring-api.json @@ -2281,7 +2281,7 @@ ], "parameters": { "name": { - "description": "A unique resource name for this Uptime check configuration. The format is: projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] [PROJECT_ID_OR_NUMBER] is the Workspace host project associated with the Uptime check.This field should be omitted when creating the Uptime check configuration; on create, the resource name is assigned by the server and included in the response.", + "description": "Identifier. A unique resource name for this Uptime check configuration. The format is: projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] [PROJECT_ID_OR_NUMBER] is the Workspace host project associated with the Uptime check.This field should be omitted when creating the Uptime check configuration; on create, the resource name is assigned by the server and included in the response.", "location": "path", "pattern": "^projects/[^/]+/uptimeCheckConfigs/[^/]+$", "required": true, @@ -2714,7 +2714,7 @@ } } }, - "revision": "20231023", + "revision": "20231115", "rootUrl": "https://monitoring.googleapis.com/", "schemas": { "Aggregation": { @@ -2880,6 +2880,22 @@ }, "type": "array" }, + "severity": { + "description": "Optional. The severity of an alert policy indicates how important alerts generated by that policy are. The severity level, if specified, will be displayed on the Incident detail page and in notifications.", + "enum": [ + "SEVERITY_UNSPECIFIED", + "CRITICAL", + "ERROR", + "WARNING" + ], + "enumDescriptions": [ + "No severity is specified. This is the default value.", + "This is the highest severity level. Use this if the problem could cause significant damage or downtime.", + "This is the medium severity level. Use this if the problem could cause minor damage or downtime.", + "This is the lowest severity level. Use this if the problem is not causing any damage or downtime, but could potentially lead to a problem in the future." + ], + "type": "string" + }, "userLabels": { "additionalProperties": { "type": "string" @@ -5854,7 +5870,7 @@ "description": "The monitored resource (https://cloud.google.com/monitoring/api/resources) associated with the configuration. The following monitored resource types are valid for this field: uptime_url, gce_instance, gae_app, aws_ec2_instance, aws_elb_load_balancer k8s_service servicedirectory_service cloud_run_revision" }, "name": { - "description": "A unique resource name for this Uptime check configuration. The format is: projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] [PROJECT_ID_OR_NUMBER] is the Workspace host project associated with the Uptime check.This field should be omitted when creating the Uptime check configuration; on create, the resource name is assigned by the server and included in the response.", + "description": "Identifier. A unique resource name for this Uptime check configuration. The format is: projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] [PROJECT_ID_OR_NUMBER] is the Workspace host project associated with the Uptime check.This field should be omitted when creating the Uptime check configuration; on create, the resource name is assigned by the server and included in the response.", "type": "string" }, "period": { diff --git a/monitoring/v3/monitoring-gen.go b/monitoring/v3/monitoring-gen.go index 00144d6812e..e3562dc9391 100644 --- a/monitoring/v3/monitoring-gen.go +++ b/monitoring/v3/monitoring-gen.go @@ -762,6 +762,23 @@ type AlertPolicy struct { // projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] NotificationChannels []string `json:"notificationChannels,omitempty"` + // Severity: Optional. The severity of an alert policy indicates how + // important alerts generated by that policy are. The severity level, if + // specified, will be displayed on the Incident detail page and in + // notifications. + // + // Possible values: + // "SEVERITY_UNSPECIFIED" - No severity is specified. This is the + // default value. + // "CRITICAL" - This is the highest severity level. Use this if the + // problem could cause significant damage or downtime. + // "ERROR" - This is the medium severity level. Use this if the + // problem could cause minor damage or downtime. + // "WARNING" - This is the lowest severity level. Use this if the + // problem is not causing any damage or downtime, but could potentially + // lead to a problem in the future. + Severity string `json:"severity,omitempty"` + // UserLabels: User-supplied key/value data to be used for organizing // and identifying the AlertPolicy objects.The field can contain up to // 64 entries. Each key and value is limited to 63 Unicode characters or @@ -6448,8 +6465,8 @@ type UptimeCheckConfig struct { // cloud_run_revision MonitoredResource *MonitoredResource `json:"monitoredResource,omitempty"` - // Name: A unique resource name for this Uptime check configuration. The - // format is: + // Name: Identifier. A unique resource name for this Uptime check + // configuration. The format is: // projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] // [PROJECT_ID_OR_NUMBER] is the Workspace host project associated with // the Uptime check.This field should be omitted when creating the @@ -16670,8 +16687,8 @@ type ProjectsUptimeCheckConfigsPatchCall struct { // fields in the current configuration by specifying the fields to be // updated via updateMask. Returns the updated configuration. // -// - name: A unique resource name for this Uptime check configuration. -// The format is: +// - name: Identifier. A unique resource name for this Uptime check +// configuration. The format is: // projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] // [PROJECT_ID_OR_NUMBER] is the Workspace host project associated // with the Uptime check.This field should be omitted when creating @@ -16794,7 +16811,7 @@ func (c *ProjectsUptimeCheckConfigsPatchCall) Do(opts ...googleapi.CallOption) ( // ], // "parameters": { // "name": { - // "description": "A unique resource name for this Uptime check configuration. The format is: projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] [PROJECT_ID_OR_NUMBER] is the Workspace host project associated with the Uptime check.This field should be omitted when creating the Uptime check configuration; on create, the resource name is assigned by the server and included in the response.", + // "description": "Identifier. A unique resource name for this Uptime check configuration. The format is: projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] [PROJECT_ID_OR_NUMBER] is the Workspace host project associated with the Uptime check.This field should be omitted when creating the Uptime check configuration; on create, the resource name is assigned by the server and included in the response.", // "location": "path", // "pattern": "^projects/[^/]+/uptimeCheckConfigs/[^/]+$", // "required": true, diff --git a/run/v2/run-api.json b/run/v2/run-api.json index bc94333cc02..e49d0a42453 100644 --- a/run/v2/run-api.json +++ b/run/v2/run-api.json @@ -1115,7 +1115,7 @@ } } }, - "revision": "20231022", + "revision": "20231112", "rootUrl": "https://run.googleapis.com/", "schemas": { "GoogleCloudRunV2BinaryAuthorization": { @@ -2709,11 +2709,11 @@ "type": "object" }, "GoogleCloudRunV2ServiceScaling": { - "description": "Scaling settings that apply to the service as a whole rather than the individual revision.", + "description": "Scaling settings applied at the service level rather than at the revision level.", "id": "GoogleCloudRunV2ServiceScaling", "properties": { "minInstanceCount": { - "description": "total min instances for the service. This number of instances will be divide among all revisions with specified traffic based on the percent of traffic they are receiving. (ALPHA)", + "description": "total min instances for the service. This number of instances is divided among all revisions with specified traffic based on the percent of traffic they are receiving. (ALPHA)", "format": "int32", "type": "integer" } diff --git a/run/v2/run-gen.go b/run/v2/run-gen.go index 33d37a1bcda..688273c4e92 100644 --- a/run/v2/run-gen.go +++ b/run/v2/run-gen.go @@ -2507,12 +2507,12 @@ func (s *GoogleCloudRunV2Service) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRunV2ServiceScaling: Scaling settings that apply to the -// service as a whole rather than the individual revision. +// GoogleCloudRunV2ServiceScaling: Scaling settings applied at the +// service level rather than at the revision level. type GoogleCloudRunV2ServiceScaling struct { // MinInstanceCount: total min instances for the service. This number of - // instances will be divide among all revisions with specified traffic - // based on the percent of traffic they are receiving. (ALPHA) + // instances is divided among all revisions with specified traffic based + // on the percent of traffic they are receiving. (ALPHA) MinInstanceCount int64 `json:"minInstanceCount,omitempty"` // ForceSendFields is a list of field names (e.g. "MinInstanceCount") to