Class ZCL_IBMC_SERVICE_EXT

public inheriting from zcl_ibmc_service create public

Documentation

Extended REST API service class

Types

Visibility and LevelNameDocumentation
publicts_oauth_prop (structured type) 
publicty_image_class type string 
publicty_image_format (typing) 
publicty_instance_id (typing) 
publicty_servicename (typing) 

Constants

Visibility and LevelNameDocumentation
public staticc_field_none type fieldname value '###'Field Name
public staticc_format_all type ty_image_format value '*'Image encoding (jpg, png, ...)
public staticc_format_gif type ty_image_format value 'gif'Image encoding (jpg, png, ...)
public staticc_format_jpg type ty_image_format value 'jpg'Image encoding (jpg, png, ...)
public staticc_format_png type ty_image_format value 'png'Image encoding (jpg, png, ...)
public staticc_format_tif type ty_image_format value 'tif'Image encoding (jpg, png, ...)
public staticc_format_unknown type ty_image_format value '###'Image encoding (jpg, png, ...)
public staticc_format_zip type ty_image_format value 'zip'Image encoding (jpg, png, ...)
public staticc_iam_token_host type string value 'iam.cloud.ibm.com' 
public staticc_iam_token_path type string value '/identity/token' 
public staticc_icp4d_token_path type string value '/v1/preauth/validateAuth' 
public staticc_token_generation_always type char value 'A' 
public staticc_token_generation_auto type char value space 
public staticc_token_generation_never type char value 'N' 

Attributes

Visibility and LevelNameDocumentation
public instancep_instance_id type ty_instance_id  
public instancep_servicename type ty_servicename  

Methods

Visibility and LevelNameDocumentation
public static
get_instance
importingi_instance_idtype ty_instance_id optional
i_urltype string optional
i_hosttype string optional
i_usernametype string optional
i_passwordtype string optional
i_proxy_hosttype string optional
i_proxy_porttype string optional
i_apikeytype string optional
i_auth_methodtype string default c_default
i_oauth_proptype ts_oauth_prop optional
i_access_tokentype ts_access_token optional
i_token_generationtype char default c_token_generation_auto
i_request_headerstype string optional
i_versiontype string optional
exportingvalue(eo_instance)type any

Factory method to instantiate a service specific wrapper class.

Parameters
i_instance_id Value of field INSTANCE_UID in table ZIBMC_CONFIG. Service credentials are read from table ZIBMC_CONFIG with key SERVICE = Name of service wrapper class without prefix ZCL_IBMC_ and INSTANCE_UID.
i_url URL of the service.
i_host Host of the service. I_URL and I_HOST can be used synonymously.
i_username User password to authenticate on service.
i_password User password to authenticate on service.
i_proxy_host Proxy server, not applicable on SAP Cloud Platform.
i_proxy_port Proxy server port, not applicable on SAP Cloud Platform.
i_apikey API key password to authenticate on service.
i_auth_method Authentication method. Possible values are "IAM", "ICP4D", "basicAuth", "NONE".
i_oauth_prop Credentials to generate token for OAuth authentication.
i_token_generation Method for access token refresh:
C_TOKEN_GENERATION_NEVER - Access token is not refreshed. C_TOKEN_GENERATION_ALWAYS - Access to token is refreshed for each service call. C_TOKEN_GENERATION_AUTO - Access to token is refreshed just before it expires.
i_request_headers List of headers sent with every request, format 'Header1=Value1;Header2=Value2'.
i_version Value of query parameter VERSION.
public static
get_zipdata
importingit_examplestype any table
iv_field_classtype fieldname default c_field_none
iv_field_filenametype fieldname optional
iv_field_imagetype fieldname optional
iv_image_formattype ty_image_format optional
iv_image_nametype string optional
exportinget_zipdatatype tt_map_file
raisingzcx_ibmc_service_exception

Compresses multiple images from an internal table

to a one or more xstrings in ZIP format.
Parameters
it_examples Internal table of images.
iv_field_class Field in IT_EXAMPLES that contains the file class. All records in IT_EXAMPLES with same class will be compress into one ZIP xstring.
iv_field_filename Field in IT_EXAMPLES that contains the filename for the image.
iv_field_image Field in IT_EXAMPLES that contains the image.
iv_image_format Format of the image. Possible values are C_FORMAT_JPG, C_FORMAT_PNG, C_FORMAT_GIF, C_FORMAT_TIF, C_FORMAT_ALL.
iv_image_name Name of the image.
et_zipdata Internal table containing a compressed ZIP xstring for each image class.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instanceget_access_token redefinition 
public instance
get_bearer_token
returningvalue(e_bearer_token)type string

Returns the bearer token, if available.

Parameters
e_bearer_token Access token.
public instance
get_config_value
importingi_defaulttype zibmc_config-value optional
i_paramtype zibmc_config-param
returningvalue(e_value)type zibmc_config-value
raisingzcx_ibmc_service_exception

Retrieves a value of a configuration parameter

from table ZIBMC_CONFIG.
Parameters
i_default Default value, if configuration parameter is not found.
i_param Configuration parameter name.
public instanceget_request_prop redefinition 
public instance
get_sdk_version_date
returningvalue(e_sdk_version_date)type string

Returns the SDK built date.

Parameters
e_sdk_version_date Built data in format YYYYMMDD.
public instance
set_bearer_token
importingi_bearer_tokentype string

Method for internal use.