Class: GandiV5::Organization

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

Overview

The Organization API is a read-only API. All organization management must be performed via the web interface.

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

#cityString (readonly)

Returns the city name of the address.

Returns:

  • (String)

    the city name of the address.



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/gandi_v5/organization.rb', line 40

class Organization
  include GandiV5::Data

  members :username, :name, :lang, :city, :zip, :country, :email, :phone, :security_phone,
          :security_email, :security_email_validated, :security_email_validation_deadline
  member :uuid, gandi_key: 'id'
  member :first_name, gandi_key: 'firstname'
  member :last_name, gandi_key: 'lastname'
  member :street_address, gandi_key: 'streetaddr'
  member :security_email_validation_deadline, converter: GandiV5::Data::Converter::Time

  alias organization_uuid uuid

  # Get information about the current authenticated user.
  # @see https://api.gandi.net/docs/organization#get-v5-organization-user-info
  # @return [GandiV5::Organization]
  # @raise [GandiV5::Error::GandiError] if Gandi returns an error.
  def self.fetch
    _response, data = GandiV5.get "#{url}/user-info"
    from_gandi data
  end

  # List organisations.
  # @see https://api.gandi.net/docs/domains#get-v5-organization-organizations
  # @param name [String, #to_s] (optional)
  #   filters the list by name, with optional patterns.
  #   e.g. "alice", "ali*", "*ice"
  # @param type [String, #to_s] (optional)
  #   filters the list by type of organization.
  #   One of: "individual", "company", "association", "publicbody"
  # @param permission [String, #to_s] (optional)
  #   filters the list by the permission the authenticated user
  #   has on that organization and products in it.
  # @param sort_by [String, #to_s] (optional default "name") how to sort the list.
  # @return [Array<GandiV5::Organization>]
  # @raise [GandiV5::Error::GandiError] if Gandi returns an error.
  def self.list(**params)
    params['~name'] = params.delete(:name) if params.key?(:name)
    _resp, data = GandiV5.get "#{url}/organizations", params: params
    data.map { |organisation| from_gandi organisation }
  end

  private

  def self.url
    "#{BASE}organization"
  end
  private_class_method :url
end

#countrynil, String (readonly)

Returns country ISO code of the address.

Returns:

  • (nil, String)

    country ISO code of the address.



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/gandi_v5/organization.rb', line 40

class Organization
  include GandiV5::Data

  members :username, :name, :lang, :city, :zip, :country, :email, :phone, :security_phone,
          :security_email, :security_email_validated, :security_email_validation_deadline
  member :uuid, gandi_key: 'id'
  member :first_name, gandi_key: 'firstname'
  member :last_name, gandi_key: 'lastname'
  member :street_address, gandi_key: 'streetaddr'
  member :security_email_validation_deadline, converter: GandiV5::Data::Converter::Time

  alias organization_uuid uuid

  # Get information about the current authenticated user.
  # @see https://api.gandi.net/docs/organization#get-v5-organization-user-info
  # @return [GandiV5::Organization]
  # @raise [GandiV5::Error::GandiError] if Gandi returns an error.
  def self.fetch
    _response, data = GandiV5.get "#{url}/user-info"
    from_gandi data
  end

  # List organisations.
  # @see https://api.gandi.net/docs/domains#get-v5-organization-organizations
  # @param name [String, #to_s] (optional)
  #   filters the list by name, with optional patterns.
  #   e.g. "alice", "ali*", "*ice"
  # @param type [String, #to_s] (optional)
  #   filters the list by type of organization.
  #   One of: "individual", "company", "association", "publicbody"
  # @param permission [String, #to_s] (optional)
  #   filters the list by the permission the authenticated user
  #   has on that organization and products in it.
  # @param sort_by [String, #to_s] (optional default "name") how to sort the list.
  # @return [Array<GandiV5::Organization>]
  # @raise [GandiV5::Error::GandiError] if Gandi returns an error.
  def self.list(**params)
    params['~name'] = params.delete(:name) if params.key?(:name)
    _resp, data = GandiV5.get "#{url}/organizations", params: params
    data.map { |organisation| from_gandi organisation }
  end

  private

  def self.url
    "#{BASE}organization"
  end
  private_class_method :url
end

#emailString (readonly)

Returns the email address of the user.

Returns:

  • (String)

    the email address of the user.



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/gandi_v5/organization.rb', line 40

class Organization
  include GandiV5::Data

  members :username, :name, :lang, :city, :zip, :country, :email, :phone, :security_phone,
          :security_email, :security_email_validated, :security_email_validation_deadline
  member :uuid, gandi_key: 'id'
  member :first_name, gandi_key: 'firstname'
  member :last_name, gandi_key: 'lastname'
  member :street_address, gandi_key: 'streetaddr'
  member :security_email_validation_deadline, converter: GandiV5::Data::Converter::Time

  alias organization_uuid uuid

  # Get information about the current authenticated user.
  # @see https://api.gandi.net/docs/organization#get-v5-organization-user-info
  # @return [GandiV5::Organization]
  # @raise [GandiV5::Error::GandiError] if Gandi returns an error.
  def self.fetch
    _response, data = GandiV5.get "#{url}/user-info"
    from_gandi data
  end

  # List organisations.
  # @see https://api.gandi.net/docs/domains#get-v5-organization-organizations
  # @param name [String, #to_s] (optional)
  #   filters the list by name, with optional patterns.
  #   e.g. "alice", "ali*", "*ice"
  # @param type [String, #to_s] (optional)
  #   filters the list by type of organization.
  #   One of: "individual", "company", "association", "publicbody"
  # @param permission [String, #to_s] (optional)
  #   filters the list by the permission the authenticated user
  #   has on that organization and products in it.
  # @param sort_by [String, #to_s] (optional default "name") how to sort the list.
  # @return [Array<GandiV5::Organization>]
  # @raise [GandiV5::Error::GandiError] if Gandi returns an error.
  def self.list(**params)
    params['~name'] = params.delete(:name) if params.key?(:name)
    _resp, data = GandiV5.get "#{url}/organizations", params: params
    data.map { |organisation| from_gandi organisation }
  end

  private

  def self.url
    "#{BASE}organization"
  end
  private_class_method :url
end

#first_namenil, String (readonly)

Returns the first name of the user.

Returns:

  • (nil, String)

    the first name of the user.



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/gandi_v5/organization.rb', line 40

class Organization
  include GandiV5::Data

  members :username, :name, :lang, :city, :zip, :country, :email, :phone, :security_phone,
          :security_email, :security_email_validated, :security_email_validation_deadline
  member :uuid, gandi_key: 'id'
  member :first_name, gandi_key: 'firstname'
  member :last_name, gandi_key: 'lastname'
  member :street_address, gandi_key: 'streetaddr'
  member :security_email_validation_deadline, converter: GandiV5::Data::Converter::Time

  alias organization_uuid uuid

  # Get information about the current authenticated user.
  # @see https://api.gandi.net/docs/organization#get-v5-organization-user-info
  # @return [GandiV5::Organization]
  # @raise [GandiV5::Error::GandiError] if Gandi returns an error.
  def self.fetch
    _response, data = GandiV5.get "#{url}/user-info"
    from_gandi data
  end

  # List organisations.
  # @see https://api.gandi.net/docs/domains#get-v5-organization-organizations
  # @param name [String, #to_s] (optional)
  #   filters the list by name, with optional patterns.
  #   e.g. "alice", "ali*", "*ice"
  # @param type [String, #to_s] (optional)
  #   filters the list by type of organization.
  #   One of: "individual", "company", "association", "publicbody"
  # @param permission [String, #to_s] (optional)
  #   filters the list by the permission the authenticated user
  #   has on that organization and products in it.
  # @param sort_by [String, #to_s] (optional default "name") how to sort the list.
  # @return [Array<GandiV5::Organization>]
  # @raise [GandiV5::Error::GandiError] if Gandi returns an error.
  def self.list(**params)
    params['~name'] = params.delete(:name) if params.key?(:name)
    _resp, data = GandiV5.get "#{url}/organizations", params: params
    data.map { |organisation| from_gandi organisation }
  end

  private

  def self.url
    "#{BASE}organization"
  end
  private_class_method :url
end

#langString (readonly)

Returns language used by the user.

Returns:

  • (String)

    language used by the user.



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/gandi_v5/organization.rb', line 40

class Organization
  include GandiV5::Data

  members :username, :name, :lang, :city, :zip, :country, :email, :phone, :security_phone,
          :security_email, :security_email_validated, :security_email_validation_deadline
  member :uuid, gandi_key: 'id'
  member :first_name, gandi_key: 'firstname'
  member :last_name, gandi_key: 'lastname'
  member :street_address, gandi_key: 'streetaddr'
  member :security_email_validation_deadline, converter: GandiV5::Data::Converter::Time

  alias organization_uuid uuid

  # Get information about the current authenticated user.
  # @see https://api.gandi.net/docs/organization#get-v5-organization-user-info
  # @return [GandiV5::Organization]
  # @raise [GandiV5::Error::GandiError] if Gandi returns an error.
  def self.fetch
    _response, data = GandiV5.get "#{url}/user-info"
    from_gandi data
  end

  # List organisations.
  # @see https://api.gandi.net/docs/domains#get-v5-organization-organizations
  # @param name [String, #to_s] (optional)
  #   filters the list by name, with optional patterns.
  #   e.g. "alice", "ali*", "*ice"
  # @param type [String, #to_s] (optional)
  #   filters the list by type of organization.
  #   One of: "individual", "company", "association", "publicbody"
  # @param permission [String, #to_s] (optional)
  #   filters the list by the permission the authenticated user
  #   has on that organization and products in it.
  # @param sort_by [String, #to_s] (optional default "name") how to sort the list.
  # @return [Array<GandiV5::Organization>]
  # @raise [GandiV5::Error::GandiError] if Gandi returns an error.
  def self.list(**params)
    params['~name'] = params.delete(:name) if params.key?(:name)
    _resp, data = GandiV5.get "#{url}/organizations", params: params
    data.map { |organisation| from_gandi organisation }
  end

  private

  def self.url
    "#{BASE}organization"
  end
  private_class_method :url
end

#last_namenil, String (readonly)

Returns the last name of the user.

Returns:

  • (nil, String)

    the last name of the user.



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/gandi_v5/organization.rb', line 40

class Organization
  include GandiV5::Data

  members :username, :name, :lang, :city, :zip, :country, :email, :phone, :security_phone,
          :security_email, :security_email_validated, :security_email_validation_deadline
  member :uuid, gandi_key: 'id'
  member :first_name, gandi_key: 'firstname'
  member :last_name, gandi_key: 'lastname'
  member :street_address, gandi_key: 'streetaddr'
  member :security_email_validation_deadline, converter: GandiV5::Data::Converter::Time

  alias organization_uuid uuid

  # Get information about the current authenticated user.
  # @see https://api.gandi.net/docs/organization#get-v5-organization-user-info
  # @return [GandiV5::Organization]
  # @raise [GandiV5::Error::GandiError] if Gandi returns an error.
  def self.fetch
    _response, data = GandiV5.get "#{url}/user-info"
    from_gandi data
  end

  # List organisations.
  # @see https://api.gandi.net/docs/domains#get-v5-organization-organizations
  # @param name [String, #to_s] (optional)
  #   filters the list by name, with optional patterns.
  #   e.g. "alice", "ali*", "*ice"
  # @param type [String, #to_s] (optional)
  #   filters the list by type of organization.
  #   One of: "individual", "company", "association", "publicbody"
  # @param permission [String, #to_s] (optional)
  #   filters the list by the permission the authenticated user
  #   has on that organization and products in it.
  # @param sort_by [String, #to_s] (optional default "name") how to sort the list.
  # @return [Array<GandiV5::Organization>]
  # @raise [GandiV5::Error::GandiError] if Gandi returns an error.
  def self.list(**params)
    params['~name'] = params.delete(:name) if params.key?(:name)
    _resp, data = GandiV5.get "#{url}/organizations", params: params
    data.map { |organisation| from_gandi organisation }
  end

  private

  def self.url
    "#{BASE}organization"
  end
  private_class_method :url
end

#nameString (readonly)

Returns the sharing name of the user.

Returns:

  • (String)

    the sharing name of the user.



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/gandi_v5/organization.rb', line 40

class Organization
  include GandiV5::Data

  members :username, :name, :lang, :city, :zip, :country, :email, :phone, :security_phone,
          :security_email, :security_email_validated, :security_email_validation_deadline
  member :uuid, gandi_key: 'id'
  member :first_name, gandi_key: 'firstname'
  member :last_name, gandi_key: 'lastname'
  member :street_address, gandi_key: 'streetaddr'
  member :security_email_validation_deadline, converter: GandiV5::Data::Converter::Time

  alias organization_uuid uuid

  # Get information about the current authenticated user.
  # @see https://api.gandi.net/docs/organization#get-v5-organization-user-info
  # @return [GandiV5::Organization]
  # @raise [GandiV5::Error::GandiError] if Gandi returns an error.
  def self.fetch
    _response, data = GandiV5.get "#{url}/user-info"
    from_gandi data
  end

  # List organisations.
  # @see https://api.gandi.net/docs/domains#get-v5-organization-organizations
  # @param name [String, #to_s] (optional)
  #   filters the list by name, with optional patterns.
  #   e.g. "alice", "ali*", "*ice"
  # @param type [String, #to_s] (optional)
  #   filters the list by type of organization.
  #   One of: "individual", "company", "association", "publicbody"
  # @param permission [String, #to_s] (optional)
  #   filters the list by the permission the authenticated user
  #   has on that organization and products in it.
  # @param sort_by [String, #to_s] (optional default "name") how to sort the list.
  # @return [Array<GandiV5::Organization>]
  # @raise [GandiV5::Error::GandiError] if Gandi returns an error.
  def self.list(**params)
    params['~name'] = params.delete(:name) if params.key?(:name)
    _resp, data = GandiV5.get "#{url}/organizations", params: params
    data.map { |organisation| from_gandi organisation }
  end

  private

  def self.url
    "#{BASE}organization"
  end
  private_class_method :url
end

#phonenil, String (readonly)

Returns the phone number of the user.

Returns:

  • (nil, String)

    the phone number of the user.



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/gandi_v5/organization.rb', line 40

class Organization
  include GandiV5::Data

  members :username, :name, :lang, :city, :zip, :country, :email, :phone, :security_phone,
          :security_email, :security_email_validated, :security_email_validation_deadline
  member :uuid, gandi_key: 'id'
  member :first_name, gandi_key: 'firstname'
  member :last_name, gandi_key: 'lastname'
  member :street_address, gandi_key: 'streetaddr'
  member :security_email_validation_deadline, converter: GandiV5::Data::Converter::Time

  alias organization_uuid uuid

  # Get information about the current authenticated user.
  # @see https://api.gandi.net/docs/organization#get-v5-organization-user-info
  # @return [GandiV5::Organization]
  # @raise [GandiV5::Error::GandiError] if Gandi returns an error.
  def self.fetch
    _response, data = GandiV5.get "#{url}/user-info"
    from_gandi data
  end

  # List organisations.
  # @see https://api.gandi.net/docs/domains#get-v5-organization-organizations
  # @param name [String, #to_s] (optional)
  #   filters the list by name, with optional patterns.
  #   e.g. "alice", "ali*", "*ice"
  # @param type [String, #to_s] (optional)
  #   filters the list by type of organization.
  #   One of: "individual", "company", "association", "publicbody"
  # @param permission [String, #to_s] (optional)
  #   filters the list by the permission the authenticated user
  #   has on that organization and products in it.
  # @param sort_by [String, #to_s] (optional default "name") how to sort the list.
  # @return [Array<GandiV5::Organization>]
  # @raise [GandiV5::Error::GandiError] if Gandi returns an error.
  def self.list(**params)
    params['~name'] = params.delete(:name) if params.key?(:name)
    _resp, data = GandiV5.get "#{url}/organizations", params: params
    data.map { |organisation| from_gandi organisation }
  end

  private

  def self.url
    "#{BASE}organization"
  end
  private_class_method :url
end

#security_emailString (readonly)

Returns email address used for security processes such as account recovery.

Returns:

  • (String)

    email address used for security processes such as account recovery.



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/gandi_v5/organization.rb', line 40

class Organization
  include GandiV5::Data

  members :username, :name, :lang, :city, :zip, :country, :email, :phone, :security_phone,
          :security_email, :security_email_validated, :security_email_validation_deadline
  member :uuid, gandi_key: 'id'
  member :first_name, gandi_key: 'firstname'
  member :last_name, gandi_key: 'lastname'
  member :street_address, gandi_key: 'streetaddr'
  member :security_email_validation_deadline, converter: GandiV5::Data::Converter::Time

  alias organization_uuid uuid

  # Get information about the current authenticated user.
  # @see https://api.gandi.net/docs/organization#get-v5-organization-user-info
  # @return [GandiV5::Organization]
  # @raise [GandiV5::Error::GandiError] if Gandi returns an error.
  def self.fetch
    _response, data = GandiV5.get "#{url}/user-info"
    from_gandi data
  end

  # List organisations.
  # @see https://api.gandi.net/docs/domains#get-v5-organization-organizations
  # @param name [String, #to_s] (optional)
  #   filters the list by name, with optional patterns.
  #   e.g. "alice", "ali*", "*ice"
  # @param type [String, #to_s] (optional)
  #   filters the list by type of organization.
  #   One of: "individual", "company", "association", "publicbody"
  # @param permission [String, #to_s] (optional)
  #   filters the list by the permission the authenticated user
  #   has on that organization and products in it.
  # @param sort_by [String, #to_s] (optional default "name") how to sort the list.
  # @return [Array<GandiV5::Organization>]
  # @raise [GandiV5::Error::GandiError] if Gandi returns an error.
  def self.list(**params)
    params['~name'] = params.delete(:name) if params.key?(:name)
    _resp, data = GandiV5.get "#{url}/organizations", params: params
    data.map { |organisation| from_gandi organisation }
  end

  private

  def self.url
    "#{BASE}organization"
  end
  private_class_method :url
end

#security_email_validatedBoolean (readonly)

Returns state of the email validation process.

Returns:

  • (Boolean)

    state of the email validation process.



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/gandi_v5/organization.rb', line 40

class Organization
  include GandiV5::Data

  members :username, :name, :lang, :city, :zip, :country, :email, :phone, :security_phone,
          :security_email, :security_email_validated, :security_email_validation_deadline
  member :uuid, gandi_key: 'id'
  member :first_name, gandi_key: 'firstname'
  member :last_name, gandi_key: 'lastname'
  member :street_address, gandi_key: 'streetaddr'
  member :security_email_validation_deadline, converter: GandiV5::Data::Converter::Time

  alias organization_uuid uuid

  # Get information about the current authenticated user.
  # @see https://api.gandi.net/docs/organization#get-v5-organization-user-info
  # @return [GandiV5::Organization]
  # @raise [GandiV5::Error::GandiError] if Gandi returns an error.
  def self.fetch
    _response, data = GandiV5.get "#{url}/user-info"
    from_gandi data
  end

  # List organisations.
  # @see https://api.gandi.net/docs/domains#get-v5-organization-organizations
  # @param name [String, #to_s] (optional)
  #   filters the list by name, with optional patterns.
  #   e.g. "alice", "ali*", "*ice"
  # @param type [String, #to_s] (optional)
  #   filters the list by type of organization.
  #   One of: "individual", "company", "association", "publicbody"
  # @param permission [String, #to_s] (optional)
  #   filters the list by the permission the authenticated user
  #   has on that organization and products in it.
  # @param sort_by [String, #to_s] (optional default "name") how to sort the list.
  # @return [Array<GandiV5::Organization>]
  # @raise [GandiV5::Error::GandiError] if Gandi returns an error.
  def self.list(**params)
    params['~name'] = params.delete(:name) if params.key?(:name)
    _resp, data = GandiV5.get "#{url}/organizations", params: params
    data.map { |organisation| from_gandi organisation }
  end

  private

  def self.url
    "#{BASE}organization"
  end
  private_class_method :url
end

#security_email_validation_deadlineTime (readonly)

Returns deadline for the email address validation process.

Returns:

  • (Time)

    deadline for the email address validation process.



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/gandi_v5/organization.rb', line 40

class Organization
  include GandiV5::Data

  members :username, :name, :lang, :city, :zip, :country, :email, :phone, :security_phone,
          :security_email, :security_email_validated, :security_email_validation_deadline
  member :uuid, gandi_key: 'id'
  member :first_name, gandi_key: 'firstname'
  member :last_name, gandi_key: 'lastname'
  member :street_address, gandi_key: 'streetaddr'
  member :security_email_validation_deadline, converter: GandiV5::Data::Converter::Time

  alias organization_uuid uuid

  # Get information about the current authenticated user.
  # @see https://api.gandi.net/docs/organization#get-v5-organization-user-info
  # @return [GandiV5::Organization]
  # @raise [GandiV5::Error::GandiError] if Gandi returns an error.
  def self.fetch
    _response, data = GandiV5.get "#{url}/user-info"
    from_gandi data
  end

  # List organisations.
  # @see https://api.gandi.net/docs/domains#get-v5-organization-organizations
  # @param name [String, #to_s] (optional)
  #   filters the list by name, with optional patterns.
  #   e.g. "alice", "ali*", "*ice"
  # @param type [String, #to_s] (optional)
  #   filters the list by type of organization.
  #   One of: "individual", "company", "association", "publicbody"
  # @param permission [String, #to_s] (optional)
  #   filters the list by the permission the authenticated user
  #   has on that organization and products in it.
  # @param sort_by [String, #to_s] (optional default "name") how to sort the list.
  # @return [Array<GandiV5::Organization>]
  # @raise [GandiV5::Error::GandiError] if Gandi returns an error.
  def self.list(**params)
    params['~name'] = params.delete(:name) if params.key?(:name)
    _resp, data = GandiV5.get "#{url}/organizations", params: params
    data.map { |organisation| from_gandi organisation }
  end

  private

  def self.url
    "#{BASE}organization"
  end
  private_class_method :url
end

#security_phonenil, String (readonly)

Returns phone number used for security recovery processes such as totp recovery.

Returns:

  • (nil, String)

    phone number used for security recovery processes such as totp recovery.



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/gandi_v5/organization.rb', line 40

class Organization
  include GandiV5::Data

  members :username, :name, :lang, :city, :zip, :country, :email, :phone, :security_phone,
          :security_email, :security_email_validated, :security_email_validation_deadline
  member :uuid, gandi_key: 'id'
  member :first_name, gandi_key: 'firstname'
  member :last_name, gandi_key: 'lastname'
  member :street_address, gandi_key: 'streetaddr'
  member :security_email_validation_deadline, converter: GandiV5::Data::Converter::Time

  alias organization_uuid uuid

  # Get information about the current authenticated user.
  # @see https://api.gandi.net/docs/organization#get-v5-organization-user-info
  # @return [GandiV5::Organization]
  # @raise [GandiV5::Error::GandiError] if Gandi returns an error.
  def self.fetch
    _response, data = GandiV5.get "#{url}/user-info"
    from_gandi data
  end

  # List organisations.
  # @see https://api.gandi.net/docs/domains#get-v5-organization-organizations
  # @param name [String, #to_s] (optional)
  #   filters the list by name, with optional patterns.
  #   e.g. "alice", "ali*", "*ice"
  # @param type [String, #to_s] (optional)
  #   filters the list by type of organization.
  #   One of: "individual", "company", "association", "publicbody"
  # @param permission [String, #to_s] (optional)
  #   filters the list by the permission the authenticated user
  #   has on that organization and products in it.
  # @param sort_by [String, #to_s] (optional default "name") how to sort the list.
  # @return [Array<GandiV5::Organization>]
  # @raise [GandiV5::Error::GandiError] if Gandi returns an error.
  def self.list(**params)
    params['~name'] = params.delete(:name) if params.key?(:name)
    _resp, data = GandiV5.get "#{url}/organizations", params: params
    data.map { |organisation| from_gandi organisation }
  end

  private

  def self.url
    "#{BASE}organization"
  end
  private_class_method :url
end

#street_addressnil, String (readonly)

Returns the street address of the user.

Returns:

  • (nil, String)

    the street address of the user.



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/gandi_v5/organization.rb', line 40

class Organization
  include GandiV5::Data

  members :username, :name, :lang, :city, :zip, :country, :email, :phone, :security_phone,
          :security_email, :security_email_validated, :security_email_validation_deadline
  member :uuid, gandi_key: 'id'
  member :first_name, gandi_key: 'firstname'
  member :last_name, gandi_key: 'lastname'
  member :street_address, gandi_key: 'streetaddr'
  member :security_email_validation_deadline, converter: GandiV5::Data::Converter::Time

  alias organization_uuid uuid

  # Get information about the current authenticated user.
  # @see https://api.gandi.net/docs/organization#get-v5-organization-user-info
  # @return [GandiV5::Organization]
  # @raise [GandiV5::Error::GandiError] if Gandi returns an error.
  def self.fetch
    _response, data = GandiV5.get "#{url}/user-info"
    from_gandi data
  end

  # List organisations.
  # @see https://api.gandi.net/docs/domains#get-v5-organization-organizations
  # @param name [String, #to_s] (optional)
  #   filters the list by name, with optional patterns.
  #   e.g. "alice", "ali*", "*ice"
  # @param type [String, #to_s] (optional)
  #   filters the list by type of organization.
  #   One of: "individual", "company", "association", "publicbody"
  # @param permission [String, #to_s] (optional)
  #   filters the list by the permission the authenticated user
  #   has on that organization and products in it.
  # @param sort_by [String, #to_s] (optional default "name") how to sort the list.
  # @return [Array<GandiV5::Organization>]
  # @raise [GandiV5::Error::GandiError] if Gandi returns an error.
  def self.list(**params)
    params['~name'] = params.delete(:name) if params.key?(:name)
    _resp, data = GandiV5.get "#{url}/organizations", params: params
    data.map { |organisation| from_gandi organisation }
  end

  private

  def self.url
    "#{BASE}organization"
  end
  private_class_method :url
end

#usernameString (readonly)

Returns the username of the user.

Returns:

  • (String)

    the username of the user.



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/gandi_v5/organization.rb', line 40

class Organization
  include GandiV5::Data

  members :username, :name, :lang, :city, :zip, :country, :email, :phone, :security_phone,
          :security_email, :security_email_validated, :security_email_validation_deadline
  member :uuid, gandi_key: 'id'
  member :first_name, gandi_key: 'firstname'
  member :last_name, gandi_key: 'lastname'
  member :street_address, gandi_key: 'streetaddr'
  member :security_email_validation_deadline, converter: GandiV5::Data::Converter::Time

  alias organization_uuid uuid

  # Get information about the current authenticated user.
  # @see https://api.gandi.net/docs/organization#get-v5-organization-user-info
  # @return [GandiV5::Organization]
  # @raise [GandiV5::Error::GandiError] if Gandi returns an error.
  def self.fetch
    _response, data = GandiV5.get "#{url}/user-info"
    from_gandi data
  end

  # List organisations.
  # @see https://api.gandi.net/docs/domains#get-v5-organization-organizations
  # @param name [String, #to_s] (optional)
  #   filters the list by name, with optional patterns.
  #   e.g. "alice", "ali*", "*ice"
  # @param type [String, #to_s] (optional)
  #   filters the list by type of organization.
  #   One of: "individual", "company", "association", "publicbody"
  # @param permission [String, #to_s] (optional)
  #   filters the list by the permission the authenticated user
  #   has on that organization and products in it.
  # @param sort_by [String, #to_s] (optional default "name") how to sort the list.
  # @return [Array<GandiV5::Organization>]
  # @raise [GandiV5::Error::GandiError] if Gandi returns an error.
  def self.list(**params)
    params['~name'] = params.delete(:name) if params.key?(:name)
    _resp, data = GandiV5.get "#{url}/organizations", params: params
    data.map { |organisation| from_gandi organisation }
  end

  private

  def self.url
    "#{BASE}organization"
  end
  private_class_method :url
end

#uuidString (readonly) Also known as: organization_uuid

Returns the sharing uuid of the user.

Returns:

  • (String)

    the sharing uuid of the user.



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/gandi_v5/organization.rb', line 40

class Organization
  include GandiV5::Data

  members :username, :name, :lang, :city, :zip, :country, :email, :phone, :security_phone,
          :security_email, :security_email_validated, :security_email_validation_deadline
  member :uuid, gandi_key: 'id'
  member :first_name, gandi_key: 'firstname'
  member :last_name, gandi_key: 'lastname'
  member :street_address, gandi_key: 'streetaddr'
  member :security_email_validation_deadline, converter: GandiV5::Data::Converter::Time

  alias organization_uuid uuid

  # Get information about the current authenticated user.
  # @see https://api.gandi.net/docs/organization#get-v5-organization-user-info
  # @return [GandiV5::Organization]
  # @raise [GandiV5::Error::GandiError] if Gandi returns an error.
  def self.fetch
    _response, data = GandiV5.get "#{url}/user-info"
    from_gandi data
  end

  # List organisations.
  # @see https://api.gandi.net/docs/domains#get-v5-organization-organizations
  # @param name [String, #to_s] (optional)
  #   filters the list by name, with optional patterns.
  #   e.g. "alice", "ali*", "*ice"
  # @param type [String, #to_s] (optional)
  #   filters the list by type of organization.
  #   One of: "individual", "company", "association", "publicbody"
  # @param permission [String, #to_s] (optional)
  #   filters the list by the permission the authenticated user
  #   has on that organization and products in it.
  # @param sort_by [String, #to_s] (optional default "name") how to sort the list.
  # @return [Array<GandiV5::Organization>]
  # @raise [GandiV5::Error::GandiError] if Gandi returns an error.
  def self.list(**params)
    params['~name'] = params.delete(:name) if params.key?(:name)
    _resp, data = GandiV5.get "#{url}/organizations", params: params
    data.map { |organisation| from_gandi organisation }
  end

  private

  def self.url
    "#{BASE}organization"
  end
  private_class_method :url
end

#zipnil, String (readonly)

Returns zip code of the address.

Returns:

  • (nil, String)

    zip code of the address.



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/gandi_v5/organization.rb', line 40

class Organization
  include GandiV5::Data

  members :username, :name, :lang, :city, :zip, :country, :email, :phone, :security_phone,
          :security_email, :security_email_validated, :security_email_validation_deadline
  member :uuid, gandi_key: 'id'
  member :first_name, gandi_key: 'firstname'
  member :last_name, gandi_key: 'lastname'
  member :street_address, gandi_key: 'streetaddr'
  member :security_email_validation_deadline, converter: GandiV5::Data::Converter::Time

  alias organization_uuid uuid

  # Get information about the current authenticated user.
  # @see https://api.gandi.net/docs/organization#get-v5-organization-user-info
  # @return [GandiV5::Organization]
  # @raise [GandiV5::Error::GandiError] if Gandi returns an error.
  def self.fetch
    _response, data = GandiV5.get "#{url}/user-info"
    from_gandi data
  end

  # List organisations.
  # @see https://api.gandi.net/docs/domains#get-v5-organization-organizations
  # @param name [String, #to_s] (optional)
  #   filters the list by name, with optional patterns.
  #   e.g. "alice", "ali*", "*ice"
  # @param type [String, #to_s] (optional)
  #   filters the list by type of organization.
  #   One of: "individual", "company", "association", "publicbody"
  # @param permission [String, #to_s] (optional)
  #   filters the list by the permission the authenticated user
  #   has on that organization and products in it.
  # @param sort_by [String, #to_s] (optional default "name") how to sort the list.
  # @return [Array<GandiV5::Organization>]
  # @raise [GandiV5::Error::GandiError] if Gandi returns an error.
  def self.list(**params)
    params['~name'] = params.delete(:name) if params.key?(:name)
    _resp, data = GandiV5.get "#{url}/organizations", params: params
    data.map { |organisation| from_gandi organisation }
  end

  private

  def self.url
    "#{BASE}organization"
  end
  private_class_method :url
end

Class Method Details

.fetchGandiV5::Organization

Get information about the current authenticated user.



57
58
59
60
# File 'lib/gandi_v5/organization.rb', line 57

def self.fetch
  _response, data = GandiV5.get "#{url}/user-info"
  from_gandi data
end

.list(**params) ⇒ Array<GandiV5::Organization>

List organisations.

Parameters:

  • name (String, #to_s)

    (optional) filters the list by name, with optional patterns. e.g. “alice”, “ali*”, “*ice”

  • type (String, #to_s)

    (optional) filters the list by type of organization. One of: “individual”, “company”, “association”, “publicbody”

  • permission (String, #to_s)

    (optional) filters the list by the permission the authenticated user has on that organization and products in it.

  • sort_by (String, #to_s)

    (optional default “name”) how to sort the list.

Returns:

Raises:

See Also:



76
77
78
79
80
# File 'lib/gandi_v5/organization.rb', line 76

def self.list(**params)
  params['~name'] = params.delete(:name) if params.key?(:name)
  _resp, data = GandiV5.get "#{url}/organizations", params: params
  data.map { |organisation| from_gandi organisation }
end