# 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.Folder do
  @moduledoc """
  A folder. Only available in buckets with hierarchical namespace enabled.

  ## Attributes

  *   `bucket` (*type:* `String.t`, *default:* `nil`) - The name of the bucket containing this folder.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - The creation time of the folder in RFC 3339 format.
  *   `id` (*type:* `String.t`, *default:* `nil`) - The ID of the folder, including the bucket name, folder name.
  *   `kind` (*type:* `String.t`, *default:* `storage#folder`) - The kind of item this is. For folders, this is always storage#folder.
  *   `metageneration` (*type:* `String.t`, *default:* `nil`) - The version of the metadata for this folder. Used for preconditions and for detecting changes in metadata.
  *   `name` (*type:* `String.t`, *default:* `nil`) - The name of the folder. Required if not specified by URL parameter.
  *   `pendingRenameInfo` (*type:* `GoogleApi.Storage.V1.Model.FolderPendingRenameInfo.t`, *default:* `nil`) - Only present if the folder is part of an ongoing rename folder operation. Contains information which can be used to query the operation status.
  *   `selfLink` (*type:* `String.t`, *default:* `nil`) - The link to this folder.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - The modification time of the folder metadata in RFC 3339 format.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :bucket => String.t() | nil,
          :createTime => DateTime.t() | nil,
          :id => String.t() | nil,
          :kind => String.t() | nil,
          :metageneration => String.t() | nil,
          :name => String.t() | nil,
          :pendingRenameInfo => GoogleApi.Storage.V1.Model.FolderPendingRenameInfo.t() | nil,
          :selfLink => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:bucket)
  field(:createTime, as: DateTime)
  field(:id)
  field(:kind)
  field(:metageneration)
  field(:name)
  field(:pendingRenameInfo, as: GoogleApi.Storage.V1.Model.FolderPendingRenameInfo)
  field(:selfLink)
  field(:updateTime, as: DateTime)
end

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

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