to_ptr.go 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  1. // Code generated by smithy-go/ptr/generate.go DO NOT EDIT.
  2. package ptr
  3. import (
  4. "time"
  5. )
  6. // Bool returns a pointer value for the bool value passed in.
  7. func Bool(v bool) *bool {
  8. return &v
  9. }
  10. // BoolSlice returns a slice of bool pointers from the values
  11. // passed in.
  12. func BoolSlice(vs []bool) []*bool {
  13. ps := make([]*bool, len(vs))
  14. for i, v := range vs {
  15. vv := v
  16. ps[i] = &vv
  17. }
  18. return ps
  19. }
  20. // BoolMap returns a map of bool pointers from the values
  21. // passed in.
  22. func BoolMap(vs map[string]bool) map[string]*bool {
  23. ps := make(map[string]*bool, len(vs))
  24. for k, v := range vs {
  25. vv := v
  26. ps[k] = &vv
  27. }
  28. return ps
  29. }
  30. // Byte returns a pointer value for the byte value passed in.
  31. func Byte(v byte) *byte {
  32. return &v
  33. }
  34. // ByteSlice returns a slice of byte pointers from the values
  35. // passed in.
  36. func ByteSlice(vs []byte) []*byte {
  37. ps := make([]*byte, len(vs))
  38. for i, v := range vs {
  39. vv := v
  40. ps[i] = &vv
  41. }
  42. return ps
  43. }
  44. // ByteMap returns a map of byte pointers from the values
  45. // passed in.
  46. func ByteMap(vs map[string]byte) map[string]*byte {
  47. ps := make(map[string]*byte, len(vs))
  48. for k, v := range vs {
  49. vv := v
  50. ps[k] = &vv
  51. }
  52. return ps
  53. }
  54. // String returns a pointer value for the string value passed in.
  55. func String(v string) *string {
  56. return &v
  57. }
  58. // StringSlice returns a slice of string pointers from the values
  59. // passed in.
  60. func StringSlice(vs []string) []*string {
  61. ps := make([]*string, len(vs))
  62. for i, v := range vs {
  63. vv := v
  64. ps[i] = &vv
  65. }
  66. return ps
  67. }
  68. // StringMap returns a map of string pointers from the values
  69. // passed in.
  70. func StringMap(vs map[string]string) map[string]*string {
  71. ps := make(map[string]*string, len(vs))
  72. for k, v := range vs {
  73. vv := v
  74. ps[k] = &vv
  75. }
  76. return ps
  77. }
  78. // Int returns a pointer value for the int value passed in.
  79. func Int(v int) *int {
  80. return &v
  81. }
  82. // IntSlice returns a slice of int pointers from the values
  83. // passed in.
  84. func IntSlice(vs []int) []*int {
  85. ps := make([]*int, len(vs))
  86. for i, v := range vs {
  87. vv := v
  88. ps[i] = &vv
  89. }
  90. return ps
  91. }
  92. // IntMap returns a map of int pointers from the values
  93. // passed in.
  94. func IntMap(vs map[string]int) map[string]*int {
  95. ps := make(map[string]*int, len(vs))
  96. for k, v := range vs {
  97. vv := v
  98. ps[k] = &vv
  99. }
  100. return ps
  101. }
  102. // Int8 returns a pointer value for the int8 value passed in.
  103. func Int8(v int8) *int8 {
  104. return &v
  105. }
  106. // Int8Slice returns a slice of int8 pointers from the values
  107. // passed in.
  108. func Int8Slice(vs []int8) []*int8 {
  109. ps := make([]*int8, len(vs))
  110. for i, v := range vs {
  111. vv := v
  112. ps[i] = &vv
  113. }
  114. return ps
  115. }
  116. // Int8Map returns a map of int8 pointers from the values
  117. // passed in.
  118. func Int8Map(vs map[string]int8) map[string]*int8 {
  119. ps := make(map[string]*int8, len(vs))
  120. for k, v := range vs {
  121. vv := v
  122. ps[k] = &vv
  123. }
  124. return ps
  125. }
  126. // Int16 returns a pointer value for the int16 value passed in.
  127. func Int16(v int16) *int16 {
  128. return &v
  129. }
  130. // Int16Slice returns a slice of int16 pointers from the values
  131. // passed in.
  132. func Int16Slice(vs []int16) []*int16 {
  133. ps := make([]*int16, len(vs))
  134. for i, v := range vs {
  135. vv := v
  136. ps[i] = &vv
  137. }
  138. return ps
  139. }
  140. // Int16Map returns a map of int16 pointers from the values
  141. // passed in.
  142. func Int16Map(vs map[string]int16) map[string]*int16 {
  143. ps := make(map[string]*int16, len(vs))
  144. for k, v := range vs {
  145. vv := v
  146. ps[k] = &vv
  147. }
  148. return ps
  149. }
  150. // Int32 returns a pointer value for the int32 value passed in.
  151. func Int32(v int32) *int32 {
  152. return &v
  153. }
  154. // Int32Slice returns a slice of int32 pointers from the values
  155. // passed in.
  156. func Int32Slice(vs []int32) []*int32 {
  157. ps := make([]*int32, len(vs))
  158. for i, v := range vs {
  159. vv := v
  160. ps[i] = &vv
  161. }
  162. return ps
  163. }
  164. // Int32Map returns a map of int32 pointers from the values
  165. // passed in.
  166. func Int32Map(vs map[string]int32) map[string]*int32 {
  167. ps := make(map[string]*int32, len(vs))
  168. for k, v := range vs {
  169. vv := v
  170. ps[k] = &vv
  171. }
  172. return ps
  173. }
  174. // Int64 returns a pointer value for the int64 value passed in.
  175. func Int64(v int64) *int64 {
  176. return &v
  177. }
  178. // Int64Slice returns a slice of int64 pointers from the values
  179. // passed in.
  180. func Int64Slice(vs []int64) []*int64 {
  181. ps := make([]*int64, len(vs))
  182. for i, v := range vs {
  183. vv := v
  184. ps[i] = &vv
  185. }
  186. return ps
  187. }
  188. // Int64Map returns a map of int64 pointers from the values
  189. // passed in.
  190. func Int64Map(vs map[string]int64) map[string]*int64 {
  191. ps := make(map[string]*int64, len(vs))
  192. for k, v := range vs {
  193. vv := v
  194. ps[k] = &vv
  195. }
  196. return ps
  197. }
  198. // Uint returns a pointer value for the uint value passed in.
  199. func Uint(v uint) *uint {
  200. return &v
  201. }
  202. // UintSlice returns a slice of uint pointers from the values
  203. // passed in.
  204. func UintSlice(vs []uint) []*uint {
  205. ps := make([]*uint, len(vs))
  206. for i, v := range vs {
  207. vv := v
  208. ps[i] = &vv
  209. }
  210. return ps
  211. }
  212. // UintMap returns a map of uint pointers from the values
  213. // passed in.
  214. func UintMap(vs map[string]uint) map[string]*uint {
  215. ps := make(map[string]*uint, len(vs))
  216. for k, v := range vs {
  217. vv := v
  218. ps[k] = &vv
  219. }
  220. return ps
  221. }
  222. // Uint8 returns a pointer value for the uint8 value passed in.
  223. func Uint8(v uint8) *uint8 {
  224. return &v
  225. }
  226. // Uint8Slice returns a slice of uint8 pointers from the values
  227. // passed in.
  228. func Uint8Slice(vs []uint8) []*uint8 {
  229. ps := make([]*uint8, len(vs))
  230. for i, v := range vs {
  231. vv := v
  232. ps[i] = &vv
  233. }
  234. return ps
  235. }
  236. // Uint8Map returns a map of uint8 pointers from the values
  237. // passed in.
  238. func Uint8Map(vs map[string]uint8) map[string]*uint8 {
  239. ps := make(map[string]*uint8, len(vs))
  240. for k, v := range vs {
  241. vv := v
  242. ps[k] = &vv
  243. }
  244. return ps
  245. }
  246. // Uint16 returns a pointer value for the uint16 value passed in.
  247. func Uint16(v uint16) *uint16 {
  248. return &v
  249. }
  250. // Uint16Slice returns a slice of uint16 pointers from the values
  251. // passed in.
  252. func Uint16Slice(vs []uint16) []*uint16 {
  253. ps := make([]*uint16, len(vs))
  254. for i, v := range vs {
  255. vv := v
  256. ps[i] = &vv
  257. }
  258. return ps
  259. }
  260. // Uint16Map returns a map of uint16 pointers from the values
  261. // passed in.
  262. func Uint16Map(vs map[string]uint16) map[string]*uint16 {
  263. ps := make(map[string]*uint16, len(vs))
  264. for k, v := range vs {
  265. vv := v
  266. ps[k] = &vv
  267. }
  268. return ps
  269. }
  270. // Uint32 returns a pointer value for the uint32 value passed in.
  271. func Uint32(v uint32) *uint32 {
  272. return &v
  273. }
  274. // Uint32Slice returns a slice of uint32 pointers from the values
  275. // passed in.
  276. func Uint32Slice(vs []uint32) []*uint32 {
  277. ps := make([]*uint32, len(vs))
  278. for i, v := range vs {
  279. vv := v
  280. ps[i] = &vv
  281. }
  282. return ps
  283. }
  284. // Uint32Map returns a map of uint32 pointers from the values
  285. // passed in.
  286. func Uint32Map(vs map[string]uint32) map[string]*uint32 {
  287. ps := make(map[string]*uint32, len(vs))
  288. for k, v := range vs {
  289. vv := v
  290. ps[k] = &vv
  291. }
  292. return ps
  293. }
  294. // Uint64 returns a pointer value for the uint64 value passed in.
  295. func Uint64(v uint64) *uint64 {
  296. return &v
  297. }
  298. // Uint64Slice returns a slice of uint64 pointers from the values
  299. // passed in.
  300. func Uint64Slice(vs []uint64) []*uint64 {
  301. ps := make([]*uint64, len(vs))
  302. for i, v := range vs {
  303. vv := v
  304. ps[i] = &vv
  305. }
  306. return ps
  307. }
  308. // Uint64Map returns a map of uint64 pointers from the values
  309. // passed in.
  310. func Uint64Map(vs map[string]uint64) map[string]*uint64 {
  311. ps := make(map[string]*uint64, len(vs))
  312. for k, v := range vs {
  313. vv := v
  314. ps[k] = &vv
  315. }
  316. return ps
  317. }
  318. // Float32 returns a pointer value for the float32 value passed in.
  319. func Float32(v float32) *float32 {
  320. return &v
  321. }
  322. // Float32Slice returns a slice of float32 pointers from the values
  323. // passed in.
  324. func Float32Slice(vs []float32) []*float32 {
  325. ps := make([]*float32, len(vs))
  326. for i, v := range vs {
  327. vv := v
  328. ps[i] = &vv
  329. }
  330. return ps
  331. }
  332. // Float32Map returns a map of float32 pointers from the values
  333. // passed in.
  334. func Float32Map(vs map[string]float32) map[string]*float32 {
  335. ps := make(map[string]*float32, len(vs))
  336. for k, v := range vs {
  337. vv := v
  338. ps[k] = &vv
  339. }
  340. return ps
  341. }
  342. // Float64 returns a pointer value for the float64 value passed in.
  343. func Float64(v float64) *float64 {
  344. return &v
  345. }
  346. // Float64Slice returns a slice of float64 pointers from the values
  347. // passed in.
  348. func Float64Slice(vs []float64) []*float64 {
  349. ps := make([]*float64, len(vs))
  350. for i, v := range vs {
  351. vv := v
  352. ps[i] = &vv
  353. }
  354. return ps
  355. }
  356. // Float64Map returns a map of float64 pointers from the values
  357. // passed in.
  358. func Float64Map(vs map[string]float64) map[string]*float64 {
  359. ps := make(map[string]*float64, len(vs))
  360. for k, v := range vs {
  361. vv := v
  362. ps[k] = &vv
  363. }
  364. return ps
  365. }
  366. // Time returns a pointer value for the time.Time value passed in.
  367. func Time(v time.Time) *time.Time {
  368. return &v
  369. }
  370. // TimeSlice returns a slice of time.Time pointers from the values
  371. // passed in.
  372. func TimeSlice(vs []time.Time) []*time.Time {
  373. ps := make([]*time.Time, len(vs))
  374. for i, v := range vs {
  375. vv := v
  376. ps[i] = &vv
  377. }
  378. return ps
  379. }
  380. // TimeMap returns a map of time.Time pointers from the values
  381. // passed in.
  382. func TimeMap(vs map[string]time.Time) map[string]*time.Time {
  383. ps := make(map[string]*time.Time, len(vs))
  384. for k, v := range vs {
  385. vv := v
  386. ps[k] = &vv
  387. }
  388. return ps
  389. }
  390. // Duration returns a pointer value for the time.Duration value passed in.
  391. func Duration(v time.Duration) *time.Duration {
  392. return &v
  393. }
  394. // DurationSlice returns a slice of time.Duration pointers from the values
  395. // passed in.
  396. func DurationSlice(vs []time.Duration) []*time.Duration {
  397. ps := make([]*time.Duration, len(vs))
  398. for i, v := range vs {
  399. vv := v
  400. ps[i] = &vv
  401. }
  402. return ps
  403. }
  404. // DurationMap returns a map of time.Duration pointers from the values
  405. // passed in.
  406. func DurationMap(vs map[string]time.Duration) map[string]*time.Duration {
  407. ps := make(map[string]*time.Duration, len(vs))
  408. for k, v := range vs {
  409. vv := v
  410. ps[k] = &vv
  411. }
  412. return ps
  413. }