Skip to main content

Actions

The ballerinax/sap.successfactors.ecglobalassignment package exposes the following clients:

Available clients:

ClientPurpose
ClientManages ecglobalassignment objects: SecondaryAssignmentsItem, SecondaryAssignments, RightToReturn, EmpGlobalAssignment, over the SAP SuccessFactors OData v2 API.

Client​

You can use these APIs to manage the assignment information of the employees who are assigned to another company within the organization.

Configuration​

ConnectionConfig​

Provides a set of configurations for controlling the behaviours when communicating with the SAP SuccessFactors OData endpoint. Passed as the argument to the client initializer.

FieldTypeDefaultDescription
authhttp:CredentialsConfigRequiredConfigurations related to client authentication
httpVersionhttp:HttpVersionSee defaultThe HTTP version understood by the client
http1Settingshttp:ClientHttp1SettingsSee defaultConfigurations related to HTTP/1.x protocol
http2Settingshttp:ClientHttp2SettingsSee defaultConfigurations related to HTTP/2 protocol
timeoutdecimalSee defaultThe maximum time to wait (in seconds) for a response before closing the connection
forwardedstringSee defaultThe choice of setting forwarded/x-forwarded header
followRedirectshttp:FollowRedirectsOptionalConfigurations associated with Redirection
poolConfighttp:PoolConfigurationOptionalConfigurations associated with request pooling
cachehttp:CacheConfigSee defaultHTTP caching related configurations
compressionhttp:CompressionSee defaultSpecifies the way of handling compression (accept-encoding) header
circuitBreakerhttp:CircuitBreakerConfigOptionalConfigurations associated with the behaviour of the Circuit Breaker
retryConfighttp:RetryConfigOptionalConfigurations associated with retrying
cookieConfighttp:CookieConfigOptionalConfigurations associated with cookies
responseLimitshttp:ResponseLimitConfigsSee defaultConfigurations associated with inbound response size limits
secureSockethttp:ClientSecureSocketOptionalSSL/TLS-related options
proxyhttp:ProxyConfigOptionalProxy server related options
socketConfighttp:ClientSocketConfigSee defaultProvides settings related to client socket configuration
validationbooleanSee defaultEnables the inbound payload validation functionality which provided by the constraint package. Enabled by default
laxDataBindingbooleanSee defaultEnables relaxed data binding on the client side. When enabled, nil values are treated as optional, and absent fields are handled as nilable types. Enabled by default.

The client also accepts a hostname string parameter (the SAP SuccessFactors API server host) and an optional port (defaults to 443).

Initializing the client​

import ballerinax/sap.successfactors.ecglobalassignment;

configurable string hostname = ?;
configurable string username = ?;
configurable string password = ?;

ecglobalassignment:Client client = check new (
{
auth: { username, password }
},
hostname
);

Operations​

SecondaryAssignmentsItem​

listSecondaryAssignmentsItems

Queries the SecondaryAssignmentsItem collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListSecondaryAssignmentsItemsQueriesNoQueries to be sent with the request

Returns: ListSecondaryAssignmentsItemsResponse&#124;error

Sample code:

ListSecondaryAssignmentsItemsResponse result = check client->listSecondaryAssignmentsItems();

Sample response:

{
"d": {
"results": [
{
"d": {}
}
]
}
}
createSecondaryAssignmentsItem

Creates a new SecondaryAssignmentsItem entity from the supplied payload.

Parameters:

NameTypeRequiredDescription
payloadSecondaryAssignmentsItemYesNew entity
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: CreatedSecondaryAssignmentsItem&#124;error

Sample code:

CreatedSecondaryAssignmentsItem result = check client->createSecondaryAssignmentsItem(payload);

Sample response:

{
"d": {
"d": {}
}
}
getSecondaryAssignmentsItem

Retrieves a single SecondaryAssignmentsItem entity identified by its key properties.

Parameters:

NameTypeRequiredDescription
SecondaryAssignments_effectiveStartDatestringYeskey: SecondaryAssignments_effectiveStartDate
SecondaryAssignments_externalCodestringYeskey: SecondaryAssignments_externalCode
externalCodestringYeskey: externalCode
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetSecondaryAssignmentsItemQueriesNoQueries to be sent with the request

Returns: SecondaryAssignmentsItem&#124;error

Sample code:

SecondaryAssignmentsItem result = check client->getSecondaryAssignmentsItem(SecondaryAssignments_effectiveStartDate, SecondaryAssignments_externalCode, externalCode);

Sample response:

{
"d": {}
}
updateSecondaryAssignmentsItem

Updates the SecondaryAssignmentsItem identified by its key properties with the supplied payload.

Parameters:

NameTypeRequiredDescription
SecondaryAssignments_effectiveStartDatestringYeskey: SecondaryAssignments_effectiveStartDate
SecondaryAssignments_externalCodestringYeskey: SecondaryAssignments_externalCode
externalCodestringYeskey: externalCode
payloadModifiedSecondaryAssignmentsItemYesNew property values
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->updateSecondaryAssignmentsItem(SecondaryAssignments_effectiveStartDate, SecondaryAssignments_externalCode, externalCode, payload);
deleteSecondaryAssignmentsItem

Deletes the SecondaryAssignmentsItem identified by its key properties.

Parameters:

NameTypeRequiredDescription
SecondaryAssignments_effectiveStartDatestringYeskey: SecondaryAssignments_effectiveStartDate
SecondaryAssignments_externalCodestringYeskey: SecondaryAssignments_externalCode
externalCodestringYeskey: externalCode
headersDeleteSecondaryAssignmentsItemHeadersNoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deleteSecondaryAssignmentsItem(SecondaryAssignments_effectiveStartDate, SecondaryAssignments_externalCode, externalCode);

SecondaryAssignments​

listSecondaryAssignmentss

Queries the SecondaryAssignments collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListSecondaryAssignmentssQueriesNoQueries to be sent with the request

Returns: ListSecondaryAssignmentssResponse&#124;error

Sample code:

ListSecondaryAssignmentssResponse result = check client->listSecondaryAssignmentss();

Sample response:

{
"d": {
"results": [
{
"effectiveStartDate": "2026-01-01",
"externalCode": "1000",
"allSfProcesses": {}
}
]
}
}
createSecondaryAssignments

Creates a new SecondaryAssignments entity from the supplied payload.

Parameters:

NameTypeRequiredDescription
payloadSecondaryAssignmentsYesNew entity
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: CreatedSecondaryAssignments&#124;error

Sample code:

CreatedSecondaryAssignments result = check client->createSecondaryAssignments(payload);

Sample response:

{
"d": {
"effectiveStartDate": "2026-01-01",
"externalCode": "1000",
"allSfProcesses": {
"results": []
}
}
}
getSecondaryAssignments

Retrieves a single SecondaryAssignments entity identified by its key properties.

Parameters:

NameTypeRequiredDescription
effectiveStartDatestringYeskey: effectiveStartDate
externalCodestringYeskey: externalCode
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetSecondaryAssignmentsQueriesNoQueries to be sent with the request

Returns: SecondaryAssignments&#124;error

Sample code:

SecondaryAssignments result = check client->getSecondaryAssignments(effectiveStartDate, externalCode);

Sample response:

{
"effectiveStartDate": "2026-01-01",
"externalCode": "1000",
"allSfProcesses": {
"results": [
{
"d": {}
}
]
}
}
updateSecondaryAssignments

Updates the SecondaryAssignments identified by its key properties with the supplied payload.

Parameters:

NameTypeRequiredDescription
effectiveStartDatestringYeskey: effectiveStartDate
externalCodestringYeskey: externalCode
payloadModifiedSecondaryAssignmentsYesNew property values
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->updateSecondaryAssignments(effectiveStartDate, externalCode, payload);
deleteSecondaryAssignments

Deletes the SecondaryAssignments identified by its key properties.

Parameters:

NameTypeRequiredDescription
effectiveStartDatestringYeskey: effectiveStartDate
externalCodestringYeskey: externalCode
headersDeleteSecondaryAssignmentsHeadersNoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deleteSecondaryAssignments(effectiveStartDate, externalCode);

RightToReturn​

listRightToReturns

Queries the RightToReturn collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListRightToReturnsQueriesNoQueries to be sent with the request

Returns: ListRightToReturnsResponse&#124;error

Sample code:

ListRightToReturnsResponse result = check client->listRightToReturns();

Sample response:

{
"d": {
"results": [
{
"Position_code": "1000",
"Position_effectiveStartDate": "2026-01-01",
"code": "1000"
}
]
}
}
createRightToReturn

Creates a new RightToReturn entity from the supplied payload.

Parameters:

NameTypeRequiredDescription
payloadRightToReturnYesNew entity
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: CreatedRightToReturn&#124;error

Sample code:

CreatedRightToReturn result = check client->createRightToReturn(payload);

Sample response:

{
"d": {
"Position_code": "1000",
"Position_effectiveStartDate": "2026-01-01",
"code": "1000"
}
}
getRightToReturn

Retrieves a single RightToReturn entity identified by its key properties.

Parameters:

NameTypeRequiredDescription
Position_codestringYeskey: Position_code
Position_effectiveStartDatestringYeskey: Position_effectiveStartDate
codestringYeskey: code
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetRightToReturnQueriesNoQueries to be sent with the request

Returns: RightToReturn&#124;error

Sample code:

RightToReturn result = check client->getRightToReturn(Position_code, Position_effectiveStartDate, code);

Sample response:

{
"Position_code": "1000",
"Position_effectiveStartDate": "2026-01-01",
"code": "1000"
}
updateRightToReturn

Updates the RightToReturn identified by its key properties with the supplied payload.

Parameters:

NameTypeRequiredDescription
Position_codestringYeskey: Position_code
Position_effectiveStartDatestringYeskey: Position_effectiveStartDate
codestringYeskey: code
payloadModifiedRightToReturnYesNew property values
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->updateRightToReturn(Position_code, Position_effectiveStartDate, code, payload);
deleteRightToReturn

Deletes the RightToReturn identified by its key properties.

Parameters:

NameTypeRequiredDescription
Position_codestringYeskey: Position_code
Position_effectiveStartDatestringYeskey: Position_effectiveStartDate
codestringYeskey: code
headersDeleteRightToReturnHeadersNoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deleteRightToReturn(Position_code, Position_effectiveStartDate, code);

EmpGlobalAssignment​

listEmpGlobalAssignments

Queries the EmpGlobalAssignment collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListEmpGlobalAssignmentsQueriesNoQueries to be sent with the request

Returns: ListEmpGlobalAssignmentsResponse&#124;error

Sample code:

ListEmpGlobalAssignmentsResponse result = check client->listEmpGlobalAssignments();

Sample response:

{
"d": {
"results": [
{
"d": {}
}
]
}
}
getEmpGlobalAssignment

Retrieves a single EmpGlobalAssignment entity identified by its key property.

Parameters:

NameTypeRequiredDescription
userIdstringYeskey: userId
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetEmpGlobalAssignmentQueriesNoQueries to be sent with the request

Returns: EmpGlobalAssignment&#124;error

Sample code:

EmpGlobalAssignment result = check client->getEmpGlobalAssignment(userId);

Sample response:

{
"d": {}
}