Description
Gets a list of regulated entity ids and their English and French display names for a specified service and entity.
Package Details
Interface
IServiceRegulatedEntityManager
Syntax
Task<ICollection<ServiceRegulatedEntityIdType>> GetList(int serviceId, string type)
Returns
ICollection<ServiceRegulatedEntityIdType>
API
GET - /api/v1/services/{id}/regulated-entities
Parameters
Parameter | Description | Type |
---|---|---|
id | The service id associated to the regulated entity. | Path |
type | The entity type of the regulated type (ex. VESSEL). This is case insensitive. | Query string |
Returns
HTTP 200 - OK
Returns a list of regulated entities with their ids, English and French display names. The ids are returned based on a sort order.
Is there’s no regulated entity ids found, an empty list is returned.
Sample response body
Note: This example is for ServiceId = 1230 and Type = Vessel.
[ { "Id": 1, "ServiceId": 1230, "RegulatedEntityTypeCode": "VESSEL", "RegulatedEntityIdTypeCode": "VESSEL_NM", "SortOrder": 1, "EnglishDisplayName": "Vessel Name", "FrenchDisplayName": "Nom du bâtiment" }, { "Id": 2, "ServiceId": 1230, "RegulatedEntityTypeCode": "VESSEL", "RegulatedEntityIdTypeCode": "CDN_SHIP_IND", "SortOrder": 2, "EnglishDisplayName": "Canadian Vessel?", "FrenchDisplayName": "Bâtment canadien?" }, { "Id": 3, "ServiceId": 1230, "RegulatedEntityTypeCode": "VESSEL", "RegulatedEntityIdTypeCode": "IMO", "SortOrder": 3, "EnglishDisplayName": "IMO", "FrenchDisplayName": "OMI" }, { "Id": 4, "ServiceId": 1230, "RegulatedEntityTypeCode": "VESSEL", "RegulatedEntityIdTypeCode": "OFFICIAL_NO", "SortOrder": 4, "EnglishDisplayName": "Official No.", "FrenchDisplayName": "Numéro officiel" } ]
Example
//Use your service id and entity type. const int serviceId = 1230; const string entity = "VESSEL"; //Returns a list of service regulated entity type ids. var serviceRegulatedEntityIdTypes = await serviceRegulatedEntityManager.GetList(serviceId, entity);