Skip to content

Commit

Permalink
Updated API from documentation release
Browse files Browse the repository at this point in the history
  • Loading branch information
ct-sdks[bot] committed Dec 16, 2024
1 parent 447e10d commit 9c2f053
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 2 deletions.
13 changes: 13 additions & 0 deletions api-specs/api/examples/channel-updated.example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"id": "ac390383-370f-43f8-a534-db1604cb96a8",
"key": "commercetools",
"version": 2,
"name": {
"en": "New Name"
},
"roles": [
"InventorySupply"
],
"createdAt": "2015-05-28T09:48:35.023Z",
"lastModifiedAt": "2015-06-02T09:48:35.023Z"
}
37 changes: 37 additions & 0 deletions api-specs/api/resources/channels.raml
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,48 @@ post:
body:
application/json:
example: !include ../examples/channel-update.example.json
responses:
200:
body:
application/json:
example: !include ../examples/channel-updated.example.json
delete:
securedBy: [oauth_2_0: { scopes: ['manage_products:{projectKey}'] }]
description: |
Returns a [ReferenceExists](ctp:api:type:ReferenceExistsError) error if other resources reference the Channel to be deleted.
responses:
200:
body:
application/json:
example: !include ../examples/channel.example.json

/key={key}:
(methodName): withKey
type:
baseResource:
uriParameterName: key
resourceType: Channel
resourceUpdateType: ChannelUpdate
get:
securedBy: [oauth_2_0: { scopes: ['view_products:{projectKey}'] }]
responses:
200:
body:
application/json:
example: !include ../examples/channel.example.json
head:
securedBy: [oauth_2_0: { scopes: ['view_products:{projectKey}'] }]
description: Checks if a Channel exists for a given `key`. Returns a `200 OK` status if the Channel exists or a `404 Not Found` otherwise.
post:
securedBy: [oauth_2_0: { scopes: ['manage_products:{projectKey}'] }]
body:
application/json:
example: !include ../examples/channel-update.example.json
responses:
200:
body:
application/json:
example: !include ../examples/channel-updated.example.json
delete:
securedBy: [oauth_2_0: { scopes: ['manage_products:{projectKey}'] }]
description: |
Expand Down
16 changes: 14 additions & 2 deletions api-specs/graphql/schema.sdl
Original file line number Diff line number Diff line change
Expand Up @@ -5571,8 +5571,20 @@ type Mutation {
"Queries with specified key"
key: String): Category
createChannel(draft: ChannelDraft!): Channel
updateChannel(id: String!, version: Long!, actions: [ChannelUpdateAction!]!): Channel
deleteChannel(id: String!, version: Long!): Channel
updateChannel(version: Long!, actions: [ChannelUpdateAction!]!,

"Queries with specified ID"
id: String,

"Queries with specified key"
key: String): Channel
deleteChannel(version: Long!,

"Queries with specified ID"
id: String,

"Queries with specified key"
key: String): Channel
createOrUpdateCustomObject(draft: CustomObjectDraft!): CustomObject
deleteCustomObject(version: Long,

Expand Down

0 comments on commit 9c2f053

Please sign in to comment.