Update or replace enumeration values of a property
/rest/ofscMetadata/v1/properties/{label}/enumerationList
The operation is applicable only for properties of type 'enumeration'.
Consider the following while updating the enumeration values of a property:
- The specified property must exist in Oracle Field Service.
- The enumeration values cannot be deleted.
- The property 'country_code' cannot be updated using this operation, though the property is of type enumeration.
- The field 'label' cannot be set to '-1' or '0'.
- The English translation for each enumeration value is required and cannot be cleared.
- API doesn't allow to set "inactive" status for all items, at least one item should remain active.
Request
-
label(required): string
Minimum Length:
1Maximum Length:40The label of the property.
array-
Array of:
array Items
Title:
ItemsAn array of enumeration values.Note: At least one item in the array should be active.
arrayItemsNote: At least one item in the array should be active.
-
Array of:
object Property Enumeration
Title:
Property Enumeration
objectProperty Enumeration-
active:
boolean
Title:
ActiveContains one of the following values: true or false. If true, then the enumeration item is active. If false, then then the enumeration item is inactive. -
label(required):
string
Title:
LabelMinimum Length:1Maximum Length:255The code of the enumeration item. This code is unique only to the specified property. The values '0' and '-1' are reserved for internal purposes and cannot be used. The values cannot be changed or deleted. -
translations(required):
array Translations
Title:
TranslationsAn array containing the translations of the enumeration item in different languages.
arrayTranslationsobject-
language(required):
string
The language code of the translated text. The code in the response is two characters long (for example, 'en', 'es').
See Supported Language Codes to view the values that are supported.
-
languageISO:
string
The ISO language code (for example, 'en-US').
-
name(required):
string
The specified name of the property translated to the language code available in the system.
Response
- application/json
- application/schema+json
200 Response
objectProperty Enumeration-
active:
boolean
Title:
ActiveContains one of the following values: true or false. If true, then the enumeration item is active. If false, then then the enumeration item is inactive. -
label(required):
string
Title:
LabelMinimum Length:1Maximum Length:255The code of the enumeration item. This code is unique only to the specified property. The values '0' and '-1' are reserved for internal purposes and cannot be used. The values cannot be changed or deleted. -
translations(required):
array Translations
Title:
TranslationsAn array containing the translations of the enumeration item in different languages.
arrayTranslationsobject-
language(required):
string
The language code of the translated text. The code in the response is two characters long (for example, 'en', 'es').
See Supported Language Codes to view the values that are supported.
-
languageISO:
string
The ISO language code (for example, 'en-US').
-
name(required):
string
The specified name of the property translated to the language code available in the system.
Default Response
object-
detail:
string
The detailed information about the error.
-
status:
string
The HTTP status code.
-
title:
string
The summary of the error message.
-
type:
string
The URL of the page containing the error details.
Examples
The following example shows how to update or replace the enumeration of property's by submitting a PUT request on the REST resource.
Example of Request Header
The following shows an example of the request header.
curl -u 'clientId@instanceName:clientSecret' \
-X PUT \
--url 'https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/properties/someEnumPropertyLabel/enumerationList' \
-d '{
"items": [
{
"label": "code1",
"active": true,
"translations": [
{
"language": "en",
"name": "Code 1"
}
]
},
{
"label": "code2",
"active": true,
"translations": [
{
"language": "en",
"name": "Code 2"
}
]
}
]
}'
Example of Response Body
The following example shows the contents of the response body in JSON format.
HTTP/1.1 200 OK
{
"items": [
{
"label": "code1",
"active": true,
"translations": [
{
"language": "en",
"name": "Code 1"
}
]
},
{
"label": "code2",
"active": true,
"translations": [
{
"language": "en",
"name": "Code 2"
}
]
}
]
}