# Copyright 2019 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
#
#     http://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.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.GKEBackup.V1.Model.Schedule do
  @moduledoc """
  Defines scheduling parameters for automatically creating Backups via this BackupPlan.

  ## Attributes

  *   `cronSchedule` (*type:* `String.t`, *default:* `nil`) - Optional. A standard [cron](https://wikipedia.com/wiki/cron) string that defines a repeating schedule for creating Backups via this BackupPlan. This is mutually exclusive with the rpo_config field since at most one schedule can be defined for a BackupPlan. If this is defined, then backup_retain_days must also be defined. Default (empty): no automatic backup creation will occur.
  *   `nextScheduledBackupTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Start time of next scheduled backup under this BackupPlan by either cron_schedule or rpo config.
  *   `paused` (*type:* `boolean()`, *default:* `nil`) - Optional. This flag denotes whether automatic Backup creation is paused for this BackupPlan. Default: False
  *   `rpoConfig` (*type:* `GoogleApi.GKEBackup.V1.Model.RpoConfig.t`, *default:* `nil`) - Optional. Defines the RPO schedule configuration for this BackupPlan. This is mutually exclusive with the cron_schedule field since at most one schedule can be defined for a BackupPLan. If this is defined, then backup_retain_days must also be defined. Default (empty): no automatic backup creation will occur.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :cronSchedule => String.t() | nil,
          :nextScheduledBackupTime => DateTime.t() | nil,
          :paused => boolean() | nil,
          :rpoConfig => GoogleApi.GKEBackup.V1.Model.RpoConfig.t() | nil
        }

  field(:cronSchedule)
  field(:nextScheduledBackupTime, as: DateTime)
  field(:paused)
  field(:rpoConfig, as: GoogleApi.GKEBackup.V1.Model.RpoConfig)
end

defimpl Poison.Decoder, for: GoogleApi.GKEBackup.V1.Model.Schedule do
  def decode(value, options) do
    GoogleApi.GKEBackup.V1.Model.Schedule.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.GKEBackup.V1.Model.Schedule do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
