lib/google_api/os_config/v1/model/os_policy.ex

# 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.OSConfig.V1.Model.OSPolicy do
  @moduledoc """
  An OS policy defines the desired state configuration for a VM.

  ## Attributes

  *   `allowNoResourceGroupMatch` (*type:* `boolean()`, *default:* `nil`) - This flag determines the OS policy compliance status when none of the resource groups within the policy are applicable for a VM. Set this value to `true` if the policy needs to be reported as compliant even if the policy has nothing to validate or enforce.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Policy description. Length of the description is limited to 1024 characters.
  *   `id` (*type:* `String.t`, *default:* `nil`) - Required. The id of the OS policy with the following restrictions: * Must contain only lowercase letters, numbers, and hyphens. * Must start with a letter. * Must be between 1-63 characters. * Must end with a number or a letter. * Must be unique within the assignment.
  *   `mode` (*type:* `String.t`, *default:* `nil`) - Required. Policy mode
  *   `resourceGroups` (*type:* `list(GoogleApi.OSConfig.V1.Model.OSPolicyResourceGroup.t)`, *default:* `nil`) - Required. List of resource groups for the policy. For a particular VM, resource groups are evaluated in the order specified and the first resource group that is applicable is selected and the rest are ignored. If none of the resource groups are applicable for a VM, the VM is considered to be non-compliant w.r.t this policy. This behavior can be toggled by the flag `allow_no_resource_group_match`
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :allowNoResourceGroupMatch => boolean() | nil,
          :description => String.t() | nil,
          :id => String.t() | nil,
          :mode => String.t() | nil,
          :resourceGroups => list(GoogleApi.OSConfig.V1.Model.OSPolicyResourceGroup.t()) | nil
        }

  field(:allowNoResourceGroupMatch)
  field(:description)
  field(:id)
  field(:mode)
  field(:resourceGroups, as: GoogleApi.OSConfig.V1.Model.OSPolicyResourceGroup, type: :list)
end

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

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