Functions

Update a function

Updates the function with the provided content.

put/functions/{functionId}

Request

  • Base URL: https://example.com/businessRules
  • URL: https://example.com/businessRules/functions/{functionId}
  • Auth: none declared. Required headers: If-Match

Path parameters

functionIdstring required

The ID of the function to update.

Headers

If-Matchstring required

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

Request body

idstring

The system-assigned unique ID for this object.

namestring

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.

nameQuotedboolean

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

categoryIdstring required

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.

descriptionstring

A description of the function.

codestring required

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

returnTypestring

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.

createdBystring

The user who created the function.

creationTimeStampstring date-time

The data and time at which the function was created.

modifiedBystring

The user who made the last modification to the function.

modifiedTimeStampstring date-time

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

versioninteger

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

Example request

{
  "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"
    }
  ],
  "nameQuoted": false
}

Response

The function was updated.

idstring

The system-assigned unique ID for this object.

namestring

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.

nameQuotedboolean

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

categoryIdstring required

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.

descriptionstring

A description of the function.

codestring required

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

returnTypestring

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.

createdBystring

The user who created the function.

creationTimeStampstring date-time

The data and time at which the function was created.

modifiedBystring

The user who made the last modification to the function.

modifiedTimeStampstring date-time

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

versioninteger

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

Example response

{
  "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"
    }
  ],
  "nameQuoted": false
}

Changes

No recorded changes to this operation across all 1 revision of this API.