# 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.SQLAdmin.V1.Model.BackupRun do
  @moduledoc """
  A BackupRun resource.

  ## Attributes

  *   `backupKind` (*type:* `String.t`, *default:* `nil`) - Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
  *   `databaseVersion` (*type:* `String.t`, *default:* `nil`) - Output only. The instance database version when this backup was made.
  *   `description` (*type:* `String.t`, *default:* `nil`) - The description of this run, only applicable to on-demand backups.
  *   `diskEncryptionConfiguration` (*type:* `GoogleApi.SQLAdmin.V1.Model.DiskEncryptionConfiguration.t`, *default:* `nil`) - Encryption configuration specific to a backup.
  *   `diskEncryptionStatus` (*type:* `GoogleApi.SQLAdmin.V1.Model.DiskEncryptionStatus.t`, *default:* `nil`) - Encryption status specific to a backup.
  *   `endTime` (*type:* `DateTime.t`, *default:* `nil`) - The time the backup operation completed in UTC timezone in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example `2012-11-15T16:19:00.094Z`.
  *   `enqueuedTime` (*type:* `DateTime.t`, *default:* `nil`) - The time the run was enqueued in UTC timezone in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example `2012-11-15T16:19:00.094Z`.
  *   `error` (*type:* `GoogleApi.SQLAdmin.V1.Model.OperationError.t`, *default:* `nil`) - Information about why the backup operation failed. This is only present if the run has the FAILED status.
  *   `id` (*type:* `String.t`, *default:* `nil`) - The identifier for this backup run. Unique only for a specific Cloud SQL instance.
  *   `instance` (*type:* `String.t`, *default:* `nil`) - Name of the database instance.
  *   `kind` (*type:* `String.t`, *default:* `nil`) - This is always `sql#backupRun`.
  *   `location` (*type:* `String.t`, *default:* `nil`) - Location of the backups.
  *   `maxChargeableBytes` (*type:* `String.t`, *default:* `nil`) - Output only. The maximum chargeable bytes for the backup.
  *   `selfLink` (*type:* `String.t`, *default:* `nil`) - The URI of this resource.
  *   `startTime` (*type:* `DateTime.t`, *default:* `nil`) - The time the backup operation actually started in UTC timezone in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example `2012-11-15T16:19:00.094Z`.
  *   `status` (*type:* `String.t`, *default:* `nil`) - The status of this run.
  *   `timeZone` (*type:* `String.t`, *default:* `nil`) - Backup time zone to prevent restores to an instance with a different time zone. Now relevant only for SQL Server.
  *   `type` (*type:* `String.t`, *default:* `nil`) - The type of this run; can be either "AUTOMATED" or "ON_DEMAND" or "FINAL". This field defaults to "ON_DEMAND" and is ignored, when specified for insert requests.
  *   `windowStartTime` (*type:* `DateTime.t`, *default:* `nil`) - The start time of the backup window during which this the backup was attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example `2012-11-15T16:19:00.094Z`.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :backupKind => String.t() | nil,
          :databaseVersion => String.t() | nil,
          :description => String.t() | nil,
          :diskEncryptionConfiguration =>
            GoogleApi.SQLAdmin.V1.Model.DiskEncryptionConfiguration.t() | nil,
          :diskEncryptionStatus => GoogleApi.SQLAdmin.V1.Model.DiskEncryptionStatus.t() | nil,
          :endTime => DateTime.t() | nil,
          :enqueuedTime => DateTime.t() | nil,
          :error => GoogleApi.SQLAdmin.V1.Model.OperationError.t() | nil,
          :id => String.t() | nil,
          :instance => String.t() | nil,
          :kind => String.t() | nil,
          :location => String.t() | nil,
          :maxChargeableBytes => String.t() | nil,
          :selfLink => String.t() | nil,
          :startTime => DateTime.t() | nil,
          :status => String.t() | nil,
          :timeZone => String.t() | nil,
          :type => String.t() | nil,
          :windowStartTime => DateTime.t() | nil
        }

  field(:backupKind)
  field(:databaseVersion)
  field(:description)
  field(:diskEncryptionConfiguration, as: GoogleApi.SQLAdmin.V1.Model.DiskEncryptionConfiguration)
  field(:diskEncryptionStatus, as: GoogleApi.SQLAdmin.V1.Model.DiskEncryptionStatus)
  field(:endTime, as: DateTime)
  field(:enqueuedTime, as: DateTime)
  field(:error, as: GoogleApi.SQLAdmin.V1.Model.OperationError)
  field(:id)
  field(:instance)
  field(:kind)
  field(:location)
  field(:maxChargeableBytes)
  field(:selfLink)
  field(:startTime, as: DateTime)
  field(:status)
  field(:timeZone)
  field(:type)
  field(:windowStartTime, as: DateTime)
end

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

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