# 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.SearchConsole.V1.Model.AmpInspectionResult do
  @moduledoc """
  AMP inspection result of the live page or the current information from Google's index, depending on whether you requested a live inspection or not.

  ## Attributes

  *   `ampIndexStatusVerdict` (*type:* `String.t`, *default:* `nil`) - Index status of the AMP URL.
  *   `ampUrl` (*type:* `String.t`, *default:* `nil`) - URL of the AMP that was inspected. If the submitted URL is a desktop page that refers to an AMP version, the AMP version will be inspected.
  *   `indexingState` (*type:* `String.t`, *default:* `nil`) - Whether or not the page blocks indexing through a noindex rule.
  *   `issues` (*type:* `list(GoogleApi.SearchConsole.V1.Model.AmpIssue.t)`, *default:* `nil`) - A list of zero or more AMP issues found for the inspected URL.
  *   `lastCrawlTime` (*type:* `DateTime.t`, *default:* `nil`) - Last time this AMP version was crawled by Google. Absent if the URL was never crawled successfully.
  *   `pageFetchState` (*type:* `String.t`, *default:* `nil`) - Whether or not Google could fetch the AMP.
  *   `robotsTxtState` (*type:* `String.t`, *default:* `nil`) - Whether or not the page is blocked to Google by a robots.txt rule.
  *   `verdict` (*type:* `String.t`, *default:* `nil`) - The status of the most severe error on the page. If a page has both warnings and errors, the page status is error. Error status means the page cannot be shown in Search results.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :ampIndexStatusVerdict => String.t() | nil,
          :ampUrl => String.t() | nil,
          :indexingState => String.t() | nil,
          :issues => list(GoogleApi.SearchConsole.V1.Model.AmpIssue.t()) | nil,
          :lastCrawlTime => DateTime.t() | nil,
          :pageFetchState => String.t() | nil,
          :robotsTxtState => String.t() | nil,
          :verdict => String.t() | nil
        }

  field(:ampIndexStatusVerdict)
  field(:ampUrl)
  field(:indexingState)
  field(:issues, as: GoogleApi.SearchConsole.V1.Model.AmpIssue, type: :list)
  field(:lastCrawlTime, as: DateTime)
  field(:pageFetchState)
  field(:robotsTxtState)
  field(:verdict)
end

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

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