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

/// Defines RPO scheduling configuration for automatically creating
/// Backups via this BackupPlan.
public struct RpoConfig: Codable, Equatable, GoogleCloudWkt._AnyPackable,
  Sendable
{
  /// Required. Defines the target RPO for the BackupPlan in minutes, which means
  /// the target maximum data loss in time that is acceptable for this
  /// BackupPlan. This must be at least 60, i.e., 1 hour, and at most 86400,
  /// i.e., 60 days.
  public var targetRpoMinutes: Swift.Int32 = Swift.Int32()

  /// Optional. User specified time windows during which backup can NOT happen
  /// for this BackupPlan - backups should start and finish outside of any given
  /// exclusion window. Note: backup jobs will be scheduled to start and
  /// finish outside the duration of the window as much as possible, but
  /// running jobs will not get canceled when it runs into the window.
  /// All the time and date values in exclusion_windows entry in the API are in
  /// UTC.
  /// We only allow <=1 recurrence (daily or weekly) exclusion window for a
  /// BackupPlan while no restriction on number of single occurrence
  /// windows.
  public var exclusionWindows: [ExclusionWindow] = []

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