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

/// App Engine Routing.
///
/// For more information about services, versions, and instances see
/// [An Overview of App
/// Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
/// [Microservices Architecture on Google App
/// Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
/// [App Engine Standard request
/// routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
/// and [App Engine Flex request
/// routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
public struct AppEngineRouting: Codable, Equatable, GoogleCloudWkt._AnyPackable,
  Sendable
{
  /// App service.
  ///
  /// By default, the job is sent to the service which is the default
  /// service when the job is attempted.
  public var service: Swift.String = Swift.String()

  /// App version.
  ///
  /// By default, the job is sent to the version which is the default
  /// version when the job is attempted.
  public var version: Swift.String = Swift.String()

  /// App instance.
  ///
  /// By default, the job is sent to an instance which is available when
  /// the job is attempted.
  ///
  /// Requests can only be sent to a specific instance if
  /// [manual scaling is used in App Engine
  /// Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?#scaling_types_and_instance_classes).
  /// App Engine Flex does not support instances. For more information, see
  /// [App Engine Standard request
  /// routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
  /// and [App Engine Flex request
  /// routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
  public var instance: Swift.String = Swift.String()

  /// Output only. The host that the job is sent to.
  ///
  /// For more information about how App Engine requests are routed, see
  /// [here](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
  ///
  /// The host is constructed as:
  ///
  ///
  /// * `host = [application_domain_name]`</br>
  ///   `| [service] + '.' + [application_domain_name]`</br>
  ///   `| [version] + '.' + [application_domain_name]`</br>
  ///   `| [version_dot_service]+ '.' + [application_domain_name]`</br>
  ///   `| [instance] + '.' + [application_domain_name]`</br>
  ///   `| [instance_dot_service] + '.' + [application_domain_name]`</br>
  ///   `| [instance_dot_version] + '.' + [application_domain_name]`</br>
  ///   `| [instance_dot_version_dot_service] + '.' + [application_domain_name]`
  ///
  /// * `application_domain_name` = The domain name of the app, for
  ///   example <app-id>.appspot.com, which is associated with the
  ///   job's project ID.
  ///
  /// * `service =` [service][google.cloud.scheduler.v1.AppEngineRouting.service]
  ///
  /// * `version =` [version][google.cloud.scheduler.v1.AppEngineRouting.version]
  ///
  /// * `version_dot_service =`
  ///   [version][google.cloud.scheduler.v1.AppEngineRouting.version] `+ '.' +`
  ///   [service][google.cloud.scheduler.v1.AppEngineRouting.service]
  ///
  /// * `instance =`
  /// [instance][google.cloud.scheduler.v1.AppEngineRouting.instance]
  ///
  /// * `instance_dot_service =`
  ///   [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] `+ '.' +`
  ///   [service][google.cloud.scheduler.v1.AppEngineRouting.service]
  ///
  /// * `instance_dot_version =`
  ///   [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] `+ '.' +`
  ///   [version][google.cloud.scheduler.v1.AppEngineRouting.version]
  ///
  /// * `instance_dot_version_dot_service =`
  ///   [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] `+ '.' +`
  ///   [version][google.cloud.scheduler.v1.AppEngineRouting.version] `+ '.' +`
  ///   [service][google.cloud.scheduler.v1.AppEngineRouting.service]
  ///
  ///
  /// If [service][google.cloud.scheduler.v1.AppEngineRouting.service] is empty,
  /// then the job will be sent to the service which is the default service when
  /// the job is attempted.
  ///
  /// If [version][google.cloud.scheduler.v1.AppEngineRouting.version] is empty,
  /// then the job will be sent to the version which is the default version when
  /// the job is attempted.
  ///
  /// If [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] is
  /// empty, then the job will be sent to an instance which is available when the
  /// job is attempted.
  ///
  /// If [service][google.cloud.scheduler.v1.AppEngineRouting.service],
  /// [version][google.cloud.scheduler.v1.AppEngineRouting.version], or
  /// [instance][google.cloud.scheduler.v1.AppEngineRouting.instance] is invalid,
  /// then the job will be sent to the default version of the default service
  /// when the job is attempted.
  ///
  /// [google.cloud.scheduler.v1.AppEngineRouting.instance]: <doc:AppEngineRouting/instance>
  /// [google.cloud.scheduler.v1.AppEngineRouting.service]: <doc:AppEngineRouting/service>
  /// [google.cloud.scheduler.v1.AppEngineRouting.version]: <doc:AppEngineRouting/version>
  public var host: Swift.String = Swift.String()

  /// Initialize a new instance of `AppEngineRouting`.
  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 = AppEngineRouting().with { $0.service = ... }
  /// ```
  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.scheduler.v1.AppEngineRouting"
  }
  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)
  }
}
