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

/// Represents the metadata of the long-running operation.
public struct OperationMetadata: Codable, Equatable, GoogleCloudWkt._AnyPackable,
  Sendable
{
  /// Output only. The time the operation was created.
  public var createTime: GoogleCloudWkt.Timestamp? = nil

  /// Output only. The time the operation finished running.
  public var endTime: GoogleCloudWkt.Timestamp? = nil

  /// Output only. Server-defined resource path for the target of the operation.
  public var target: Swift.String = Swift.String()

  /// Output only. Name of the verb executed by the operation.
  public var verb: Swift.String = Swift.String()

  /// Output only. Human-readable status of the operation, if any.
  public var statusMessage: Swift.String = Swift.String()

  /// Output only. Identifies whether the user has requested cancellation
  /// of the operation. Operations that have successfully been cancelled
  /// have
  /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
  /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
  /// corresponding to `Code.CANCELLED`.
  ///
  /// [google.longrunning.Operation.error]: https://www.google.com/search?q=Swift+google.longrunning+GoogleLongRunning.Operation/error
  /// [google.rpc.Status.code]: https://www.google.com/search?q=Swift+google.rpc+GoogleRpc.Status/code
  public var requestedCancellation: Swift.Bool = Swift.Bool()

  /// Output only. API version used to start the operation.
  public var apiVersion: Swift.String = Swift.String()

  /// Initialize a new instance of `OperationMetadata`.
  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 = OperationMetadata().with { $0.createTime = ... }
  /// ```
  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.cloud.batch.v1.OperationMetadata"
  }
  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)
  }
}
