# 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.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2ExternalSystem do
  @moduledoc """
  Representation of third party SIEM/SOAR fields within SCC.

  ## Attributes

  *   `assignees` (*type:* `list(String.t)`, *default:* `nil`) - References primary/secondary etc assignees in the external system.
  *   `caseCloseTime` (*type:* `DateTime.t`, *default:* `nil`) - The time when the case was closed, as reported by the external system.
  *   `caseCreateTime` (*type:* `DateTime.t`, *default:* `nil`) - The time when the case was created, as reported by the external system.
  *   `casePriority` (*type:* `String.t`, *default:* `nil`) - The priority of the finding's corresponding case in the external system.
  *   `caseSla` (*type:* `DateTime.t`, *default:* `nil`) - The SLA of the finding's corresponding case in the external system.
  *   `caseUri` (*type:* `String.t`, *default:* `nil`) - The link to the finding's corresponding case in the external system.
  *   `externalSystemUpdateTime` (*type:* `DateTime.t`, *default:* `nil`) - The time when the case was last updated, as reported by the external system.
  *   `externalUid` (*type:* `String.t`, *default:* `nil`) - The identifier that's used to track the finding's corresponding case in the external system.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Full resource name of the external system. The following list shows some examples: + `organizations/1234/sources/5678/findings/123456/externalSystems/jira` + `organizations/1234/sources/5678/locations/us/findings/123456/externalSystems/jira` + `folders/1234/sources/5678/findings/123456/externalSystems/jira` + `folders/1234/sources/5678/locations/us/findings/123456/externalSystems/jira` + `projects/1234/sources/5678/findings/123456/externalSystems/jira` + `projects/1234/sources/5678/locations/us/findings/123456/externalSystems/jira`
  *   `status` (*type:* `String.t`, *default:* `nil`) - The most recent status of the finding's corresponding case, as reported by the external system.
  *   `ticketInfo` (*type:* `GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2TicketInfo.t`, *default:* `nil`) - Information about the ticket, if any, that is being used to track the resolution of the issue that is identified by this finding.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :assignees => list(String.t()) | nil,
          :caseCloseTime => DateTime.t() | nil,
          :caseCreateTime => DateTime.t() | nil,
          :casePriority => String.t() | nil,
          :caseSla => DateTime.t() | nil,
          :caseUri => String.t() | nil,
          :externalSystemUpdateTime => DateTime.t() | nil,
          :externalUid => String.t() | nil,
          :name => String.t() | nil,
          :status => String.t() | nil,
          :ticketInfo =>
            GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2TicketInfo.t() | nil
        }

  field(:assignees, type: :list)
  field(:caseCloseTime, as: DateTime)
  field(:caseCreateTime, as: DateTime)
  field(:casePriority)
  field(:caseSla, as: DateTime)
  field(:caseUri)
  field(:externalSystemUpdateTime, as: DateTime)
  field(:externalUid)
  field(:name)
  field(:status)
  field(:ticketInfo, as: GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2TicketInfo)
end

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

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