Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions smithy/model/brand/brand-apis.smithy
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
$version: "2"

namespace com.shopping.inandout.brand

use com.shopping.inandout#DeleteRestrictedError
use com.shopping.inandout#ImageUrl
use com.shopping.inandout#InternalServerError
use com.shopping.inandout#InvalidInputError
use com.shopping.inandout#ResourceAlreadyExistsError
use com.shopping.inandout#ResourceName
use com.shopping.inandout#ResourceNotFoundError
use com.shopping.inandout#UUID

resource Brand {
identifiers: {
brandId: UUID
}
properties: {
name: ResourceName
logoUrl: ImageUrl
createdAt: Timestamp
updatedAt: Timestamp
}
create: CreateBrand
read: GetBrand
update: UpdateBrand
delete: DeleteBrand
}

@http(method: "POST", uri: "/brands")
operation CreateBrand {
input: CreateBrandInput
output: BrandSummary
errors: [
InvalidInputError
ResourceAlreadyExistsError
InternalServerError
]
}

@readonly
@http(method: "GET", uri: "/brands/{brandId}")
operation GetBrand {
input: GetBrandInput
output: BrandSummary
errors: [
InvalidInputError
ResourceNotFoundError
InternalServerError
]
}

@http(method: "PATCH", uri: "/brands/{brandId}")
operation UpdateBrand {
input: UpdateBrandInput
output: BrandSummary
errors: [
InvalidInputError
ResourceNotFoundError
InternalServerError
]
}

@idempotent
@http(method: "DELETE", uri: "/brands/{brandId}")
@documentation("Restricted cascading operation, references for stores and articles should NOT exist")
operation DeleteBrand {
input: DeleteBrandInput
output: BrandSummary
errors: [
InvalidInputError
ResourceNotFoundError
DeleteRestrictedError
InternalServerError
]
}
36 changes: 36 additions & 0 deletions smithy/model/brand/brand-io.smithy
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
$version: "2"

namespace com.shopping.inandout.brand

use com.shopping.inandout#ImageUrl
use com.shopping.inandout#ResourceName
use com.shopping.inandout#UUID

structure CreateBrandInput {
@required
name: ResourceName

logoUrl: ImageUrl
}

structure GetBrandInput {
@required
@httpLabel
brandId: UUID
}

structure UpdateBrandInput {
@required
@httpLabel
brandId: UUID

name: ResourceName

logoUrl: ImageUrl
}

structure DeleteBrandInput {
@required
@httpLabel
brandId: UUID
}
23 changes: 23 additions & 0 deletions smithy/model/brand/brand-types.smithy
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
$version: "2"

namespace com.shopping.inandout.brand

use com.shopping.inandout#ImageUrl
use com.shopping.inandout#ResourceName
use com.shopping.inandout#UUID

structure BrandSummary {
@required
brandId: UUID

@required
name: ResourceName

logoUrl: ImageUrl

@required
createdAt: Timestamp

@required
updatedAt: Timestamp
}
8 changes: 8 additions & 0 deletions smithy/model/common.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,11 @@ string UUID
list UUIDList {
member: UUID
}

@pattern("^[a-zA-Z0-9\\- ]+$")
@length(min: 3, max: 63)
string ResourceName

@pattern("^https?://[a-zA-Z0-9\\-._~:/?#\\[\\]@!$&'()*+,;=%]+\\.(jpg|jpeg|png|gif)$")
@length(min: 8, max: 255)
string ImageUrl
6 changes: 5 additions & 1 deletion smithy/model/main.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@ $version: "2"

namespace com.shopping.inandout

use com.shopping.inandout.tsp#FindTspSolution
use aws.protocols#restJson1
use com.shopping.inandout.brand#Brand
use com.shopping.inandout.tsp#FindTspSolution

@restJson1
service InAndOut {
version: "2026-04-01"
resources: [
Brand
]
operations: [
FindTspSolution
]
Expand Down