Class: AtlasRb::Admin::Community
- Inherits:
-
Object
- Object
- AtlasRb::Admin::Community
- Extended by:
- FaradayHelper
- Defined in:
- lib/atlas_rb/admin/community.rb
Overview
Destructive lifecycle operations on a Community.
See AtlasRb::Admin for the rationale behind the namespace and the
confirm: :i_understand friction marker.
Constant Summary collapse
- ROUTE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Atlas REST endpoint prefix.
"/communities/"
Class Method Summary collapse
-
.destroy(id, confirm:, nuid: nil, on_behalf_of: nil) ⇒ Faraday::Response
Hard-delete a Community.
-
.restore(id, nuid: nil, on_behalf_of: nil) ⇒ Faraday::Response
Restore a previously-tombstoned Community.
Methods included from FaradayHelper
connection, multipart, system_connection
Class Method Details
.destroy(id, confirm:, nuid: nil, on_behalf_of: nil) ⇒ Faraday::Response
Hard-delete a Community.
Unrecoverable — prefer Community.tombstone for user-visible withdrawal. Operator-only.
32 33 34 35 36 37 38 |
# File 'lib/atlas_rb/admin/community.rb', line 32 def self.destroy(id, confirm:, nuid: nil, on_behalf_of: nil) unless confirm == :i_understand raise ArgumentError, "AtlasRb::Admin::Community.destroy requires confirm: :i_understand" end connection({}, nuid, on_behalf_of: on_behalf_of).delete(ROUTE + id) end |
.restore(id, nuid: nil, on_behalf_of: nil) ⇒ Faraday::Response
Restore a previously-tombstoned Community.
49 50 51 |
# File 'lib/atlas_rb/admin/community.rb', line 49 def self.restore(id, nuid: nil, on_behalf_of: nil) connection({}, nuid, on_behalf_of: on_behalf_of).post(ROUTE + id + '/restore') end |