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

/// Information related to the source system of the data resource that is
/// represented by the entry.
public struct EntrySource: Codable, Equatable, GoogleCloudWkt._AnyPackable,
  Sendable
{
  /// The name of the resource in the source system.
  /// Maximum length is 4,000 characters.
  public var resource: Swift.String = Swift.String()

  /// The name of the source system.
  /// Maximum length is 64 characters.
  public var system: Swift.String = Swift.String()

  /// The platform containing the source system.
  /// Maximum length is 64 characters.
  public var platform: Swift.String = Swift.String()

  /// A user-friendly display name.
  /// Maximum length is 500 characters.
  public var displayName: Swift.String = Swift.String()

  /// A description of the data resource.
  /// Maximum length is 2,000 characters.
  public var description: Swift.String = Swift.String()

  /// User-defined labels.
  /// The maximum size of keys and values is 128 characters each.
  public var labels: [Swift.String: Swift.String] = [:]

  /// Immutable. The entries representing the ancestors of the data resource in
  /// the source system.
  public var ancestors: [EntrySource.Ancestor] = []

  /// The time when the resource was created in the source system.
  public var createTime: GoogleCloudWkt.Timestamp? = nil

  /// The time when the resource was last updated in the source system. If the
  /// entry exists in the system and its `EntrySource` has `update_time`
  /// populated, further updates to the `EntrySource` of the entry must provide
  /// incremental updates to its `update_time`.
  public var updateTime: GoogleCloudWkt.Timestamp? = nil

  /// Output only. Location of the resource in the source system. You can search
  /// the entry by this location. By default, this should match the location of
  /// the entry group containing this entry. A different value allows capturing
  /// the source location for data external to Google Cloud.
  public var location: Swift.String = Swift.String()

  /// Initialize a new instance of `EntrySource`.
  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 = EntrySource().with { $0.resource = ... }
  /// ```
  public func with(_ config: (inout Self) throws -> Swift.Void) rethrows -> Self {
    var copy = self
    try config(&copy)
    return copy
  }

  /// Information about individual items in the hierarchy that is associated with
  /// the data resource.
  public struct Ancestor: Codable, Equatable, GoogleCloudWkt._AnyPackable,
    Sendable
  {
    /// Optional. The name of the ancestor resource.
    public var name: Swift.String = Swift.String()

    /// Optional. The type of the ancestor resource.
    public var type: Swift.String = Swift.String()

    /// Initialize a new instance of `Ancestor`.
    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 = Ancestor().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.cloud.dataplex.v1.EntrySource.Ancestor"
    }
    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)
    }
  }

  public static var _anyTypeUrl: Swift.String {
    return "type.googleapis.com/google.cloud.dataplex.v1.EntrySource"
  }
  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)
  }
}
