// 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 GoogleApi
import GoogleCloudWkt

/// The configuration of the service.
public struct ServiceConfig: Codable, Equatable, GoogleCloudWkt._AnyPackable,
  Sendable
{
  /// The DNS address at which this service is available.
  ///
  /// An example DNS address would be:
  /// `calendar.googleapis.com`.
  public var name: Swift.String = Swift.String()

  /// The product title for this service.
  public var title: Swift.String = Swift.String()

  /// A list of API interfaces exported by this service. Contains only the names,
  /// versions, and method names of the interfaces.
  public var apis: [GoogleCloudWkt.Api] = []

  /// Additional API documentation. Contains only the summary and the
  /// documentation URL.
  public var documentation: GoogleApi.Documentation? = nil

  /// Quota configuration.
  public var quota: GoogleApi.Quota? = nil

  /// Auth configuration. Contains only the OAuth rules.
  public var authentication: GoogleApi.Authentication? = nil

  /// Configuration controlling usage of this service.
  public var usage: GoogleApi.Usage? = nil

  /// Configuration for network endpoints. Contains only the names and aliases
  /// of the endpoints.
  public var endpoints: [GoogleApi.Endpoint] = []

  /// Defines the monitored resources used by this service. This is required
  /// by the [Service.monitoring][google.api.Service.monitoring] and
  /// [Service.logging][google.api.Service.logging] configurations.
  public var monitoredResources: [GoogleApi.MonitoredResourceDescriptor] = []

  /// Monitoring configuration.
  /// This should not include the 'producer_destinations' field.
  public var monitoring: GoogleApi.Monitoring? = nil

  /// Initialize a new instance of `ServiceConfig`.
  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 = ServiceConfig().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.api.serviceusage.v1.ServiceConfig"
  }
  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)
  }
}
