Methods
The Methods screens contains the Operations of the REST API, in AMT these are named Methods.
To add a new Method, select the Methods node and click on the Add new method link. Alternatively right-clicking the Methods node brings up a context menu from where the Insert option can be selected.
After a Method has been added, the Name and Description can be filled in.
Method Parameters
Parameters can be added by right-clicking in the 'Method Parameters' panel and selecting the 'Insert' option.
If a parameter is selected, the Object inspector window is opened where the properties of the parameter can be set.
Property: | Description: | Value: | ||
Name | The name of the method. | <Text> |
||
ArrayType | If the native type of the method is an array, the value type of the array must be defined here. | <None | Int32 | Int64 | Double | Boolean | String | Decimal | Object> |
||
Length | The maximal number of characters. |
<Integer> | ||
Decimals | The number of decimal characters. |
<Integer> | ||
Attribute |
The location of the parameter:
|
<None | FromQuery | FromRoute | FromBody | FromHeader > |
||
ClassName |
The AMT global class definition name, required when using a Class/Object as type.
|
<Text> | ||
Description | A free to choose description of the parameter. | <Text> | ||
Direction | The direction this parameter should be passed, from the client to the REST API (In) or from the REST API to
the client (Out). There can be only one parameter with direction Out. |
<In | Out> | ||
IsNullable | Set if the parameter can be NULL (True) or not (False). | <Boolean> | ||
ListType | If the (AMT) type of the method is a list, the AMT data type of the list must be defined here. In case of Alpha, Financial, Numeric or Signed, the 'Length' property should be set. For Financial, Numeric or Signed, the 'Decimal' property can also be set. Class required the 'ClassName' property to be set. |
<None | Alpha | Boolean | Financial | Integer | Numeric | RealString | Signed | String | Class> |
||
NativeType | The data type of the parameter in the REST API. Will be automatically set/updated after the (AMT) Type has
been changed. Native types incompatible with the set (AMT) type are not allowed. |
<Int32 | Int64 | Double | Char | Boolean | String | Decimal | Object | Array> |
||
Optional | Set if the parameter is optional (True) or required (False). | <Boolean> | ||
Type |
The AMT data type of the parameter used in the underlying routine. |
<Alpha | Boolean | Financial | Integer | Numeric | RealString | Signed | String | Class | List> |
With the 'Create Default Route' button, a template route for the method can be added to the Routes panel.
By clicking the 'Generate Lion logic' button, a routine for this method will be added to the 'Implementation' screen.
This routine will have the name of the method and all the parameters that have been defined for this method as routine
parameters.
Routes
Routes can be added in the same way by right-clicking in the 'Routes' panel and selecting the 'Insert' option.
When a route is selected an 'Object inspector' window will be opened where the properties of the route can be set.
Properties: | Description: | Value: |
Path | The endpoint (Path) of the method relative to the REST API URL. | <Text> |
Method | The HTTP method (Operation) | <Post | Get | Put | Patch | Delete> |
Description | A free to choose description of this Route. | <Text> |