# 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.DeveloperConnect.V1.Model.GitHubConfig do
  @moduledoc """
  Configuration for connections to github.com.

  ## Attributes

  *   `appInstallationId` (*type:* `String.t`, *default:* `nil`) - Optional. GitHub App installation id.
  *   `authorizerCredential` (*type:* `GoogleApi.DeveloperConnect.V1.Model.OAuthCredential.t`, *default:* `nil`) - Optional. OAuth credential of the account that authorized the GitHub App. It is recommended to use a robot account instead of a human user account. The OAuth token must be tied to the GitHub App of this config.
  *   `githubApp` (*type:* `String.t`, *default:* `nil`) - Required. Immutable. The GitHub Application that was installed to the GitHub user or organization.
  *   `installationUri` (*type:* `String.t`, *default:* `nil`) - Output only. The URI to navigate to in order to manage the installation associated with this GitHubConfig.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :appInstallationId => String.t() | nil,
          :authorizerCredential => GoogleApi.DeveloperConnect.V1.Model.OAuthCredential.t() | nil,
          :githubApp => String.t() | nil,
          :installationUri => String.t() | nil
        }

  field(:appInstallationId)
  field(:authorizerCredential, as: GoogleApi.DeveloperConnect.V1.Model.OAuthCredential)
  field(:githubApp)
  field(:installationUri)
end

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

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