# 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.OrgPolicy.V2.Model.GoogleCloudOrgpolicyV2ConstraintCustomConstraintDefinitionParameter do
  @moduledoc """
  Defines a parameter structure.

  ## Attributes

  *   `defaultValue` (*type:* `any()`, *default:* `nil`) - Sets the value of the parameter in an assignment if no value is given.
  *   `item` (*type:* `String.t`, *default:* `nil`) - Determines the parameter's value structure. For example, `LIST` can be specified by defining `type: LIST`, and `item: STRING`.
  *   `metadata` (*type:* `GoogleApi.OrgPolicy.V2.Model.GoogleCloudOrgpolicyV2ConstraintCustomConstraintDefinitionParameterMetadata.t`, *default:* `nil`) - Defines subproperties primarily used by the UI to display user-friendly information.
  *   `type` (*type:* `String.t`, *default:* `nil`) - Type of the parameter.
  *   `validValuesExpr` (*type:* `String.t`, *default:* `nil`) - Provides a CEL expression to specify the acceptable parameter values during assignment. For example, parameterName in ("parameterValue1", "parameterValue2")
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :defaultValue => any() | nil,
          :item => String.t() | nil,
          :metadata =>
            GoogleApi.OrgPolicy.V2.Model.GoogleCloudOrgpolicyV2ConstraintCustomConstraintDefinitionParameterMetadata.t()
            | nil,
          :type => String.t() | nil,
          :validValuesExpr => String.t() | nil
        }

  field(:defaultValue)
  field(:item)

  field(:metadata,
    as:
      GoogleApi.OrgPolicy.V2.Model.GoogleCloudOrgpolicyV2ConstraintCustomConstraintDefinitionParameterMetadata
  )

  field(:type)
  field(:validValuesExpr)
end

defimpl Poison.Decoder,
  for:
    GoogleApi.OrgPolicy.V2.Model.GoogleCloudOrgpolicyV2ConstraintCustomConstraintDefinitionParameter do
  def decode(value, options) do
    GoogleApi.OrgPolicy.V2.Model.GoogleCloudOrgpolicyV2ConstraintCustomConstraintDefinitionParameter.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for:
    GoogleApi.OrgPolicy.V2.Model.GoogleCloudOrgpolicyV2ConstraintCustomConstraintDefinitionParameter do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
