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

#if SqlInstancesService
  import Foundation
  import GoogleCloudWkt

  /// Database instance restore backup request.
  public struct InstancesRestoreBackupRequest: Codable, Equatable, GoogleCloudWkt._AnyPackable,
    Sendable
  {
    /// Parameters required to perform the restore backup operation.
    public var restoreBackupContext: RestoreBackupContext? = nil

    /// The name of the backup that's used to restore a Cloud SQL instance:
    /// Format:  projects/{project-id}/backups/{backup-uid}. Only one of
    /// restore_backup_context, backup, backupdr_backup can be passed to the input.
    public var backup: Swift.String = Swift.String()

    /// The name of the backup that's used to restore a Cloud SQL instance:
    /// Format:
    /// "projects/{project-id}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup-uid}".
    /// Only one of restore_backup_context, backup, backupdr_backup can be
    /// passed to the input.
    public var backupdrBackup: Swift.String = Swift.String()

    /// Optional. By using this parameter, Cloud SQL overrides any instance
    /// settings stored in the backup you are restoring from. You can't change the
    /// instance's major database version and you can only increase the disk size.
    /// You can use this field to restore new instances only. This field is not
    /// applicable for restore to existing instances.
    public var restoreInstanceSettings: DatabaseInstance? = nil

    /// Optional. This field has the same purpose as restore_instance_settings,
    /// changes any instance settings stored in the backup you are restoring from.
    /// With the difference that these fields are cleared in the settings.
    public var restoreInstanceClearOverridesFieldNames: [Swift.String] = []

    /// Initialize a new instance of `InstancesRestoreBackupRequest`.
    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 = InstancesRestoreBackupRequest().with { $0.restoreBackupContext = ... }
    /// ```
    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.sql.v1.InstancesRestoreBackupRequest"
    }
    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)
    }
  }
#endif
