# 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.Admin.Directory_v1.Model.Member do
  @moduledoc """
  A Google Groups member can be a user or another group. This member can be inside or outside of your account's domains. For more information about common group member tasks, see the [Developer's Guide](/admin-sdk/directory/v1/guides/manage-group-members).

  ## Attributes

  *   `delivery_settings` (*type:* `String.t`, *default:* `nil`) - Defines mail delivery preferences of member. This field is only supported by `insert`, `update`, and `get` methods.
  *   `email` (*type:* `String.t`, *default:* `nil`) - The member's email address. A member can be a user or another group. This property is required when adding a member to a group. The `email` must be unique and cannot be an alias of another group. If the email address is changed, the API automatically reflects the email address changes.
  *   `etag` (*type:* `String.t`, *default:* `nil`) - ETag of the resource.
  *   `id` (*type:* `String.t`, *default:* `nil`) - The unique ID of the group member. A member `id` can be used as a member request URI's `memberKey`.
  *   `kind` (*type:* `String.t`, *default:* `admin#directory#member`) - The type of the API resource. For Members resources, the value is `admin#directory#member`.
  *   `role` (*type:* `String.t`, *default:* `nil`) - The member's role in a group. The API returns an error for cycles in group memberships. For example, if `group1` is a member of `group2`, `group2` cannot be a member of `group1`. For more information about a member's role, see the [administration help center](https://support.google.com/a/answer/167094).
  *   `status` (*type:* `String.t`, *default:* `nil`) - Status of member (Immutable)
  *   `type` (*type:* `String.t`, *default:* `nil`) - The type of group member.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :delivery_settings => String.t() | nil,
          :email => String.t() | nil,
          :etag => String.t() | nil,
          :id => String.t() | nil,
          :kind => String.t() | nil,
          :role => String.t() | nil,
          :status => String.t() | nil,
          :type => String.t() | nil
        }

  field(:delivery_settings)
  field(:email)
  field(:etag)
  field(:id)
  field(:kind)
  field(:role)
  field(:status)
  field(:type)
end

defimpl Poison.Decoder, for: GoogleApi.Admin.Directory_v1.Model.Member do
  def decode(value, options) do
    GoogleApi.Admin.Directory_v1.Model.Member.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Admin.Directory_v1.Model.Member do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
