# 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.HealthCare.V1.Model.EvaluateUserConsentsRequest do
  @moduledoc """
  Evaluate a user's Consents for all matching User data mappings. Note: User data mappings are indexed asynchronously, causing slight delays between the time mappings are created or updated and when they are included in EvaluateUserConsents results.

  ## Attributes

  *   `consentList` (*type:* `GoogleApi.HealthCare.V1.Model.ConsentList.t`, *default:* `nil`) - Optional. Specific Consents to evaluate the access request against. These Consents must have the same `user_id` as the User data mappings being evalauted, must exist in the current `consent_store`, and must have a `state` of either `ACTIVE` or `DRAFT`. A maximum of 100 Consents can be provided here. If unspecified, all `ACTIVE` unexpired Consents in the current `consent_store` will be evaluated.
  *   `pageSize` (*type:* `integer()`, *default:* `nil`) - Optional. Limit on the number of User data mappings to return in a single response. If not specified, 100 is used. May not be larger than 1000.
  *   `pageToken` (*type:* `String.t`, *default:* `nil`) - Optional. Token to retrieve the next page of results, or empty to get the first page.
  *   `requestAttributes` (*type:* `map()`, *default:* `nil`) - Required. The values of request attributes associated with this access request.
  *   `resourceAttributes` (*type:* `map()`, *default:* `nil`) - Optional. The values of resource attributes associated with the resources being requested. If no values are specified, then all resources are queried.
  *   `responseView` (*type:* `String.t`, *default:* `nil`) - Optional. The view for EvaluateUserConsentsResponse. If unspecified, defaults to `BASIC` and returns `consented` as `TRUE` or `FALSE`.
  *   `userId` (*type:* `String.t`, *default:* `nil`) - Required. User ID to evaluate consents for.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :consentList => GoogleApi.HealthCare.V1.Model.ConsentList.t() | nil,
          :pageSize => integer() | nil,
          :pageToken => String.t() | nil,
          :requestAttributes => map() | nil,
          :resourceAttributes => map() | nil,
          :responseView => String.t() | nil,
          :userId => String.t() | nil
        }

  field(:consentList, as: GoogleApi.HealthCare.V1.Model.ConsentList)
  field(:pageSize)
  field(:pageToken)
  field(:requestAttributes, type: :map)
  field(:resourceAttributes, type: :map)
  field(:responseView)
  field(:userId)
end

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

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