# 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.GitHubEnterpriseConfig do
  @moduledoc """
  Configuration for connections to an instance of GitHub Enterprise.

  ## Attributes

  *   `appId` (*type:* `String.t`, *default:* `nil`) - Optional. ID of the GitHub App created from the manifest.
  *   `appInstallationId` (*type:* `String.t`, *default:* `nil`) - Optional. ID of the installation of the GitHub App.
  *   `appSlug` (*type:* `String.t`, *default:* `nil`) - Output only. The URL-friendly name of the GitHub App.
  *   `hostUri` (*type:* `String.t`, *default:* `nil`) - Required. The URI of the GitHub Enterprise host this connection is for.
  *   `installationUri` (*type:* `String.t`, *default:* `nil`) - Output only. The URI to navigate to in order to manage the installation associated with this GitHubEnterpriseConfig.
  *   `privateKeySecretVersion` (*type:* `String.t`, *default:* `nil`) - Optional. SecretManager resource containing the private key of the GitHub App, formatted as `projects/*/secrets/*/versions/*`.
  *   `serverVersion` (*type:* `String.t`, *default:* `nil`) - Output only. GitHub Enterprise version installed at the host_uri.
  *   `serviceDirectoryConfig` (*type:* `GoogleApi.DeveloperConnect.V1.Model.ServiceDirectoryConfig.t`, *default:* `nil`) - Optional. Configuration for using Service Directory to privately connect to a GitHub Enterprise server. This should only be set if the GitHub Enterprise server is hosted on-premises and not reachable by public internet. If this field is left empty, calls to the GitHub Enterprise server will be made over the public internet.
  *   `sslCaCertificate` (*type:* `String.t`, *default:* `nil`) - Optional. SSL certificate to use for requests to GitHub Enterprise.
  *   `webhookSecretSecretVersion` (*type:* `String.t`, *default:* `nil`) - Optional. SecretManager resource containing the webhook secret of the GitHub App, formatted as `projects/*/secrets/*/versions/*`.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :appId => String.t() | nil,
          :appInstallationId => String.t() | nil,
          :appSlug => String.t() | nil,
          :hostUri => String.t() | nil,
          :installationUri => String.t() | nil,
          :privateKeySecretVersion => String.t() | nil,
          :serverVersion => String.t() | nil,
          :serviceDirectoryConfig =>
            GoogleApi.DeveloperConnect.V1.Model.ServiceDirectoryConfig.t() | nil,
          :sslCaCertificate => String.t() | nil,
          :webhookSecretSecretVersion => String.t() | nil
        }

  field(:appId)
  field(:appInstallationId)
  field(:appSlug)
  field(:hostUri)
  field(:installationUri)
  field(:privateKeySecretVersion)
  field(:serverVersion)
  field(:serviceDirectoryConfig, as: GoogleApi.DeveloperConnect.V1.Model.ServiceDirectoryConfig)
  field(:sslCaCertificate)
  field(:webhookSecretSecretVersion)
end

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

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