# 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.Storage.V1.Model.BulkRestoreObjectsRequest do
  @moduledoc """
  A bulk restore objects request.

  ## Attributes

  *   `allowOverwrite` (*type:* `boolean()`, *default:* `nil`) - If false (default), the restore will not overwrite live objects with the same name at the destination. This means some deleted objects may be skipped. If true, live objects will be overwritten resulting in a noncurrent object (if versioning is enabled). If versioning is not enabled, overwriting the object will result in a soft-deleted object. In either case, if a noncurrent object already exists with the same name, a live version can be written without issue.
  *   `copySourceAcl` (*type:* `boolean()`, *default:* `nil`) - If true, copies the source object's ACL; otherwise, uses the bucket's default object ACL. The default is false.
  *   `matchGlobs` (*type:* `list(String.t)`, *default:* `nil`) - Restores only the objects matching any of the specified glob(s). If this parameter is not specified, all objects will be restored within the specified time range.
  *   `softDeletedAfterTime` (*type:* `DateTime.t`, *default:* `nil`) - Restores only the objects that were soft-deleted after this time.
  *   `softDeletedBeforeTime` (*type:* `DateTime.t`, *default:* `nil`) - Restores only the objects that were soft-deleted before this time.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :allowOverwrite => boolean() | nil,
          :copySourceAcl => boolean() | nil,
          :matchGlobs => list(String.t()) | nil,
          :softDeletedAfterTime => DateTime.t() | nil,
          :softDeletedBeforeTime => DateTime.t() | nil
        }

  field(:allowOverwrite)
  field(:copySourceAcl)
  field(:matchGlobs, type: :list)
  field(:softDeletedAfterTime, as: DateTime)
  field(:softDeletedBeforeTime, as: DateTime)
end

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

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