# 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.EnterpriseCrmFrontendsEventbusProtoParamSpecEntry do
  @moduledoc """
  Key-value pair of EventBus task parameters. Next id: 13

  ## Attributes

  *   `className` (*type:* `String.t`, *default:* `nil`) - The FQCN of the Java object this represents. A string, for example, would be "java.lang.String". If this is "java.lang.Object", the parameter can be of any type.
  *   `collectionElementClassName` (*type:* `String.t`, *default:* `nil`) - If it is a collection of objects, this would be the FCQN of every individual element in the collection. If this is "java.lang.Object", the parameter is a collection of any type.
  *   `config` (*type:* `GoogleApi.Integrations.V1.Model.EnterpriseCrmEventbusProtoParamSpecEntryConfig.t`, *default:* `nil`) - Optional fields, such as help text and other useful info.
  *   `dataType` (*type:* `String.t`, *default:* `nil`) - The data type of the parameter.
  *   `defaultValue` (*type:* `GoogleApi.Integrations.V1.Model.EnterpriseCrmFrontendsEventbusProtoParameterValueType.t`, *default:* `nil`) - Default values for the defined keys. Each value can either be string, int, double or any proto message or a serialized object.
  *   `isDeprecated` (*type:* `boolean()`, *default:* `nil`) - If set, this entry is deprecated, so further use of this parameter should be prohibited.
  *   `isOutput` (*type:* `boolean()`, *default:* `nil`) - 
  *   `jsonSchema` (*type:* `String.t`, *default:* `nil`) - If the data_type is JSON_VALUE, then this will define its schema.
  *   `key` (*type:* `String.t`, *default:* `nil`) - Key is used to retrieve the corresponding parameter value. This should be unique for a given task. These parameters must be predefined in the workflow definition.
  *   `protoDef` (*type:* `GoogleApi.Integrations.V1.Model.EnterpriseCrmEventbusProtoParamSpecEntryProtoDefinition.t`, *default:* `nil`) - Populated if this represents a proto or proto array.
  *   `required` (*type:* `boolean()`, *default:* `nil`) - If set, the user must provide an input value for this parameter.
  *   `validationRule` (*type:* `GoogleApi.Integrations.V1.Model.EnterpriseCrmEventbusProtoParamSpecEntryValidationRule.t`, *default:* `nil`) - Rule used to validate inputs (individual values and collection elements) for this parameter.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :className => String.t() | nil,
          :collectionElementClassName => String.t() | nil,
          :config =>
            GoogleApi.Integrations.V1.Model.EnterpriseCrmEventbusProtoParamSpecEntryConfig.t()
            | nil,
          :dataType => String.t() | nil,
          :defaultValue =>
            GoogleApi.Integrations.V1.Model.EnterpriseCrmFrontendsEventbusProtoParameterValueType.t()
            | nil,
          :isDeprecated => boolean() | nil,
          :isOutput => boolean() | nil,
          :jsonSchema => String.t() | nil,
          :key => String.t() | nil,
          :protoDef =>
            GoogleApi.Integrations.V1.Model.EnterpriseCrmEventbusProtoParamSpecEntryProtoDefinition.t()
            | nil,
          :required => boolean() | nil,
          :validationRule =>
            GoogleApi.Integrations.V1.Model.EnterpriseCrmEventbusProtoParamSpecEntryValidationRule.t()
            | nil
        }

  field(:className)
  field(:collectionElementClassName)

  field(:config,
    as: GoogleApi.Integrations.V1.Model.EnterpriseCrmEventbusProtoParamSpecEntryConfig
  )

  field(:dataType)

  field(:defaultValue,
    as: GoogleApi.Integrations.V1.Model.EnterpriseCrmFrontendsEventbusProtoParameterValueType
  )

  field(:isDeprecated)
  field(:isOutput)
  field(:jsonSchema)
  field(:key)

  field(:protoDef,
    as: GoogleApi.Integrations.V1.Model.EnterpriseCrmEventbusProtoParamSpecEntryProtoDefinition
  )

  field(:required)

  field(:validationRule,
    as: GoogleApi.Integrations.V1.Model.EnterpriseCrmEventbusProtoParamSpecEntryValidationRule
  )
end

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

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