Update or replace enumeration values of a property
put
/rest/ofscMetadata/v1/properties/{label}/enumerationList
This operation updates or replaces the enumeration values of the specified property.
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.
Request
Path Parameters
-
label(required): string
Minimum Length:
1
Maximum Length:40
The label of the property.
The property enumerations object that needs to be updated.
Root Schema : schema
Type:
Show Source
array
-
Array of:
array Items
Title:
Items
An array of enumeration values.Note: At least one item in the array should be active.
Nested Schema : Items
Type:
array
Title:
Items
An array of enumeration values.
Show Source
Note: At least one item in the array should be active.
-
Array of:
object Property Enumeration
Title:
Property Enumeration
Nested Schema : Property Enumeration
Type:
object
Title:
Show Source
Property Enumeration
-
active:
boolean
Title:
Active
Contains 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:
Label
Minimum Length:1
Maximum Length:255
The 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:
Translations
An array containing the translations of the enumeration item in different languages.
Nested Schema : Translations
Type:
array
Title:
Translations
An array containing the translations of the enumeration item in different languages.
Show Source
Nested Schema : Translation
Type:
Show Source
object
-
language(required):
string
This field contains language code of a text translation, it conatains two characters length code in responses (e.g. 'en', 'es') but can be used in requests as extended ISO code (e.g. 'en-US') as well as old two character format.
-
languageISO:
string
This field is used only in responses and returns ISO language code (e.g. 'en-US'). This field is ignored in the requests (use 'language' instead)
-
name(required):
string
Response
Supported Media Types
- application/json
- application/schema+json
200 Response
This section describes the 200 status response for this operation.
Root Schema : Property Enumeration
Type:
object
Title:
Show Source
Property Enumeration
-
active:
boolean
Title:
Active
Contains 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:
Label
Minimum Length:1
Maximum Length:255
The 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:
Translations
An array containing the translations of the enumeration item in different languages.
Nested Schema : Translations
Type:
array
Title:
Translations
An array containing the translations of the enumeration item in different languages.
Show Source
Nested Schema : Translation
Type:
Show Source
object
-
language(required):
string
This field contains language code of a text translation, it conatains two characters length code in responses (e.g. 'en', 'es') but can be used in requests as extended ISO code (e.g. 'en-US') as well as old two character format.
-
languageISO:
string
This field is used only in responses and returns ISO language code (e.g. 'en-US'). This field is ignored in the requests (use 'language' instead)
-
name(required):
string
Default Response
This section describes the default error response for this operation.
Root Schema : Error
Type:
Show Source
object
-
detail:
string
The detailed description of this error.
-
status:
string
The HTTP status code of this error.
-
title(required):
string
The brief description of this error.
-
type(required):
string
The URL of the web page containing more details about this error.
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" } ] } ] }