# 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.CloudBilling.V1.Model.ProjectBillingInfo do
  @moduledoc """
  Encapsulation of billing information for a Google Cloud Console project. A project has at most one associated billing account at a time (but a billing account can be assigned to multiple projects).

  ## Attributes

  *   `billingAccountName` (*type:* `String.t`, *default:* `nil`) - The resource name of the billing account associated with the project, if any. For example, `billingAccounts/012345-567890-ABCDEF`.
  *   `billingEnabled` (*type:* `boolean()`, *default:* `nil`) - Output only. True if the project is associated with an open billing account, to which usage on the project is charged. False if the project is associated with a closed billing account, or no billing account at all, and therefore cannot use paid services.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. The resource name for the `ProjectBillingInfo`; has the form `projects/{project_id}/billingInfo`. For example, the resource name for the billing information for project `tokyo-rain-123` would be `projects/tokyo-rain-123/billingInfo`.
  *   `projectId` (*type:* `String.t`, *default:* `nil`) - Output only. The ID of the project that this `ProjectBillingInfo` represents, such as `tokyo-rain-123`. This is a convenience field so that you don't need to parse the `name` field to obtain a project ID.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :billingAccountName => String.t() | nil,
          :billingEnabled => boolean() | nil,
          :name => String.t() | nil,
          :projectId => String.t() | nil
        }

  field(:billingAccountName)
  field(:billingEnabled)
  field(:name)
  field(:projectId)
end

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

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