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)



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)



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)



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)



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)



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)



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)



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)



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)



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)



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)



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)



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)



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)



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



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)



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.



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