Class: RES::Service

Inherits:
Common::Client::Base show all
Includes:
Common::Client::Concerns::Monitoring
Defined in:
lib/res/service.rb

Direct Known Subclasses

Ch31Form

Instance Method Summary collapse

Methods included from Common::Client::Concerns::Monitoring

#increment, #increment_failure, #increment_total, #with_monitoring

Methods inherited from Common::Client::Base

#config, configuration, #connection, #delete, #get, #perform, #post, #put, #raise_backend_exception, #raise_not_authenticated, #request, #sanitize_headers!, #service_name

Methods included from SentryLogging

#log_exception_to_sentry, #log_message_to_sentry, #non_nil_hash?, #normalize_level, #rails_logger, #set_sentry_metadata

Instance Method Details

#end_pointObject (private)



30
31
32
# File 'lib/res/service.rb', line 30

def end_point
  "#{Settings.res.base_url}/suite/webapi/form281900"
end

#request_headersObject



22
23
24
25
26
# File 'lib/res/service.rb', line 22

def request_headers
  {
    'Appian-API-Key': Settings.res.api_key
  }
end

#send_to_res(payload:) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'lib/res/service.rb', line 11

def send_to_res(payload:)
  with_monitoring do
    perform(
      :post,
      end_point,
      payload,
      request_headers
    ) # see lib/common/client/base.rb#L94
  end
end