Source file values.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
(* generated by: awso-codegen generate-all --botocore-data vendor/botocore/botocore/data -o aws --runtime-dir lib/runtime/awso --cli-dir awso-cli *)
open Awso
open! Import
[@@@warning "-32"]
let service = Service.kinesis_video_webrtc_storage
let apiVersion = "2018-05-10"
let endpointPrefix = "kinesisvideo"
let serviceFullName = "Amazon Kinesis Video WebRTC Storage"
let signatureVersion = "v4"
let protocol = "rest_json"
let globalEndpoint = endpointPrefix ^ ".amazonaws.com"
let simple_to_json to_value x =
  Botodata.Json.value_to_json_scalar (to_value x)
let composed_to_json to_value x = Botodata.Json.value_to_json (to_value x)
let to_query to_value x = Client.Query.of_value (to_value x)
let structure_to_value_aux st ~f =
  let filter = function | (k, Some v) -> Some (k, v) | _ -> None in
  let pair k v = (k, v) in
  let defer_value (k, dv) = pair k dv in
  ((List.filter_map st ~f:filter) |> (List.map ~f:defer_value)) |>
    (fun x -> `Structure (f x))
let structure_to_value = structure_to_value_aux ~f:Fn.id
let structure_to_wrapped_value ~wrapper ~response =
  structure_to_value_aux
    ~f:(fun x -> [(wrapper, (`Structure x)); (response, (`Structure []))])
module String_ =
  struct
    type nonrec t = string
    let context_ = "String"
    let make i = i
    let of_string x = x
    let to_value x = `String x
    let to_query v = to_query to_value v
    let to_header x = x
    let of_xml = Xml.string_data_exn ~context:context_
    let of_json j = string_of_json ~kind:"String" j
    let to_json = simple_to_json to_value
  end
module ChannelArn =
  struct
    type nonrec t = string
    let context_ = "ChannelArn"
    let make i =
      let open Result in
        ok_or_failwith
          (check_pattern i
             ~pattern:"^arn:(aws[a-zA-Z-]*):kinesisvideo:[a-z0-9-]+:[0-9]+:[a-z]+/[a-zA-Z0-9_.-]+/[0-9]+$");
        i
    let of_string x = x
    let to_value x = `String x
    let to_query v = to_query to_value v
    let to_header x = x
    let of_xml = Xml.string_data_exn ~context:context_
    let of_json j = string_of_json ~kind:"ChannelArn" j
    let to_json = simple_to_json to_value
  end
module ClientId =
  struct
    type nonrec t = string
    let context_ = "ClientId"
    let make i =
      let open Result in
        ok_or_failwith
          ((check_string_min i ~min:1) >>=
             (fun () ->
                (check_string_max i ~max:256) >>=
                  (fun () -> check_pattern i ~pattern:"^[a-zA-Z0-9_.-]+$")));
        i
    let of_string x = x
    let to_value x = `String x
    let to_query v = to_query to_value v
    let to_header x = x
    let of_xml = Xml.string_data_exn ~context:context_
    let of_json j = string_of_json ~kind:"ClientId" j
    let to_json = simple_to_json to_value
  end
module ResourceNotFoundException =
  struct
    type nonrec t = {
      message: String_.t option }
    let make ?message = fun () -> { message }
    let to_value x =
      structure_to_value
        [("message", (Option.map x.message ~f:String_.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let message =
        (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "message") in
      make ?message ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let message = field_map json__ "message" String_.of_json in
      make ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "The specified resource is not found."]
module JoinStorageSessionInput =
  struct
    type nonrec t =
      {
      channelArn: ChannelArn.t
        [@ocaml.doc
          "The Amazon Resource Name (ARN) of the signaling channel."]}
    let context_ = "JoinStorageSessionInput"
    let make ~channelArn = fun () -> { channelArn }
    let to_value x =
      structure_to_value
        [("channelArn", (Some (ChannelArn.to_value x.channelArn)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let channelArn =
        ChannelArn.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "channelArn") in
      make ~channelArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let channelArn = field_map_exn json__ "channelArn" ChannelArn.of_json in
      make ~channelArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Before using this API, you must call the GetSignalingChannelEndpoint API to request the WEBRTC endpoint. You then specify the endpoint and region in your JoinStorageSession API request. Join the ongoing one way-video and/or multi-way audio WebRTC session as a video producing device for an input channel. If there\226\128\153s no existing session for the channel, a new streaming session needs to be created, and the Amazon Resource Name (ARN) of the signaling channel must be provided. Currently for the SINGLE_MASTER type, a video producing device is able to ingest both audio and video media into a stream. Only video producing devices can join the session and record media. Both audio and video tracks are currently required for WebRTC ingestion. Current requirements: Video track: H.264 Audio track: Opus The resulting ingested video in the Kinesis video stream will have the following parameters: H.264 video and AAC audio. Once a master participant has negotiated a connection through WebRTC, the ingested media session will be stored in the Kinesis video stream. Multiple viewers are then able to play back real-time media through our Playback APIs. You can also use existing Kinesis Video Streams features like HLS or DASH playback, image generation via GetImages, and more with ingested WebRTC media. S3 image delivery and notifications are not currently supported. Assume that only one video producing device client can be associated with a session for the channel. If more than one client joins the session of a specific channel as a video producing device, the most recent client request takes precedence. Additional information Idempotent - This API is not idempotent. Retry behavior - This is counted as a new API call. Concurrent calls - Concurrent calls are allowed. An offer is sent once per each call."]
module JoinStorageSessionAsViewerInput =
  struct
    type nonrec t =
      {
      channelArn: ChannelArn.t
        [@ocaml.doc
          "The Amazon Resource Name (ARN) of the signaling channel."];
      clientId: ClientId.t
        [@ocaml.doc "The unique identifier for the sender client."]}
    let context_ = "JoinStorageSessionAsViewerInput"
    let make ~channelArn =
      fun ~clientId -> fun () -> { channelArn; clientId }
    let to_value x =
      structure_to_value
        [("channelArn", (Some (ChannelArn.to_value x.channelArn)));
        ("clientId", (Some (ClientId.to_value x.clientId)))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let clientId =
        ClientId.of_xml (Xml.child_exn ~context:context_ xml_arg0 "clientId") in
      let channelArn =
        ChannelArn.of_xml
          (Xml.child_exn ~context:context_ xml_arg0 "channelArn") in
      make ~clientId ~channelArn ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let clientId = field_map_exn json__ "clientId" ClientId.of_json in
      let channelArn = field_map_exn json__ "channelArn" ChannelArn.of_json in
      make ~clientId ~channelArn ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Join the ongoing one way-video and/or multi-way audio WebRTC session as a viewer for an input channel. If there\226\128\153s no existing session for the channel, create a new streaming session and provide the Amazon Resource Name (ARN) of the signaling channel (channelArn) and client id (clientId). Currently for SINGLE_MASTER type, a video producing device is able to ingest both audio and video media into a stream, while viewers can only ingest audio. Both a video producing device and viewers can join a session first and wait for other participants. While participants are having peer to peer conversations through WebRTC, the ingested media session will be stored into the Kinesis Video Stream. Multiple viewers are able to playback real-time media. Customers can also use existing Kinesis Video Streams features like HLS or DASH playback, Image generation, and more with ingested WebRTC media. If there\226\128\153s an existing session with the same clientId that's found in the join session request, the new request takes precedence."]
module InvalidArgumentException =
  struct
    type nonrec t = {
      message: String_.t option }
    let make ?message = fun () -> { message }
    let to_value x =
      structure_to_value
        [("message", (Option.map x.message ~f:String_.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let message =
        (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "message") in
      make ?message ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let message = field_map json__ "message" String_.of_json in
      make ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc "The value for this input parameter is invalid."]
module ClientLimitExceededException =
  struct
    type nonrec t = {
      message: String_.t option }
    let make ?message = fun () -> { message }
    let to_value x =
      structure_to_value
        [("message", (Option.map x.message ~f:String_.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let message =
        (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "message") in
      make ?message ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let message = field_map json__ "message" String_.of_json in
      make ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "Kinesis Video Streams has throttled the request because you have exceeded the limit of allowed client calls. Try making the call later."]
module AccessDeniedException =
  struct
    type nonrec t = {
      message: String_.t option }
    let make ?message = fun () -> { message }
    let to_value x =
      structure_to_value
        [("message", (Option.map x.message ~f:String_.to_value))]
    let to_query v = to_query to_value v
    let of_xml xml_arg0 =
      let message =
        (Option.map ~f:String_.of_xml) (Xml.child xml_arg0 "message") in
      make ?message ()
    let of_string s = of_xml (Awso.Xml.parse_response s)[@@warning "-32"]
    let of_json json__ =
      let message = field_map json__ "message" String_.of_json in
      make ?message ()
    let to_json v = composed_to_json to_value v
  end[@@ocaml.doc
       "You do not have required permissions to perform this operation."]