from_ptr.go 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. // Code generated by aws/generate.go DO NOT EDIT.
  2. package aws
  3. import (
  4. "github.com/aws/smithy-go/ptr"
  5. "time"
  6. )
  7. // ToBool returns bool value dereferenced if the passed
  8. // in pointer was not nil. Returns a bool zero value if the
  9. // pointer was nil.
  10. func ToBool(p *bool) (v bool) {
  11. return ptr.ToBool(p)
  12. }
  13. // ToBoolSlice returns a slice of bool values, that are
  14. // dereferenced if the passed in pointer was not nil. Returns a bool
  15. // zero value if the pointer was nil.
  16. func ToBoolSlice(vs []*bool) []bool {
  17. return ptr.ToBoolSlice(vs)
  18. }
  19. // ToBoolMap returns a map of bool values, that are
  20. // dereferenced if the passed in pointer was not nil. The bool
  21. // zero value is used if the pointer was nil.
  22. func ToBoolMap(vs map[string]*bool) map[string]bool {
  23. return ptr.ToBoolMap(vs)
  24. }
  25. // ToByte returns byte value dereferenced if the passed
  26. // in pointer was not nil. Returns a byte zero value if the
  27. // pointer was nil.
  28. func ToByte(p *byte) (v byte) {
  29. return ptr.ToByte(p)
  30. }
  31. // ToByteSlice returns a slice of byte values, that are
  32. // dereferenced if the passed in pointer was not nil. Returns a byte
  33. // zero value if the pointer was nil.
  34. func ToByteSlice(vs []*byte) []byte {
  35. return ptr.ToByteSlice(vs)
  36. }
  37. // ToByteMap returns a map of byte values, that are
  38. // dereferenced if the passed in pointer was not nil. The byte
  39. // zero value is used if the pointer was nil.
  40. func ToByteMap(vs map[string]*byte) map[string]byte {
  41. return ptr.ToByteMap(vs)
  42. }
  43. // ToString returns string value dereferenced if the passed
  44. // in pointer was not nil. Returns a string zero value if the
  45. // pointer was nil.
  46. func ToString(p *string) (v string) {
  47. return ptr.ToString(p)
  48. }
  49. // ToStringSlice returns a slice of string values, that are
  50. // dereferenced if the passed in pointer was not nil. Returns a string
  51. // zero value if the pointer was nil.
  52. func ToStringSlice(vs []*string) []string {
  53. return ptr.ToStringSlice(vs)
  54. }
  55. // ToStringMap returns a map of string values, that are
  56. // dereferenced if the passed in pointer was not nil. The string
  57. // zero value is used if the pointer was nil.
  58. func ToStringMap(vs map[string]*string) map[string]string {
  59. return ptr.ToStringMap(vs)
  60. }
  61. // ToInt returns int value dereferenced if the passed
  62. // in pointer was not nil. Returns a int zero value if the
  63. // pointer was nil.
  64. func ToInt(p *int) (v int) {
  65. return ptr.ToInt(p)
  66. }
  67. // ToIntSlice returns a slice of int values, that are
  68. // dereferenced if the passed in pointer was not nil. Returns a int
  69. // zero value if the pointer was nil.
  70. func ToIntSlice(vs []*int) []int {
  71. return ptr.ToIntSlice(vs)
  72. }
  73. // ToIntMap returns a map of int values, that are
  74. // dereferenced if the passed in pointer was not nil. The int
  75. // zero value is used if the pointer was nil.
  76. func ToIntMap(vs map[string]*int) map[string]int {
  77. return ptr.ToIntMap(vs)
  78. }
  79. // ToInt8 returns int8 value dereferenced if the passed
  80. // in pointer was not nil. Returns a int8 zero value if the
  81. // pointer was nil.
  82. func ToInt8(p *int8) (v int8) {
  83. return ptr.ToInt8(p)
  84. }
  85. // ToInt8Slice returns a slice of int8 values, that are
  86. // dereferenced if the passed in pointer was not nil. Returns a int8
  87. // zero value if the pointer was nil.
  88. func ToInt8Slice(vs []*int8) []int8 {
  89. return ptr.ToInt8Slice(vs)
  90. }
  91. // ToInt8Map returns a map of int8 values, that are
  92. // dereferenced if the passed in pointer was not nil. The int8
  93. // zero value is used if the pointer was nil.
  94. func ToInt8Map(vs map[string]*int8) map[string]int8 {
  95. return ptr.ToInt8Map(vs)
  96. }
  97. // ToInt16 returns int16 value dereferenced if the passed
  98. // in pointer was not nil. Returns a int16 zero value if the
  99. // pointer was nil.
  100. func ToInt16(p *int16) (v int16) {
  101. return ptr.ToInt16(p)
  102. }
  103. // ToInt16Slice returns a slice of int16 values, that are
  104. // dereferenced if the passed in pointer was not nil. Returns a int16
  105. // zero value if the pointer was nil.
  106. func ToInt16Slice(vs []*int16) []int16 {
  107. return ptr.ToInt16Slice(vs)
  108. }
  109. // ToInt16Map returns a map of int16 values, that are
  110. // dereferenced if the passed in pointer was not nil. The int16
  111. // zero value is used if the pointer was nil.
  112. func ToInt16Map(vs map[string]*int16) map[string]int16 {
  113. return ptr.ToInt16Map(vs)
  114. }
  115. // ToInt32 returns int32 value dereferenced if the passed
  116. // in pointer was not nil. Returns a int32 zero value if the
  117. // pointer was nil.
  118. func ToInt32(p *int32) (v int32) {
  119. return ptr.ToInt32(p)
  120. }
  121. // ToInt32Slice returns a slice of int32 values, that are
  122. // dereferenced if the passed in pointer was not nil. Returns a int32
  123. // zero value if the pointer was nil.
  124. func ToInt32Slice(vs []*int32) []int32 {
  125. return ptr.ToInt32Slice(vs)
  126. }
  127. // ToInt32Map returns a map of int32 values, that are
  128. // dereferenced if the passed in pointer was not nil. The int32
  129. // zero value is used if the pointer was nil.
  130. func ToInt32Map(vs map[string]*int32) map[string]int32 {
  131. return ptr.ToInt32Map(vs)
  132. }
  133. // ToInt64 returns int64 value dereferenced if the passed
  134. // in pointer was not nil. Returns a int64 zero value if the
  135. // pointer was nil.
  136. func ToInt64(p *int64) (v int64) {
  137. return ptr.ToInt64(p)
  138. }
  139. // ToInt64Slice returns a slice of int64 values, that are
  140. // dereferenced if the passed in pointer was not nil. Returns a int64
  141. // zero value if the pointer was nil.
  142. func ToInt64Slice(vs []*int64) []int64 {
  143. return ptr.ToInt64Slice(vs)
  144. }
  145. // ToInt64Map returns a map of int64 values, that are
  146. // dereferenced if the passed in pointer was not nil. The int64
  147. // zero value is used if the pointer was nil.
  148. func ToInt64Map(vs map[string]*int64) map[string]int64 {
  149. return ptr.ToInt64Map(vs)
  150. }
  151. // ToUint returns uint value dereferenced if the passed
  152. // in pointer was not nil. Returns a uint zero value if the
  153. // pointer was nil.
  154. func ToUint(p *uint) (v uint) {
  155. return ptr.ToUint(p)
  156. }
  157. // ToUintSlice returns a slice of uint values, that are
  158. // dereferenced if the passed in pointer was not nil. Returns a uint
  159. // zero value if the pointer was nil.
  160. func ToUintSlice(vs []*uint) []uint {
  161. return ptr.ToUintSlice(vs)
  162. }
  163. // ToUintMap returns a map of uint values, that are
  164. // dereferenced if the passed in pointer was not nil. The uint
  165. // zero value is used if the pointer was nil.
  166. func ToUintMap(vs map[string]*uint) map[string]uint {
  167. return ptr.ToUintMap(vs)
  168. }
  169. // ToUint8 returns uint8 value dereferenced if the passed
  170. // in pointer was not nil. Returns a uint8 zero value if the
  171. // pointer was nil.
  172. func ToUint8(p *uint8) (v uint8) {
  173. return ptr.ToUint8(p)
  174. }
  175. // ToUint8Slice returns a slice of uint8 values, that are
  176. // dereferenced if the passed in pointer was not nil. Returns a uint8
  177. // zero value if the pointer was nil.
  178. func ToUint8Slice(vs []*uint8) []uint8 {
  179. return ptr.ToUint8Slice(vs)
  180. }
  181. // ToUint8Map returns a map of uint8 values, that are
  182. // dereferenced if the passed in pointer was not nil. The uint8
  183. // zero value is used if the pointer was nil.
  184. func ToUint8Map(vs map[string]*uint8) map[string]uint8 {
  185. return ptr.ToUint8Map(vs)
  186. }
  187. // ToUint16 returns uint16 value dereferenced if the passed
  188. // in pointer was not nil. Returns a uint16 zero value if the
  189. // pointer was nil.
  190. func ToUint16(p *uint16) (v uint16) {
  191. return ptr.ToUint16(p)
  192. }
  193. // ToUint16Slice returns a slice of uint16 values, that are
  194. // dereferenced if the passed in pointer was not nil. Returns a uint16
  195. // zero value if the pointer was nil.
  196. func ToUint16Slice(vs []*uint16) []uint16 {
  197. return ptr.ToUint16Slice(vs)
  198. }
  199. // ToUint16Map returns a map of uint16 values, that are
  200. // dereferenced if the passed in pointer was not nil. The uint16
  201. // zero value is used if the pointer was nil.
  202. func ToUint16Map(vs map[string]*uint16) map[string]uint16 {
  203. return ptr.ToUint16Map(vs)
  204. }
  205. // ToUint32 returns uint32 value dereferenced if the passed
  206. // in pointer was not nil. Returns a uint32 zero value if the
  207. // pointer was nil.
  208. func ToUint32(p *uint32) (v uint32) {
  209. return ptr.ToUint32(p)
  210. }
  211. // ToUint32Slice returns a slice of uint32 values, that are
  212. // dereferenced if the passed in pointer was not nil. Returns a uint32
  213. // zero value if the pointer was nil.
  214. func ToUint32Slice(vs []*uint32) []uint32 {
  215. return ptr.ToUint32Slice(vs)
  216. }
  217. // ToUint32Map returns a map of uint32 values, that are
  218. // dereferenced if the passed in pointer was not nil. The uint32
  219. // zero value is used if the pointer was nil.
  220. func ToUint32Map(vs map[string]*uint32) map[string]uint32 {
  221. return ptr.ToUint32Map(vs)
  222. }
  223. // ToUint64 returns uint64 value dereferenced if the passed
  224. // in pointer was not nil. Returns a uint64 zero value if the
  225. // pointer was nil.
  226. func ToUint64(p *uint64) (v uint64) {
  227. return ptr.ToUint64(p)
  228. }
  229. // ToUint64Slice returns a slice of uint64 values, that are
  230. // dereferenced if the passed in pointer was not nil. Returns a uint64
  231. // zero value if the pointer was nil.
  232. func ToUint64Slice(vs []*uint64) []uint64 {
  233. return ptr.ToUint64Slice(vs)
  234. }
  235. // ToUint64Map returns a map of uint64 values, that are
  236. // dereferenced if the passed in pointer was not nil. The uint64
  237. // zero value is used if the pointer was nil.
  238. func ToUint64Map(vs map[string]*uint64) map[string]uint64 {
  239. return ptr.ToUint64Map(vs)
  240. }
  241. // ToFloat32 returns float32 value dereferenced if the passed
  242. // in pointer was not nil. Returns a float32 zero value if the
  243. // pointer was nil.
  244. func ToFloat32(p *float32) (v float32) {
  245. return ptr.ToFloat32(p)
  246. }
  247. // ToFloat32Slice returns a slice of float32 values, that are
  248. // dereferenced if the passed in pointer was not nil. Returns a float32
  249. // zero value if the pointer was nil.
  250. func ToFloat32Slice(vs []*float32) []float32 {
  251. return ptr.ToFloat32Slice(vs)
  252. }
  253. // ToFloat32Map returns a map of float32 values, that are
  254. // dereferenced if the passed in pointer was not nil. The float32
  255. // zero value is used if the pointer was nil.
  256. func ToFloat32Map(vs map[string]*float32) map[string]float32 {
  257. return ptr.ToFloat32Map(vs)
  258. }
  259. // ToFloat64 returns float64 value dereferenced if the passed
  260. // in pointer was not nil. Returns a float64 zero value if the
  261. // pointer was nil.
  262. func ToFloat64(p *float64) (v float64) {
  263. return ptr.ToFloat64(p)
  264. }
  265. // ToFloat64Slice returns a slice of float64 values, that are
  266. // dereferenced if the passed in pointer was not nil. Returns a float64
  267. // zero value if the pointer was nil.
  268. func ToFloat64Slice(vs []*float64) []float64 {
  269. return ptr.ToFloat64Slice(vs)
  270. }
  271. // ToFloat64Map returns a map of float64 values, that are
  272. // dereferenced if the passed in pointer was not nil. The float64
  273. // zero value is used if the pointer was nil.
  274. func ToFloat64Map(vs map[string]*float64) map[string]float64 {
  275. return ptr.ToFloat64Map(vs)
  276. }
  277. // ToTime returns time.Time value dereferenced if the passed
  278. // in pointer was not nil. Returns a time.Time zero value if the
  279. // pointer was nil.
  280. func ToTime(p *time.Time) (v time.Time) {
  281. return ptr.ToTime(p)
  282. }
  283. // ToTimeSlice returns a slice of time.Time values, that are
  284. // dereferenced if the passed in pointer was not nil. Returns a time.Time
  285. // zero value if the pointer was nil.
  286. func ToTimeSlice(vs []*time.Time) []time.Time {
  287. return ptr.ToTimeSlice(vs)
  288. }
  289. // ToTimeMap returns a map of time.Time values, that are
  290. // dereferenced if the passed in pointer was not nil. The time.Time
  291. // zero value is used if the pointer was nil.
  292. func ToTimeMap(vs map[string]*time.Time) map[string]time.Time {
  293. return ptr.ToTimeMap(vs)
  294. }
  295. // ToDuration returns time.Duration value dereferenced if the passed
  296. // in pointer was not nil. Returns a time.Duration zero value if the
  297. // pointer was nil.
  298. func ToDuration(p *time.Duration) (v time.Duration) {
  299. return ptr.ToDuration(p)
  300. }
  301. // ToDurationSlice returns a slice of time.Duration values, that are
  302. // dereferenced if the passed in pointer was not nil. Returns a time.Duration
  303. // zero value if the pointer was nil.
  304. func ToDurationSlice(vs []*time.Duration) []time.Duration {
  305. return ptr.ToDurationSlice(vs)
  306. }
  307. // ToDurationMap returns a map of time.Duration values, that are
  308. // dereferenced if the passed in pointer was not nil. The time.Duration
  309. // zero value is used if the pointer was nil.
  310. func ToDurationMap(vs map[string]*time.Duration) map[string]time.Duration {
  311. return ptr.ToDurationMap(vs)
  312. }