# 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.GKEHub.V1.Model.ConfigManagementSyncState do
  @moduledoc """
  State indicating an ACM's progress syncing configurations to a cluster

  ## Attributes

  *   `code` (*type:* `String.t`, *default:* `nil`) - Sync status code
  *   `errors` (*type:* `list(GoogleApi.GKEHub.V1.Model.ConfigManagementSyncError.t)`, *default:* `nil`) - A list of errors resulting from problematic configs. This list will be truncated after 100 errors, although it is unlikely for that many errors to simultaneously exist.
  *   `importToken` (*type:* `String.t`, *default:* `nil`) - Token indicating the state of the importer.
  *   `lastSync` (*type:* `String.t`, *default:* `nil`) - Deprecated: use last_sync_time instead. Timestamp of when ACM last successfully synced the repo The time format is specified in https://golang.org/pkg/time/#Time.String
  *   `lastSyncTime` (*type:* `DateTime.t`, *default:* `nil`) - Timestamp type of when ACM last successfully synced the repo
  *   `sourceToken` (*type:* `String.t`, *default:* `nil`) - Token indicating the state of the repo.
  *   `syncToken` (*type:* `String.t`, *default:* `nil`) - Token indicating the state of the syncer.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :code => String.t() | nil,
          :errors => list(GoogleApi.GKEHub.V1.Model.ConfigManagementSyncError.t()) | nil,
          :importToken => String.t() | nil,
          :lastSync => String.t() | nil,
          :lastSyncTime => DateTime.t() | nil,
          :sourceToken => String.t() | nil,
          :syncToken => String.t() | nil
        }

  field(:code)
  field(:errors, as: GoogleApi.GKEHub.V1.Model.ConfigManagementSyncError, type: :list)
  field(:importToken)
  field(:lastSync)
  field(:lastSyncTime, as: DateTime)
  field(:sourceToken)
  field(:syncToken)
end

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

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