lib/google_api/drive/v3/model/change.ex

# 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.Drive.V3.Model.Change do
  @moduledoc """
  A change to a file or shared drive.

  ## Attributes

  *   `changeType` (*type:* `String.t`, *default:* `nil`) - The type of the change. Possible values are file and drive.
  *   `drive` (*type:* `GoogleApi.Drive.V3.Model.Drive.t`, *default:* `nil`) - The updated state of the shared drive. Present if the changeType is drive, the user is still a member of the shared drive, and the shared drive has not been deleted.
  *   `driveId` (*type:* `String.t`, *default:* `nil`) - The ID of the shared drive associated with this change.
  *   `file` (*type:* `GoogleApi.Drive.V3.Model.File.t`, *default:* `nil`) - The updated state of the file. Present if the type is file and the file has not been removed from this list of changes.
  *   `fileId` (*type:* `String.t`, *default:* `nil`) - The ID of the file which has changed.
  *   `kind` (*type:* `String.t`, *default:* `drive#change`) - Identifies what kind of resource this is. Value: the fixed string "drive#change".
  *   `removed` (*type:* `boolean()`, *default:* `nil`) - Whether the file or shared drive has been removed from this list of changes, for example by deletion or loss of access.
  *   `teamDrive` (*type:* `GoogleApi.Drive.V3.Model.TeamDrive.t`, *default:* `nil`) - Deprecated - use drive instead.
  *   `teamDriveId` (*type:* `String.t`, *default:* `nil`) - Deprecated - use driveId instead.
  *   `time` (*type:* `DateTime.t`, *default:* `nil`) - The time of this change (RFC 3339 date-time).
  *   `type` (*type:* `String.t`, *default:* `nil`) - Deprecated - use changeType instead.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :changeType => String.t() | nil,
          :drive => GoogleApi.Drive.V3.Model.Drive.t() | nil,
          :driveId => String.t() | nil,
          :file => GoogleApi.Drive.V3.Model.File.t() | nil,
          :fileId => String.t() | nil,
          :kind => String.t() | nil,
          :removed => boolean() | nil,
          :teamDrive => GoogleApi.Drive.V3.Model.TeamDrive.t() | nil,
          :teamDriveId => String.t() | nil,
          :time => DateTime.t() | nil,
          :type => String.t() | nil
        }

  field(:changeType)
  field(:drive, as: GoogleApi.Drive.V3.Model.Drive)
  field(:driveId)
  field(:file, as: GoogleApi.Drive.V3.Model.File)
  field(:fileId)
  field(:kind)
  field(:removed)
  field(:teamDrive, as: GoogleApi.Drive.V3.Model.TeamDrive)
  field(:teamDriveId)
  field(:time, as: DateTime)
  field(:type)
end

defimpl Poison.Decoder, for: GoogleApi.Drive.V3.Model.Change do
  def decode(value, options) do
    GoogleApi.Drive.V3.Model.Change.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Drive.V3.Model.Change do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end