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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
// DO NOT EDIT. This file is auto-generated by running 'pnpm generate' in the 'src/api/autogen' folder.

/*!
ASCOM Alpaca Device API v1

The Alpaca API uses RESTful techniques and TCP/IP to enable ASCOM applications and devices to communicate across modern network environments.

## Interface Behaviour
The ASCOM Interface behavioural requirements for Alpaca drivers are the same as for COM based drivers and are documented in the <a href="https://ascom-standards.org/Help/Developer/html/N_ASCOM_DeviceInterface.htm">API Interface Definitions</a> e.g. the <a href="https://ascom-standards.org/Help/Developer/html/M_ASCOM_DeviceInterface_ITelescopeV3_SlewToCoordinates.htm">Telescope.SlewToCoordinates</a> method. This document focuses on how to use the ASCOM Interface standards in their RESTful Alpaca form.
## Alpaca URLs, Case Sensitivity, Parameters and Returned values
**Alpaca Device API URLs** are of the form **http(s)://host:port/path** where path comprises **"/api/v1/"** followed by one of the method names below. e.g. for an Alpaca interface running on port 7843 of a device with IP address 192.168.1.89:
* A telescope "Interface Version" method URL would be **http://192.168.1.89:7843/api/v1/telescope/0/interfaceversion**
* A first focuser "Position" method URL would be  **http://192.168.1.89:7843/api/v1/focuser/0/position**
* A second focuser "StepSize" method URL would be  **http://192.168.1.89:7843/api/v1/focuser/1/stepsize**
* A rotator "Halt" method URL would be  **http://192.168.1.89:7843/api/v1/rotator/0/halt**


URLs are case sensitive and all elements must be in lower case. This means that both the device type and command name must always be in lower case. Parameter names are not case sensitive, so clients and drivers should be prepared for parameter names to be supplied and returned with any casing. Parameter values can be in mixed case as required.

For GET operations, parameters should be placed in the URL query string and for PUT operations they should be placed in the body of the message.

Responses, as described below, are returned in JSON format and always include a common set of values including the client's transaction number, the server's transaction number together with any error message and error number.
If the transaction completes successfully, the ErrorMessage field will be an empty string and the ErrorNumber field will be zero.

## HTTP Status Codes and ASCOM Error codes
The returned HTTP status code gives a high level view of whether the device understood the request and whether it attempted to process it.

Under most circumstances the returned status will be `200`, indicating that the request was correctly formatted and that it was passed to the device's handler to execute. A `200` status does not necessarily mean that the operation completed as expected, without error, and you must always check the ErrorMessage and ErrorNumber fields to confirm whether the returned result is valid. The `200` status simply means that the transaction was successfully managed by the device's transaction management layer.

An HTTP status code of `400` indicates that the device could not interpret the request e.g. an invalid device number or misspelt device type was supplied. Check the body of the response for a text error message.

An HTTP status code of `500` indicates an unexpected error within the device from which it could not recover. Check the body of the response for a text error message.
## SetupDialog and Alpaca Device Configuration
The SetupDialog method has been omitted from the Alpaca Device API because it presents a user interface rather than returning data. Alpaca device configuration is covered in the "ASCOM Alpaca Management API" specification, which can be selected through the drop-down box at the head of this page.

*/

#![allow(
  rustdoc::broken_intra_doc_links,
  clippy::doc_markdown,
  clippy::as_conversions, // triggers on derive-generated code https://github.com/rust-lang/rust-clippy/issues/9657
)]

mod bool_param;
mod devices_impl;
mod server_info;

use crate::macros::{rpc_mod, rpc_trait};
use crate::response::ValueResponse;
use crate::{ASCOMError, ASCOMResult};
use bool_param::BoolParam;
use macro_rules_attribute::apply;
use num_enum::{IntoPrimitive, TryFromPrimitive};
use serde::{Deserialize, Serialize};
use serde_repr::{Deserialize_repr, Serialize_repr};

pub use server_info::*;

/// Returned camera state
#[cfg(feature = "camera")]
#[derive(
    Debug,
    PartialEq,
    Eq,
    Clone,
    Copy,
    Serialize_repr,
    Deserialize_repr,
    TryFromPrimitive,
    IntoPrimitive,
)]
#[repr(i32)]
#[allow(clippy::default_numeric_fallback)] // false positive https://github.com/rust-lang/rust-clippy/issues/9656
#[allow(missing_docs)] // some enum variants might not have docs and that's okay
pub enum CameraState {
    Idle = 0,

    Waiting = 1,

    Exposing = 2,

    Reading = 3,

    Download = 4,

    Error = 5,
}

#[cfg(feature = "camera")]
mod image_array;

#[cfg(feature = "camera")]
pub use image_array::*;

/// The UTC date/time of exposure start in the FITS-standard CCYY-MM-DDThh:mm:ss[.sss...] format.
#[cfg(feature = "camera")]
#[derive(Debug, Serialize, Deserialize)]
pub(crate) struct LastExposureStartTime {
    #[serde(rename = "Value", with = "LastExposureStartTime")]
    pub(crate) value: time::OffsetDateTime,
}

#[cfg(feature = "camera")]
impl From<std::time::SystemTime> for LastExposureStartTime {
    fn from(value: std::time::SystemTime) -> Self {
        Self {
            value: value.into(),
        }
    }
}

#[cfg(feature = "camera")]
impl From<LastExposureStartTime> for std::time::SystemTime {
    fn from(wrapper: LastExposureStartTime) -> Self {
        wrapper.value.into()
    }
}

#[cfg(feature = "camera")]
impl LastExposureStartTime {
    const FORMAT: &[time::format_description::FormatItem<'static>] = time::macros::format_description!(
        "[year]-[month]-[day]T[hour]:[minute]:[second][optional [.[subsecond]]]"
    );

    fn serialize<S: serde::Serializer>(
        value: &time::OffsetDateTime,
        serializer: S,
    ) -> Result<S::Ok, S::Error> {
        value
            .to_offset(time::UtcOffset::UTC)
            .format(Self::FORMAT)
            .map_err(serde::ser::Error::custom)?
            .serialize(serializer)
    }

    fn deserialize<'de, D: serde::Deserializer<'de>>(
        deserializer: D,
    ) -> Result<time::OffsetDateTime, D::Error> {
        struct Visitor;

        impl serde::de::Visitor<'_> for Visitor {
            type Value = time::OffsetDateTime;

            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                formatter.write_str("a date string")
            }

            fn visit_str<E: serde::de::Error>(self, value: &str) -> Result<Self::Value, E> {
                match time::PrimitiveDateTime::parse(value, LastExposureStartTime::FORMAT) {
                    Ok(time) => Ok(time.assume_utc()),
                    Err(err) => Err(serde::de::Error::custom(err)),
                }
            }
        }

        deserializer.deserialize_str(Visitor)
    }
}

/// Returned sensor type
#[cfg(feature = "camera")]
#[derive(
    Debug,
    PartialEq,
    Eq,
    Clone,
    Copy,
    Serialize_repr,
    Deserialize_repr,
    TryFromPrimitive,
    IntoPrimitive,
)]
#[repr(i32)]
#[allow(clippy::default_numeric_fallback)] // false positive https://github.com/rust-lang/rust-clippy/issues/9656
#[allow(missing_docs)] // some enum variants might not have docs and that's okay
pub enum SensorType {
    /// Camera produces monochrome array with no Bayer encoding
    Monochrome = 0,

    /// Camera produces color image directly, not requiring Bayer decoding
    Color = 1,

    /// Camera produces RGGB encoded Bayer array images
    RGGB = 2,

    /// Camera produces CMYG encoded Bayer array images
    CMYG = 3,

    /// Camera produces CMYG2 encoded Bayer array images
    CMYG2 = 4,

    /// Camera produces Kodak TRUESENSE LRGB encoded Bayer array images
    LRGB = 5,
}

/// The direction in which the guide-rate motion is to be made.
#[cfg(any(feature = "camera", feature = "telescope"))]
#[derive(
    Debug,
    PartialEq,
    Eq,
    Clone,
    Copy,
    Serialize_repr,
    Deserialize_repr,
    TryFromPrimitive,
    IntoPrimitive,
)]
#[repr(i32)]
#[allow(clippy::default_numeric_fallback)] // false positive https://github.com/rust-lang/rust-clippy/issues/9656
#[allow(missing_docs)] // some enum variants might not have docs and that's okay
pub enum PutPulseGuideDirection {
    North = 0,

    South = 1,

    East = 2,

    West = 3,
}

/// Returned side of pier
#[cfg(feature = "covercalibrator")]
#[derive(
    Debug,
    PartialEq,
    Eq,
    Clone,
    Copy,
    Serialize_repr,
    Deserialize_repr,
    TryFromPrimitive,
    IntoPrimitive,
)]
#[repr(i32)]
#[allow(clippy::default_numeric_fallback)] // false positive https://github.com/rust-lang/rust-clippy/issues/9656
#[allow(missing_docs)] // some enum variants might not have docs and that's okay
pub enum CalibratorStatus {
    /// This device does not have a calibration capability.
    NotPresent = 0,

    /// The calibrator is off.
    Off = 1,

    /// The calibrator is stabilising or is not yet in the commanded state.
    NotReady = 2,

    /// The calibrator is ready for use.
    Ready = 3,

    /// The calibrator state is unknown.
    Unknown = 4,

    /// The calibrator encountered an error when changing state.
    Error = 5,
}

/// Returned side of pier
#[cfg(feature = "covercalibrator")]
#[derive(
    Debug,
    PartialEq,
    Eq,
    Clone,
    Copy,
    Serialize_repr,
    Deserialize_repr,
    TryFromPrimitive,
    IntoPrimitive,
)]
#[repr(i32)]
#[allow(clippy::default_numeric_fallback)] // false positive https://github.com/rust-lang/rust-clippy/issues/9656
#[allow(missing_docs)] // some enum variants might not have docs and that's okay
pub enum CoverStatus {
    /// This device does not have a cover that can be closed independently.
    NotPresent = 0,

    /// The cover is closed.
    Closed = 1,

    /// The cover is moving to a new position.
    Moving = 2,

    /// The cover is open.
    Open = 3,

    /// The state of the cover is unknown.
    Unknown = 4,

    /// The device encountered an error when changing state.
    Error = 5,
}

/// Returned dome shutter status
#[cfg(feature = "dome")]
#[derive(
    Debug,
    PartialEq,
    Eq,
    Clone,
    Copy,
    Serialize_repr,
    Deserialize_repr,
    TryFromPrimitive,
    IntoPrimitive,
)]
#[repr(i32)]
#[allow(clippy::default_numeric_fallback)] // false positive https://github.com/rust-lang/rust-clippy/issues/9656
#[allow(missing_docs)] // some enum variants might not have docs and that's okay
pub enum DomeShutterStatus {
    Open = 0,

    Closed = 1,

    Opening = 2,

    Closing = 3,

    Error = 4,
}

/// Returned side of pier
#[cfg(feature = "telescope")]
#[derive(
    Debug,
    PartialEq,
    Eq,
    Clone,
    Copy,
    Serialize_repr,
    Deserialize_repr,
    TryFromPrimitive,
    IntoPrimitive,
)]
#[repr(i32)]
#[allow(clippy::default_numeric_fallback)] // false positive https://github.com/rust-lang/rust-clippy/issues/9656
#[allow(missing_docs)] // some enum variants might not have docs and that's okay
pub enum AlignmentMode {
    /// Altitude-Azimuth alignment.
    AltAz = 0,

    /// Polar (equatorial) mount other than German equatorial.
    Polar = 1,

    /// German equatorial mount.
    GermanPolar = 2,
}

/// Returned side of pier
#[cfg(feature = "telescope")]
#[derive(
    Debug,
    PartialEq,
    Eq,
    Clone,
    Copy,
    Serialize_repr,
    Deserialize_repr,
    TryFromPrimitive,
    IntoPrimitive,
)]
#[repr(i32)]
#[allow(clippy::default_numeric_fallback)] // false positive https://github.com/rust-lang/rust-clippy/issues/9656
#[allow(missing_docs)] // some enum variants might not have docs and that's okay
pub enum EquatorialSystem {
    /// Custom or unknown equinox and/or reference frame.
    Other = 0,

    /// Topocentric coordinates. Coordinates of the object at the current date having allowed for annual aberration, precession and nutation. This is the most common coordinate type for amateur telescopes.
    Topocentric = 1,

    /// J2000 equator/equinox. Coordinates of the object at mid-day on 1st January 2000, ICRS reference frame.
    J2000 = 2,

    /// J2050 equator/equinox, ICRS reference frame.
    J2050 = 3,

    /// B1950 equinox, FK4 reference frame.
    B1950 = 4,
}

/// Returned side of pier
#[cfg(feature = "telescope")]
#[derive(
    Debug,
    PartialEq,
    Eq,
    Clone,
    Copy,
    Serialize_repr,
    Deserialize_repr,
    TryFromPrimitive,
    IntoPrimitive,
)]
#[repr(i32)]
#[allow(clippy::default_numeric_fallback)] // false positive https://github.com/rust-lang/rust-clippy/issues/9656
#[allow(missing_docs)] // some enum variants might not have docs and that's okay
pub enum SideOfPier {
    /// Normal pointing state - Mount on the East side of pier (looking West).
    East = 0,

    /// Through the pole pointing state - Mount on the West side of pier (looking East).
    West = 1,

    /// Unknown or indeterminate.
    Unknown = -1,
}

/// DriveRate enum corresponding to one of the standard drive rates.
#[cfg(feature = "telescope")]
#[derive(
    Debug,
    PartialEq,
    Eq,
    Clone,
    Copy,
    Serialize_repr,
    Deserialize_repr,
    TryFromPrimitive,
    IntoPrimitive,
)]
#[repr(i32)]
#[allow(clippy::default_numeric_fallback)] // false positive https://github.com/rust-lang/rust-clippy/issues/9656
#[allow(missing_docs)] // some enum variants might not have docs and that's okay
pub enum DriveRate {
    /// 15.041 arcseconds per second
    Sidereal = 0,

    /// 14.685 arcseconds per second
    Lunar = 1,

    /// 15.0 arcseconds per second
    Solar = 2,

    /// 15.0369 arcseconds per second
    King = 3,
}

/// The UTC date/time of the telescope's internal clock in ISO 8601 format including fractional seconds. The general format (in Microsoft custom date format style) is yyyy-MM-ddTHH:mm:ss.fffffffZ, e.g. 2016-03-04T17:45:31.1234567Z or 2016-11-14T07:03:08.1234567Z. Please note the compulsary trailing Z indicating the 'Zulu', UTC time zone.
#[cfg(feature = "telescope")]
#[derive(Debug, Serialize, Deserialize)]
pub(crate) struct TelescopeUtcdate {
    #[serde(rename = "Value", with = "TelescopeUtcdate")]
    pub(crate) value: time::OffsetDateTime,
}

#[cfg(feature = "telescope")]
impl From<std::time::SystemTime> for TelescopeUtcdate {
    fn from(value: std::time::SystemTime) -> Self {
        Self {
            value: value.into(),
        }
    }
}

#[cfg(feature = "telescope")]
impl From<TelescopeUtcdate> for std::time::SystemTime {
    fn from(wrapper: TelescopeUtcdate) -> Self {
        wrapper.value.into()
    }
}

#[cfg(feature = "telescope")]
impl TelescopeUtcdate {
    const FORMAT: &[time::format_description::FormatItem<'static>] = time::macros::format_description!(
        "[year]-[month]-[day]T[hour]:[minute]:[second][optional [.[subsecond]]]Z"
    );

    fn serialize<S: serde::Serializer>(
        value: &time::OffsetDateTime,
        serializer: S,
    ) -> Result<S::Ok, S::Error> {
        value
            .to_offset(time::UtcOffset::UTC)
            .format(Self::FORMAT)
            .map_err(serde::ser::Error::custom)?
            .serialize(serializer)
    }

    fn deserialize<'de, D: serde::Deserializer<'de>>(
        deserializer: D,
    ) -> Result<time::OffsetDateTime, D::Error> {
        struct Visitor;

        impl serde::de::Visitor<'_> for Visitor {
            type Value = time::OffsetDateTime;

            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                formatter.write_str("a date string")
            }

            fn visit_str<E: serde::de::Error>(self, value: &str) -> Result<Self::Value, E> {
                match time::PrimitiveDateTime::parse(value, TelescopeUtcdate::FORMAT) {
                    Ok(time) => Ok(time.assume_utc()),
                    Err(err) => Err(serde::de::Error::custom(err)),
                }
            }
        }

        deserializer.deserialize_str(Visitor)
    }
}

/// The axis of mount rotation.
#[cfg(feature = "telescope")]
#[derive(
    Debug,
    PartialEq,
    Eq,
    Clone,
    Copy,
    Serialize_repr,
    Deserialize_repr,
    TryFromPrimitive,
    IntoPrimitive,
)]
#[repr(i32)]
#[allow(clippy::default_numeric_fallback)] // false positive https://github.com/rust-lang/rust-clippy/issues/9656
#[allow(missing_docs)] // some enum variants might not have docs and that's okay
pub enum Axis {
    Primary = 0,

    Secondary = 1,

    Tertiary = 2,
}

/// Axis rate object
#[cfg(feature = "telescope")]
#[allow(missing_copy_implementations)]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct AxisRate {
    /// The maximum rate (degrees per second) This must always be a positive number. It indicates the maximum rate in either direction about the axis.
    pub maximum: f64,

    /// The minimum rate (degrees per second) This must always be a positive number. It indicates the maximum rate in either direction about the axis.
    pub minimum: f64,
}

/// ASCOM Methods Common To All Devices
#[apply(rpc_trait)]
pub trait Device: std::fmt::Debug + Send + Sync {
    const EXTRA_METHODS: () = {
        /// Static device name for the configured list.
        fn static_name(&self) -> &str {
            &self.name
        }

        /// Unique ID of this device.
        fn unique_id(&self) -> &str {
            &self.unique_id
        }
    };

    /**
    Actions and SupportedActions are a standardised means for drivers to extend functionality beyond the built-in capabilities of the ASCOM device interfaces.

    The key advantage of using Actions is that drivers can expose any device specific functionality required. The downside is that, in order to use these unique features, every application author would need to create bespoke code to present or exploit them.

    The Action parameter and return strings are deceptively simple, but can support transmission of arbitrarily complex data structures, for example through JSON encoding.

    This capability will be of primary value to
     * <span style="font-size:14px;">bespoke software and hardware configurations where a single entity controls both the consuming application software and the hardware / driver environment</span>
     * <span style="font-size:14px;">a group of application and device authors to quickly formulate and try out new interface capabilities without requiring an immediate change to the ASCOM device interface, which will take a lot longer than just agreeing a name, input parameters and a standard response for an Action command.</span>


    The list of Action commands supported by a driver can be discovered through the SupportedActions property.

    This method should return an error message and NotImplementedException error number (0x400) if the driver just implements the standard ASCOM device methods and has no bespoke, unique, functionality.
    */
    #[http("action", method = Put, via = ValueResponse)]
    async fn action(
        &self,

        #[http("Action")] action: String,

        #[http("Parameters")] parameters: String,
    ) -> ASCOMResult<String> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Transmits an arbitrary string to the device and does not wait for a response. Optionally, protocol framing characters may be added to the string before transmission.
    #[http("commandblind", method = Put)]
    async fn command_blind(
        &self,

        #[http("Command")] command: String,

        #[http("Raw")] raw: String,
    ) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Transmits an arbitrary string to the device and waits for a boolean response. Optionally, protocol framing characters may be added to the string before transmission.
    #[http("commandbool", method = Put, via = ValueResponse)]
    async fn command_bool(
        &self,

        #[http("Command")] command: String,

        #[http("Raw")] raw: String,
    ) -> ASCOMResult<bool> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Transmits an arbitrary string to the device and waits for a string response. Optionally, protocol framing characters may be added to the string before transmission.
    #[http("commandstring", method = Put, via = ValueResponse)]
    async fn command_string(
        &self,

        #[http("Command")] command: String,

        #[http("Raw")] raw: String,
    ) -> ASCOMResult<String> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Retrieves the connected state of the device
    #[http("connected", method = Get, via = ValueResponse)]
    async fn connected(&self) -> ASCOMResult<bool> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets the connected state of the device
    #[http("connected", method = Put)]
    async fn set_connected(
        &self,

        #[http("Connected", via = BoolParam)] connected: bool,
    ) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// The description of the device
    #[http("description", method = Get, via = ValueResponse)]
    async fn description(&self) -> ASCOMResult<String> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// The description of the driver
    #[http("driverinfo", method = Get, via = ValueResponse)]
    async fn driver_info(&self) -> ASCOMResult<String> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// A string containing only the major and minor version of the driver.
    #[http("driverversion", method = Get, via = ValueResponse)]
    async fn driver_version(&self) -> ASCOMResult<String> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// This method returns the version of the ASCOM device interface contract to which this device complies. Only one interface version is current at a moment in time and all new devices should be built to the latest interface version. Applications can choose which device interface versions they support and it is in their interest to support previous versions as well as the current version to ensure thay can use the largest number of devices.
    #[http("interfaceversion", method = Get, via = ValueResponse)]
    async fn interface_version(&self) -> ASCOMResult<i32> {
        Ok(3_i32)
    }

    /// The name of the device
    #[http("name", method = Get, via = ValueResponse)]
    async fn name(&self) -> ASCOMResult<String> {
        Ok(self.static_name().to_owned())
    }

    /// Returns the list of action names supported by this driver.
    #[http("supportedactions", method = Get, via = ValueResponse)]
    async fn supported_actions(&self) -> ASCOMResult<Vec<String>> {
        Ok(vec![])
    }
}

/// Camera Specific Methods
#[cfg(feature = "camera")]
#[apply(rpc_trait)]
pub trait Camera: Device + Send + Sync {
    /// Returns the X offset of the Bayer matrix, as defined in SensorType.
    #[http("bayeroffsetx", method = Get, via = ValueResponse)]
    async fn bayer_offset_x(&self) -> ASCOMResult<i32> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the Y offset of the Bayer matrix, as defined in SensorType.
    #[http("bayeroffsety", method = Get, via = ValueResponse)]
    async fn bayer_offset_y(&self) -> ASCOMResult<i32> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the binning factor for the X axis.
    #[http("binx", method = Get, via = ValueResponse)]
    async fn bin_x(&self) -> ASCOMResult<i32> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets the binning factor for the X axis.
    #[http("binx", method = Put)]
    async fn set_bin_x(&self, #[http("BinX")] bin_x: i32) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the binning factor for the Y axis.
    #[http("biny", method = Get, via = ValueResponse)]
    async fn bin_y(&self) -> ASCOMResult<i32> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets the binning factor for the Y axis.
    #[http("biny", method = Put)]
    async fn set_bin_y(&self, #[http("BinY")] bin_y: i32) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the current camera operational state.
    #[http("camerastate", method = Get, via = ValueResponse)]
    async fn camera_state(&self) -> ASCOMResult<CameraState> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the width of the CCD camera chip in unbinned pixels.
    #[http("cameraxsize", method = Get, via = ValueResponse)]
    async fn camera_xsize(&self) -> ASCOMResult<i32> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the height of the CCD camera chip in unbinned pixels.
    #[http("cameraysize", method = Get, via = ValueResponse)]
    async fn camera_ysize(&self) -> ASCOMResult<i32> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns true if the camera can abort exposures; false if not.
    #[http("canabortexposure", method = Get, via = ValueResponse)]
    async fn can_abort_exposure(&self) -> ASCOMResult<bool> {
        Ok(false)
    }

    /// Returns a flag showing whether this camera supports asymmetric binning
    #[http("canasymmetricbin", method = Get, via = ValueResponse)]
    async fn can_asymmetric_bin(&self) -> ASCOMResult<bool> {
        Ok(false)
    }

    /// Indicates whether the camera has a fast readout mode.
    #[http("canfastreadout", method = Get, via = ValueResponse)]
    async fn can_fast_readout(&self) -> ASCOMResult<bool> {
        Ok(false)
    }

    /// If true, the camera's cooler power setting can be read.
    #[http("cangetcoolerpower", method = Get, via = ValueResponse)]
    async fn can_get_cooler_power(&self) -> ASCOMResult<bool> {
        Ok(false)
    }

    /// Returns a flag indicating whether this camera supports pulse guiding.
    #[http("canpulseguide", method = Get, via = ValueResponse)]
    async fn can_pulse_guide(&self) -> ASCOMResult<bool> {
        Ok(false)
    }

    /// Returns a flag indicatig whether this camera supports setting the CCD temperature
    #[http("cansetccdtemperature", method = Get, via = ValueResponse)]
    async fn can_set_ccd_temperature(&self) -> ASCOMResult<bool> {
        Ok(false)
    }

    /// Returns a flag indicating whether this camera can stop an exposure that is in progress
    #[http("canstopexposure", method = Get, via = ValueResponse)]
    async fn can_stop_exposure(&self) -> ASCOMResult<bool> {
        Ok(false)
    }

    /// Returns the current CCD temperature in degrees Celsius.
    #[http("ccdtemperature", method = Get, via = ValueResponse)]
    async fn ccd_temperature(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the current cooler on/off state.
    #[http("cooleron", method = Get, via = ValueResponse)]
    async fn cooler_on(&self) -> ASCOMResult<bool> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Turns on and off the camera cooler. True = cooler on, False = cooler off
    #[http("cooleron", method = Put)]
    async fn set_cooler_on(
        &self,

        #[http("CoolerOn", via = BoolParam)] cooler_on: bool,
    ) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the present cooler power level, in percent.
    #[http("coolerpower", method = Get, via = ValueResponse)]
    async fn cooler_power(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the gain of the camera in photoelectrons per A/D unit.
    #[http("electronsperadu", method = Get, via = ValueResponse)]
    async fn electrons_per_adu(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the maximum exposure time supported by StartExposure.
    #[http("exposuremax", method = Get, via = ValueResponse)]
    async fn exposure_max(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the Minimium exposure time in seconds that the camera supports through StartExposure.
    #[http("exposuremin", method = Get, via = ValueResponse)]
    async fn exposure_min(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the smallest increment in exposure time supported by StartExposure.
    #[http("exposureresolution", method = Get, via = ValueResponse)]
    async fn exposure_resolution(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns whenther Fast Readout Mode is enabled.
    #[http("fastreadout", method = Get, via = ValueResponse)]
    async fn fast_readout(&self) -> ASCOMResult<bool> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets whether Fast Readout Mode is enabled.
    #[http("fastreadout", method = Put)]
    async fn set_fast_readout(
        &self,

        #[http("FastReadout", via = BoolParam)] fast_readout: bool,
    ) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Reports the full well capacity of the camera in electrons, at the current camera settings (binning, SetupDialog settings, etc.).
    #[http("fullwellcapacity", method = Get, via = ValueResponse)]
    async fn full_well_capacity(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// The camera's gain (GAIN VALUE MODE) OR the index of the selected camera gain description in the Gains array (GAINS INDEX MODE).
    #[http("gain", method = Get, via = ValueResponse)]
    async fn gain(&self) -> ASCOMResult<i32> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// The camera's gain (GAIN VALUE MODE) OR the index of the selected camera gain description in the Gains array (GAINS INDEX MODE).
    #[http("gain", method = Put)]
    async fn set_gain(&self, #[http("Gain")] gain: i32) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the maximum value of Gain.
    #[http("gainmax", method = Get, via = ValueResponse)]
    async fn gain_max(&self) -> ASCOMResult<i32> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the Minimum value of Gain.
    #[http("gainmin", method = Get, via = ValueResponse)]
    async fn gain_min(&self) -> ASCOMResult<i32> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the Gains supported by the camera.
    #[http("gains", method = Get, via = ValueResponse)]
    async fn gains(&self) -> ASCOMResult<Vec<String>> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns a flag indicating whether this camera has a mechanical shutter.
    #[http("hasshutter", method = Get, via = ValueResponse)]
    async fn has_shutter(&self) -> ASCOMResult<bool> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the current heat sink temperature (called "ambient temperature" by some manufacturers) in degrees Celsius.
    #[http("heatsinktemperature", method = Get, via = ValueResponse)]
    async fn heat_sink_temperature(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /**
    Returns an array of 32bit integers containing the pixel values from the last exposure. This call can return either a 2 dimension (monochrome images) or 3 dimension (colour or multi-plane images) array of size NumX \* NumY or NumX \* NumY \* NumPlanes. Where applicable, the size of NumPlanes has to be determined by inspection of the returned Array.

    Since 32bit integers are always returned by this call, the returned JSON Type value (0 = Unknown, 1 = short(16bit), 2 = int(32bit), 3 = Double) is always 2. The number of planes is given in the returned Rank value.

    When de-serialising to an object it is essential to know the array Rank beforehand so that the correct data class can be used. This can be achieved through a regular expression or by direct parsing of the returned JSON string to extract the Type and Rank values before de-serialising.

    This regular expression accomplishes the extraction into two named groups Type and Rank, which can then be used to select the correct de-serialisation data class:

    __`^*"Type":(?<Type>\d*),"Rank":(?<Rank>\d*)`__

    When the SensorType is Monochrome, RGGB, CMYG, CMYG2 or LRGB, the serialised JSON array should have 2 dimensions. For example, the returned array should appear as below if NumX = 7, NumY = 5 and Pxy represents the pixel value at the zero based position x across and y down the image with the origin in the top left corner of the image.

    Please note that this is "column-major" order (column changes most rapidly) from the image's row and column perspective, while, from the array's perspective, serialisation is actually effected in "row-major" order (rightmost index changes most rapidly). This unintuitive outcome arises because the ASCOM Camera Interface specification defines the image column dimension as the rightmost array dimension.

    [

    [P00,P01,P02,P03,P04],

    [P10,P11,P12,P13,P14],

    [P20,P21,P22,P23,P24],

    [P30,P31,P32,P33,P34],

    [P40,P41,P42,P43,P44],

    [P50,P51,P52,P53,P54],

    [P60,P61,P62,P63,P64]

    ]

    When the SensorType is Color, the serialised JSON array will have 3 dimensions. For example, the returned array should appear as below if NumX = 7, NumY = 5 and Rxy, Gxy and Bxy represent the red, green and blue pixel values at the zero based position x across and y down the image with the origin in the top left corner of the image.  Please see note above regarding element ordering.

    [

    [[R00,G00,B00],[R01,G01,B01],[R02,G02,B02],[R03,G03,B03],[R04,G04,B04]],

    [[R10,G10,B10],[R11,G11,B11],[R12,G12,B12],[R13,G13,B13],[R14,G14,B14]],

    [[R20,G20,B20],[R21,G21,B21],[R22,G22,B22],[R23,G23,B23],[R24,G24,B24]],

    [[R30,G30,B30],[R31,G31,B31],[R32,G32,B32],[R33,G33,B33],[R34,G34,B34]],

    [[R40,G40,B40],[R41,G41,B41],[R42,G42,B42],[R43,G43,B43],[R44,G44,B44]],

    [[R50,G50,B50],[R51,G51,B51],[R52,G52,B52],[R53,G53,B53],[R54,G54,B54]],

    [[R60,G60,B60],[R61,G61,B61],[R62,G62,B62],[R63,G63,B63],[R64,G64,B64]],

    ]

    __`Performance`__

    Returning an image from an Alpaca device as a JSON array is very inefficient and can result in delays of 30 or more seconds while client and device process and send the huge JSON string over the network. A new, much faster mechanic called ImageBytes - [Alpaca ImageBytes Concepts and Implementation](https://www.ascom-standards.org/Developer/AlpacaImageBytes.pdf) has been developed that sends data as a binary byte stream and can offer a 10 to 20 fold reduction in transfer time. It is strongly recommended that Alpaca Cameras implement the ImageBytes mechanic as well as the JSON mechanic.
    */
    #[http("imagearray", method = Get)]
    async fn image_array(&self) -> ASCOMResult<ImageArray> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns a flag indicating whether the image is ready to be downloaded from the camera.
    #[http("imageready", method = Get, via = ValueResponse)]
    async fn image_ready(&self) -> ASCOMResult<bool> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns a flag indicating whether the camera is currrently in a PulseGuide operation.
    #[http("ispulseguiding", method = Get, via = ValueResponse)]
    async fn is_pulse_guiding(&self) -> ASCOMResult<bool> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Reports the actual exposure duration in seconds (i.e. shutter open time).
    #[http("lastexposureduration", method = Get, via = ValueResponse)]
    async fn last_exposure_duration(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Reports the actual exposure start in the FITS-standard CCYY-MM-DDThh:mm:ss[.sss...] format.
    #[http("lastexposurestarttime", method = Get, via = LastExposureStartTime)]
    async fn last_exposure_start_time(&self) -> ASCOMResult<std::time::SystemTime> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Reports the maximum ADU value the camera can produce.
    #[http("maxadu", method = Get, via = ValueResponse)]
    async fn max_adu(&self) -> ASCOMResult<i32> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the maximum allowed binning for the X camera axis
    #[http("maxbinx", method = Get, via = ValueResponse)]
    async fn max_bin_x(&self) -> ASCOMResult<i32> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the maximum allowed binning for the Y camera axis
    #[http("maxbiny", method = Get, via = ValueResponse)]
    async fn max_bin_y(&self) -> ASCOMResult<i32> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the current subframe width, if binning is active, value is in binned pixels.
    #[http("numx", method = Get, via = ValueResponse)]
    async fn num_x(&self) -> ASCOMResult<i32> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets the current subframe width.
    #[http("numx", method = Put)]
    async fn set_num_x(&self, #[http("NumX")] num_x: i32) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the current subframe height, if binning is active, value is in binned pixels.
    #[http("numy", method = Get, via = ValueResponse)]
    async fn num_y(&self) -> ASCOMResult<i32> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets the current subframe height.
    #[http("numy", method = Put)]
    async fn set_num_y(&self, #[http("NumY")] num_y: i32) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the camera's offset (OFFSET VALUE MODE) OR the index of the selected camera offset description in the offsets array (OFFSETS INDEX MODE).
    #[http("offset", method = Get, via = ValueResponse)]
    async fn offset(&self) -> ASCOMResult<i32> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets the camera's offset (OFFSET VALUE MODE) OR the index of the selected camera offset description in the offsets array (OFFSETS INDEX MODE).
    #[http("offset", method = Put)]
    async fn set_offset(&self, #[http("Offset")] offset: i32) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the maximum value of offset.
    #[http("offsetmax", method = Get, via = ValueResponse)]
    async fn offset_max(&self) -> ASCOMResult<i32> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the Minimum value of offset.
    #[http("offsetmin", method = Get, via = ValueResponse)]
    async fn offset_min(&self) -> ASCOMResult<i32> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the offsets supported by the camera.
    #[http("offsets", method = Get, via = ValueResponse)]
    async fn offsets(&self) -> ASCOMResult<Vec<String>> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the percentage of the current operation that is complete. If valid, returns an integer between 0 and 100, where 0 indicates 0% progress (function just started) and 100 indicates 100% progress (i.e. completion).
    #[http("percentcompleted", method = Get, via = ValueResponse)]
    async fn percent_completed(&self) -> ASCOMResult<i32> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the width of the CCD chip pixels in microns.
    #[http("pixelsizex", method = Get, via = ValueResponse)]
    async fn pixel_size_x(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the Height of the CCD chip pixels in microns.
    #[http("pixelsizey", method = Get, via = ValueResponse)]
    async fn pixel_size_y(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// ReadoutMode is an index into the array ReadoutModes and returns the desired readout mode for the camera. Defaults to 0 if not set.
    #[http("readoutmode", method = Get, via = ValueResponse)]
    async fn readout_mode(&self) -> ASCOMResult<i32> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets the ReadoutMode as an index into the array ReadoutModes.
    #[http("readoutmode", method = Put)]
    async fn set_readout_mode(&self, #[http("ReadoutMode")] readout_mode: i32) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// This property provides an array of strings, each of which describes an available readout mode of the camera. At least one string must be present in the list.
    #[http("readoutmodes", method = Get, via = ValueResponse)]
    async fn readout_modes(&self) -> ASCOMResult<Vec<String>> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// The name of the sensor used within the camera.
    #[http("sensorname", method = Get, via = ValueResponse)]
    async fn sensor_name(&self) -> ASCOMResult<String> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns a value indicating whether the sensor is monochrome, or what Bayer matrix it encodes.
    #[http("sensortype", method = Get, via = ValueResponse)]
    async fn sensor_type(&self) -> ASCOMResult<SensorType> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the current camera cooler setpoint in degrees Celsius.
    #[http("setccdtemperature", method = Get, via = ValueResponse)]
    async fn set_ccd_temperature(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Set's the camera's cooler setpoint in degrees Celsius.
    #[http("setccdtemperature", method = Put)]
    async fn set_set_ccd_temperature(
        &self,

        #[http("SetCCDTemperature")] set_ccd_temperature: f64,
    ) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets the subframe start position for the X axis (0 based) and returns the current value. If binning is active, value is in binned pixels.
    #[http("startx", method = Get, via = ValueResponse)]
    async fn start_x(&self) -> ASCOMResult<i32> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets the current subframe X axis start position in binned pixels.
    #[http("startx", method = Put)]
    async fn set_start_x(&self, #[http("StartX")] start_x: i32) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets the subframe start position for the Y axis (0 based) and returns the current value. If binning is active, value is in binned pixels.
    #[http("starty", method = Get, via = ValueResponse)]
    async fn start_y(&self) -> ASCOMResult<i32> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets the current subframe Y axis start position in binned pixels.
    #[http("starty", method = Put)]
    async fn set_start_y(&self, #[http("StartY")] start_y: i32) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// The Camera's sub exposure duration in seconds. Only available in Camera Interface Version 3 and later.
    #[http("subexposureduration", method = Get, via = ValueResponse)]
    async fn sub_exposure_duration(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets image sub exposure duration in seconds. Only available in Camera Interface Version 3 and later.
    #[http("subexposureduration", method = Put)]
    async fn set_sub_exposure_duration(
        &self,

        #[http("SubExposureDuration")] sub_exposure_duration: f64,
    ) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Aborts the current exposure, if any, and returns the camera to Idle state.
    #[http("abortexposure", method = Put)]
    async fn abort_exposure(&self) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Activates the Camera's mount control sytem to instruct the mount to move in a particular direction for a given period of time
    #[http("pulseguide", method = Put)]
    async fn pulse_guide(
        &self,

        #[http("Direction")] direction: PutPulseGuideDirection,

        #[http("Duration")] duration: i32,
    ) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Starts an exposure. Use ImageReady to check when the exposure is complete.
    #[http("startexposure", method = Put)]
    async fn start_exposure(
        &self,

        #[http("Duration")] duration: f64,

        #[http("Light", via = BoolParam)] light: bool,
    ) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Stops the current exposure, if any. If an exposure is in progress, the readout process is initiated. Ignored if readout is already in process.
    #[http("stopexposure", method = Put)]
    async fn stop_exposure(&self) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }
}

/// CoverCalibrator Specific Methods
#[cfg(feature = "covercalibrator")]
#[apply(rpc_trait)]
pub trait CoverCalibrator: Device + Send + Sync {
    /// Returns the current calibrator brightness in the range 0 (completely off) to MaxBrightness (fully on)
    #[http("brightness", method = Get, via = ValueResponse)]
    async fn brightness(&self) -> ASCOMResult<i32> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the state of the calibration device, if present, otherwise returns "NotPresent". The calibrator state mode is specified as an integer value from the CalibratorStatus Enum.
    #[http("calibratorstate", method = Get, via = ValueResponse)]
    async fn calibrator_state(&self) -> ASCOMResult<CalibratorStatus> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the state of the device cover, if present, otherwise returns "NotPresent". The cover state mode is specified as an integer value from the CoverStatus Enum.
    #[http("coverstate", method = Get, via = ValueResponse)]
    async fn cover_state(&self) -> ASCOMResult<CoverStatus> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// The Brightness value that makes the calibrator deliver its maximum illumination.
    #[http("maxbrightness", method = Get, via = ValueResponse)]
    async fn max_brightness(&self) -> ASCOMResult<i32> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Turns the calibrator off if the device has calibration capability.
    #[http("calibratoroff", method = Put)]
    async fn calibrator_off(&self) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Turns the calibrator on at the specified brightness if the device has calibration capability.
    #[http("calibratoron", method = Put)]
    async fn calibrator_on(&self, #[http("Brightness")] brightness: i32) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Initiates cover closing if a cover is present.
    #[http("closecover", method = Put)]
    async fn close_cover(&self) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Stops any cover movement that may be in progress if a cover is present and cover movement can be interrupted.
    #[http("haltcover", method = Put)]
    async fn halt_cover(&self) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Initiates cover opening if a cover is present.
    #[http("opencover", method = Put)]
    async fn open_cover(&self) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }
}

/// Dome Specific Methods
#[cfg(feature = "dome")]
#[apply(rpc_trait)]
pub trait Dome: Device + Send + Sync {
    /// The dome altitude (degrees, horizon zero and increasing positive to 90 zenith).
    #[http("altitude", method = Get, via = ValueResponse)]
    async fn altitude(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Indicates whether the dome is in the home position. This is normally used following a FindHome()  operation. The value is reset with any azimuth slew operation that moves the dome away from the home position. AtHome may also become true durng normal slew operations, if the dome passes through the home position and the dome controller hardware is capable of detecting that; or at the end of a slew operation if the dome comes to rest at the home position.
    #[http("athome", method = Get, via = ValueResponse)]
    async fn at_home(&self) -> ASCOMResult<bool> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// True if the dome is in the programmed park position. Set only following a Park() operation and reset with any slew operation.
    #[http("atpark", method = Get, via = ValueResponse)]
    async fn at_park(&self) -> ASCOMResult<bool> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the dome azimuth (degrees, North zero and increasing clockwise, i.e., 90 East, 180 South, 270 West)
    #[http("azimuth", method = Get, via = ValueResponse)]
    async fn azimuth(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// True if the dome can move to the home position.
    #[http("canfindhome", method = Get, via = ValueResponse)]
    async fn can_find_home(&self) -> ASCOMResult<bool> {
        Ok(false)
    }

    /// True if the dome is capable of programmed parking (Park() method)
    #[http("canpark", method = Get, via = ValueResponse)]
    async fn can_park(&self) -> ASCOMResult<bool> {
        Ok(false)
    }

    /// True if driver is capable of setting the dome altitude.
    #[http("cansetaltitude", method = Get, via = ValueResponse)]
    async fn can_set_altitude(&self) -> ASCOMResult<bool> {
        Ok(false)
    }

    /// True if driver is capable of setting the dome azimuth.
    #[http("cansetazimuth", method = Get, via = ValueResponse)]
    async fn can_set_azimuth(&self) -> ASCOMResult<bool> {
        Ok(false)
    }

    /// True if driver is capable of setting the dome park position.
    #[http("cansetpark", method = Get, via = ValueResponse)]
    async fn can_set_park(&self) -> ASCOMResult<bool> {
        Ok(false)
    }

    /// True if driver is capable of automatically operating shutter
    #[http("cansetshutter", method = Get, via = ValueResponse)]
    async fn can_set_shutter(&self) -> ASCOMResult<bool> {
        Ok(false)
    }

    /// True if driver is capable of slaving to a telescope.
    #[http("canslave", method = Get, via = ValueResponse)]
    async fn can_slave(&self) -> ASCOMResult<bool> {
        Ok(false)
    }

    /// True if driver is capable of synchronizing the dome azimuth position using the SyncToAzimuth(Double) method.
    #[http("cansyncazimuth", method = Get, via = ValueResponse)]
    async fn can_sync_azimuth(&self) -> ASCOMResult<bool> {
        Ok(false)
    }

    /// Returns the status of the dome shutter or roll-off roof.
    #[http("shutterstatus", method = Get, via = ValueResponse)]
    async fn shutter_status(&self) -> ASCOMResult<DomeShutterStatus> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// True if the dome is slaved to the telescope in its hardware, else False.
    #[http("slaved", method = Get, via = ValueResponse)]
    async fn slaved(&self) -> ASCOMResult<bool> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets the current subframe height.
    #[http("slaved", method = Put)]
    async fn set_slaved(&self, #[http("Slaved", via = BoolParam)] slaved: bool) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// True if any part of the dome is currently moving, False if all dome components are steady.
    #[http("slewing", method = Get, via = ValueResponse)]
    async fn slewing(&self) -> ASCOMResult<bool> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Calling this method will immediately disable hardware slewing (Slaved will become False).
    #[http("abortslew", method = Put)]
    async fn abort_slew(&self) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Close the shutter or otherwise shield telescope from the sky.
    #[http("closeshutter", method = Put)]
    async fn close_shutter(&self) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// After Home position is established initializes Azimuth to the default value and sets the AtHome flag.
    #[http("findhome", method = Put)]
    async fn find_home(&self) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Open shutter or otherwise expose telescope to the sky.
    #[http("openshutter", method = Put)]
    async fn open_shutter(&self) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// After assuming programmed park position, sets AtPark flag.
    #[http("park", method = Put)]
    async fn park(&self) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Set the current azimuth, altitude position of dome to be the park position.
    #[http("setpark", method = Put)]
    async fn set_park(&self) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Slew the dome to the given altitude position.
    #[http("slewtoaltitude", method = Put)]
    async fn slew_to_altitude(&self, #[http("Altitude")] altitude: f64) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Slew the dome to the given azimuth position.
    #[http("slewtoazimuth", method = Put)]
    async fn slew_to_azimuth(&self, #[http("Azimuth")] azimuth: f64) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Synchronize the current position of the dome to the given azimuth.
    #[http("synctoazimuth", method = Put)]
    async fn sync_to_azimuth(&self, #[http("Azimuth")] azimuth: f64) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }
}

/// FilterWheel Specific Methods
#[cfg(feature = "filterwheel")]
#[apply(rpc_trait)]
pub trait FilterWheel: Device + Send + Sync {
    /// An integer array of filter focus offsets.
    #[http("focusoffsets", method = Get, via = ValueResponse)]
    async fn focus_offsets(&self) -> ASCOMResult<Vec<i32>> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// The names of the filters
    #[http("names", method = Get, via = ValueResponse)]
    async fn names(&self) -> ASCOMResult<Vec<String>> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the current filter wheel position
    #[http("position", method = Get, via = ValueResponse)]
    async fn position(&self) -> ASCOMResult<i32> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets the filter wheel position
    #[http("position", method = Put)]
    async fn set_position(&self, #[http("Position")] position: i32) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }
}

/// Focuser Specific Methods
#[cfg(feature = "focuser")]
#[apply(rpc_trait)]
pub trait Focuser: Device + Send + Sync {
    /// True if the focuser is capable of absolute position; that is, being commanded to a specific step location.
    #[http("absolute", method = Get, via = ValueResponse)]
    async fn absolute(&self) -> ASCOMResult<bool> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// True if the focuser is currently moving to a new position. False if the focuser is stationary.
    #[http("ismoving", method = Get, via = ValueResponse)]
    async fn is_moving(&self) -> ASCOMResult<bool> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Maximum increment size allowed by the focuser; i.e. the maximum number of steps allowed in one move operation.
    #[http("maxincrement", method = Get, via = ValueResponse)]
    async fn max_increment(&self) -> ASCOMResult<i32> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Maximum step position permitted.
    #[http("maxstep", method = Get, via = ValueResponse)]
    async fn max_step(&self) -> ASCOMResult<i32> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Current focuser position, in steps.
    #[http("position", method = Get, via = ValueResponse)]
    async fn position(&self) -> ASCOMResult<i32> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Step size (microns) for the focuser.
    #[http("stepsize", method = Get, via = ValueResponse)]
    async fn step_size(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Gets the state of temperature compensation mode (if available), else always False.
    #[http("tempcomp", method = Get, via = ValueResponse)]
    async fn temp_comp(&self) -> ASCOMResult<bool> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets the state of temperature compensation mode.
    #[http("tempcomp", method = Put)]
    async fn set_temp_comp(
        &self,

        #[http("TempComp", via = BoolParam)] temp_comp: bool,
    ) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// True if focuser has temperature compensation available.
    #[http("tempcompavailable", method = Get, via = ValueResponse)]
    async fn temp_comp_available(&self) -> ASCOMResult<bool> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Current ambient temperature as measured by the focuser.
    #[http("temperature", method = Get, via = ValueResponse)]
    async fn temperature(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Immediately stop any focuser motion due to a previous Move(Int32) method call.
    #[http("halt", method = Put)]
    async fn halt(&self) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Moves the focuser by the specified amount or to the specified position depending on the value of the Absolute property.
    #[http("move", method = Put)]
    async fn move_(&self, #[http("Position")] position: i32) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }
}

/// ObservingConditions Specific Methods
#[cfg(feature = "observingconditions")]
#[apply(rpc_trait)]
pub trait ObservingConditions: Device + Send + Sync {
    /// Gets the time period over which observations will be averaged
    #[http("averageperiod", method = Get, via = ValueResponse)]
    async fn average_period(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets the time period over which observations will be averaged
    #[http("averageperiod", method = Put)]
    async fn set_average_period(
        &self,

        #[http("AveragePeriod")] average_period: f64,
    ) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Gets the percentage of the sky obscured by cloud
    #[http("cloudcover", method = Get, via = ValueResponse)]
    async fn cloud_cover(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Gets the atmospheric dew point at the observatory reported in °C.
    #[http("dewpoint", method = Get, via = ValueResponse)]
    async fn dew_point(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Gets the atmospheric  humidity (%) at the observatory
    #[http("humidity", method = Get, via = ValueResponse)]
    async fn humidity(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Gets the atmospheric pressure in hectoPascals at the observatory's altitude - NOT reduced to sea level.
    #[http("pressure", method = Get, via = ValueResponse)]
    async fn pressure(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Gets the rain rate (mm/hour) at the observatory.
    #[http("rainrate", method = Get, via = ValueResponse)]
    async fn rain_rate(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Gets the sky brightness at the observatory (Lux)
    #[http("skybrightness", method = Get, via = ValueResponse)]
    async fn sky_brightness(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Gets the sky quality at the observatory (magnitudes per square arc second)
    #[http("skyquality", method = Get, via = ValueResponse)]
    async fn sky_quality(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Gets the sky temperature(°C) at the observatory.
    #[http("skytemperature", method = Get, via = ValueResponse)]
    async fn sky_temperature(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Gets the seeing at the observatory measured as star full width half maximum (FWHM) in arc secs.
    #[http("starfwhm", method = Get, via = ValueResponse)]
    async fn star_fwhm(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Gets the temperature(°C) at the observatory.
    #[http("temperature", method = Get, via = ValueResponse)]
    async fn temperature(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Gets the wind direction. The returned value must be between 0.0 and 360.0, interpreted according to the metereological standard, where a special value of 0.0 is returned when the wind speed is 0.0. Wind direction is measured clockwise from north, through east, where East=90.0, South=180.0, West=270.0 and North=360.0.
    #[http("winddirection", method = Get, via = ValueResponse)]
    async fn wind_direction(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Gets the peak 3 second wind gust(m/s) at the observatory over the last 2 minutes.
    #[http("windgust", method = Get, via = ValueResponse)]
    async fn wind_gust(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Gets the wind speed(m/s) at the observatory.
    #[http("windspeed", method = Get, via = ValueResponse)]
    async fn wind_speed(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Forces the driver to immediately query its attached hardware to refresh sensor values.
    #[http("refresh", method = Put)]
    async fn refresh(&self) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Gets a description of the sensor with the name specified in the SensorName parameter
    #[http("sensordescription", method = Get, via = ValueResponse)]
    async fn sensor_description(
        &self,

        #[http("SensorName")] sensor_name: String,
    ) -> ASCOMResult<String> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Gets the time since the sensor specified in the SensorName parameter was last updated
    #[http("timesincelastupdate", method = Get, via = ValueResponse)]
    async fn time_since_last_update(
        &self,

        #[http("SensorName")] sensor_name: String,
    ) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }
}

/// Rotator Specific Methods
#[cfg(feature = "rotator")]
#[apply(rpc_trait)]
pub trait Rotator: Device + Send + Sync {
    /// True if the Rotator supports the Reverse method.
    #[http("canreverse", method = Get, via = ValueResponse)]
    async fn can_reverse(&self) -> ASCOMResult<bool> {
        Ok(false)
    }

    /// True if the rotator is currently moving to a new position. False if the focuser is stationary.
    #[http("ismoving", method = Get, via = ValueResponse)]
    async fn is_moving(&self) -> ASCOMResult<bool> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the raw mechanical position of the rotator in degrees.
    #[http("mechanicalposition", method = Get, via = ValueResponse)]
    async fn mechanical_position(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Current instantaneous Rotator position, in degrees.
    #[http("position", method = Get, via = ValueResponse)]
    async fn position(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the rotator’s Reverse state.
    #[http("reverse", method = Get, via = ValueResponse)]
    async fn reverse(&self) -> ASCOMResult<bool> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets the rotator’s Reverse state.
    #[http("reverse", method = Put)]
    async fn set_reverse(&self, #[http("Reverse", via = BoolParam)] reverse: bool) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// The minimum StepSize, in degrees.
    #[http("stepsize", method = Get, via = ValueResponse)]
    async fn step_size(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// The destination position angle for Move() and MoveAbsolute().
    #[http("targetposition", method = Get, via = ValueResponse)]
    async fn target_position(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Immediately stop any Rotator motion due to a previous Move or MoveAbsolute method call.
    #[http("halt", method = Put)]
    async fn halt(&self) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Causes the rotator to move Position degrees relative to the current Position value.
    #[http("move", method = Put)]
    async fn move_(&self, #[http("Position")] position: f64) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Causes the rotator to move the absolute position of Position degrees.
    #[http("moveabsolute", method = Put)]
    async fn move_absolute(&self, #[http("Position")] position: f64) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Causes the rotator to move the mechanical position of Position degrees.
    #[http("movemechanical", method = Put)]
    async fn move_mechanical(&self, #[http("Position")] position: f64) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Causes the rotator to sync to the position of Position degrees.
    #[http("sync", method = Put)]
    async fn sync(&self, #[http("Position")] position: f64) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }
}

/// SafetyMonitor Specific Methods
#[cfg(feature = "safetymonitor")]
#[apply(rpc_trait)]
pub trait SafetyMonitor: Device + Send + Sync {
    /// Indicates whether the monitored state is safe for use. True if the state is safe, False if it is unsafe.
    #[http("issafe", method = Get, via = ValueResponse)]
    async fn is_safe(&self) -> ASCOMResult<bool> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }
}

/// Switch Specific Methods
#[cfg(feature = "switch")]
#[apply(rpc_trait)]
pub trait Switch: Device + Send + Sync {
    /// Returns the number of switch devices managed by this driver. Devices are numbered from 0 to MaxSwitch - 1
    #[http("maxswitch", method = Get, via = ValueResponse)]
    async fn max_switch(&self) -> ASCOMResult<i32> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Reports if the specified switch device can be written to, default true. This is false if the device cannot be written to, for example a limit switch or a sensor.  Devices are numbered from 0 to MaxSwitch - 1
    #[http("canwrite", method = Get, via = ValueResponse)]
    async fn can_write(&self, #[http("Id")] id: u32) -> ASCOMResult<bool> {
        Ok(false)
    }

    /// Return the state of switch device id as a boolean.  Devices are numbered from 0 to MaxSwitch - 1
    #[http("getswitch", method = Get, via = ValueResponse)]
    async fn get_switch(&self, #[http("Id")] id: u32) -> ASCOMResult<bool> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Gets the description of the specified switch device. This is to allow a fuller description of the device to be returned, for example for a tool tip. Devices are numbered from 0 to MaxSwitch - 1
    #[http("getswitchdescription", method = Get, via = ValueResponse)]
    async fn get_switch_description(&self, #[http("Id")] id: u32) -> ASCOMResult<String> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Gets the name of the specified switch device. Devices are numbered from 0 to MaxSwitch - 1
    #[http("getswitchname", method = Get, via = ValueResponse)]
    async fn get_switch_name(&self, #[http("Id")] id: u32) -> ASCOMResult<String> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Gets the value of the specified switch device as a double. Devices are numbered from 0 to MaxSwitch - 1, The value of this switch is expected to be between MinSwitchValue and MaxSwitchValue.
    #[http("getswitchvalue", method = Get, via = ValueResponse)]
    async fn get_switch_value(&self, #[http("Id")] id: u32) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Gets the minimum value of the specified switch device as a double. Devices are numbered from 0 to MaxSwitch - 1.
    #[http("minswitchvalue", method = Get, via = ValueResponse)]
    async fn min_switch_value(&self, #[http("Id")] id: u32) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Gets the maximum value of the specified switch device as a double. Devices are numbered from 0 to MaxSwitch - 1.
    #[http("maxswitchvalue", method = Get, via = ValueResponse)]
    async fn max_switch_value(&self, #[http("Id")] id: u32) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets a switch controller device to the specified state, true or false.
    #[http("setswitch", method = Put)]
    async fn set_switch(
        &self,

        #[http("Id")] id: u32,

        #[http("State", via = BoolParam)] state: bool,
    ) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets a switch device name to the specified value.
    #[http("setswitchname", method = Put)]
    async fn set_switch_name(
        &self,

        #[http("Id")] id: u32,

        #[http("Name")] name: String,
    ) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets a switch device value to the specified value.
    #[http("setswitchvalue", method = Put)]
    async fn set_switch_value(
        &self,

        #[http("Id")] id: u32,

        #[http("Value")] value: f64,
    ) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the step size that this device supports (the difference between successive values of the device). Devices are numbered from 0 to MaxSwitch - 1.
    #[http("switchstep", method = Get, via = ValueResponse)]
    async fn switch_step(&self, #[http("Id")] id: u32) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }
}

/// Telescope Specific Methods
#[cfg(feature = "telescope")]
#[apply(rpc_trait)]
pub trait Telescope: Device + Send + Sync {
    /// Returns the alignment mode of the mount (Alt/Az, Polar, German Polar). The alignment mode is specified as an integer value from the AlignmentModes Enum.
    #[http("alignmentmode", method = Get, via = ValueResponse)]
    async fn alignment_mode(&self) -> ASCOMResult<AlignmentMode> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// The altitude above the local horizon of the mount's current position (degrees, positive up)
    #[http("altitude", method = Get, via = ValueResponse)]
    async fn altitude(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// The area of the telescope's aperture, taking into account any obstructions (square meters)
    #[http("aperturearea", method = Get, via = ValueResponse)]
    async fn aperture_area(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// The telescope's effective aperture diameter (meters)
    #[http("aperturediameter", method = Get, via = ValueResponse)]
    async fn aperture_diameter(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// True if the mount is stopped in the Home position. Set only following a FindHome()  operation, and reset with any slew operation. This property must be False if the telescope does not support homing.
    #[http("athome", method = Get, via = ValueResponse)]
    async fn at_home(&self) -> ASCOMResult<bool> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// True if the telescope has been put into the parked state by the seee Park()  method. Set False by calling the Unpark() method.
    #[http("atpark", method = Get, via = ValueResponse)]
    async fn at_park(&self) -> ASCOMResult<bool> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// The azimuth at the local horizon of the mount's current position (degrees, North-referenced, positive East/clockwise).
    #[http("azimuth", method = Get, via = ValueResponse)]
    async fn azimuth(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// True if this telescope is capable of programmed finding its home position (FindHome()  method).
    #[http("canfindhome", method = Get, via = ValueResponse)]
    async fn can_find_home(&self) -> ASCOMResult<bool> {
        Ok(false)
    }

    /// True if this telescope is capable of programmed parking (Park() method)
    #[http("canpark", method = Get, via = ValueResponse)]
    async fn can_park(&self) -> ASCOMResult<bool> {
        Ok(false)
    }

    /// True if this telescope is capable of software-pulsed guiding (via the PulseGuide(GuideDirections, Int32) method)
    #[http("canpulseguide", method = Get, via = ValueResponse)]
    async fn can_pulse_guide(&self) -> ASCOMResult<bool> {
        Ok(false)
    }

    /// True if the DeclinationRate property can be changed to provide offset tracking in the declination axis.
    #[http("cansetdeclinationrate", method = Get, via = ValueResponse)]
    async fn can_set_declination_rate(&self) -> ASCOMResult<bool> {
        Ok(false)
    }

    /// True if the guide rate properties used for PulseGuide(GuideDirections, Int32) can ba adjusted.
    #[http("cansetguiderates", method = Get, via = ValueResponse)]
    async fn can_set_guide_rates(&self) -> ASCOMResult<bool> {
        Ok(false)
    }

    /// True if this telescope is capable of programmed setting of its park position (SetPark() method)
    #[http("cansetpark", method = Get, via = ValueResponse)]
    async fn can_set_park(&self) -> ASCOMResult<bool> {
        Ok(false)
    }

    /// True if the SideOfPier property can be set, meaning that the mount can be forced to flip.
    #[http("cansetpierside", method = Get, via = ValueResponse)]
    async fn can_set_pier_side(&self) -> ASCOMResult<bool> {
        Ok(false)
    }

    /// True if the RightAscensionRate property can be changed to provide offset tracking in the right ascension axis. .
    #[http("cansetrightascensionrate", method = Get, via = ValueResponse)]
    async fn can_set_right_ascension_rate(&self) -> ASCOMResult<bool> {
        Ok(false)
    }

    /// True if the Tracking property can be changed, turning telescope sidereal tracking on and off.
    #[http("cansettracking", method = Get, via = ValueResponse)]
    async fn can_set_tracking(&self) -> ASCOMResult<bool> {
        Ok(false)
    }

    /// True if this telescope is capable of programmed slewing (synchronous or asynchronous) to equatorial coordinates
    #[http("canslew", method = Get, via = ValueResponse)]
    async fn can_slew(&self) -> ASCOMResult<bool> {
        Ok(false)
    }

    /// True if this telescope is capable of programmed slewing (synchronous or asynchronous) to local horizontal coordinates
    #[http("canslewaltaz", method = Get, via = ValueResponse)]
    async fn can_slew_alt_az(&self) -> ASCOMResult<bool> {
        Ok(false)
    }

    /// True if this telescope is capable of programmed asynchronous slewing to local horizontal coordinates
    #[http("canslewaltazasync", method = Get, via = ValueResponse)]
    async fn can_slew_alt_az_async(&self) -> ASCOMResult<bool> {
        Ok(false)
    }

    /// True if this telescope is capable of programmed asynchronous slewing to equatorial coordinates.
    #[http("canslewasync", method = Get, via = ValueResponse)]
    async fn can_slew_async(&self) -> ASCOMResult<bool> {
        Ok(false)
    }

    /// True if this telescope is capable of programmed synching to equatorial coordinates.
    #[http("cansync", method = Get, via = ValueResponse)]
    async fn can_sync(&self) -> ASCOMResult<bool> {
        Ok(false)
    }

    /// True if this telescope is capable of programmed synching to local horizontal coordinates
    #[http("cansyncaltaz", method = Get, via = ValueResponse)]
    async fn can_sync_alt_az(&self) -> ASCOMResult<bool> {
        Ok(false)
    }

    /// True if this telescope is capable of programmed unparking (UnPark() method)
    #[http("canunpark", method = Get, via = ValueResponse)]
    async fn can_unpark(&self) -> ASCOMResult<bool> {
        Ok(false)
    }

    /// The declination (degrees) of the mount's current equatorial coordinates, in the coordinate system given by the EquatorialSystem property. Reading the property will raise an error if the value is unavailable.
    #[http("declination", method = Get, via = ValueResponse)]
    async fn declination(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// The declination tracking rate (arcseconds per second, default = 0.0)
    #[http("declinationrate", method = Get, via = ValueResponse)]
    async fn declination_rate(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets the declination tracking rate (arcseconds per second)
    #[http("declinationrate", method = Put)]
    async fn set_declination_rate(
        &self,

        #[http("DeclinationRate")] declination_rate: f64,
    ) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// True if the telescope or driver applies atmospheric refraction to coordinates.
    #[http("doesrefraction", method = Get, via = ValueResponse)]
    async fn does_refraction(&self) -> ASCOMResult<bool> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Causes the rotator to move Position degrees relative to the current Position value.
    #[http("doesrefraction", method = Put)]
    async fn set_does_refraction(
        &self,

        #[http("DoesRefraction", via = BoolParam)] does_refraction: bool,
    ) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the current equatorial coordinate system used by this telescope (e.g. Topocentric or J2000).
    #[http("equatorialsystem", method = Get, via = ValueResponse)]
    async fn equatorial_system(&self) -> ASCOMResult<EquatorialSystem> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// The telescope's focal length in meters
    #[http("focallength", method = Get, via = ValueResponse)]
    async fn focal_length(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// The current Declination movement rate offset for telescope guiding (degrees/sec)
    #[http("guideratedeclination", method = Get, via = ValueResponse)]
    async fn guide_rate_declination(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets the current Declination movement rate offset for telescope guiding (degrees/sec).
    #[http("guideratedeclination", method = Put)]
    async fn set_guide_rate_declination(
        &self,

        #[http("GuideRateDeclination")] guide_rate_declination: f64,
    ) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// The current RightAscension movement rate offset for telescope guiding (degrees/sec)
    #[http("guideraterightascension", method = Get, via = ValueResponse)]
    async fn guide_rate_right_ascension(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets the current RightAscension movement rate offset for telescope guiding (degrees/sec).
    #[http("guideraterightascension", method = Put)]
    async fn set_guide_rate_right_ascension(
        &self,

        #[http("GuideRateRightAscension")] guide_rate_right_ascension: f64,
    ) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// True if a PulseGuide(GuideDirections, Int32) command is in progress, False otherwise
    #[http("ispulseguiding", method = Get, via = ValueResponse)]
    async fn is_pulse_guiding(&self) -> ASCOMResult<bool> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// The right ascension (hours) of the mount's current equatorial coordinates, in the coordinate system given by the EquatorialSystem property
    #[http("rightascension", method = Get, via = ValueResponse)]
    async fn right_ascension(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// The right ascension tracking rate (arcseconds per second, default = 0.0)
    #[http("rightascensionrate", method = Get, via = ValueResponse)]
    async fn right_ascension_rate(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets the right ascension tracking rate (arcseconds per second)
    #[http("rightascensionrate", method = Put)]
    async fn set_right_ascension_rate(
        &self,

        #[http("RightAscensionRate")] right_ascension_rate: f64,
    ) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Indicates the pointing state of the mount.
    #[http("sideofpier", method = Get, via = ValueResponse)]
    async fn side_of_pier(&self) -> ASCOMResult<SideOfPier> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets the pointing state of the mount.
    #[http("sideofpier", method = Put)]
    async fn set_side_of_pier(
        &self,

        #[http("SideOfPier")] side_of_pier: SideOfPier,
    ) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// The local apparent sidereal time from the telescope's internal clock (hours, sidereal).
    #[http("siderealtime", method = Get, via = ValueResponse)]
    async fn sidereal_time(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// The elevation above mean sea level (meters) of the site at which the telescope is located.
    #[http("siteelevation", method = Get, via = ValueResponse)]
    async fn site_elevation(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets the elevation above mean sea level (metres) of the site at which the telescope is located.
    #[http("siteelevation", method = Put)]
    async fn set_site_elevation(
        &self,

        #[http("SiteElevation")] site_elevation: f64,
    ) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// The geodetic(map) latitude (degrees, positive North, WGS84) of the site at which the telescope is located.
    #[http("sitelatitude", method = Get, via = ValueResponse)]
    async fn site_latitude(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets the observing site's latitude (degrees).
    #[http("sitelatitude", method = Put)]
    async fn set_site_latitude(&self, #[http("SiteLatitude")] site_latitude: f64) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// The longitude (degrees, positive East, WGS84) of the site at which the telescope is located.
    #[http("sitelongitude", method = Get, via = ValueResponse)]
    async fn site_longitude(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets the observing site's longitude (degrees, positive East, WGS84).
    #[http("sitelongitude", method = Put)]
    async fn set_site_longitude(
        &self,

        #[http("SiteLongitude")] site_longitude: f64,
    ) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// True if telescope is currently moving in response to one of the Slew methods or the MoveAxis(TelescopeAxes, Double) method, False at all other times.
    #[http("slewing", method = Get, via = ValueResponse)]
    async fn slewing(&self) -> ASCOMResult<bool> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the post-slew settling time (sec.).
    #[http("slewsettletime", method = Get, via = ValueResponse)]
    async fn slew_settle_time(&self) -> ASCOMResult<i32> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets the  post-slew settling time (integer sec.).
    #[http("slewsettletime", method = Put)]
    async fn set_slew_settle_time(
        &self,

        #[http("SlewSettleTime")] slew_settle_time: i32,
    ) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// The declination (degrees, positive North) for the target of an equatorial slew or sync operation
    #[http("targetdeclination", method = Get, via = ValueResponse)]
    async fn target_declination(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets the declination (degrees, positive North) for the target of an equatorial slew or sync operation
    #[http("targetdeclination", method = Put)]
    async fn set_target_declination(
        &self,

        #[http("TargetDeclination")] target_declination: f64,
    ) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// The right ascension (hours) for the target of an equatorial slew or sync operation
    #[http("targetrightascension", method = Get, via = ValueResponse)]
    async fn target_right_ascension(&self) -> ASCOMResult<f64> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets the right ascension (hours) for the target of an equatorial slew or sync operation
    #[http("targetrightascension", method = Put)]
    async fn set_target_right_ascension(
        &self,

        #[http("TargetRightAscension")] target_right_ascension: f64,
    ) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the state of the telescope's sidereal tracking drive.
    #[http("tracking", method = Get, via = ValueResponse)]
    async fn tracking(&self) -> ASCOMResult<bool> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets the state of the telescope's sidereal tracking drive.
    #[http("tracking", method = Put)]
    async fn set_tracking(
        &self,

        #[http("Tracking", via = BoolParam)] tracking: bool,
    ) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// The current tracking rate of the telescope's sidereal drive.
    #[http("trackingrate", method = Get, via = ValueResponse)]
    async fn tracking_rate(&self) -> ASCOMResult<DriveRate> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets the tracking rate of the telescope's sidereal drive.
    #[http("trackingrate", method = Put)]
    async fn set_tracking_rate(
        &self,

        #[http("TrackingRate")] tracking_rate: DriveRate,
    ) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns an array of supported DriveRates values that describe the permissible values of the TrackingRate property for this telescope type.
    #[http("trackingrates", method = Get, via = ValueResponse)]
    async fn tracking_rates(&self) -> ASCOMResult<Vec<DriveRate>> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Returns the UTC date/time of the telescope's internal clock.
    #[http("utcdate", method = Get, via = TelescopeUtcdate)]
    async fn utc_date(&self) -> ASCOMResult<std::time::SystemTime> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets the UTC date/time of the telescope's internal clock.
    #[http("utcdate", method = Put)]
    async fn set_utc_date(
        &self,

        #[http("UTCDate", via = TelescopeUtcdate)] utc_date: std::time::SystemTime,
    ) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Immediately Stops a slew in progress.
    #[http("abortslew", method = Put)]
    async fn abort_slew(&self) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// The rates at which the telescope may be moved about the specified axis by the MoveAxis(TelescopeAxes, Double) method.
    #[http("axisrates", method = Get, via = ValueResponse)]
    async fn axis_rates(&self, #[http("Axis")] axis: Axis) -> ASCOMResult<Vec<AxisRate>> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// True if this telescope can move the requested axis.
    #[http("canmoveaxis", method = Get, via = ValueResponse)]
    async fn can_move_axis(&self, #[http("Axis")] axis: Axis) -> ASCOMResult<bool> {
        Ok(false)
    }

    /// Predicts the pointing state that a German equatorial mount will be in if it slews to the given coordinates.
    #[http("destinationsideofpier", method = Get, via = ValueResponse)]
    async fn destination_side_of_pier(
        &self,

        #[http("RightAscension")] right_ascension: f64,

        #[http("Declination")] declination: f64,
    ) -> ASCOMResult<SideOfPier> {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Locates the telescope's "home" position (synchronous)
    #[http("findhome", method = Put)]
    async fn find_home(&self) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Move the telescope in one axis at the given rate.
    #[http("moveaxis", method = Put)]
    async fn move_axis(
        &self,

        #[http("Axis")] axis: Axis,

        #[http("Rate")] rate: f64,
    ) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Move the telescope to its park position, stop all motion (or restrict to a small safe range), and set AtPark to True. )
    #[http("park", method = Put)]
    async fn park(&self) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Moves the scope in the given direction for the given interval or time at the rate given by the corresponding guide rate property
    #[http("pulseguide", method = Put)]
    async fn pulse_guide(
        &self,

        #[http("Direction")] direction: PutPulseGuideDirection,

        #[http("Duration")] duration: i32,
    ) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Sets the telescope's park position to be its current position.
    #[http("setpark", method = Put)]
    async fn set_park(&self) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Move the telescope to the given local horizontal coordinates, return when slew is complete
    #[http("slewtoaltaz", method = Put)]
    async fn slew_to_alt_az(
        &self,

        #[http("Azimuth")] azimuth: f64,

        #[http("Altitude")] altitude: f64,
    ) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Move the telescope to the given local horizontal coordinates, return immediatley after the slew starts. The client can poll the Slewing method to determine when the mount reaches the intended coordinates.
    #[http("slewtoaltazasync", method = Put)]
    async fn slew_to_alt_az_async(
        &self,

        #[http("Azimuth")] azimuth: f64,

        #[http("Altitude")] altitude: f64,
    ) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Move the telescope to the given equatorial coordinates, return when slew is complete
    #[http("slewtocoordinates", method = Put)]
    async fn slew_to_coordinates(
        &self,

        #[http("RightAscension")] right_ascension: f64,

        #[http("Declination")] declination: f64,
    ) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Move the telescope to the given equatorial coordinates, return immediatley after the slew starts. The client can poll the Slewing method to determine when the mount reaches the intended coordinates.
    #[http("slewtocoordinatesasync", method = Put)]
    async fn slew_to_coordinates_async(
        &self,

        #[http("RightAscension")] right_ascension: f64,

        #[http("Declination")] declination: f64,
    ) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Move the telescope to the TargetRightAscension and TargetDeclination equatorial coordinates, return when slew is complete
    #[http("slewtotarget", method = Put)]
    async fn slew_to_target(&self) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Move the telescope to the TargetRightAscension and TargetDeclination equatorial coordinates, return immediatley after the slew starts. The client can poll the Slewing method to determine when the mount reaches the intended coordinates.
    #[http("slewtotargetasync", method = Put)]
    async fn slew_to_target_async(&self) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Matches the scope's local horizontal coordinates to the given local horizontal coordinates.
    #[http("synctoaltaz", method = Put)]
    async fn sync_to_alt_az(
        &self,

        #[http("Azimuth")] azimuth: f64,

        #[http("Altitude")] altitude: f64,
    ) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Matches the scope's equatorial coordinates to the given equatorial coordinates.
    #[http("synctocoordinates", method = Put)]
    async fn sync_to_coordinates(
        &self,

        #[http("RightAscension")] right_ascension: f64,

        #[http("Declination")] declination: f64,
    ) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Matches the scope's equatorial coordinates to the TargetRightAscension and TargetDeclination equatorial coordinates.
    #[http("synctotarget", method = Put)]
    async fn sync_to_target(&self) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }

    /// Takes telescope out of the Parked state. )
    #[http("unpark", method = Put)]
    async fn unpark(&self) -> ASCOMResult {
        Err(ASCOMError::NOT_IMPLEMENTED)
    }
}

rpc_mod! {
    Camera = "camera",
    CoverCalibrator = "covercalibrator",
    Dome = "dome",
    FilterWheel = "filterwheel",
    Focuser = "focuser",
    ObservingConditions = "observingconditions",
    Rotator = "rotator",
    SafetyMonitor = "safetymonitor",
    Switch = "switch",
    Telescope = "telescope",
}