// 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 color information of a [Product][google.cloud.retail.v2.Product].
///
/// [google.cloud.retail.v2.Product]: <doc:Product>
public struct ColorInfo: Codable, Equatable, GoogleCloudWkt._AnyPackable,
  Sendable
{
  /// The standard color families. Strongly recommended to use the following
  /// standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
  /// "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and "Mixed".
  /// Normally it is expected to have only 1 color family. May consider using
  /// single "Mixed" instead of multiple values.
  ///
  /// A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
  /// string with a length limit of 128 characters. Otherwise, an
  /// INVALID_ARGUMENT error is returned.
  ///
  /// Google Merchant Center property
  /// [color](https://support.google.com/merchants/answer/6324487). Schema.org
  /// property [Product.color](https://schema.org/color).
  ///
  /// The colorFamilies field as a system attribute is not a required field but
  /// strongly recommended to be specified. Google Search models treat this field
  /// as more important than a custom product attribute when specified.
  public var colorFamilies: [Swift.String] = []

  /// The color display names, which may be different from standard color family
  /// names, such as the color aliases used in the website frontend. Normally
  /// it is expected to have only 1 color. May consider using single "Mixed"
  /// instead of multiple values.
  ///
  /// A maximum of 75 colors are allowed. Each value must be a UTF-8 encoded
  /// string with a length limit of 128 characters. Otherwise, an
  /// INVALID_ARGUMENT error is returned.
  ///
  /// Google Merchant Center property
  /// [color](https://support.google.com/merchants/answer/6324487). Schema.org
  /// property [Product.color](https://schema.org/color).
  public var colors: [Swift.String] = []

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