-
Notifications
You must be signed in to change notification settings - Fork 0
/
company.raml
96 lines (79 loc) · 2.86 KB
/
company.raml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#%RAML 1.0
title: Company Service API
version: v1
baseUri: http://localhost:6891/api
annotationTypes: !include types/annotations.raml
types: !include types/company/types.raml
# The default media type is JSON. Each resource can override that
# as needed.
mediaType: application/json
# RAML resourceTypes are templates for resource definitions.
resourceTypes:
change-status: !include resourceTypes/change-status.raml
collection: !include resourceTypes/collection.raml
collection-item: !include resourceTypes/collection-item.raml
heartbeat: !include resourceTypes/heartbeat.raml
shutdown: !include resourceTypes/shutdown.raml
########################################################################
# Internal Resources
########################################################################
/internal/heartbeat:
type: heartbeat
/internal/shutdown:
type: shutdown
########################################################################
# Public Resources
########################################################################
/companies:
type:
collection:
collectionResource: Companies
existingResource: Company
newResource: NewCompany
# Creating new companies is done via 'POST' due to the service
# having exclusive responsibility for establishing uniqueness.
post:
# Individual company instances are made available under this endpoint.
# The "company" is the entity URN or UUID.
/{company}:
uriParameters:
company:
type: UUID | URN
type:
collection-item:
resource: Company
itemIdParameter: company
itemIdType: string
# Attempt to activate the Company, succeeding when the
# current CompanyStatus allows transitioning to "Active."
# If it is semantically valid for this endpoint to be
# invoked for any given Company, it will be provided by
# the service within the `_links` array.
/activate:
type:
change-status:
resource: Company
itemIdParameter: company
itemIdType: string
# Attempt to deactivate the Company, succeeding when the
# current CompanyStatus allows transitioning to "Inactive."
# If it is semantically valid for this endpoint to be
# invoked for any given Company, it will be provided by
# the service within the `_links` array.
/deactivate:
type:
change-status:
resource: Company
itemIdParameter: company
itemIdType: string
# Attempt to suspend the Company, succeeding when the
# current CompanyStatus allows transitioning to "Suspended."
# If it is semantically valid for this endpoint to be
# invoked for any given Company, it will be provided by
# the service within the `_links` array.
/suspend:
type:
change-status:
resource: Company
itemIdParameter: company
itemIdType: string