--------------------------------------------------------
--  DDL for Package PKG_SICD_COMMONS
--------------------------------------------------------

  CREATE OR REPLACE EDITIONABLE PACKAGE "ENVX_OPER"."PKG_SICD_COMMONS" AS

/*--------------- FNC01-------------------*/
   FUNCTION f_rest_call (
      p_body              IN VARCHAR2,
      p_url               IN VARCHAR2,
      p_http_verb         IN VARCHAR2,
      p_http_version      IN VARCHAR2,
      p_http_content_type IN VARCHAR2 DEFAULT NULL,
      p_http_accept       IN VARCHAR2,
      p_one_way           IN BOOLEAN DEFAULT false,
      p_response_text     OUT CLOB,
      p_reason_phrase     OUT VARCHAR2
   ) RETURN NUMBER;

/*--------------- FNC02-------------------*/

   FUNCTION f_system_message (
      pi_id_message    NUMBER,
      pi_message_class VARCHAR2,
      pi_return_type   NUMBER DEFAULT 1
     -- 0- SIMPLE / 1- COMPLETE / 2- ADDITIONAL INFO
   ) RETURN VARCHAR2;

/*--------------- FNC03-------------------*/

   FUNCTION get_parameter_value (
      param_name VARCHAR2
   ) RETURN VARCHAR2;

/*--------------- FNC04-------------------*/

   FUNCTION get_parameter_list (
      param_name VARCHAR2
   ) RETURN SYS_REFCURSOR;

/*--------------- FNC05-------------------*/

   FUNCTION get_parameter_list_q (
      param_name VARCHAR2
   ) RETURN VARCHAR2;

/*--------------- FNC06-------------------*/

   FUNCTION fnc_ldap_auth (
      p_username IN VARCHAR2,
      p_password IN VARCHAR2
   ) RETURN BOOLEAN;

/*--------------- FNC07-------------------*/

   FUNCTION f_access_token_sicddb RETURN VARCHAR2;

/*--------------- FNC08-------------------*/

   FUNCTION fnc_ad_auth (
      p_username IN VARCHAR2,
      p_password IN VARCHAR2
   ) RETURN BOOLEAN;

/*--------------- FNC09-------------------*/
   FUNCTION fnc_auth_groups (
      p_js_parameters json DEFAULT NULL
   ) RETURN BOOLEAN;
   
/*--------------- FNC10-------------------*/
FUNCTION fnc_parameter_validator(pi_value IN CLOB, pi_type IN NUMBER)
   RETURN BOOLEAN;
   
/*--------------- PR01-------------------*/

   PROCEDURE p_rest_call_apim (
      pi_url           IN VARCHAR2,
      pi_http_method   IN VARCHAR2 DEFAULT 'GET',
      pi_body          IN CLOB DEFAULT empty_clob(),
      po_http_status   OUT VARCHAR2,
      po_http_headers  OUT http_headers_tab,
      po_response      OUT CLOB,
      po_response_code OUT VARCHAR2,
      po_error_message OUT VARCHAR2
   ); 
-------------------------------------------


END pkg_sicd_commons;

/

  GRANT EXECUTE ON "ENVX_OPER"."PKG_SICD_COMMONS" TO "APEX_REST_PUBLIC_USER";
  GRANT DEBUG ON "ENVX_OPER"."PKG_SICD_COMMONS" TO "APEX_REST_PUBLIC_USER";
