-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
116 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
modules/core/shared/src/main/scala/smithy4s/deriving/aliases/aliases.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
package smithy4s.deriving.aliases | ||
|
||
import smithy4s.Hints | ||
import smithy4s.deriving.HintsProvider | ||
import smithy.api.* | ||
import alloy.Discriminated | ||
import alloy.Untagged | ||
import alloy.SimpleRestJson | ||
import alloy.proto.ProtoIndex | ||
|
||
case class httpGet(uri: String, code: Int = 200) extends HintsProvider { | ||
def hints = Hints(Http(NonEmptyString("GET"), NonEmptyString(uri), code)) | ||
} | ||
|
||
case class httpPost(uri: String, code: Int = 200) extends HintsProvider { | ||
def hints = Hints(Http(NonEmptyString("POST"), NonEmptyString(uri), code)) | ||
} | ||
|
||
case class httpPatch(uri: String, code: Int = 200) extends HintsProvider { | ||
def hints = Hints(Http(NonEmptyString("PATCH"), NonEmptyString(uri), code)) | ||
} | ||
|
||
case class httpDelete(uri: String, code: Int = 200) extends HintsProvider { | ||
def hints = Hints(Http(NonEmptyString("DELETE"), NonEmptyString(uri), code)) | ||
} | ||
|
||
case class httpPut(uri: String, code: Int = 200) extends HintsProvider { | ||
def hints = Hints(Http(NonEmptyString("PUT"), NonEmptyString(uri), code)) | ||
} | ||
|
||
case class httpLabel() extends HintsProvider { | ||
def hints = Hints(HttpLabel()) | ||
} | ||
|
||
case class httpQuery(name: String) extends HintsProvider { | ||
def hints = Hints(HttpQuery(name)) | ||
} | ||
|
||
case class httpHeader(name: String) extends HintsProvider { | ||
def hints = Hints(HttpHeader(name)) | ||
} | ||
|
||
case class httpPayload() extends HintsProvider { | ||
def hints = Hints(HttpPayload()) | ||
} | ||
|
||
case class httpError(code: Int) extends HintsProvider { | ||
def hints = Hints(HttpError(code)) | ||
} | ||
|
||
case class readonly() extends HintsProvider { | ||
def hints = Hints(Readonly()) | ||
} | ||
|
||
case class idempotent() extends HintsProvider { | ||
def hints = Hints(Idempotent()) | ||
} | ||
|
||
case class jsonName(name: String) extends HintsProvider { | ||
def hints = Hints(JsonName(name)) | ||
} | ||
|
||
case class simpleRestJson() extends HintsProvider { | ||
def hints = Hints(SimpleRestJson()) | ||
} | ||
|
||
case class discriminated(fieldName: String) extends HintsProvider { | ||
def hints = Hints(Discriminated(fieldName)) | ||
} | ||
|
||
case class untagged() extends HintsProvider { | ||
def hints = Hints(Untagged()) | ||
} | ||
|
||
case class protoIndex(value: Int) extends HintsProvider { | ||
def hints = Hints(ProtoIndex(value)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters