Update a function

put/functions/{functionId}
Internal-Use Only

Updates the function with the provided content.

Request Samples

1

Response Samples

1{
2 "creationTimeStamp": "2020-08-04T17:46:19.097Z",
3 "modifiedTimeStamp": "2020-08-04T17:47:28.848Z",
4 "createdBy": "brmdev",
5 "modifiedBy": "brmdev",
6 "version": 1,
7 "id": "26674236-bc80-41de-954d-d37b1a19d98d",
8 "categoryId": "85329ae9-52df-444f-8e18-bffb1a523da7",
9 "name": "customadd2",
10 "code": "method customAdd2(double a, double b) returns double; return a + b; end;",
11 "returnType": "double",
12 "signature": [
13 {
14 "type": "double",
15 "name": "a",
16 "inOut": false,
17 "nameQuoted": false
18 },
19 {
20 "type": "double",
21 "name": "b",
22 "inOut": false,
23 "nameQuoted": false
24 }
25 ],
26 "links": [
27 {
28 "method": "GET",
29 "rel": "self",
30 "href": "/businessRules/functions/26674236-bc80-41de-954d-d37b1a19d98d",
31 "uri": "/businessRules/functions/26674236-bc80-41de-954d-d37b1a19d98d",
32 "type": "application/vnd.sas.business.rule.function"
33 },
34 {
35 "method": "PUT",
36 "rel": "update",
37 "href": "/businessRules/functions/26674236-bc80-41de-954d-d37b1a19d98d",
38 "uri": "/businessRules/functions/26674236-bc80-41de-954d-d37b1a19d98d",
39 "type": "application/vnd.sas.business.rule.function"
40 },
41 {
42 "method": "DELETE",
43 "rel": "delete",
44 "href": "/businessRules/functions/26674236-bc80-41de-954d-d37b1a19d98d",
45 "uri": "/businessRules/functions/26674236-bc80-41de-954d-d37b1a19d98d"
46 },
47 {
48 "method": "GET",
49 "rel": "up",
50 "href": "/businessRules/functions",
51 "uri": "/businessRules/functions",
52 "type": "application/vnd.sas.collection",
53 "itemType": "application/vnd.sas.business.rule.function"
54 },
55 {
56 "method": "GET",
57 "rel": "category",
58 "href": "/businessRules/functionCategories/85329ae9-52df-444f-8e18-bffb1a523da7",
59 "uri": "/businessRules/functionCategories/85329ae9-52df-444f-8e18-bffb1a523da7",
60 "type": "application/vnd.sas.business.rule.function.category"
61 }
62 ],
63 "hidden": false,
64 "nameQuoted": false
65}

Path Parameters

NameTypeRequiredDescription
functionId
string
true

The ID of the function to update.

Header Parameters

NameTypeRequiredDescription
If-Match
string
true

The entity tag from the last time the function was retrieved.

Example:
"\"kt144a1d\""

Request Body

A reusable DS2 method with additional metadata.

Example:
{"creationTimeStamp":"2020-08-04T17:46:19.097Z","modifiedTimeStamp":"2020-08-04T17:47:28.848Z","createdBy":"brmdev","modifiedBy":"brmdev","version":1,"id":"26674236-bc80-41de-954d-d37b1a19d98d","categoryId":"85329ae9-52df-444f-8e18-bffb1a523da7","name":"customadd2","code":"method customAdd2(double a, double b) returns double; return a + b; end;","returnType":"double","signature":[{"type":"double","name":"a","inOut":false,"nameQuoted":false},{"type":"double","name":"b","inOut":false,"nameQuoted":false}],"links":[{"method":"GET","rel":"self","href":"/businessRules/functions/26674236-bc80-41de-954d-d37b1a19d98d","uri":"/businessRules/functions/26674236-bc80-41de-954d-d37b1a19d98d","type":"application/vnd.sas.business.rule.function"},{"method":"PUT","rel":"update","href":"/businessRules/functions/26674236-bc80-41de-954d-d37b1a19d98d","uri":"/businessRules/functions/26674236-bc80-41de-954d-d37b1a19d98d","type":"application/vnd.sas.business.rule.function"},{"method":"DELETE","rel":"delete","href":"/businessRules/functions/26674236-bc80-41de-954d-d37b1a19d98d","uri":"/businessRules/functions/26674236-bc80-41de-954d-d37b1a19d98d"},{"method":"GET","rel":"up","href":"/businessRules/functions","uri":"/businessRules/functions","type":"application/vnd.sas.collection","itemType":"application/vnd.sas.business.rule.function"},{"method":"GET","rel":"category","href":"/businessRules/functionCategories/85329ae9-52df-444f-8e18-bffb1a523da7","uri":"/businessRules/functionCategories/85329ae9-52df-444f-8e18-bffb1a523da7","type":"application/vnd.sas.business.rule.function.category"}],"hidden":false,"nameQuoted":false}
NameTypeRequiredDescription
id
string
false

The system-assigned unique ID for this object.

name
string
false

A unique name for the function. The name is determined by parsing the method name defined in the function's code. Note that if the method identifier is quoted, this name will NOT include those quotes, but it will match the casing of the name in the code. If the method identifier is unquoted in the code, its name will be folded to lowercase.

nameQuoted
boolean
false

A boolean indicating if the function's name is quoted in its code.

hidden
boolean
false

A boolean indicating if the function is hidden or not.

categoryId
string
true

The ID of the function's parent category. This can be changed during an update to the function in order to move the function into a different category.

description
string
false

A description of the function.

code
string
true

The DS2 function implementation, starting with the method my_func(); statement.

returnType
string
false

The type returned from the function is specified after the returns keyword in the header of the declaration. This property is omitted if the function does not specify a return type.

signature
array [Function Signature Term]
false

An ordered array of the input parameters to the function determined by parsing the function's code.

createdBy
string
false

The user who created the function.

creationTimeStamp
string<date-time>
false

The data and time at which the function was created.

modifiedBy
string
false

The user who made the last modification to the function.

modifiedTimeStamp
string<date-time>
false

The date and time at which the function was last modified.

testCustomContextUri
string
false

The URI of a Custom Context DS2 code file that provides a custom context to this function. Normally, this function's custom context is provided by the decision that utimately utilizes it. For syntax validation purpose, you can specify a testing-only custom context.

links
array [Link]
false

Zero or more links to related resources or operations.

version
integer
false

This media type's schema version number. This representation is version 1.

Responses

StatusMeaningDescription
200OKThe function was updated.HeadersSchema
400Bad RequestThe request was invalid.Schema
404Not FoundNo resource exists at the requested path.Schema
412Precondition FailedThe `If-Match` header did not match the resource's entity tag.Schema
428Precondition RequiredThe request headers did not include the `If-Match` precondition.Schema