Class: ApiEngineBase::Inbox::MessageBlastController
- Inherits:
-
ApplicationController
- Object
- ActionController::API
- ApplicationController
- ApiEngineBase::Inbox::MessageBlastController
- Includes:
- SchemaHelper
- Defined in:
- app/controllers/api_engine_base/inbox/message_blast_controller.rb
Constant Summary
Constants inherited from ApplicationController
ApplicationController::AUTHENTICATION_EXPIRE_HEADER, ApplicationController::AUTHENTICATION_HEADER, ApplicationController::AUTHENTICATION_WITH_RESET
Instance Method Summary collapse
-
#blast ⇒ Object
GET /inbox/blast/:id.
-
#create ⇒ Object
POST /inbox/blast.
-
#delete ⇒ Object
DELETE /inbox/blast/:id.
-
#metadata ⇒ Object
GET /inbox/blast.
-
#modify ⇒ Object
PATCH /inbox/blast/:id.
Methods included from SchemaHelper
#invalid_arguments!, #schema_succesful!
Methods inherited from ApplicationController
#authenticate_user!, #authenticate_user_without_email_verification!, #authorize_user!, #current_user, #safe_boolean
Instance Method Details
#blast ⇒ Object
GET /inbox/blast/:id
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'app/controllers/api_engine_base/inbox/message_blast_controller.rb', line 18 def blast result = ApiEngineBase::InboxService::Blast::Retrieve.(id: params[:id].to_i) if result.success? schema = result. status = 200 schema_succesful!(status:, schema:) else invalid_arguments!( status: 400, message: result.msg, argument_object: result.invalid_argument_hash, schema: ApiEngineBase::Schema::PlainText::LoginRequest, ) end end |
#create ⇒ Object
POST /inbox/blast
35 36 37 |
# File 'app/controllers/api_engine_base/inbox/message_blast_controller.rb', line 35 def create upsert end |
#delete ⇒ Object
DELETE /inbox/blast/:id
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'app/controllers/api_engine_base/inbox/message_blast_controller.rb', line 45 def delete result = ApiEngineBase::InboxService::Blast::Delete.(id: params[:id].to_i) if result.success? schema = result. status = 200 render :json, { id: params[:id], msg: "Message Blast message deleted" } else invalid_arguments!( status: 400, message: result.msg, argument_object: result.invalid_argument_hash, schema: ApiEngineBase::Schema::PlainText::LoginRequest, ) end end |
#metadata ⇒ Object
GET /inbox/blast
12 13 14 15 |
# File 'app/controllers/api_engine_base/inbox/message_blast_controller.rb', line 12 def result = ApiEngineBase::InboxService::Blast::Metadata.(id: params[:id].to_i) schema_succesful!(status: 200, schema: result.) end |
#modify ⇒ Object
PATCH /inbox/blast/:id
40 41 42 |
# File 'app/controllers/api_engine_base/inbox/message_blast_controller.rb', line 40 def modify upsert(id: params[:id].to_i) end |