-module(slack_webhook_client@operations). -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). -define(FILEPATH, "src/slack_webhook_client/operations.gleam"). -export([post_webhook_request/5, post_webhook_response/1]). -file("src/slack_webhook_client/operations.gleam", 7). -spec post_webhook_request( gleam@http@request:request(any()), binary(), binary(), binary(), slack_webhook_client@schema:slack_message() ) -> gleam@http@request:request(bitstring()). post_webhook_request(Base, Team_id, Channel_id, Token_, Data) -> Method = post, Path = <<<<<<<<<<"/services/"/utf8, Team_id/binary>>/binary, "/"/utf8>>/binary, Channel_id/binary>>/binary, "/"/utf8>>/binary, Token_/binary>>, Query = [], Body = oas@generator@utils:json_to_bits( slack_webhook_client@schema:slack_message_encode(Data) ), _pipe = Base, _pipe@1 = oas@generator@utils:set_method(_pipe, Method), _pipe@2 = oas@generator@utils:append_path(_pipe@1, Path), _pipe@3 = oas@generator@utils:set_query(_pipe@2, Query), oas@generator@utils:set_body(_pipe@3, <<"application/json"/utf8>>, Body). -file("src/slack_webhook_client/operations.gleam", 25). -spec post_webhook_response(gleam@http@response:response(FGA)) -> {ok, {ok, nil} | {error, gleam@http@response:response(FGA)}} | {error, any()}. post_webhook_response(Response) -> {response, Status, _, _} = Response, case Status of 200 -> {ok, {ok, nil}}; _ -> {ok, {error, Response}} end.