diff --git a/src/Internal/Api/All.elm b/src/Internal/Api/All.elm index 690381c..0c97add 100644 --- a/src/Internal/Api/All.elm +++ b/src/Internal/Api/All.elm @@ -31,7 +31,7 @@ sendMessageEvent = {-| Send a state event into a Matrix room. -} -sendStateEvent : List String -> SendStateKey.SendStateKeyInput -> SendStateKey.SendStateKeyOutput +sendStateEvent : List String -> Maybe (SendStateKey.SendStateKeyInput -> SendStateKey.SendStateKeyOutput) sendStateEvent = SendStateKey.sendStateKey diff --git a/src/Internal/Api/SendMessageEvent/Main.elm b/src/Internal/Api/SendMessageEvent/Main.elm index 526330a..277da06 100644 --- a/src/Internal/Api/SendMessageEvent/Main.elm +++ b/src/Internal/Api/SendMessageEvent/Main.elm @@ -13,6 +13,7 @@ sendMessageEvent versions = |> VC.sameForVersion "r0.1.0" |> VC.sameForVersion "r0.2.0" |> VC.sameForVersion "r0.3.0" + |> VC.sameForVersion "r0.4.0" |> VC.sameForVersion "r0.5.0" |> VC.sameForVersion "r0.6.0" |> VC.sameForVersion "r0.6.1" diff --git a/src/Internal/Api/SendStateKey/Api.elm b/src/Internal/Api/SendStateKey/Api.elm index 7b8c70e..2a91f03 100644 --- a/src/Internal/Api/SendStateKey/Api.elm +++ b/src/Internal/Api/SendStateKey/Api.elm @@ -1,6 +1,7 @@ module Internal.Api.SendStateKey.Api exposing (..) import Internal.Api.Request as R +import Internal.Api.SendStateKey.V1.SpecObjects as SO1 import Internal.Tools.Exceptions as X import Json.Decode as D import Task exposing (Task) @@ -15,9 +16,31 @@ type alias SendStateKeyInputV1 = , stateKey : String } +type alias SendStateKeyOutputV1 = + Task X.Error SO1.EventResponse -sendStateKeyV1 : D.Decoder a -> (a -> b) -> SendStateKeyInputV1 -> Task X.Error b -sendStateKeyV1 decoder mapping data = + +sendStateKeyV1 : SendStateKeyInputV1 -> SendStateKeyOutputV1 +sendStateKeyV1 data = + R.rawApiCall + { headers = R.WithAccessToken data.accessToken + , method = "PUT" + , baseUrl = data.baseUrl + , path = "/_matrix/client/r0/rooms/{roomId}/state/{eventType}/{stateKey}" + , pathParams = + [ ( "eventType", data.eventType ) + , ( "roomId", data.roomId ) + , ( "stateKey", data.stateKey ) + ] + , queryParams = [] + , bodyParams = [ R.RequiredValue "*" data.content ] + , timeout = Nothing + , decoder = \_ -> SO1.eventResponseDecoder + } + + +sendStateKeyV2 : SendStateKeyInputV1 -> SendStateKeyOutputV1 +sendStateKeyV2 data = R.rawApiCall { headers = R.WithAccessToken data.accessToken , method = "PUT" @@ -31,5 +54,5 @@ sendStateKeyV1 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/SendStateKey/Main.elm b/src/Internal/Api/SendStateKey/Main.elm index 65b61ed..4a97703 100644 --- a/src/Internal/Api/SendStateKey/Main.elm +++ b/src/Internal/Api/SendStateKey/Main.elm @@ -1,23 +1,34 @@ module Internal.Api.SendStateKey.Main exposing (..) import Internal.Api.SendStateKey.Api as Api -import Internal.Api.SendStateKey.V1_2.Api as V1_2 -import Internal.Api.SendStateKey.V1_3.Api as V1_3 -import Internal.Api.SendStateKey.V1_4.Api as V1_4 -import Internal.Api.SendStateKey.V1_5.Api as V1_5 -import Internal.Api.SendStateKey.V1_5.Objects as O -import Internal.Api.VersionControl as V -import Internal.Tools.Exceptions as X -import Task exposing (Task) +import Internal.Tools.VersionControl as VC -sendStateKey : List String -> SendStateKeyInput -> SendStateKeyOutput -sendStateKey = - V.firstVersion V1_2.packet - |> V.updateWith V1_3.packet - |> V.updateWith V1_4.packet - |> V.updateWith V1_5.packet - |> V.toFunction +sendStateKey : List String -> Maybe (SendStateKeyInput -> SendStateKeyOutput) +sendStateKey versions = + VC.withBottomLayer + { current = Api.sendStateKeyV1 + , version = "r0.0.0" + } + |> VC.sameForVersion "r0.0.1" + |> VC.sameForVersion "r0.1.0" + |> VC.sameForVersion "r0.2.0" + |> VC.sameForVersion "r0.3.0" + |> VC.sameForVersion "r0.4.0" + |> VC.sameForVersion "r0.5.0" + |> VC.sameForVersion "r0.6.0" + |> VC.sameForVersion "r0.6.1" + |> VC.addMiddleLayer + { downcast = identity + , current = Api.sendStateKeyV2 + , upcast = identity + , version = "v1.1" + } + |> VC.sameForVersion "v1.2" + |> VC.sameForVersion "v1.3" + |> VC.sameForVersion "v1.4" + |> VC.sameForVersion "v1.5" + |> VC.mostRecentFromVersionList versions type alias SendStateKeyInput = @@ -25,4 +36,4 @@ type alias SendStateKeyInput = type alias SendStateKeyOutput = - Task X.Error O.EventResponse + Api.SendStateKeyOutputV1 diff --git a/src/Internal/Api/SendStateKey/V1_3/Objects.elm b/src/Internal/Api/SendStateKey/V1/SpecObjects.elm similarity index 58% rename from src/Internal/Api/SendStateKey/V1_3/Objects.elm rename to src/Internal/Api/SendStateKey/V1/SpecObjects.elm index 0feefbc..3a4cf36 100644 --- a/src/Internal/Api/SendStateKey/V1_3/Objects.elm +++ b/src/Internal/Api/SendStateKey/V1/SpecObjects.elm @@ -1,38 +1,37 @@ -module Internal.Api.SendStateKey.V1_3.Objects exposing - ( EventResponse +module Internal.Api.SendStateKey.V1.SpecObjects exposing ( + EventResponse , encodeEventResponse , eventResponseDecoder ) - {-| Automatically generated 'SpecObjects' -Last generated at Unix time 1673279712 - +Last generated at Unix time 1675965633 -} + 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 +type alias EventResponse = { + eventId : String } - encodeEventResponse : EventResponse -> E.Value encodeEventResponse data = - maybeObject - [ ( "event_id", Just <| E.string data.eventId ) - ] + maybeObject [ + ("event_id", Just <| E.string data.eventId) + ] eventResponseDecoder : D.Decoder EventResponse eventResponseDecoder = D.map (\a -> - { eventId = a } - ) - (D.field "event_id" D.string) + { eventId=a}) + (D.field "event_id" D.string) + + diff --git a/src/Internal/Api/SendStateKey/V1_2/SpecObjects.yaml b/src/Internal/Api/SendStateKey/V1/SpecObjects.yaml similarity index 92% rename from src/Internal/Api/SendStateKey/V1_2/SpecObjects.yaml rename to src/Internal/Api/SendStateKey/V1/SpecObjects.yaml index f5eaebe..9b619b4 100644 --- a/src/Internal/Api/SendStateKey/V1_2/SpecObjects.yaml +++ b/src/Internal/Api/SendStateKey/V1/SpecObjects.yaml @@ -1,4 +1,4 @@ -version: v1.2 +version: v1 name: SpecObjects objects: EventResponse: diff --git a/src/Internal/Api/SendStateKey/V1_2/Api.elm b/src/Internal/Api/SendStateKey/V1_2/Api.elm deleted file mode 100644 index 3456b95..0000000 --- a/src/Internal/Api/SendStateKey/V1_2/Api.elm +++ /dev/null @@ -1,16 +0,0 @@ -module Internal.Api.SendStateKey.V1_2.Api exposing (..) - -import Internal.Api.SendStateKey.Api as Api -import Internal.Api.SendStateKey.V1_2.Convert as C -import Internal.Api.SendStateKey.V1_2.Objects as O -import Internal.Api.SendStateKey.V1_2.Upcast as U -import Internal.Api.VersionControl as V - - -packet : V.SingleVersion () () Api.SendStateKeyInputV1 O.EventResponse -packet = - { version = "v1.2" - , downcast = \_ -> () - , current = Api.sendStateKeyV1 O.eventResponseDecoder C.convert - , upcast = U.upcast - } diff --git a/src/Internal/Api/SendStateKey/V1_2/Convert.elm b/src/Internal/Api/SendStateKey/V1_2/Convert.elm deleted file mode 100644 index ef2ca42..0000000 --- a/src/Internal/Api/SendStateKey/V1_2/Convert.elm +++ /dev/null @@ -1,9 +0,0 @@ -module Internal.Api.SendStateKey.V1_2.Convert exposing (..) - -import Internal.Api.SendStateKey.V1_2.Objects as O -import Internal.Api.SendStateKey.V1_2.SpecObjects as SO - - -convert : SO.EventResponse -> O.EventResponse -convert = - identity diff --git a/src/Internal/Api/SendStateKey/V1_2/Objects.elm b/src/Internal/Api/SendStateKey/V1_2/Objects.elm deleted file mode 100644 index f7c6e6b..0000000 --- a/src/Internal/Api/SendStateKey/V1_2/Objects.elm +++ /dev/null @@ -1,38 +0,0 @@ -module Internal.Api.SendStateKey.V1_2.Objects 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/SendStateKey/V1_2/Objects.yaml b/src/Internal/Api/SendStateKey/V1_2/Objects.yaml deleted file mode 100644 index f5eaebe..0000000 --- a/src/Internal/Api/SendStateKey/V1_2/Objects.yaml +++ /dev/null @@ -1,9 +0,0 @@ -version: v1.2 -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/SendStateKey/V1_2/SpecObjects.elm b/src/Internal/Api/SendStateKey/V1_2/SpecObjects.elm deleted file mode 100644 index b9467bc..0000000 --- a/src/Internal/Api/SendStateKey/V1_2/SpecObjects.elm +++ /dev/null @@ -1,38 +0,0 @@ -module Internal.Api.SendStateKey.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/SendStateKey/V1_2/Upcast.elm b/src/Internal/Api/SendStateKey/V1_2/Upcast.elm deleted file mode 100644 index 9b887a4..0000000 --- a/src/Internal/Api/SendStateKey/V1_2/Upcast.elm +++ /dev/null @@ -1,9 +0,0 @@ -module Internal.Api.SendStateKey.V1_2.Upcast exposing (..) - -import Internal.Api.SendStateKey.V1_2.Objects as O -import Internal.Config.Leaking as L - - -upcast : () -> O.EventResponse -upcast _ = - { eventId = L.eventId } diff --git a/src/Internal/Api/SendStateKey/V1_3/Api.elm b/src/Internal/Api/SendStateKey/V1_3/Api.elm deleted file mode 100644 index b16ed28..0000000 --- a/src/Internal/Api/SendStateKey/V1_3/Api.elm +++ /dev/null @@ -1,17 +0,0 @@ -module Internal.Api.SendStateKey.V1_3.Api exposing (..) - -import Internal.Api.SendStateKey.Api as Api -import Internal.Api.SendStateKey.V1_2.Objects as PO -import Internal.Api.SendStateKey.V1_3.Convert as C -import Internal.Api.SendStateKey.V1_3.Objects as O -import Internal.Api.SendStateKey.V1_3.Upcast as U -import Internal.Api.VersionControl as V - - -packet : V.SingleVersion Api.SendStateKeyInputV1 PO.EventResponse Api.SendStateKeyInputV1 O.EventResponse -packet = - { version = "v1.3" - , downcast = identity - , current = Api.sendStateKeyV1 O.eventResponseDecoder C.convert - , upcast = U.upcast - } diff --git a/src/Internal/Api/SendStateKey/V1_3/Convert.elm b/src/Internal/Api/SendStateKey/V1_3/Convert.elm deleted file mode 100644 index 287f75d..0000000 --- a/src/Internal/Api/SendStateKey/V1_3/Convert.elm +++ /dev/null @@ -1,9 +0,0 @@ -module Internal.Api.SendStateKey.V1_3.Convert exposing (..) - -import Internal.Api.SendStateKey.V1_3.Objects as O -import Internal.Api.SendStateKey.V1_3.SpecObjects as SO - - -convert : SO.EventResponse -> O.EventResponse -convert = - identity diff --git a/src/Internal/Api/SendStateKey/V1_3/Objects.yaml b/src/Internal/Api/SendStateKey/V1_3/Objects.yaml deleted file mode 100644 index e330263..0000000 --- a/src/Internal/Api/SendStateKey/V1_3/Objects.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/SendStateKey/V1_3/SpecObjects.elm b/src/Internal/Api/SendStateKey/V1_3/SpecObjects.elm deleted file mode 100644 index b00c428..0000000 --- a/src/Internal/Api/SendStateKey/V1_3/SpecObjects.elm +++ /dev/null @@ -1,38 +0,0 @@ -module Internal.Api.SendStateKey.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/SendStateKey/V1_3/SpecObjects.yaml b/src/Internal/Api/SendStateKey/V1_3/SpecObjects.yaml deleted file mode 100644 index e330263..0000000 --- a/src/Internal/Api/SendStateKey/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/SendStateKey/V1_3/Upcast.elm b/src/Internal/Api/SendStateKey/V1_3/Upcast.elm deleted file mode 100644 index 59b36dc..0000000 --- a/src/Internal/Api/SendStateKey/V1_3/Upcast.elm +++ /dev/null @@ -1,9 +0,0 @@ -module Internal.Api.SendStateKey.V1_3.Upcast exposing (..) - -import Internal.Api.SendStateKey.V1_2.Objects as PO -import Internal.Api.SendStateKey.V1_3.Objects as O - - -upcast : PO.EventResponse -> O.EventResponse -upcast = - identity diff --git a/src/Internal/Api/SendStateKey/V1_4/Api.elm b/src/Internal/Api/SendStateKey/V1_4/Api.elm deleted file mode 100644 index 1aa8eae..0000000 --- a/src/Internal/Api/SendStateKey/V1_4/Api.elm +++ /dev/null @@ -1,17 +0,0 @@ -module Internal.Api.SendStateKey.V1_4.Api exposing (..) - -import Internal.Api.SendStateKey.Api as Api -import Internal.Api.SendStateKey.V1_3.Objects as PO -import Internal.Api.SendStateKey.V1_4.Convert as C -import Internal.Api.SendStateKey.V1_4.Objects as O -import Internal.Api.SendStateKey.V1_4.Upcast as U -import Internal.Api.VersionControl as V - - -packet : V.SingleVersion Api.SendStateKeyInputV1 PO.EventResponse Api.SendStateKeyInputV1 O.EventResponse -packet = - { version = "v1.4" - , downcast = identity - , current = Api.sendStateKeyV1 O.eventResponseDecoder C.convert - , upcast = U.upcast - } diff --git a/src/Internal/Api/SendStateKey/V1_4/Convert.elm b/src/Internal/Api/SendStateKey/V1_4/Convert.elm deleted file mode 100644 index b942f33..0000000 --- a/src/Internal/Api/SendStateKey/V1_4/Convert.elm +++ /dev/null @@ -1,9 +0,0 @@ -module Internal.Api.SendStateKey.V1_4.Convert exposing (..) - -import Internal.Api.SendStateKey.V1_4.Objects as O -import Internal.Api.SendStateKey.V1_4.SpecObjects as SO - - -convert : SO.EventResponse -> O.EventResponse -convert = - identity diff --git a/src/Internal/Api/SendStateKey/V1_4/Objects.elm b/src/Internal/Api/SendStateKey/V1_4/Objects.elm deleted file mode 100644 index c298ec0..0000000 --- a/src/Internal/Api/SendStateKey/V1_4/Objects.elm +++ /dev/null @@ -1,38 +0,0 @@ -module Internal.Api.SendStateKey.V1_4.Objects 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/SendStateKey/V1_4/Objects.yaml b/src/Internal/Api/SendStateKey/V1_4/Objects.yaml deleted file mode 100644 index 9ab5c91..0000000 --- a/src/Internal/Api/SendStateKey/V1_4/Objects.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/SendStateKey/V1_4/SpecObjects.elm b/src/Internal/Api/SendStateKey/V1_4/SpecObjects.elm deleted file mode 100644 index 435f6de..0000000 --- a/src/Internal/Api/SendStateKey/V1_4/SpecObjects.elm +++ /dev/null @@ -1,38 +0,0 @@ -module Internal.Api.SendStateKey.V1_4.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/SendStateKey/V1_4/SpecObjects.yaml b/src/Internal/Api/SendStateKey/V1_4/SpecObjects.yaml deleted file mode 100644 index 9ab5c91..0000000 --- a/src/Internal/Api/SendStateKey/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/SendStateKey/V1_4/Upcast.elm b/src/Internal/Api/SendStateKey/V1_4/Upcast.elm deleted file mode 100644 index 4e46468..0000000 --- a/src/Internal/Api/SendStateKey/V1_4/Upcast.elm +++ /dev/null @@ -1,9 +0,0 @@ -module Internal.Api.SendStateKey.V1_4.Upcast exposing (..) - -import Internal.Api.SendStateKey.V1_3.Objects as PO -import Internal.Api.SendStateKey.V1_4.Objects as O - - -upcast : PO.EventResponse -> O.EventResponse -upcast = - identity diff --git a/src/Internal/Api/SendStateKey/V1_5/Api.elm b/src/Internal/Api/SendStateKey/V1_5/Api.elm deleted file mode 100644 index 33cc30b..0000000 --- a/src/Internal/Api/SendStateKey/V1_5/Api.elm +++ /dev/null @@ -1,17 +0,0 @@ -module Internal.Api.SendStateKey.V1_5.Api exposing (..) - -import Internal.Api.SendStateKey.Api as Api -import Internal.Api.SendStateKey.V1_4.Objects as PO -import Internal.Api.SendStateKey.V1_5.Convert as C -import Internal.Api.SendStateKey.V1_5.Objects as O -import Internal.Api.SendStateKey.V1_5.Upcast as U -import Internal.Api.VersionControl as V - - -packet : V.SingleVersion Api.SendStateKeyInputV1 PO.EventResponse Api.SendStateKeyInputV1 O.EventResponse -packet = - { version = "v1.5" - , downcast = identity - , current = Api.sendStateKeyV1 O.eventResponseDecoder C.convert - , upcast = U.upcast - } diff --git a/src/Internal/Api/SendStateKey/V1_5/Convert.elm b/src/Internal/Api/SendStateKey/V1_5/Convert.elm deleted file mode 100644 index aaf010a..0000000 --- a/src/Internal/Api/SendStateKey/V1_5/Convert.elm +++ /dev/null @@ -1,9 +0,0 @@ -module Internal.Api.SendStateKey.V1_5.Convert exposing (..) - -import Internal.Api.SendStateKey.V1_5.Objects as O -import Internal.Api.SendStateKey.V1_5.SpecObjects as SO - - -convert : SO.EventResponse -> O.EventResponse -convert = - identity diff --git a/src/Internal/Api/SendStateKey/V1_5/Objects.elm b/src/Internal/Api/SendStateKey/V1_5/Objects.elm deleted file mode 100644 index 6303d95..0000000 --- a/src/Internal/Api/SendStateKey/V1_5/Objects.elm +++ /dev/null @@ -1,38 +0,0 @@ -module Internal.Api.SendStateKey.V1_5.Objects 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/SendStateKey/V1_5/Objects.yaml b/src/Internal/Api/SendStateKey/V1_5/Objects.yaml deleted file mode 100644 index ee1cb6f..0000000 --- a/src/Internal/Api/SendStateKey/V1_5/Objects.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/SendStateKey/V1_5/SpecObjects.elm b/src/Internal/Api/SendStateKey/V1_5/SpecObjects.elm deleted file mode 100644 index a5e4dc5..0000000 --- a/src/Internal/Api/SendStateKey/V1_5/SpecObjects.elm +++ /dev/null @@ -1,38 +0,0 @@ -module Internal.Api.SendStateKey.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/SendStateKey/V1_5/SpecObjects.yaml b/src/Internal/Api/SendStateKey/V1_5/SpecObjects.yaml deleted file mode 100644 index ee1cb6f..0000000 --- a/src/Internal/Api/SendStateKey/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/SendStateKey/V1_5/Upcast.elm b/src/Internal/Api/SendStateKey/V1_5/Upcast.elm deleted file mode 100644 index adc8e51..0000000 --- a/src/Internal/Api/SendStateKey/V1_5/Upcast.elm +++ /dev/null @@ -1,9 +0,0 @@ -module Internal.Api.SendStateKey.V1_5.Upcast exposing (..) - -import Internal.Api.SendStateKey.V1_4.Objects as PO -import Internal.Api.SendStateKey.V1_5.Objects as O - - -upcast : PO.EventResponse -> O.EventResponse -upcast = - identity