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

/// Custom attribute values that are either filterable or non-filterable.
public struct CustomAttribute: Codable, Equatable, GoogleCloudWkt._AnyPackable,
  Sendable
{
  /// Exactly one of
  /// [string_values][google.cloud.talent.v4.CustomAttribute.string_values] or
  /// [long_values][google.cloud.talent.v4.CustomAttribute.long_values] must be
  /// specified.
  ///
  /// This field is used to perform a string match (`CASE_SENSITIVE_MATCH` or
  /// `CASE_INSENSITIVE_MATCH`) search.
  /// For filterable `string_value`s, a maximum total number of 200 values
  /// is allowed, with each `string_value` has a byte size of no more than
  /// 500B. For unfilterable `string_values`, the maximum total byte size of
  /// unfilterable `string_values` is 50KB.
  ///
  /// Empty string isn't allowed.
  ///
  /// [google.cloud.talent.v4.CustomAttribute.long_values]: <doc:CustomAttribute/longValues>
  /// [google.cloud.talent.v4.CustomAttribute.string_values]: <doc:CustomAttribute/stringValues>
  public var stringValues: [Swift.String] = []

  /// Exactly one of
  /// [string_values][google.cloud.talent.v4.CustomAttribute.string_values] or
  /// [long_values][google.cloud.talent.v4.CustomAttribute.long_values] must be
  /// specified.
  ///
  /// This field is used to perform number range search.
  /// (`EQ`, `GT`, `GE`, `LE`, `LT`) over filterable `long_value`.
  ///
  /// Currently at most 1
  /// [long_values][google.cloud.talent.v4.CustomAttribute.long_values] is
  /// supported.
  ///
  /// [google.cloud.talent.v4.CustomAttribute.long_values]: <doc:CustomAttribute/longValues>
  /// [google.cloud.talent.v4.CustomAttribute.string_values]: <doc:CustomAttribute/stringValues>
  public var longValues: [Swift.Int64] = []

  /// If the `filterable` flag is true, the custom field values may be used for
  /// custom attribute filters
  /// [JobQuery.custom_attribute_filter][google.cloud.talent.v4.JobQuery.custom_attribute_filter].
  /// If false, these values may not be used for custom attribute filters.
  ///
  /// Default is false.
  ///
  /// [google.cloud.talent.v4.JobQuery.custom_attribute_filter]: <doc:JobQuery/customAttributeFilter>
  public var filterable: Swift.Bool = Swift.Bool()

  /// If the `keyword_searchable` flag is true, the keywords in custom fields are
  /// searchable by keyword match.
  /// If false, the values are not searchable by keyword match.
  ///
  /// Default is false.
  public var keywordSearchable: Swift.Bool = Swift.Bool()

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