// Code generated by sidekick. DO NOT EDIT.
//
// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import Foundation
import GoogleCloudWkt

/// Specifies a set of log entries that are filtered out by a sink. If
/// your Google Cloud resource receives a large volume of log entries, you can
/// use exclusions to reduce your chargeable logs. Note that exclusions on
/// organization-level and folder-level sinks don't apply to child resources.
/// Note also that you cannot modify the _Required sink or exclude logs from it.
public struct LogExclusion: Codable, Equatable, GoogleCloudWkt._AnyPackable,
  Sendable
{
  /// Required. A client-assigned identifier, such as
  /// `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and
  /// can include only letters, digits, underscores, hyphens, and periods. First
  /// character has to be alphanumeric.
  public var name: Swift.String = Swift.String()

  /// Optional. A description of this exclusion.
  public var description: Swift.String = Swift.String()

  /// Required. An [advanced logs
  /// filter](https://cloud.google.com/logging/docs/view/advanced-queries) that
  /// matches the log entries to be excluded. By using the [sample
  /// function](https://cloud.google.com/logging/docs/view/advanced-queries#sample),
  /// you can exclude less than 100% of the matching log entries.
  ///
  /// For example, the following query matches 99% of low-severity log entries
  /// from Google Cloud Storage buckets:
  ///
  ///   `resource.type=gcs_bucket severity<ERROR sample(insertId, 0.99)`
  public var filter: Swift.String = Swift.String()

  /// Optional. If set to True, then this exclusion is disabled and it does not
  /// exclude any log entries. You can [update an
  /// exclusion][google.logging.v2.ConfigServiceV2.UpdateExclusion] to change the
  /// value of this field.
  ///
  /// [google.logging.v2.ConfigServiceV2.UpdateExclusion]: <doc:ConfigServiceV2/updateExclusion(request:)>
  public var disabled: Swift.Bool = Swift.Bool()

  /// Output only. The creation timestamp of the exclusion.
  ///
  /// This field may not be present for older exclusions.
  public var createTime: GoogleCloudWkt.Timestamp? = nil

  /// Output only. The last update timestamp of the exclusion.
  ///
  /// This field may not be present for older exclusions.
  public var updateTime: GoogleCloudWkt.Timestamp? = nil

  /// Initialize a new instance of `LogExclusion`.
  public init() {}

  /// Use `config` to return a new instance of this object, with some fields updated.
  ///
  /// Commonly used to initialize the value, for example:
  ///
  /// ```
  /// let value = LogExclusion().with { $0.name = ... }
  /// ```
  public func with(_ config: (inout Self) throws -> Swift.Void) rethrows -> Self {
    var copy = self
    try config(&copy)
    return copy
  }

  public static var _anyTypeUrl: Swift.String {
    return "type.googleapis.com/google.logging.v2.LogExclusion"
  }
  public init(fromAny any: GoogleCloudWkt.`Any`) throws {
    self = try GoogleCloudWkt._slowAnyDeserialize(Self.self, from: any)
  }
  public func _pack() throws -> GoogleCloudWkt.Struct {
    return try GoogleCloudWkt._slowAnySerialize(message: self)
  }
}
