// 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

/// The parameters to `UpdateSink`.
public struct UpdateSinkRequest: Codable, Equatable, GoogleCloudWkt._AnyPackable,
  Sendable
{
  /// 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"`
  public var sinkName: Swift.String = Swift.String()

  /// Required. The updated sink, whose name is the same identifier that appears
  /// as part of `sink_name`.
  public var sink: LogSink? = nil

  /// Optional. See [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink]
  /// 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 unique service account.
  /// +   It is an error if the old value is true and the new value is
  ///     set to false or defaulted to false.
  ///
  /// [google.logging.v2.ConfigServiceV2.CreateSink]: <doc:ConfigServiceV2/createSink(request:)>
  public var uniqueWriterIdentity: Swift.Bool = Swift.Bool()

  /// 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,includeChildren`
  ///
  /// At 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.FieldMask
  ///
  /// For example: `updateMask=filter`
  public var updateMask: GoogleCloudWkt.FieldMask? = nil

  /// Initialize a new instance of `UpdateSinkRequest`.
  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 = UpdateSinkRequest().with { $0.sinkName = ... }
  /// ```
  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.UpdateSinkRequest"
  }
  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)
  }
}
