Skip to content

Commit 41774e0

Browse files
committed
Updated API from documentation release
1 parent 71b6bfb commit 41774e0

File tree

9 files changed

+75
-0
lines changed

9 files changed

+75
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"action": "setCustomField",
3+
"name": "ExampleStringTypeField",
4+
"value": "TextString"
5+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"action": "setCustomType",
3+
"type": {
4+
"id": "{{type-id}}",
5+
"typeId": "type"
6+
},
7+
"fields": {
8+
"exampleStringTypeField": "TextString"
9+
}
10+
}

api-specs/api/types/approval-rule/ApprovalRule.raml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,7 @@ properties:
6969
type: BusinessUnitKeyReference
7070
description: |
7171
The [Business Unit](ctp:api:type:BusinessUnit) the Approval Rule belongs to.
72+
custom?:
73+
type: CustomFields
74+
description: |
75+
Custom Fields on the Approval Rule.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#%RAML 1.0 DataType
2+
(package): ApprovalRule
3+
type: ApprovalRuleUpdateAction
4+
displayName: ApprovalRuleSetCustomFieldAction
5+
discriminatorValue: setCustomField
6+
example: !include ../../examples/ApprovalRule/ApprovalRuleSetCustomFieldAction.json
7+
properties:
8+
name:
9+
type: string
10+
description: |
11+
Name of the [Custom Field](ctp:api:type:CustomFields).
12+
value?:
13+
type: CustomFieldValue
14+
description: |
15+
If `value` is absent or `null`, this field will be removed if it exists.
16+
Removing a field that does not exist returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
17+
If `value` is provided, it is set for the field defined by `name`.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#%RAML 1.0 DataType
2+
(package): ApprovalRule
3+
type: ApprovalRuleUpdateAction
4+
displayName: ApprovalRuleSetCustomTypeAction
5+
discriminatorValue: setCustomType
6+
example: !include ../../examples/ApprovalRule/ApprovalRuleSetCustomTypeAction.json
7+
properties:
8+
type?:
9+
type: TypeResourceIdentifier
10+
description: |
11+
Defines the [Type](ctp:api:type:Type) that extends the ApprovalRule with [Custom Fields](ctp:api:type:CustomFields).
12+
If absent, any existing Type and Custom Fields are removed from the ApprovalRule.
13+
fields?:
14+
type: FieldContainer
15+
description: |
16+
Sets the [Custom Fields](ctp:api:type:CustomFields) fields for the ApprovalRule.

api-specs/api/types/type/CustomFieldReferenceValue.raml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ description: |
66
Defines which resource type a [CustomFieldReferenceType](ctp:api:type:CustomFieldReferenceType) can reference.
77
enum:
88
- approval-flow
9+
- approval-rule
910
- associate-role
1011
- business-unit
1112
- cart
@@ -25,6 +26,8 @@ enum:
2526
(enumDescriptions):
2627
approval-flow: |
2728
[ApprovalFlow](ctp:api:type:ApprovalFlow)
29+
approval-rule: |
30+
[ApprovalRule](ctp:api:type:ApprovalRule)
2831
associate-role: |
2932
[AssociateRole](ctp:api:type:AssociateRole)
3033
business-unit: |

api-specs/api/types/type/ResourceTypeId.raml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ enum:
88
- address
99
- asset
1010
- approval-flow
11+
- approval-rule
1112
- associate-role
1213
- business-unit
1314
- cart-discount
@@ -45,6 +46,8 @@ enum:
4546
[Asset](ctp:api:type:Asset) on [Category](ctp:api:type:Category) and [ProductVariant](ctp:api:type:ProductVariant)
4647
approval-flow: |
4748
[ApprovalFlow](ctp:api:type:ApprovalFlow)
49+
approval-rule: |
50+
[ApprovalRule](ctp:api:type:ApprovalRule)
4851
associate-role: |
4952
[AssociateRole](ctp:api:type:AssociateRole)
5053
business-unit: |

api-specs/api/types/types.raml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ ApprovalRule: !include approval-rule/ApprovalRule.raml
1919
ApprovalRuleDraft: !include approval-rule/ApprovalRuleDraft.raml
2020
ApprovalRulePagedQueryResponse: !include approval-rule/ApprovalRulePagedQueryResponse.raml
2121
ApprovalRuleSetApproversAction: !include approval-rule/ApprovalRuleSetApproversAction.raml
22+
ApprovalRuleSetCustomFieldAction: !include approval-rule/ApprovalRuleSetCustomFieldAction.raml
23+
ApprovalRuleSetCustomTypeAction: !include approval-rule/ApprovalRuleSetCustomTypeAction.raml
2224
ApprovalRuleSetDescriptionAction: !include approval-rule/ApprovalRuleSetDescriptionAction.raml
2325
ApprovalRuleSetKeyAction: !include approval-rule/ApprovalRuleSetKeyAction.raml
2426
ApprovalRuleSetNameAction: !include approval-rule/ApprovalRuleSetNameAction.raml

api-specs/graphql/schema.sdl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,7 @@ type ApprovalRule implements Versioned {
778778
requesters: [RuleRequester!]!
779779
businessUnitRef: KeyReference!
780780
businessUnit: BusinessUnit!
781+
custom: CustomFieldsType
781782
id: String!
782783
version: Long!
783784
createdAt: DateTime!
@@ -864,6 +865,8 @@ input ApprovalRuleUpdateAction {
864865
setRequesters: SetApprovalRuleRequesters
865866
setStatus: SetApprovalRuleStatus
866867
setApprovers: SetApprovalRuleApprovers
868+
setCustomField: SetApprovalRuleCustomField
869+
setCustomType: SetApprovalRuleCustomType
867870
}
868871

869872
input ApproveApprovalFlow {
@@ -10532,6 +10535,18 @@ input SetApprovalRuleStatus {
1053210535
status: ApprovalRuleStatus!
1053310536
}
1053410537

10538+
input SetApprovalRuleCustomField {
10539+
name: String!
10540+
value: String
10541+
}
10542+
10543+
input SetApprovalRuleCustomType {
10544+
fields: [CustomFieldInput!]
10545+
type: ResourceIdentifierInput
10546+
typeKey: String
10547+
typeId: String
10548+
}
10549+
1053510550
input SetAssociateRoleCustomField {
1053610551
name: String!
1053710552
value: String

0 commit comments

Comments
 (0)