# 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.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaTemplate do
  @moduledoc """
  Defines the template for Application Integration

  ## Attributes

  *   `author` (*type:* `String.t`, *default:* `nil`) - Optional. Creator of the template.
  *   `categories` (*type:* `list(String.t)`, *default:* `nil`) - Required. Categories associated with the Template. The categories listed below will be utilized for the Template listing.
  *   `components` (*type:* `list(GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaTemplateComponent.t)`, *default:* `nil`) - Optional. Components being used in the template. This could be used to categorize and filter.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Auto-generated.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Optional. Description of the template. The length should not be more than 255 characters
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - Required. The name of the template
  *   `docLink` (*type:* `String.t`, *default:* `nil`) - Optional. Link to template documentation.
  *   `lastUsedTime` (*type:* `DateTime.t`, *default:* `nil`) - Optional. Time the template was last used.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Identifier. Resource name of the template.
  *   `sharedWith` (*type:* `list(String.t)`, *default:* `nil`) - Required. Resource names with which the template is shared for example ProjectNumber/Ord id
  *   `tags` (*type:* `list(String.t)`, *default:* `nil`) - Required. Tags which are used to identify templates. These tags could be for business use case, connectors etc.
  *   `templateBundle` (*type:* `GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaTemplateBundle.t`, *default:* `nil`) - Required. Bundle which is part of the templates. The template entities in the bundle would be converted to an actual entity.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Auto-generated
  *   `usageCount` (*type:* `String.t`, *default:* `nil`) - Optional. Number of template usages.
  *   `usageInfo` (*type:* `String.t`, *default:* `nil`) - Optional. Information on how to use the template. This should contain detailed information about usage of the template.
  *   `visibility` (*type:* `String.t`, *default:* `nil`) - Required. Visibility of the template.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :author => String.t() | nil,
          :categories => list(String.t()) | nil,
          :components =>
            list(
              GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaTemplateComponent.t()
            )
            | nil,
          :createTime => DateTime.t() | nil,
          :description => String.t() | nil,
          :displayName => String.t() | nil,
          :docLink => String.t() | nil,
          :lastUsedTime => DateTime.t() | nil,
          :name => String.t() | nil,
          :sharedWith => list(String.t()) | nil,
          :tags => list(String.t()) | nil,
          :templateBundle =>
            GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaTemplateBundle.t() | nil,
          :updateTime => DateTime.t() | nil,
          :usageCount => String.t() | nil,
          :usageInfo => String.t() | nil,
          :visibility => String.t() | nil
        }

  field(:author)
  field(:categories, type: :list)

  field(:components,
    as: GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaTemplateComponent,
    type: :list
  )

  field(:createTime, as: DateTime)
  field(:description)
  field(:displayName)
  field(:docLink)
  field(:lastUsedTime, as: DateTime)
  field(:name)
  field(:sharedWith, type: :list)
  field(:tags, type: :list)

  field(:templateBundle,
    as: GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaTemplateBundle
  )

  field(:updateTime, as: DateTime)
  field(:usageCount)
  field(:usageInfo)
  field(:visibility)
end

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

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