From dbbd009a58ded7cc25b073d4149398bc0b8e7d04 Mon Sep 17 00:00:00 2001 From: Bram van den Heuvel Date: Thu, 9 Feb 2023 15:50:14 +0100 Subject: [PATCH] Rewrite send message library This should make the modules a lot more flexible when it comes to modular version control. --- src/Internal/Api/All.elm | 2 +- src/Internal/Api/SendMessageEvent/Api.elm | 30 +++++- src/Internal/Api/SendMessageEvent/Main.elm | 95 ++++++++++++++++--- .../{V1_4 => V1}/SpecObjects.elm | 4 +- .../{V1_2 => V1}/SpecObjects.yaml | 2 +- .../Api/SendMessageEvent/V1_2/Api.elm | 16 ---- .../Api/SendMessageEvent/V1_2/Convert.elm | 9 -- .../Api/SendMessageEvent/V1_2/Objects.elm | 38 -------- .../Api/SendMessageEvent/V1_2/Objects.yaml | 9 -- .../Api/SendMessageEvent/V1_2/SpecObjects.elm | 38 -------- .../Api/SendMessageEvent/V1_2/Upcast.elm | 9 -- .../Api/SendMessageEvent/V1_3/Api.elm | 17 ---- .../Api/SendMessageEvent/V1_3/Convert.elm | 9 -- .../Api/SendMessageEvent/V1_3/Objects.elm | 38 -------- .../Api/SendMessageEvent/V1_3/Objects.yaml | 9 -- .../Api/SendMessageEvent/V1_3/SpecObjects.elm | 38 -------- .../SendMessageEvent/V1_3/SpecObjects.yaml | 9 -- .../Api/SendMessageEvent/V1_3/Upcast.elm | 9 -- .../Api/SendMessageEvent/V1_4/Api.elm | 17 ---- .../Api/SendMessageEvent/V1_4/Convert.elm | 9 -- .../Api/SendMessageEvent/V1_4/Objects.elm | 38 -------- .../Api/SendMessageEvent/V1_4/Objects.yaml | 9 -- .../SendMessageEvent/V1_4/SpecObjects.yaml | 9 -- .../Api/SendMessageEvent/V1_4/Upcast.elm | 9 -- .../Api/SendMessageEvent/V1_5/Api.elm | 17 ---- .../Api/SendMessageEvent/V1_5/Convert.elm | 9 -- .../Api/SendMessageEvent/V1_5/Objects.elm | 38 -------- .../Api/SendMessageEvent/V1_5/Objects.yaml | 9 -- .../Api/SendMessageEvent/V1_5/SpecObjects.elm | 38 -------- .../SendMessageEvent/V1_5/SpecObjects.yaml | 9 -- .../Api/SendMessageEvent/V1_5/Upcast.elm | 9 -- 31 files changed, 111 insertions(+), 490 deletions(-) rename src/Internal/Api/SendMessageEvent/{V1_4 => V1}/SpecObjects.elm (86%) rename src/Internal/Api/SendMessageEvent/{V1_2 => V1}/SpecObjects.yaml (92%) delete mode 100644 src/Internal/Api/SendMessageEvent/V1_2/Api.elm delete mode 100644 src/Internal/Api/SendMessageEvent/V1_2/Convert.elm delete mode 100644 src/Internal/Api/SendMessageEvent/V1_2/Objects.elm delete mode 100644 src/Internal/Api/SendMessageEvent/V1_2/Objects.yaml delete mode 100644 src/Internal/Api/SendMessageEvent/V1_2/SpecObjects.elm delete mode 100644 src/Internal/Api/SendMessageEvent/V1_2/Upcast.elm delete mode 100644 src/Internal/Api/SendMessageEvent/V1_3/Api.elm delete mode 100644 src/Internal/Api/SendMessageEvent/V1_3/Convert.elm delete mode 100644 src/Internal/Api/SendMessageEvent/V1_3/Objects.elm delete mode 100644 src/Internal/Api/SendMessageEvent/V1_3/Objects.yaml delete mode 100644 src/Internal/Api/SendMessageEvent/V1_3/SpecObjects.elm delete mode 100644 src/Internal/Api/SendMessageEvent/V1_3/SpecObjects.yaml delete mode 100644 src/Internal/Api/SendMessageEvent/V1_3/Upcast.elm delete mode 100644 src/Internal/Api/SendMessageEvent/V1_4/Api.elm delete mode 100644 src/Internal/Api/SendMessageEvent/V1_4/Convert.elm delete mode 100644 src/Internal/Api/SendMessageEvent/V1_4/Objects.elm delete mode 100644 src/Internal/Api/SendMessageEvent/V1_4/Objects.yaml delete mode 100644 src/Internal/Api/SendMessageEvent/V1_4/SpecObjects.yaml delete mode 100644 src/Internal/Api/SendMessageEvent/V1_4/Upcast.elm delete mode 100644 src/Internal/Api/SendMessageEvent/V1_5/Api.elm delete mode 100644 src/Internal/Api/SendMessageEvent/V1_5/Convert.elm delete mode 100644 src/Internal/Api/SendMessageEvent/V1_5/Objects.elm delete mode 100644 src/Internal/Api/SendMessageEvent/V1_5/Objects.yaml delete mode 100644 src/Internal/Api/SendMessageEvent/V1_5/SpecObjects.elm delete mode 100644 src/Internal/Api/SendMessageEvent/V1_5/SpecObjects.yaml delete mode 100644 src/Internal/Api/SendMessageEvent/V1_5/Upcast.elm diff --git a/src/Internal/Api/All.elm b/src/Internal/Api/All.elm index 530eaa5..690381c 100644 --- a/src/Internal/Api/All.elm +++ b/src/Internal/Api/All.elm @@ -24,7 +24,7 @@ joinedMembers = {-| Send a message event into a Matrix room. -} -sendMessageEvent : List String -> SendMessageEvent.SendMessageEventInput -> SendMessageEvent.SendMessageEventOutput +sendMessageEvent : List String -> Maybe (SendMessageEvent.SendMessageEventInput -> SendMessageEvent.SendMessageEventOutput) sendMessageEvent = SendMessageEvent.sendMessageEvent diff --git a/src/Internal/Api/SendMessageEvent/Api.elm b/src/Internal/Api/SendMessageEvent/Api.elm index 7e22142..919fb89 100644 --- a/src/Internal/Api/SendMessageEvent/Api.elm +++ b/src/Internal/Api/SendMessageEvent/Api.elm @@ -1,6 +1,7 @@ -module Internal.Api.SendMessageEvent.Api exposing (..) +module Internal.Api.SendMessageEvent.V1.Api exposing (sendMessageEventV1, sendMessageEventV2, SendMessageEventOutputV1, SendMessageEventInputV1) import Internal.Api.Request as R +import Internal.Api.SendMessageEvent.V1.SpecObjects as SO1 import Internal.Tools.Exceptions as X import Json.Decode as D import Task exposing (Task) @@ -15,9 +16,30 @@ type alias SendMessageEventInputV1 = , transactionId : String } +type alias SendMessageEventOutputV1 = Task X.Error SO1.EventResponse -sendMessageEventV1 : D.Decoder a -> (a -> b) -> SendMessageEventInputV1 -> Task X.Error b -sendMessageEventV1 decoder mapping data = + +sendMessageEventV1 : SendMessageEventInputV1 -> SendMessageEventOutputV1 +sendMessageEventV1 data = + R.rawApiCall + { headers = R.WithAccessToken data.accessToken + , method = "PUT" + , baseUrl = data.baseUrl + , path = "/_matrix/client/r0/rooms/{roomId}/send/{eventType}/{txnId}" + , pathParams = + [ ( "eventType", data.eventType ) + , ( "roomId", data.roomId ) + , ( "txnId", data.transactionId ) + ] + , queryParams = [] + , bodyParams = [ R.RequiredValue "*" data.content ] + , timeout = Nothing + , decoder = \_ -> SO1.eventResponseDecoder + } + + +sendMessageEventV2 : SendMessageEventInputV1 -> SendMessageEventOutputV1 +sendMessageEventV2 data = R.rawApiCall { headers = R.WithAccessToken data.accessToken , method = "PUT" @@ -31,5 +53,5 @@ sendMessageEventV1 decoder mapping data = , queryParams = [] , bodyParams = [ R.RequiredValue "*" data.content ] , timeout = Nothing - , decoder = \_ -> D.map mapping decoder + , decoder = \_ -> SO1.eventResponseDecoder } diff --git a/src/Internal/Api/SendMessageEvent/Main.elm b/src/Internal/Api/SendMessageEvent/Main.elm index 6529755..57e94f3 100644 --- a/src/Internal/Api/SendMessageEvent/Main.elm +++ b/src/Internal/Api/SendMessageEvent/Main.elm @@ -1,23 +1,90 @@ module Internal.Api.SendMessageEvent.Main exposing (..) import Internal.Api.SendMessageEvent.Api as Api -import Internal.Api.SendMessageEvent.V1_2.Api as V1_2 -import Internal.Api.SendMessageEvent.V1_3.Api as V1_3 -import Internal.Api.SendMessageEvent.V1_4.Api as V1_4 -import Internal.Api.SendMessageEvent.V1_5.Api as V1_5 -import Internal.Api.SendMessageEvent.V1_5.Objects as O -import Internal.Api.VersionControl as V +import Internal.Tools.VersionControl as VC import Internal.Tools.Exceptions as X import Task exposing (Task) -sendMessageEvent : List String -> SendMessageEventInput -> SendMessageEventOutput -sendMessageEvent = - V.firstVersion V1_2.packet - |> V.updateWith V1_3.packet - |> V.updateWith V1_4.packet - |> V.updateWith V1_5.packet - |> V.toFunction +sendMessageEvent : List String -> Maybe (SendMessageEventInput -> SendMessageEventOutput) +sendMessageEvent versions = + VC.withBottomLayer + { current = Api.sendMessageEventV1 + , version = "r0.0.0" + } + |> VC.addMiddleLayer + { downcast = identity + , current = Api.sendMessageEventV1 + , upcast = identity + , version = "r0.0.1" + } + |> VC.addMiddleLayer + { downcast = identity + , current = Api.sendMessageEventV1 + , upcast = identity + , version = "r0.1.0" + } + |> VC.addMiddleLayer + { downcast = identity + , current = Api.sendMessageEventV1 + , upcast = identity + , version = "r0.2.0" + } + |> VC.addMiddleLayer + { downcast = identity + , current = Api.sendMessageEventV1 + , upcast = identity + , version = "r0.3.0" + } + |> VC.addMiddleLayer + { downcast = identity + , current = Api.sendMessageEventV1 + , upcast = identity + , version = "r0.5.0" + } + |> VC.addMiddleLayer + { downcast = identity + , current = Api.sendMessageEventV1 + , upcast = identity + , version = "r0.6.0" + } + |> VC.addMiddleLayer + { downcast = identity + , current = Api.sendMessageEventV1 + , upcast = identity + , version = "r0.6.1" + } + |> VC.addMiddleLayer + { downcast = identity + , current = Api.sendMessageEventV2 + , upcast = identity + , version = "v1.1" + } + |> VC.addMiddleLayer + { downcast = identity + , current = Api.sendMessageEventV2 + , upcast = identity + , version = "v1.2" + } + |> VC.addMiddleLayer + { downcast = identity + , current = Api.sendMessageEventV2 + , upcast = identity + , version = "v1.3" + } + |> VC.addMiddleLayer + { downcast = identity + , current = Api.sendMessageEventV2 + , upcast = identity + , version = "v1.4" + } + |> VC.addMiddleLayer + { downcast = identity + , current = Api.sendMessageEventV2 + , upcast = identity + , version = "v1.5" + } + |> VC.mostRecentFromVersionList versions type alias SendMessageEventInput = @@ -25,4 +92,4 @@ type alias SendMessageEventInput = type alias SendMessageEventOutput = - Task X.Error O.EventResponse + Api.SendMessageEventOutputV1 diff --git a/src/Internal/Api/SendMessageEvent/V1_4/SpecObjects.elm b/src/Internal/Api/SendMessageEvent/V1/SpecObjects.elm similarity index 86% rename from src/Internal/Api/SendMessageEvent/V1_4/SpecObjects.elm rename to src/Internal/Api/SendMessageEvent/V1/SpecObjects.elm index 36e4461..d2483c6 100644 --- a/src/Internal/Api/SendMessageEvent/V1_4/SpecObjects.elm +++ b/src/Internal/Api/SendMessageEvent/V1/SpecObjects.elm @@ -1,4 +1,4 @@ -module Internal.Api.SendMessageEvent.V1_4.SpecObjects exposing +module Internal.Api.SendMessageEvent.V1.SpecObjects exposing ( EventResponse , encodeEventResponse , eventResponseDecoder @@ -6,7 +6,7 @@ module Internal.Api.SendMessageEvent.V1_4.SpecObjects exposing {-| Automatically generated 'SpecObjects' -Last generated at Unix time 1673279712 +Last generated at Unix time 1675952679 -} diff --git a/src/Internal/Api/SendMessageEvent/V1_2/SpecObjects.yaml b/src/Internal/Api/SendMessageEvent/V1/SpecObjects.yaml similarity index 92% rename from src/Internal/Api/SendMessageEvent/V1_2/SpecObjects.yaml rename to src/Internal/Api/SendMessageEvent/V1/SpecObjects.yaml index f5eaebe..9b619b4 100644 --- a/src/Internal/Api/SendMessageEvent/V1_2/SpecObjects.yaml +++ b/src/Internal/Api/SendMessageEvent/V1/SpecObjects.yaml @@ -1,4 +1,4 @@ -version: v1.2 +version: v1 name: SpecObjects objects: EventResponse: diff --git a/src/Internal/Api/SendMessageEvent/V1_2/Api.elm b/src/Internal/Api/SendMessageEvent/V1_2/Api.elm deleted file mode 100644 index a407148..0000000 --- a/src/Internal/Api/SendMessageEvent/V1_2/Api.elm +++ /dev/null @@ -1,16 +0,0 @@ -module Internal.Api.SendMessageEvent.V1_2.Api exposing (..) - -import Internal.Api.SendMessageEvent.Api as Api -import Internal.Api.SendMessageEvent.V1_2.Convert as C -import Internal.Api.SendMessageEvent.V1_2.Objects as O -import Internal.Api.SendMessageEvent.V1_2.Upcast as U -import Internal.Api.VersionControl as V - - -packet : V.SingleVersion () () Api.SendMessageEventInputV1 O.EventResponse -packet = - { version = "v1.2" - , downcast = \_ -> () - , current = Api.sendMessageEventV1 O.eventResponseDecoder C.convert - , upcast = U.upcast - } diff --git a/src/Internal/Api/SendMessageEvent/V1_2/Convert.elm b/src/Internal/Api/SendMessageEvent/V1_2/Convert.elm deleted file mode 100644 index 04d6c2a..0000000 --- a/src/Internal/Api/SendMessageEvent/V1_2/Convert.elm +++ /dev/null @@ -1,9 +0,0 @@ -module Internal.Api.SendMessageEvent.V1_2.Convert exposing (..) - -import Internal.Api.SendMessageEvent.V1_2.Objects as O -import Internal.Api.SendMessageEvent.V1_2.SpecObjects as SO - - -convert : SO.EventResponse -> O.EventResponse -convert = - identity diff --git a/src/Internal/Api/SendMessageEvent/V1_2/Objects.elm b/src/Internal/Api/SendMessageEvent/V1_2/Objects.elm deleted file mode 100644 index 62bcd68..0000000 --- a/src/Internal/Api/SendMessageEvent/V1_2/Objects.elm +++ /dev/null @@ -1,38 +0,0 @@ -module Internal.Api.SendMessageEvent.V1_2.Objects exposing - ( EventResponse - , encodeEventResponse - , eventResponseDecoder - ) - -{-| Automatically generated 'Objects' - -Last generated at Unix time 1673279712 - --} - -import Internal.Tools.EncodeExtra exposing (maybeObject) -import Json.Decode as D -import Json.Encode as E - - -{-| A response confirming that an event has been sent. --} -type alias EventResponse = - { eventId : String - } - - -encodeEventResponse : EventResponse -> E.Value -encodeEventResponse data = - maybeObject - [ ( "event_id", Just <| E.string data.eventId ) - ] - - -eventResponseDecoder : D.Decoder EventResponse -eventResponseDecoder = - D.map - (\a -> - { eventId = a } - ) - (D.field "event_id" D.string) diff --git a/src/Internal/Api/SendMessageEvent/V1_2/Objects.yaml b/src/Internal/Api/SendMessageEvent/V1_2/Objects.yaml deleted file mode 100644 index 0d30551..0000000 --- a/src/Internal/Api/SendMessageEvent/V1_2/Objects.yaml +++ /dev/null @@ -1,9 +0,0 @@ -version: v1.2 -name: Objects -objects: - EventResponse: - description: A response confirming that an event has been sent. - fields: - event_id: - type: string - required: true diff --git a/src/Internal/Api/SendMessageEvent/V1_2/SpecObjects.elm b/src/Internal/Api/SendMessageEvent/V1_2/SpecObjects.elm deleted file mode 100644 index 8e57da4..0000000 --- a/src/Internal/Api/SendMessageEvent/V1_2/SpecObjects.elm +++ /dev/null @@ -1,38 +0,0 @@ -module Internal.Api.SendMessageEvent.V1_2.SpecObjects exposing - ( EventResponse - , encodeEventResponse - , eventResponseDecoder - ) - -{-| Automatically generated 'SpecObjects' - -Last generated at Unix time 1673279712 - --} - -import Internal.Tools.EncodeExtra exposing (maybeObject) -import Json.Decode as D -import Json.Encode as E - - -{-| A response confirming that an event has been sent. --} -type alias EventResponse = - { eventId : String - } - - -encodeEventResponse : EventResponse -> E.Value -encodeEventResponse data = - maybeObject - [ ( "event_id", Just <| E.string data.eventId ) - ] - - -eventResponseDecoder : D.Decoder EventResponse -eventResponseDecoder = - D.map - (\a -> - { eventId = a } - ) - (D.field "event_id" D.string) diff --git a/src/Internal/Api/SendMessageEvent/V1_2/Upcast.elm b/src/Internal/Api/SendMessageEvent/V1_2/Upcast.elm deleted file mode 100644 index d4b15d0..0000000 --- a/src/Internal/Api/SendMessageEvent/V1_2/Upcast.elm +++ /dev/null @@ -1,9 +0,0 @@ -module Internal.Api.SendMessageEvent.V1_2.Upcast exposing (..) - -import Internal.Api.SendMessageEvent.V1_2.Objects as O -import Internal.Config.Leaking as L - - -upcast : () -> O.EventResponse -upcast _ = - { eventId = L.eventId } diff --git a/src/Internal/Api/SendMessageEvent/V1_3/Api.elm b/src/Internal/Api/SendMessageEvent/V1_3/Api.elm deleted file mode 100644 index 41c93e0..0000000 --- a/src/Internal/Api/SendMessageEvent/V1_3/Api.elm +++ /dev/null @@ -1,17 +0,0 @@ -module Internal.Api.SendMessageEvent.V1_3.Api exposing (..) - -import Internal.Api.SendMessageEvent.Api as Api -import Internal.Api.SendMessageEvent.V1_2.Objects as PO -import Internal.Api.SendMessageEvent.V1_3.Convert as C -import Internal.Api.SendMessageEvent.V1_3.Objects as O -import Internal.Api.SendMessageEvent.V1_3.Upcast as U -import Internal.Api.VersionControl as V - - -packet : V.SingleVersion Api.SendMessageEventInputV1 PO.EventResponse Api.SendMessageEventInputV1 O.EventResponse -packet = - { version = "v1.3" - , downcast = identity - , current = Api.sendMessageEventV1 O.eventResponseDecoder C.convert - , upcast = U.upcast - } diff --git a/src/Internal/Api/SendMessageEvent/V1_3/Convert.elm b/src/Internal/Api/SendMessageEvent/V1_3/Convert.elm deleted file mode 100644 index 80259a8..0000000 --- a/src/Internal/Api/SendMessageEvent/V1_3/Convert.elm +++ /dev/null @@ -1,9 +0,0 @@ -module Internal.Api.SendMessageEvent.V1_3.Convert exposing (..) - -import Internal.Api.SendMessageEvent.V1_3.Objects as O -import Internal.Api.SendMessageEvent.V1_3.SpecObjects as SO - - -convert : SO.EventResponse -> O.EventResponse -convert = - identity diff --git a/src/Internal/Api/SendMessageEvent/V1_3/Objects.elm b/src/Internal/Api/SendMessageEvent/V1_3/Objects.elm deleted file mode 100644 index ba6a7c9..0000000 --- a/src/Internal/Api/SendMessageEvent/V1_3/Objects.elm +++ /dev/null @@ -1,38 +0,0 @@ -module Internal.Api.SendMessageEvent.V1_3.Objects exposing - ( EventResponse - , encodeEventResponse - , eventResponseDecoder - ) - -{-| Automatically generated 'Objects' - -Last generated at Unix time 1673279712 - --} - -import Internal.Tools.EncodeExtra exposing (maybeObject) -import Json.Decode as D -import Json.Encode as E - - -{-| A response confirming that an event has been sent. --} -type alias EventResponse = - { eventId : String - } - - -encodeEventResponse : EventResponse -> E.Value -encodeEventResponse data = - maybeObject - [ ( "event_id", Just <| E.string data.eventId ) - ] - - -eventResponseDecoder : D.Decoder EventResponse -eventResponseDecoder = - D.map - (\a -> - { eventId = a } - ) - (D.field "event_id" D.string) diff --git a/src/Internal/Api/SendMessageEvent/V1_3/Objects.yaml b/src/Internal/Api/SendMessageEvent/V1_3/Objects.yaml deleted file mode 100644 index d302712..0000000 --- a/src/Internal/Api/SendMessageEvent/V1_3/Objects.yaml +++ /dev/null @@ -1,9 +0,0 @@ -version: v1.3 -name: Objects -objects: - EventResponse: - description: A response confirming that an event has been sent. - fields: - event_id: - type: string - required: true diff --git a/src/Internal/Api/SendMessageEvent/V1_3/SpecObjects.elm b/src/Internal/Api/SendMessageEvent/V1_3/SpecObjects.elm deleted file mode 100644 index e346914..0000000 --- a/src/Internal/Api/SendMessageEvent/V1_3/SpecObjects.elm +++ /dev/null @@ -1,38 +0,0 @@ -module Internal.Api.SendMessageEvent.V1_3.SpecObjects exposing - ( EventResponse - , encodeEventResponse - , eventResponseDecoder - ) - -{-| Automatically generated 'SpecObjects' - -Last generated at Unix time 1673279712 - --} - -import Internal.Tools.EncodeExtra exposing (maybeObject) -import Json.Decode as D -import Json.Encode as E - - -{-| A response confirming that an event has been sent. --} -type alias EventResponse = - { eventId : String - } - - -encodeEventResponse : EventResponse -> E.Value -encodeEventResponse data = - maybeObject - [ ( "event_id", Just <| E.string data.eventId ) - ] - - -eventResponseDecoder : D.Decoder EventResponse -eventResponseDecoder = - D.map - (\a -> - { eventId = a } - ) - (D.field "event_id" D.string) diff --git a/src/Internal/Api/SendMessageEvent/V1_3/SpecObjects.yaml b/src/Internal/Api/SendMessageEvent/V1_3/SpecObjects.yaml deleted file mode 100644 index e330263..0000000 --- a/src/Internal/Api/SendMessageEvent/V1_3/SpecObjects.yaml +++ /dev/null @@ -1,9 +0,0 @@ -version: v1.3 -name: SpecObjects -objects: - EventResponse: - description: A response confirming that an event has been sent. - fields: - event_id: - type: string - required: true diff --git a/src/Internal/Api/SendMessageEvent/V1_3/Upcast.elm b/src/Internal/Api/SendMessageEvent/V1_3/Upcast.elm deleted file mode 100644 index 2ca1c35..0000000 --- a/src/Internal/Api/SendMessageEvent/V1_3/Upcast.elm +++ /dev/null @@ -1,9 +0,0 @@ -module Internal.Api.SendMessageEvent.V1_3.Upcast exposing (..) - -import Internal.Api.SendMessageEvent.V1_2.Objects as PO -import Internal.Api.SendMessageEvent.V1_3.Objects as O - - -upcast : PO.EventResponse -> O.EventResponse -upcast = - identity diff --git a/src/Internal/Api/SendMessageEvent/V1_4/Api.elm b/src/Internal/Api/SendMessageEvent/V1_4/Api.elm deleted file mode 100644 index 37ad6fb..0000000 --- a/src/Internal/Api/SendMessageEvent/V1_4/Api.elm +++ /dev/null @@ -1,17 +0,0 @@ -module Internal.Api.SendMessageEvent.V1_4.Api exposing (..) - -import Internal.Api.SendMessageEvent.Api as Api -import Internal.Api.SendMessageEvent.V1_3.Objects as PO -import Internal.Api.SendMessageEvent.V1_4.Convert as C -import Internal.Api.SendMessageEvent.V1_4.Objects as O -import Internal.Api.SendMessageEvent.V1_4.Upcast as U -import Internal.Api.VersionControl as V - - -packet : V.SingleVersion Api.SendMessageEventInputV1 PO.EventResponse Api.SendMessageEventInputV1 O.EventResponse -packet = - { version = "v1.4" - , downcast = identity - , current = Api.sendMessageEventV1 O.eventResponseDecoder C.convert - , upcast = U.upcast - } diff --git a/src/Internal/Api/SendMessageEvent/V1_4/Convert.elm b/src/Internal/Api/SendMessageEvent/V1_4/Convert.elm deleted file mode 100644 index 19a4da6..0000000 --- a/src/Internal/Api/SendMessageEvent/V1_4/Convert.elm +++ /dev/null @@ -1,9 +0,0 @@ -module Internal.Api.SendMessageEvent.V1_4.Convert exposing (..) - -import Internal.Api.SendMessageEvent.V1_4.Objects as O -import Internal.Api.SendMessageEvent.V1_4.SpecObjects as SO - - -convert : SO.EventResponse -> O.EventResponse -convert = - identity diff --git a/src/Internal/Api/SendMessageEvent/V1_4/Objects.elm b/src/Internal/Api/SendMessageEvent/V1_4/Objects.elm deleted file mode 100644 index 65321e3..0000000 --- a/src/Internal/Api/SendMessageEvent/V1_4/Objects.elm +++ /dev/null @@ -1,38 +0,0 @@ -module Internal.Api.SendMessageEvent.V1_4.Objects exposing - ( EventResponse - , encodeEventResponse - , eventResponseDecoder - ) - -{-| Automatically generated 'Objects' - -Last generated at Unix time 1673279712 - --} - -import Internal.Tools.EncodeExtra exposing (maybeObject) -import Json.Decode as D -import Json.Encode as E - - -{-| A response confirming that an event has been sent. --} -type alias EventResponse = - { eventId : String - } - - -encodeEventResponse : EventResponse -> E.Value -encodeEventResponse data = - maybeObject - [ ( "event_id", Just <| E.string data.eventId ) - ] - - -eventResponseDecoder : D.Decoder EventResponse -eventResponseDecoder = - D.map - (\a -> - { eventId = a } - ) - (D.field "event_id" D.string) diff --git a/src/Internal/Api/SendMessageEvent/V1_4/Objects.yaml b/src/Internal/Api/SendMessageEvent/V1_4/Objects.yaml deleted file mode 100644 index 93126c6..0000000 --- a/src/Internal/Api/SendMessageEvent/V1_4/Objects.yaml +++ /dev/null @@ -1,9 +0,0 @@ -version: v1.4 -name: Objects -objects: - EventResponse: - description: A response confirming that an event has been sent. - fields: - event_id: - type: string - required: true diff --git a/src/Internal/Api/SendMessageEvent/V1_4/SpecObjects.yaml b/src/Internal/Api/SendMessageEvent/V1_4/SpecObjects.yaml deleted file mode 100644 index 9ab5c91..0000000 --- a/src/Internal/Api/SendMessageEvent/V1_4/SpecObjects.yaml +++ /dev/null @@ -1,9 +0,0 @@ -version: v1.4 -name: SpecObjects -objects: - EventResponse: - description: A response confirming that an event has been sent. - fields: - event_id: - type: string - required: true diff --git a/src/Internal/Api/SendMessageEvent/V1_4/Upcast.elm b/src/Internal/Api/SendMessageEvent/V1_4/Upcast.elm deleted file mode 100644 index 84e9080..0000000 --- a/src/Internal/Api/SendMessageEvent/V1_4/Upcast.elm +++ /dev/null @@ -1,9 +0,0 @@ -module Internal.Api.SendMessageEvent.V1_4.Upcast exposing (..) - -import Internal.Api.SendMessageEvent.V1_3.Objects as PO -import Internal.Api.SendMessageEvent.V1_4.Objects as O - - -upcast : PO.EventResponse -> O.EventResponse -upcast = - identity diff --git a/src/Internal/Api/SendMessageEvent/V1_5/Api.elm b/src/Internal/Api/SendMessageEvent/V1_5/Api.elm deleted file mode 100644 index 7680445..0000000 --- a/src/Internal/Api/SendMessageEvent/V1_5/Api.elm +++ /dev/null @@ -1,17 +0,0 @@ -module Internal.Api.SendMessageEvent.V1_5.Api exposing (..) - -import Internal.Api.SendMessageEvent.Api as Api -import Internal.Api.SendMessageEvent.V1_4.Objects as PO -import Internal.Api.SendMessageEvent.V1_5.Convert as C -import Internal.Api.SendMessageEvent.V1_5.Objects as O -import Internal.Api.SendMessageEvent.V1_5.Upcast as U -import Internal.Api.VersionControl as V - - -packet : V.SingleVersion Api.SendMessageEventInputV1 PO.EventResponse Api.SendMessageEventInputV1 O.EventResponse -packet = - { version = "v1.5" - , downcast = identity - , current = Api.sendMessageEventV1 O.eventResponseDecoder C.convert - , upcast = U.upcast - } diff --git a/src/Internal/Api/SendMessageEvent/V1_5/Convert.elm b/src/Internal/Api/SendMessageEvent/V1_5/Convert.elm deleted file mode 100644 index 0df53f0..0000000 --- a/src/Internal/Api/SendMessageEvent/V1_5/Convert.elm +++ /dev/null @@ -1,9 +0,0 @@ -module Internal.Api.SendMessageEvent.V1_5.Convert exposing (..) - -import Internal.Api.SendMessageEvent.V1_5.Objects as O -import Internal.Api.SendMessageEvent.V1_5.SpecObjects as SO - - -convert : SO.EventResponse -> O.EventResponse -convert = - identity diff --git a/src/Internal/Api/SendMessageEvent/V1_5/Objects.elm b/src/Internal/Api/SendMessageEvent/V1_5/Objects.elm deleted file mode 100644 index 1828555..0000000 --- a/src/Internal/Api/SendMessageEvent/V1_5/Objects.elm +++ /dev/null @@ -1,38 +0,0 @@ -module Internal.Api.SendMessageEvent.V1_5.Objects exposing - ( EventResponse - , encodeEventResponse - , eventResponseDecoder - ) - -{-| Automatically generated 'Objects' - -Last generated at Unix time 1673279712 - --} - -import Internal.Tools.EncodeExtra exposing (maybeObject) -import Json.Decode as D -import Json.Encode as E - - -{-| A response confirming that an event has been sent. --} -type alias EventResponse = - { eventId : String - } - - -encodeEventResponse : EventResponse -> E.Value -encodeEventResponse data = - maybeObject - [ ( "event_id", Just <| E.string data.eventId ) - ] - - -eventResponseDecoder : D.Decoder EventResponse -eventResponseDecoder = - D.map - (\a -> - { eventId = a } - ) - (D.field "event_id" D.string) diff --git a/src/Internal/Api/SendMessageEvent/V1_5/Objects.yaml b/src/Internal/Api/SendMessageEvent/V1_5/Objects.yaml deleted file mode 100644 index b2411ba..0000000 --- a/src/Internal/Api/SendMessageEvent/V1_5/Objects.yaml +++ /dev/null @@ -1,9 +0,0 @@ -version: v1.5 -name: Objects -objects: - EventResponse: - description: A response confirming that an event has been sent. - fields: - event_id: - type: string - required: true diff --git a/src/Internal/Api/SendMessageEvent/V1_5/SpecObjects.elm b/src/Internal/Api/SendMessageEvent/V1_5/SpecObjects.elm deleted file mode 100644 index 1534cb2..0000000 --- a/src/Internal/Api/SendMessageEvent/V1_5/SpecObjects.elm +++ /dev/null @@ -1,38 +0,0 @@ -module Internal.Api.SendMessageEvent.V1_5.SpecObjects exposing - ( EventResponse - , encodeEventResponse - , eventResponseDecoder - ) - -{-| Automatically generated 'SpecObjects' - -Last generated at Unix time 1673279712 - --} - -import Internal.Tools.EncodeExtra exposing (maybeObject) -import Json.Decode as D -import Json.Encode as E - - -{-| A response confirming that an event has been sent. --} -type alias EventResponse = - { eventId : String - } - - -encodeEventResponse : EventResponse -> E.Value -encodeEventResponse data = - maybeObject - [ ( "event_id", Just <| E.string data.eventId ) - ] - - -eventResponseDecoder : D.Decoder EventResponse -eventResponseDecoder = - D.map - (\a -> - { eventId = a } - ) - (D.field "event_id" D.string) diff --git a/src/Internal/Api/SendMessageEvent/V1_5/SpecObjects.yaml b/src/Internal/Api/SendMessageEvent/V1_5/SpecObjects.yaml deleted file mode 100644 index ee1cb6f..0000000 --- a/src/Internal/Api/SendMessageEvent/V1_5/SpecObjects.yaml +++ /dev/null @@ -1,9 +0,0 @@ -version: v1.5 -name: SpecObjects -objects: - EventResponse: - description: A response confirming that an event has been sent. - fields: - event_id: - type: string - required: true diff --git a/src/Internal/Api/SendMessageEvent/V1_5/Upcast.elm b/src/Internal/Api/SendMessageEvent/V1_5/Upcast.elm deleted file mode 100644 index cdf56d6..0000000 --- a/src/Internal/Api/SendMessageEvent/V1_5/Upcast.elm +++ /dev/null @@ -1,9 +0,0 @@ -module Internal.Api.SendMessageEvent.V1_5.Upcast exposing (..) - -import Internal.Api.SendMessageEvent.V1_4.Objects as PO -import Internal.Api.SendMessageEvent.V1_5.Objects as O - - -upcast : PO.EventResponse -> O.EventResponse -upcast = - identity