Class: GandiV5::Email::Offer

Inherits:
Object
  • Object
show all
Includes:
Data
Defined in:
lib/gandi_v5/email/offer.rb

Overview

The current status of your mailbox offer.

Instance Attribute Summary collapse

Class Method Summary collapse

Methods included from Data

#from_gandi, included, #initialize, #to_gandi, #to_h, #values_at

Instance Attribute Details

#status:active, :inactive (readonly)

Returns:

  • (:active, :inactive)


10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/gandi_v5/email/offer.rb', line 10

class Offer
  include GandiV5::Data

  member :version
  member :status, converter: GandiV5::Data::Converter::Symbol

  # Get the current status of your mailbox offer.
  # @see https://api.gandi.net/docs/email#get-v5-email-offers-domain
  # @param fqdn [String, #to_s] the fully qualified domain name to get the offer for.
  # @return [GandiV5::Email::Offer]
  # @raise [GandiV5::Error::GandiError] if Gandi returns an error.
  def self.fetch(fqdn)
    _response, data = GandiV5.get "#{BASE}email/offers/#{CGI.escape fqdn}"
    from_gandi data
  end
end

#version1, 2 (readonly)

Returns:

  • (1, 2)


10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/gandi_v5/email/offer.rb', line 10

class Offer
  include GandiV5::Data

  member :version
  member :status, converter: GandiV5::Data::Converter::Symbol

  # Get the current status of your mailbox offer.
  # @see https://api.gandi.net/docs/email#get-v5-email-offers-domain
  # @param fqdn [String, #to_s] the fully qualified domain name to get the offer for.
  # @return [GandiV5::Email::Offer]
  # @raise [GandiV5::Error::GandiError] if Gandi returns an error.
  def self.fetch(fqdn)
    _response, data = GandiV5.get "#{BASE}email/offers/#{CGI.escape fqdn}"
    from_gandi data
  end
end

Class Method Details

.fetch(fqdn) ⇒ GandiV5::Email::Offer

Get the current status of your mailbox offer.

Parameters:

  • fqdn (String, #to_s)

    the fully qualified domain name to get the offer for.

Returns:

Raises:

See Also:



21
22
23
24
# File 'lib/gandi_v5/email/offer.rb', line 21

def self.fetch(fqdn)
  _response, data = GandiV5.get "#{BASE}email/offers/#{CGI.escape fqdn}"
  from_gandi data
end