lib/fastly/customer.rb in fastly-2.0.0 vs lib/fastly/customer.rb in fastly-2.1.0
- old
+ new
@@ -1,26 +1,78 @@
class Fastly
# A Customer account
class Customer < Base
- attr_accessor :id, :name, :owner_id
+ attr_accessor :billing_contact_id, :id, :legal_contact_id, :name,
+ :owner_id, :security_contact_id, :technical_contact_id
##
+ # :attr: billing_contact_id
+ #
+ # The id of the user to be contacted for billing issues.
+
+ ##
# :attr: id
#
# The id of this customer
##
+ # :attr: legal_contact_id
+ #
+ # The id of the user to be contacted for legal issues.
+
+ ##
# :attr: name
#
# The name of this customer
##
# :attr: owner_id
#
# The id of the user that owns this customer
- # Return a user object representing the owner of this Customer
+ ##
+ # :attr: security_contact_id
+ #
+ # The id of the user to be contacted for security issues.
+
+ ##
+ # :attr: technical_contact_id
+ #
+ # The id of the user to be contacted for technical issues.
+
+ ##
+ # The billing contact as a Fastly::User
+ def billing_contact
+ get_user billing_contact_id
+ end
+
+ ##
+ # The legal contact as a Fastly::User
+ def legal_contact
+ get_user legal_contact_id
+ end
+
+ ##
+ # The account owner as a Fastly::User
def owner
- fetcher.get(User, owner_id)
+ get_user owner_id
+ end
+
+ ##
+ # The security contact as a Fastly::User
+ def security_contact
+ get_user security_contact_id
+ end
+
+ ##
+ # The technical contact as a Fastly::User
+ def technical_contact
+ get_user technical_contact_id
+ end
+
+ private
+
+ def get_user(id)
+ id ? fetcher.get(User, id) : nil
end
end
end