vsphere-automation-content 0.4.5 → 0.4.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (348) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +20 -0
  3. data/lib/vsphere-automation-content/version.rb +1 -1
  4. metadata +8 -518
  5. data/Gemfile +0 -14
  6. data/Gemfile.lock +0 -86
  7. data/README.md +0 -276
  8. data/Rakefile +0 -18
  9. data/docs/ConfigurationApi.md +0 -105
  10. data/docs/ContentConfigurationModel.md +0 -11
  11. data/docs/ContentConfigurationResult.md +0 -8
  12. data/docs/ContentConfigurationUpdate.md +0 -8
  13. data/docs/ContentLibraryFind.md +0 -8
  14. data/docs/ContentLibraryFindResult.md +0 -8
  15. data/docs/ContentLibraryFindSpec.md +0 -9
  16. data/docs/ContentLibraryItemCopy.md +0 -9
  17. data/docs/ContentLibraryItemCopyResult.md +0 -8
  18. data/docs/ContentLibraryItemCreate.md +0 -9
  19. data/docs/ContentLibraryItemCreateResult.md +0 -8
  20. data/docs/ContentLibraryItemDestinationSpec.md +0 -8
  21. data/docs/ContentLibraryItemDownloadSessionCreate.md +0 -9
  22. data/docs/ContentLibraryItemDownloadSessionCreateResult.md +0 -8
  23. data/docs/ContentLibraryItemDownloadSessionFail.md +0 -8
  24. data/docs/ContentLibraryItemDownloadSessionKeepAlive.md +0 -8
  25. data/docs/ContentLibraryItemDownloadSessionListResult.md +0 -8
  26. data/docs/ContentLibraryItemDownloadSessionModel.md +0 -14
  27. data/docs/ContentLibraryItemDownloadSessionModelState.md +0 -7
  28. data/docs/ContentLibraryItemDownloadSessionResult.md +0 -8
  29. data/docs/ContentLibraryItemDownloadsessionFileEndpointType.md +0 -7
  30. data/docs/ContentLibraryItemDownloadsessionFileGet.md +0 -8
  31. data/docs/ContentLibraryItemDownloadsessionFileInfo.md +0 -14
  32. data/docs/ContentLibraryItemDownloadsessionFileListResult.md +0 -8
  33. data/docs/ContentLibraryItemDownloadsessionFilePrepare.md +0 -9
  34. data/docs/ContentLibraryItemDownloadsessionFilePrepareResult.md +0 -8
  35. data/docs/ContentLibraryItemDownloadsessionFilePrepareStatus.md +0 -7
  36. data/docs/ContentLibraryItemDownloadsessionFileResult.md +0 -8
  37. data/docs/ContentLibraryItemFileChecksumAlgorithm.md +0 -7
  38. data/docs/ContentLibraryItemFileChecksumInfo.md +0 -9
  39. data/docs/ContentLibraryItemFileGet.md +0 -8
  40. data/docs/ContentLibraryItemFileInfo.md +0 -12
  41. data/docs/ContentLibraryItemFileListResult.md +0 -8
  42. data/docs/ContentLibraryItemFileResult.md +0 -8
  43. data/docs/ContentLibraryItemFind.md +0 -8
  44. data/docs/ContentLibraryItemFindResult.md +0 -8
  45. data/docs/ContentLibraryItemFindSpec.md +0 -12
  46. data/docs/ContentLibraryItemListResult.md +0 -8
  47. data/docs/ContentLibraryItemModel.md +0 -21
  48. data/docs/ContentLibraryItemPublish.md +0 -9
  49. data/docs/ContentLibraryItemResult.md +0 -8
  50. data/docs/ContentLibraryItemStorageGet.md +0 -8
  51. data/docs/ContentLibraryItemStorageInfo.md +0 -14
  52. data/docs/ContentLibraryItemStorageListResult.md +0 -8
  53. data/docs/ContentLibraryItemStorageResult.md +0 -8
  54. data/docs/ContentLibraryItemTransferEndpoint.md +0 -9
  55. data/docs/ContentLibraryItemTransferStatus.md +0 -7
  56. data/docs/ContentLibraryItemUpdate.md +0 -8
  57. data/docs/ContentLibraryItemUpdateSessionCreate.md +0 -9
  58. data/docs/ContentLibraryItemUpdateSessionCreateResult.md +0 -8
  59. data/docs/ContentLibraryItemUpdateSessionFail.md +0 -8
  60. data/docs/ContentLibraryItemUpdateSessionKeepAlive.md +0 -8
  61. data/docs/ContentLibraryItemUpdateSessionListResult.md +0 -8
  62. data/docs/ContentLibraryItemUpdateSessionModel.md +0 -16
  63. data/docs/ContentLibraryItemUpdateSessionModelState.md +0 -7
  64. data/docs/ContentLibraryItemUpdateSessionResult.md +0 -8
  65. data/docs/ContentLibraryItemUpdateSessionUpdate.md +0 -8
  66. data/docs/ContentLibraryItemUpdatesessionCertificateInfo.md +0 -11
  67. data/docs/ContentLibraryItemUpdatesessionFileAdd.md +0 -8
  68. data/docs/ContentLibraryItemUpdatesessionFileAddResult.md +0 -8
  69. data/docs/ContentLibraryItemUpdatesessionFileAddSpec.md +0 -12
  70. data/docs/ContentLibraryItemUpdatesessionFileGet.md +0 -8
  71. data/docs/ContentLibraryItemUpdatesessionFileInfo.md +0 -17
  72. data/docs/ContentLibraryItemUpdatesessionFileListResult.md +0 -8
  73. data/docs/ContentLibraryItemUpdatesessionFileRemove.md +0 -8
  74. data/docs/ContentLibraryItemUpdatesessionFileResult.md +0 -8
  75. data/docs/ContentLibraryItemUpdatesessionFileSourceType.md +0 -7
  76. data/docs/ContentLibraryItemUpdatesessionFileValidateResult.md +0 -8
  77. data/docs/ContentLibraryItemUpdatesessionFileValidationError.md +0 -9
  78. data/docs/ContentLibraryItemUpdatesessionFileValidationResult.md +0 -10
  79. data/docs/ContentLibraryItemUpdatesessionPreviewInfo.md +0 -10
  80. data/docs/ContentLibraryItemUpdatesessionPreviewInfoState.md +0 -7
  81. data/docs/ContentLibraryItemUpdatesessionPreviewWarningInfo.md +0 -10
  82. data/docs/ContentLibraryItemUpdatesessionWarningBehavior.md +0 -9
  83. data/docs/ContentLibraryItemUpdatesessionWarningType.md +0 -7
  84. data/docs/ContentLibraryListResult.md +0 -8
  85. data/docs/ContentLibraryModel.md +0 -20
  86. data/docs/ContentLibraryModelLibraryType.md +0 -7
  87. data/docs/ContentLibraryOptimizationInfo.md +0 -8
  88. data/docs/ContentLibraryPublishInfo.md +0 -14
  89. data/docs/ContentLibraryPublishInfoAuthenticationMethod.md +0 -7
  90. data/docs/ContentLibraryResult.md +0 -8
  91. data/docs/ContentLibrarySourceInfo.md +0 -9
  92. data/docs/ContentLibraryStorageBacking.md +0 -10
  93. data/docs/ContentLibraryStorageBackingType.md +0 -7
  94. data/docs/ContentLibrarySubscribedItemSync.md +0 -8
  95. data/docs/ContentLibrarySubscriptionInfo.md +0 -15
  96. data/docs/ContentLibrarySubscriptionInfoAuthenticationMethod.md +0 -7
  97. data/docs/ContentLibrarySubscriptionsCreate.md +0 -9
  98. data/docs/ContentLibrarySubscriptionsCreateResult.md +0 -8
  99. data/docs/ContentLibrarySubscriptionsCreateSpec.md +0 -8
  100. data/docs/ContentLibrarySubscriptionsCreateSpecNewSubscribedLibrary.md +0 -12
  101. data/docs/ContentLibrarySubscriptionsCreateSpecPlacement.md +0 -12
  102. data/docs/ContentLibrarySubscriptionsCreateSpecSubscribedLibrary.md +0 -13
  103. data/docs/ContentLibrarySubscriptionsCreateSpecSubscribedLibraryTarget.md +0 -7
  104. data/docs/ContentLibrarySubscriptionsCreateSpecVcenter.md +0 -9
  105. data/docs/ContentLibrarySubscriptionsDelete.md +0 -8
  106. data/docs/ContentLibrarySubscriptionsGet.md +0 -8
  107. data/docs/ContentLibrarySubscriptionsInfo.md +0 -12
  108. data/docs/ContentLibrarySubscriptionsListResult.md +0 -8
  109. data/docs/ContentLibrarySubscriptionsLocation.md +0 -7
  110. data/docs/ContentLibrarySubscriptionsPlacementInfo.md +0 -12
  111. data/docs/ContentLibrarySubscriptionsResult.md +0 -8
  112. data/docs/ContentLibrarySubscriptionsSummary.md +0 -11
  113. data/docs/ContentLibrarySubscriptionsUpdate.md +0 -9
  114. data/docs/ContentLibrarySubscriptionsUpdateSpec.md +0 -9
  115. data/docs/ContentLibrarySubscriptionsUpdateSpecPlacement.md +0 -12
  116. data/docs/ContentLibrarySubscriptionsUpdateSpecVcenter.md +0 -9
  117. data/docs/ContentLibrarySubscriptionsVcenterInfo.md +0 -10
  118. data/docs/ContentLibraryUpdate.md +0 -8
  119. data/docs/ContentLocalLibraryCreate.md +0 -9
  120. data/docs/ContentLocalLibraryCreateResult.md +0 -8
  121. data/docs/ContentLocalLibraryDestinationSpec.md +0 -8
  122. data/docs/ContentLocalLibraryListResult.md +0 -8
  123. data/docs/ContentLocalLibraryPublish.md +0 -8
  124. data/docs/ContentLocalLibraryResult.md +0 -8
  125. data/docs/ContentLocalLibraryUpdate.md +0 -8
  126. data/docs/ContentSubscribedLibraryCreate.md +0 -9
  127. data/docs/ContentSubscribedLibraryCreateResult.md +0 -8
  128. data/docs/ContentSubscribedLibraryListResult.md +0 -8
  129. data/docs/ContentSubscribedLibraryProbe.md +0 -8
  130. data/docs/ContentSubscribedLibraryProbeResult.md +0 -10
  131. data/docs/ContentSubscribedLibraryProbeResultStatus.md +0 -7
  132. data/docs/ContentSubscribedLibraryResult.md +0 -8
  133. data/docs/ContentSubscribedLibraryUpdate.md +0 -8
  134. data/docs/LibraryApi.md +0 -209
  135. data/docs/LibraryItemApi.md +0 -419
  136. data/docs/LibraryItemDownloadSessionApi.md +0 -369
  137. data/docs/LibraryItemDownloadsessionFileApi.md +0 -165
  138. data/docs/LibraryItemFileApi.md +0 -112
  139. data/docs/LibraryItemStorageApi.md +0 -112
  140. data/docs/LibraryItemUpdateSessionApi.md +0 -471
  141. data/docs/LibraryItemUpdatesessionFileApi.md +0 -268
  142. data/docs/LibrarySubscribedItemApi.md +0 -110
  143. data/docs/LibrarySubscriptionsApi.md +0 -269
  144. data/docs/LocalLibraryApi.md +0 -313
  145. data/docs/SubscribedLibraryApi.md +0 -410
  146. data/docs/VapiStdErrorsAlreadyExists.md +0 -9
  147. data/docs/VapiStdErrorsAlreadyExistsError.md +0 -9
  148. data/docs/VapiStdErrorsConcurrentChange.md +0 -9
  149. data/docs/VapiStdErrorsConcurrentChangeError.md +0 -9
  150. data/docs/VapiStdErrorsError.md +0 -9
  151. data/docs/VapiStdErrorsErrorError.md +0 -9
  152. data/docs/VapiStdErrorsInvalidArgument.md +0 -9
  153. data/docs/VapiStdErrorsInvalidArgumentError.md +0 -9
  154. data/docs/VapiStdErrorsInvalidElementConfiguration.md +0 -9
  155. data/docs/VapiStdErrorsInvalidElementConfigurationError.md +0 -9
  156. data/docs/VapiStdErrorsInvalidElementType.md +0 -9
  157. data/docs/VapiStdErrorsInvalidElementTypeError.md +0 -9
  158. data/docs/VapiStdErrorsNotAllowedInCurrentState.md +0 -9
  159. data/docs/VapiStdErrorsNotAllowedInCurrentStateError.md +0 -9
  160. data/docs/VapiStdErrorsNotFound.md +0 -9
  161. data/docs/VapiStdErrorsNotFoundError.md +0 -9
  162. data/docs/VapiStdErrorsResourceBusy.md +0 -9
  163. data/docs/VapiStdErrorsResourceBusyError.md +0 -9
  164. data/docs/VapiStdErrorsResourceInaccessible.md +0 -9
  165. data/docs/VapiStdErrorsResourceInaccessibleError.md +0 -9
  166. data/docs/VapiStdErrorsUnauthenticated.md +0 -9
  167. data/docs/VapiStdErrorsUnauthenticatedError.md +0 -9
  168. data/docs/VapiStdErrorsUnauthorized.md +0 -9
  169. data/docs/VapiStdErrorsUnauthorizedError.md +0 -9
  170. data/docs/VapiStdErrorsUnsupported.md +0 -9
  171. data/docs/VapiStdErrorsUnsupportedError.md +0 -9
  172. data/docs/VapiStdLocalizableMessage.md +0 -10
  173. data/git_push.sh +0 -55
  174. data/lib/vsphere-automation-content/api_client.rb +0 -260
  175. data/lib/vsphere-automation-content/api_error.rb +0 -34
  176. data/lib/vsphere-automation-content/configuration.rb +0 -212
  177. data/pkg/vsphere-automation-content-0.4.1.gem +0 -0
  178. data/pkg/vsphere-automation-content-0.4.2.gem +0 -0
  179. data/pkg/vsphere-automation-content-0.4.3.gem +0 -0
  180. data/pkg/vsphere-automation-content-0.4.4.gem +0 -0
  181. data/spec/api/configuration_api_spec.rb +0 -52
  182. data/spec/api/library_api_spec.rb +0 -75
  183. data/spec/api/library_item_api_spec.rb +0 -122
  184. data/spec/api/library_item_download_session_api_spec.rb +0 -110
  185. data/spec/api/library_item_downloadsession_file_api_spec.rb +0 -66
  186. data/spec/api/library_item_file_api_spec.rb +0 -54
  187. data/spec/api/library_item_storage_api_spec.rb +0 -54
  188. data/spec/api/library_item_update_session_api_spec.rb +0 -133
  189. data/spec/api/library_item_updatesession_file_api_spec.rb +0 -89
  190. data/spec/api/library_subscribed_item_api_spec.rb +0 -54
  191. data/spec/api/library_subscriptions_api_spec.rb +0 -90
  192. data/spec/api/local_library_api_spec.rb +0 -98
  193. data/spec/api/subscribed_library_api_spec.rb +0 -119
  194. data/spec/api_client_spec.rb +0 -248
  195. data/spec/configuration_spec.rb +0 -38
  196. data/spec/models/content_configuration_model_spec.rb +0 -55
  197. data/spec/models/content_configuration_result_spec.rb +0 -37
  198. data/spec/models/content_configuration_update_spec.rb +0 -37
  199. data/spec/models/content_library_find_result_spec.rb +0 -37
  200. data/spec/models/content_library_find_spec.rb +0 -37
  201. data/spec/models/content_library_find_spec_spec.rb +0 -43
  202. data/spec/models/content_library_item_copy_result_spec.rb +0 -37
  203. data/spec/models/content_library_item_copy_spec.rb +0 -43
  204. data/spec/models/content_library_item_create_result_spec.rb +0 -37
  205. data/spec/models/content_library_item_create_spec.rb +0 -43
  206. data/spec/models/content_library_item_destination_spec_spec.rb +0 -37
  207. data/spec/models/content_library_item_download_session_create_result_spec.rb +0 -37
  208. data/spec/models/content_library_item_download_session_create_spec.rb +0 -43
  209. data/spec/models/content_library_item_download_session_fail_spec.rb +0 -37
  210. data/spec/models/content_library_item_download_session_keep_alive_spec.rb +0 -37
  211. data/spec/models/content_library_item_download_session_list_result_spec.rb +0 -37
  212. data/spec/models/content_library_item_download_session_model_spec.rb +0 -73
  213. data/spec/models/content_library_item_download_session_model_state_spec.rb +0 -31
  214. data/spec/models/content_library_item_download_session_result_spec.rb +0 -37
  215. data/spec/models/content_library_item_downloadsession_file_endpoint_type_spec.rb +0 -31
  216. data/spec/models/content_library_item_downloadsession_file_get_spec.rb +0 -37
  217. data/spec/models/content_library_item_downloadsession_file_info_spec.rb +0 -73
  218. data/spec/models/content_library_item_downloadsession_file_list_result_spec.rb +0 -37
  219. data/spec/models/content_library_item_downloadsession_file_prepare_result_spec.rb +0 -37
  220. data/spec/models/content_library_item_downloadsession_file_prepare_spec.rb +0 -43
  221. data/spec/models/content_library_item_downloadsession_file_prepare_status_spec.rb +0 -31
  222. data/spec/models/content_library_item_downloadsession_file_result_spec.rb +0 -37
  223. data/spec/models/content_library_item_file_checksum_algorithm_spec.rb +0 -31
  224. data/spec/models/content_library_item_file_checksum_info_spec.rb +0 -43
  225. data/spec/models/content_library_item_file_get_spec.rb +0 -37
  226. data/spec/models/content_library_item_file_info_spec.rb +0 -61
  227. data/spec/models/content_library_item_file_list_result_spec.rb +0 -37
  228. data/spec/models/content_library_item_file_result_spec.rb +0 -37
  229. data/spec/models/content_library_item_find_result_spec.rb +0 -37
  230. data/spec/models/content_library_item_find_spec.rb +0 -37
  231. data/spec/models/content_library_item_find_spec_spec.rb +0 -61
  232. data/spec/models/content_library_item_list_result_spec.rb +0 -37
  233. data/spec/models/content_library_item_model_spec.rb +0 -115
  234. data/spec/models/content_library_item_publish_spec.rb +0 -43
  235. data/spec/models/content_library_item_result_spec.rb +0 -37
  236. data/spec/models/content_library_item_storage_get_spec.rb +0 -37
  237. data/spec/models/content_library_item_storage_info_spec.rb +0 -73
  238. data/spec/models/content_library_item_storage_list_result_spec.rb +0 -37
  239. data/spec/models/content_library_item_storage_result_spec.rb +0 -37
  240. data/spec/models/content_library_item_transfer_endpoint_spec.rb +0 -43
  241. data/spec/models/content_library_item_transfer_status_spec.rb +0 -31
  242. data/spec/models/content_library_item_update_session_create_result_spec.rb +0 -37
  243. data/spec/models/content_library_item_update_session_create_spec.rb +0 -43
  244. data/spec/models/content_library_item_update_session_fail_spec.rb +0 -37
  245. data/spec/models/content_library_item_update_session_keep_alive_spec.rb +0 -37
  246. data/spec/models/content_library_item_update_session_list_result_spec.rb +0 -37
  247. data/spec/models/content_library_item_update_session_model_spec.rb +0 -85
  248. data/spec/models/content_library_item_update_session_model_state_spec.rb +0 -31
  249. data/spec/models/content_library_item_update_session_result_spec.rb +0 -37
  250. data/spec/models/content_library_item_update_session_update_spec.rb +0 -37
  251. data/spec/models/content_library_item_update_spec.rb +0 -37
  252. data/spec/models/content_library_item_updatesession_certificate_info_spec.rb +0 -55
  253. data/spec/models/content_library_item_updatesession_file_add_result_spec.rb +0 -37
  254. data/spec/models/content_library_item_updatesession_file_add_spec.rb +0 -37
  255. data/spec/models/content_library_item_updatesession_file_add_spec_spec.rb +0 -61
  256. data/spec/models/content_library_item_updatesession_file_get_spec.rb +0 -37
  257. data/spec/models/content_library_item_updatesession_file_info_spec.rb +0 -91
  258. data/spec/models/content_library_item_updatesession_file_list_result_spec.rb +0 -37
  259. data/spec/models/content_library_item_updatesession_file_remove_spec.rb +0 -37
  260. data/spec/models/content_library_item_updatesession_file_result_spec.rb +0 -37
  261. data/spec/models/content_library_item_updatesession_file_source_type_spec.rb +0 -31
  262. data/spec/models/content_library_item_updatesession_file_validate_result_spec.rb +0 -37
  263. data/spec/models/content_library_item_updatesession_file_validation_error_spec.rb +0 -43
  264. data/spec/models/content_library_item_updatesession_file_validation_result_spec.rb +0 -49
  265. data/spec/models/content_library_item_updatesession_preview_info_spec.rb +0 -49
  266. data/spec/models/content_library_item_updatesession_preview_info_state_spec.rb +0 -31
  267. data/spec/models/content_library_item_updatesession_preview_warning_info_spec.rb +0 -49
  268. data/spec/models/content_library_item_updatesession_warning_behavior_spec.rb +0 -43
  269. data/spec/models/content_library_item_updatesession_warning_type_spec.rb +0 -31
  270. data/spec/models/content_library_list_result_spec.rb +0 -37
  271. data/spec/models/content_library_model_library_type_spec.rb +0 -31
  272. data/spec/models/content_library_model_spec.rb +0 -109
  273. data/spec/models/content_library_optimization_info_spec.rb +0 -37
  274. data/spec/models/content_library_publish_info_authentication_method_spec.rb +0 -31
  275. data/spec/models/content_library_publish_info_spec.rb +0 -73
  276. data/spec/models/content_library_result_spec.rb +0 -37
  277. data/spec/models/content_library_source_info_spec.rb +0 -43
  278. data/spec/models/content_library_storage_backing_spec.rb +0 -49
  279. data/spec/models/content_library_storage_backing_type_spec.rb +0 -31
  280. data/spec/models/content_library_subscribed_item_sync_spec.rb +0 -37
  281. data/spec/models/content_library_subscription_info_authentication_method_spec.rb +0 -31
  282. data/spec/models/content_library_subscription_info_spec.rb +0 -79
  283. data/spec/models/content_library_subscriptions_create_result_spec.rb +0 -37
  284. data/spec/models/content_library_subscriptions_create_spec.rb +0 -43
  285. data/spec/models/content_library_subscriptions_create_spec_new_subscribed_library_spec.rb +0 -61
  286. data/spec/models/content_library_subscriptions_create_spec_placement_spec.rb +0 -61
  287. data/spec/models/content_library_subscriptions_create_spec_spec.rb +0 -37
  288. data/spec/models/content_library_subscriptions_create_spec_subscribed_library_spec.rb +0 -67
  289. data/spec/models/content_library_subscriptions_create_spec_subscribed_library_target_spec.rb +0 -31
  290. data/spec/models/content_library_subscriptions_create_spec_vcenter_spec.rb +0 -43
  291. data/spec/models/content_library_subscriptions_delete_spec.rb +0 -37
  292. data/spec/models/content_library_subscriptions_get_spec.rb +0 -37
  293. data/spec/models/content_library_subscriptions_info_spec.rb +0 -61
  294. data/spec/models/content_library_subscriptions_list_result_spec.rb +0 -37
  295. data/spec/models/content_library_subscriptions_location_spec.rb +0 -31
  296. data/spec/models/content_library_subscriptions_placement_info_spec.rb +0 -61
  297. data/spec/models/content_library_subscriptions_result_spec.rb +0 -37
  298. data/spec/models/content_library_subscriptions_summary_spec.rb +0 -55
  299. data/spec/models/content_library_subscriptions_update_spec.rb +0 -43
  300. data/spec/models/content_library_subscriptions_update_spec_placement_spec.rb +0 -61
  301. data/spec/models/content_library_subscriptions_update_spec_spec.rb +0 -43
  302. data/spec/models/content_library_subscriptions_update_spec_vcenter_spec.rb +0 -43
  303. data/spec/models/content_library_subscriptions_vcenter_info_spec.rb +0 -49
  304. data/spec/models/content_library_update_spec.rb +0 -37
  305. data/spec/models/content_local_library_create_result_spec.rb +0 -37
  306. data/spec/models/content_local_library_create_spec.rb +0 -43
  307. data/spec/models/content_local_library_destination_spec_spec.rb +0 -37
  308. data/spec/models/content_local_library_list_result_spec.rb +0 -37
  309. data/spec/models/content_local_library_publish_spec.rb +0 -37
  310. data/spec/models/content_local_library_result_spec.rb +0 -37
  311. data/spec/models/content_local_library_update_spec.rb +0 -37
  312. data/spec/models/content_subscribed_library_create_result_spec.rb +0 -37
  313. data/spec/models/content_subscribed_library_create_spec.rb +0 -43
  314. data/spec/models/content_subscribed_library_list_result_spec.rb +0 -37
  315. data/spec/models/content_subscribed_library_probe_result_spec.rb +0 -49
  316. data/spec/models/content_subscribed_library_probe_result_status_spec.rb +0 -31
  317. data/spec/models/content_subscribed_library_probe_spec.rb +0 -37
  318. data/spec/models/content_subscribed_library_result_spec.rb +0 -37
  319. data/spec/models/content_subscribed_library_update_spec.rb +0 -37
  320. data/spec/models/vapi_std_errors_already_exists_error_spec.rb +0 -43
  321. data/spec/models/vapi_std_errors_already_exists_spec.rb +0 -43
  322. data/spec/models/vapi_std_errors_concurrent_change_error_spec.rb +0 -43
  323. data/spec/models/vapi_std_errors_concurrent_change_spec.rb +0 -43
  324. data/spec/models/vapi_std_errors_error_error_spec.rb +0 -43
  325. data/spec/models/vapi_std_errors_error_spec.rb +0 -43
  326. data/spec/models/vapi_std_errors_invalid_argument_error_spec.rb +0 -43
  327. data/spec/models/vapi_std_errors_invalid_argument_spec.rb +0 -43
  328. data/spec/models/vapi_std_errors_invalid_element_configuration_error_spec.rb +0 -43
  329. data/spec/models/vapi_std_errors_invalid_element_configuration_spec.rb +0 -43
  330. data/spec/models/vapi_std_errors_invalid_element_type_error_spec.rb +0 -43
  331. data/spec/models/vapi_std_errors_invalid_element_type_spec.rb +0 -43
  332. data/spec/models/vapi_std_errors_not_allowed_in_current_state_error_spec.rb +0 -43
  333. data/spec/models/vapi_std_errors_not_allowed_in_current_state_spec.rb +0 -43
  334. data/spec/models/vapi_std_errors_not_found_error_spec.rb +0 -43
  335. data/spec/models/vapi_std_errors_not_found_spec.rb +0 -43
  336. data/spec/models/vapi_std_errors_resource_busy_error_spec.rb +0 -43
  337. data/spec/models/vapi_std_errors_resource_busy_spec.rb +0 -43
  338. data/spec/models/vapi_std_errors_resource_inaccessible_error_spec.rb +0 -43
  339. data/spec/models/vapi_std_errors_resource_inaccessible_spec.rb +0 -43
  340. data/spec/models/vapi_std_errors_unauthenticated_error_spec.rb +0 -43
  341. data/spec/models/vapi_std_errors_unauthenticated_spec.rb +0 -43
  342. data/spec/models/vapi_std_errors_unauthorized_error_spec.rb +0 -43
  343. data/spec/models/vapi_std_errors_unauthorized_spec.rb +0 -43
  344. data/spec/models/vapi_std_errors_unsupported_error_spec.rb +0 -43
  345. data/spec/models/vapi_std_errors_unsupported_spec.rb +0 -43
  346. data/spec/models/vapi_std_localizable_message_spec.rb +0 -49
  347. data/spec/spec_helper.rb +0 -110
  348. data/vsphere-automation-content.gemspec +0 -40
@@ -1,54 +0,0 @@
1
- # Copyright (c) 2018-2019 VMware, Inc. All Rights Reserved.
2
- # SPDX-License-Identifier: MIT
3
-
4
- # DO NOT MODIFY. THIS CODE IS GENERATED. CHANGES WILL BE OVERWRITTEN.
5
-
6
- # content - VMware vSphere® Content Library empowers vSphere Admins to effectively manage VM templates, vApps, ISO images and scripts with ease.
7
-
8
-
9
- require 'spec_helper'
10
- require 'json'
11
-
12
- # Unit tests for VSphereAutomation::Content::LibrarySubscribedItemApi
13
- # Automatically generated by openapi-generator (https://openapi-generator.tech)
14
- # Please update as you see appropriate
15
- describe 'LibrarySubscribedItemApi' do
16
- before do
17
- # run before each test
18
- @instance = VSphereAutomation::Content::LibrarySubscribedItemApi.new
19
- end
20
-
21
- after do
22
- # run after each test
23
- end
24
-
25
- describe 'test an instance of LibrarySubscribedItemApi' do
26
- it 'should create an instance of LibrarySubscribedItemApi' do
27
- expect(@instance).to be_instance_of(VSphereAutomation::Content::LibrarySubscribedItemApi)
28
- end
29
- end
30
-
31
- # unit tests for evict
32
- # Evicts the cached content of a library item in a subscribed library. <p> This {@term operation} allows the cached content of a library item to be removed to free up storage capacity. This {@term operation} will only work when a library item is synchronized on-demand. When a library is not synchronized on-demand, it always attempts to keep its cache up-to-date with the published source. Evicting the library item will set {@link ItemModel#cached} to false.
33
- # @param library_item_id Identifier of the library item whose content should be evicted.
34
- # @param [Hash] opts the optional parameters
35
- # @return [nil]
36
- describe 'evict test' do
37
- it 'should work' do
38
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
39
- end
40
- end
41
-
42
- # unit tests for sync
43
- # Forces the synchronization of an individual library item in a subscribed library. <p> Synchronizing an individual item will update that item's metadata from the remote source. If the source library item on the remote library has been deleted, this {@term operation} will delete the library item from the subscribed library as well. <p> The default behavior of the synchronization is determined by the {@link SubscriptionInfo} of the library which owns the library item. <ul> <li>If {@link SubscriptionInfo#onDemand} is true, then the file content is not synchronized by default. In this case, only the library item metadata is synchronized. The file content may still be forcefully synchronized by passing true for the {@param.name forceSyncContent} {@term parameter}.</li> <li>If {@link SubscriptionInfo#onDemand} is false, then this call will always synchronize the file content. The {@param.name forceSyncContent} {@term parameter} is ignored when the subscription is not on-demand.</li> </ul> When the file content has been synchronized, the {@link ItemModel#cached} {@term field} will be true. <p> This {@term operation} will return immediately and create an asynchronous task to perform the synchronization.
44
- # @param library_item_id Identifier of the library item to synchronize.
45
- # @param request_body
46
- # @param [Hash] opts the optional parameters
47
- # @return [nil]
48
- describe 'sync test' do
49
- it 'should work' do
50
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
51
- end
52
- end
53
-
54
- end
@@ -1,90 +0,0 @@
1
- # Copyright (c) 2018-2019 VMware, Inc. All Rights Reserved.
2
- # SPDX-License-Identifier: MIT
3
-
4
- # DO NOT MODIFY. THIS CODE IS GENERATED. CHANGES WILL BE OVERWRITTEN.
5
-
6
- # content - VMware vSphere® Content Library empowers vSphere Admins to effectively manage VM templates, vApps, ISO images and scripts with ease.
7
-
8
-
9
- require 'spec_helper'
10
- require 'json'
11
-
12
- # Unit tests for VSphereAutomation::Content::LibrarySubscriptionsApi
13
- # Automatically generated by openapi-generator (https://openapi-generator.tech)
14
- # Please update as you see appropriate
15
- describe 'LibrarySubscriptionsApi' do
16
- before do
17
- # run before each test
18
- @instance = VSphereAutomation::Content::LibrarySubscriptionsApi.new
19
- end
20
-
21
- after do
22
- # run after each test
23
- end
24
-
25
- describe 'test an instance of LibrarySubscriptionsApi' do
26
- it 'should create an instance of LibrarySubscriptionsApi' do
27
- expect(@instance).to be_instance_of(VSphereAutomation::Content::LibrarySubscriptionsApi)
28
- end
29
- end
30
-
31
- # unit tests for create
32
- # Creates a subscription of the published library.
33
- # @param library Identifier of the published library.
34
- # @param request_body
35
- # @param [Hash] opts the optional parameters
36
- # @return [ContentLibrarySubscriptionsCreateResult]
37
- describe 'create test' do
38
- it 'should work' do
39
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
40
- end
41
- end
42
-
43
- # unit tests for delete
44
- # Deletes the specified subscription of the published library. The subscribed library associated with the subscription will not be deleted.
45
- # @param library Identifier of the published library.
46
- # @param request_body
47
- # @param [Hash] opts the optional parameters
48
- # @return [nil]
49
- describe 'delete test' do
50
- it 'should work' do
51
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
52
- end
53
- end
54
-
55
- # unit tests for get
56
- # Returns information about the specified subscription of the published library.
57
- # @param library Identifier of the published library.
58
- # @param request_body
59
- # @param [Hash] opts the optional parameters
60
- # @return [ContentLibrarySubscriptionsResult]
61
- describe 'get test' do
62
- it 'should work' do
63
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
64
- end
65
- end
66
-
67
- # unit tests for list
68
- # Lists the subscriptions of the published library.
69
- # @param library Identifier of the published library.
70
- # @param [Hash] opts the optional parameters
71
- # @return [ContentLibrarySubscriptionsListResult]
72
- describe 'list test' do
73
- it 'should work' do
74
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
75
- end
76
- end
77
-
78
- # unit tests for update
79
- # Updates the specified subscription of the published library. <p> This is an incremental update to the subscription. Except for the {@link UpdateSpecPlacement} {@term structure}, {@term fields} that are {@term unset} in the update specification will be left unchanged. If {@param.name spec#subscribedLibraryPlacement} is specified, all {@term fields} of the current subscribed library placement will be replaced by this placement.
80
- # @param library Identifier of the published library.
81
- # @param request_body
82
- # @param [Hash] opts the optional parameters
83
- # @return [nil]
84
- describe 'update test' do
85
- it 'should work' do
86
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
87
- end
88
- end
89
-
90
- end
@@ -1,98 +0,0 @@
1
- # Copyright (c) 2018-2019 VMware, Inc. All Rights Reserved.
2
- # SPDX-License-Identifier: MIT
3
-
4
- # DO NOT MODIFY. THIS CODE IS GENERATED. CHANGES WILL BE OVERWRITTEN.
5
-
6
- # content - VMware vSphere® Content Library empowers vSphere Admins to effectively manage VM templates, vApps, ISO images and scripts with ease.
7
-
8
-
9
- require 'spec_helper'
10
- require 'json'
11
-
12
- # Unit tests for VSphereAutomation::Content::LocalLibraryApi
13
- # Automatically generated by openapi-generator (https://openapi-generator.tech)
14
- # Please update as you see appropriate
15
- describe 'LocalLibraryApi' do
16
- before do
17
- # run before each test
18
- @instance = VSphereAutomation::Content::LocalLibraryApi.new
19
- end
20
-
21
- after do
22
- # run after each test
23
- end
24
-
25
- describe 'test an instance of LocalLibraryApi' do
26
- it 'should create an instance of LocalLibraryApi' do
27
- expect(@instance).to be_instance_of(VSphereAutomation::Content::LocalLibraryApi)
28
- end
29
- end
30
-
31
- # unit tests for create
32
- # Creates a new local library.
33
- # @param request_body
34
- # @param [Hash] opts the optional parameters
35
- # @return [ContentLocalLibraryCreateResult]
36
- describe 'create test' do
37
- it 'should work' do
38
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
39
- end
40
- end
41
-
42
- # unit tests for delete
43
- # Deletes the specified local library. <p> Deleting a local library will remove the entry immediately and begin an asynchronous task to remove all cached content for the library. If the asynchronous task fails, file content may remain on the storage backing. This content will require manual removal.
44
- # @param library_id Identifier of the local library to delete.
45
- # @param [Hash] opts the optional parameters
46
- # @return [nil]
47
- describe 'delete test' do
48
- it 'should work' do
49
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
- end
51
- end
52
-
53
- # unit tests for get
54
- # Returns a given local library.
55
- # @param library_id Identifier of the local library to return.
56
- # @param [Hash] opts the optional parameters
57
- # @return [ContentLocalLibraryResult]
58
- describe 'get test' do
59
- it 'should work' do
60
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
61
- end
62
- end
63
-
64
- # unit tests for list
65
- # Returns the identifiers of all local libraries in the Content Library.
66
- # @param [Hash] opts the optional parameters
67
- # @return [ContentLocalLibraryListResult]
68
- describe 'list test' do
69
- it 'should work' do
70
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
71
- end
72
- end
73
-
74
- # unit tests for publish
75
- # Publishes the library to specified subscriptions. If no subscriptions are specified, then publishes the library to all its subscriptions.
76
- # @param library_id Identifier of the published library.
77
- # @param [Hash] opts the optional parameters
78
- # @option opts [ContentLocalLibraryPublish] :request_body
79
- # @return [nil]
80
- describe 'publish test' do
81
- it 'should work' do
82
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
83
- end
84
- end
85
-
86
- # unit tests for update
87
- # Updates the properties of a local library. <p> This is an incremental update to the local library. {@term Fields} that are {@term unset} in the update specification will be left unchanged.
88
- # @param library_id Identifier of the local library to update.
89
- # @param request_body
90
- # @param [Hash] opts the optional parameters
91
- # @return [nil]
92
- describe 'update test' do
93
- it 'should work' do
94
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
95
- end
96
- end
97
-
98
- end
@@ -1,119 +0,0 @@
1
- # Copyright (c) 2018-2019 VMware, Inc. All Rights Reserved.
2
- # SPDX-License-Identifier: MIT
3
-
4
- # DO NOT MODIFY. THIS CODE IS GENERATED. CHANGES WILL BE OVERWRITTEN.
5
-
6
- # content - VMware vSphere® Content Library empowers vSphere Admins to effectively manage VM templates, vApps, ISO images and scripts with ease.
7
-
8
-
9
- require 'spec_helper'
10
- require 'json'
11
-
12
- # Unit tests for VSphereAutomation::Content::SubscribedLibraryApi
13
- # Automatically generated by openapi-generator (https://openapi-generator.tech)
14
- # Please update as you see appropriate
15
- describe 'SubscribedLibraryApi' do
16
- before do
17
- # run before each test
18
- @instance = VSphereAutomation::Content::SubscribedLibraryApi.new
19
- end
20
-
21
- after do
22
- # run after each test
23
- end
24
-
25
- describe 'test an instance of SubscribedLibraryApi' do
26
- it 'should create an instance of SubscribedLibraryApi' do
27
- expect(@instance).to be_instance_of(VSphereAutomation::Content::SubscribedLibraryApi)
28
- end
29
- end
30
-
31
- # unit tests for create
32
- # Creates a new subscribed library. <p> Once created, the subscribed library will be empty. If the {@link LibraryModel#subscriptionInfo} property is set, the Content Library Service will attempt to synchronize to the remote source. This is an asynchronous operation so the content of the published library may not immediately appear.
33
- # @param request_body
34
- # @param [Hash] opts the optional parameters
35
- # @return [ContentSubscribedLibraryCreateResult]
36
- describe 'create test' do
37
- it 'should work' do
38
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
39
- end
40
- end
41
-
42
- # unit tests for delete
43
- # Deletes the specified subscribed library. <p> Deleting a subscribed library will remove the entry immediately and begin an asynchronous task to remove all cached content for the library. If the asynchronous task fails, file content may remain on the storage backing. This content will require manual removal.
44
- # @param library_id Identifier of the subscribed library to delete.
45
- # @param [Hash] opts the optional parameters
46
- # @return [nil]
47
- describe 'delete test' do
48
- it 'should work' do
49
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
- end
51
- end
52
-
53
- # unit tests for evict
54
- # Evicts the cached content of an on-demand subscribed library. <p> This {@term operation} allows the cached content of a subscribed library to be removed to free up storage capacity. This {@term operation} will only work when a subscribed library is synchronized on-demand.
55
- # @param library_id Identifier of the subscribed library whose content should be evicted.
56
- # @param [Hash] opts the optional parameters
57
- # @return [nil]
58
- describe 'evict test' do
59
- it 'should work' do
60
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
61
- end
62
- end
63
-
64
- # unit tests for get
65
- # Returns a given subscribed library.
66
- # @param library_id Identifier of the subscribed library to return.
67
- # @param [Hash] opts the optional parameters
68
- # @return [ContentSubscribedLibraryResult]
69
- describe 'get test' do
70
- it 'should work' do
71
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
72
- end
73
- end
74
-
75
- # unit tests for list
76
- # Returns the identifiers of all subscribed libraries in the Content Library.
77
- # @param [Hash] opts the optional parameters
78
- # @return [ContentSubscribedLibraryListResult]
79
- describe 'list test' do
80
- it 'should work' do
81
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
82
- end
83
- end
84
-
85
- # unit tests for probe
86
- # Probes remote library subscription information, including URL, SSL certificate and password. The resulting {@link ProbeResult} {@term structure} describes whether or not the subscription configuration is successful.
87
- # @param request_body
88
- # @param [Hash] opts the optional parameters
89
- # @return [ContentSubscribedLibraryProbeResult]
90
- describe 'probe test' do
91
- it 'should work' do
92
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
93
- end
94
- end
95
-
96
- # unit tests for sync
97
- # Forces the synchronization of the subscribed library. <p> Synchronizing a subscribed library forcefully with this {@term operation} will perform the same synchronization behavior as would run periodically for the library. The {@link SubscriptionInfo#onDemand} setting is respected. Calling this {@term operation} on a library that is already in the process of synchronizing will have no effect.
98
- # @param library_id Identifier of the subscribed library to synchronize.
99
- # @param [Hash] opts the optional parameters
100
- # @return [nil]
101
- describe 'sync test' do
102
- it 'should work' do
103
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
104
- end
105
- end
106
-
107
- # unit tests for update
108
- # Updates the properties of a subscribed library. <p> This is an incremental update to the subscribed library. {@term Fields} that are {@term unset} in the update specification will be left unchanged.
109
- # @param library_id Identifier of the subscribed library to update.
110
- # @param request_body
111
- # @param [Hash] opts the optional parameters
112
- # @return [nil]
113
- describe 'update test' do
114
- it 'should work' do
115
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
116
- end
117
- end
118
-
119
- end
@@ -1,248 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe VSphereAutomation::ApiClient do
4
- describe '.default' do
5
- it 'returns the same instance every time' do
6
- first_instance = VSphereAutomation::ApiClient.default
7
- second_instance = VSphereAutomation::ApiClient.default
8
- third_instance = VSphereAutomation::ApiClient.default
9
- expect(first_instance).to be(second_instance)
10
- expect(first_instance).to be(third_instance)
11
- end
12
- end
13
-
14
- describe '#build_collection_param' do
15
- context 'when called with format :multi' do
16
- it 'returns the collection' do
17
- params = { foo: 'bar', baz: 'quux' }
18
- expect(subject.build_collection_param(params, :multi)).to eq(params)
19
- end
20
- end
21
- end
22
-
23
- describe '#call_api' do
24
- let(:host) { 'example.com' }
25
- let(:config) do
26
- VSphereAutomation::Configuration.new.tap do |c|
27
- c.scheme = 'https'
28
- c.host = host
29
- end
30
- end
31
- let(:url) { 'https://example.com/rest/test' }
32
- subject { VSphereAutomation::ApiClient.new(config) }
33
-
34
- it 'adds headers to request' do
35
- headers = { 'foo' => 'bar' }
36
- stub_request(:get, url).with(headers: headers)
37
-
38
- subject.call_api(:GET, '/test', header_params: headers)
39
-
40
- expect(a_request(:get, url).with(headers: headers)).to have_been_made
41
- end
42
-
43
- it 'adds query parameters to request' do
44
- query_params = { 'foo' => 'bar' }
45
- stub_request(:get, url).with(query: query_params)
46
-
47
- subject.call_api(:GET, '/test', query_params: query_params)
48
-
49
- expect(a_request(:get, url).with(query: query_params)).to have_been_made
50
- end
51
-
52
- it 'keeps query parameters from the path to request' do
53
- # The specs have some paths that contain query parameters already. This
54
- # test is to make sure they don't get overwritten.
55
- key = '~foo'
56
- value = 'bar'
57
- query_params = { key => value }
58
- stub_request(:post, url).with(query: query_params)
59
-
60
- subject.call_api(:POST, "/test?#{key}=#{value}")
61
-
62
- expect(a_request(:post, url).with(query: query_params)).to have_been_made
63
- end
64
-
65
- it 'adds form parameters to the request body' do
66
- form_params = { 'foo' => 'bar' }
67
- body = form_params.to_a.map { |e| e.join('=') }.join('&')
68
- stub_request(:get, url).with(body: body)
69
-
70
- subject.call_api(:GET, '/test', form_params: form_params)
71
-
72
- expect(a_request(:get, url).with(body: body)).to have_been_made
73
- end
74
-
75
- it 'uses basic auth information from configuration' do
76
- auth_name = 'basic_auth'
77
- auth_header = { config.auth_settings[auth_name][:key] =>
78
- config.auth_settings[auth_name][:value] }
79
- stub_request(:get, url).with(headers: auth_header)
80
-
81
- subject.call_api(:GET, '/test', auth_names: [auth_name])
82
-
83
- expect(a_request(:get, url)
84
- .with(headers: auth_header)).to have_been_made
85
- end
86
-
87
- it 'use API key information from configuration' do
88
- auth_name = 'api_key'
89
- config.api_key[config.auth_settings[auth_name][:key]] = 'foo'
90
- auth_header = { config.auth_settings[auth_name][:key] =>
91
- config.auth_settings[auth_name][:value] }
92
- stub_request(:get, url).with(headers: auth_header)
93
-
94
- subject.call_api(:GET, '/test', auth_names: [auth_name])
95
-
96
- expect(a_request(:get, url)
97
- .with(headers: auth_header)).to have_been_made
98
- end
99
-
100
- it 'updates api_key from responses with set-cookie header' do
101
- key = config.auth_settings['api_key'][:key]
102
- value = 'foo'
103
- cookie = "#{key}=#{value};Path=/rest;Secure;HttpOnly"
104
- set_cookie_header = { 'set-cookie' => cookie }
105
- stub_request(:get, url + '1').to_return(headers: set_cookie_header)
106
- stub_request(:get, url + '2')
107
-
108
- subject.call_api(:GET, '/test1')
109
- subject.call_api(:GET, '/test2', auth_names: ['api_key'])
110
-
111
- expect(a_request(:get, url + '1')).to have_been_made
112
- expect(a_request(:get, url + '2')).to have_been_made
113
- expect(subject.config.api_key[key]).to eq(value)
114
- end
115
-
116
- it 'updates api_key from responses with api_key header' do
117
- key = config.auth_settings['api_key'][:key]
118
- value = 'foo'
119
- auth_header = { key => value }
120
-
121
- stub_request(:get, url + '1').to_return(headers: auth_header)
122
- stub_request(:get, url + '2').with(headers: auth_header)
123
-
124
- subject.call_api(:GET, '/test1')
125
- subject.call_api(:GET, '/test2', auth_names: ['api_key'])
126
-
127
- expect(a_request(:get, url + '1')).to have_been_made
128
- expect(a_request(:get, url + '2')
129
- .with(headers: auth_header)).to have_been_made
130
- end
131
-
132
- it 'adds the body to requests when available' do
133
- body = { foo: 'bar' }.to_json
134
- stub_request(:post, url).with(body: body)
135
-
136
- subject.call_api(:POST, '/test', body: body)
137
-
138
- expect(a_request(:post, url).with(body: body)).to have_been_made
139
- end
140
-
141
- it 'sets the Content-Type on requests when available' do
142
- content_type = { 'Content-Type' => 'application/json' }
143
- body = { foo: 'bar' }.to_json
144
-
145
- stub_request(:post, url).with(body: body, headers: content_type)
146
-
147
- subject.call_api(:POST, '/test', body: body, header_params: content_type)
148
-
149
- expect(a_request(:post, url)
150
- .with(body: body, headers: content_type)).to have_been_made
151
- end
152
- end
153
-
154
- describe '#object_to_http_body' do
155
- context 'when given nil' do
156
- it 'returns the object as is' do
157
- expect(subject.object_to_http_body(nil)).to be_nil
158
- end
159
- end
160
-
161
- context 'when given a string' do
162
- it 'returns the object as is' do
163
- expect(subject.object_to_http_body('asdf')).to eq('asdf')
164
- end
165
- end
166
-
167
- context 'when given an object that responds to `to_hash`' do
168
- it 'returns that object as JSON' do
169
- obj = OpenStruct.new(foo: 'bar', baz: 'quux')
170
- obj.to_hash = obj.to_h
171
- json = obj.to_hash.to_json
172
-
173
- expect(subject.object_to_http_body(obj)).to eq(json)
174
- end
175
- end
176
-
177
- context 'when given an array' do
178
- it 'returns a JSON array of objects' do
179
- obj = OpenStruct.new(foo: 'bar', baz: 'quux')
180
- obj.to_hash = obj.to_h
181
- json = obj.to_hash.to_json
182
-
183
- expect(subject.object_to_http_body([obj])).to eq([json])
184
- end
185
- end
186
- end
187
-
188
- describe '#select_header_accept' do
189
- context 'when given anything other than an array' do
190
- it 'returns application/json as a default' do
191
- expect(subject.select_header_accept(nil)).to eq('application/json')
192
- expect(subject.select_header_accept('')).to eq('application/json')
193
- expect(subject.select_header_accept(1)).to eq('application/json')
194
- end
195
- end
196
-
197
- context 'when given a list of types' do
198
- context 'that includes a JSON type' do
199
- it 'returns the first type containing JSON' do
200
- xml = 'application/xml'
201
- json = 'application/json'
202
-
203
- expect(subject.select_header_accept([xml, json])).to eq(json)
204
- end
205
- end
206
-
207
- context 'that does not include a JSON type' do
208
- it 'returns the all of the types' do
209
- xml = 'application/xml'
210
- html = 'text/html'
211
- result = [xml, html].join(', ')
212
-
213
- expect(subject.select_header_accept([xml, html])).to eq(result)
214
- end
215
- end
216
- end
217
- end
218
-
219
- describe '#select_header_content_type' do
220
- context 'when given anything other than an array' do
221
- it 'returns application/json as a default' do
222
- expect(subject.select_header_content_type(nil)).to eq('application/json')
223
- expect(subject.select_header_content_type('')).to eq('application/json')
224
- expect(subject.select_header_content_type(1)).to eq('application/json')
225
- end
226
- end
227
-
228
- context 'when given a list of types' do
229
- context 'that includes a JSON type' do
230
- it 'returns the first type containing JSON' do
231
- xml = 'application/xml'
232
- json = 'application/json'
233
-
234
- expect(subject.select_header_content_type([xml, json])).to eq(json)
235
- end
236
- end
237
-
238
- context 'that does not include a JSON type' do
239
- it 'returns the first type' do
240
- xml = 'application/xml'
241
- html = 'text/html'
242
-
243
- expect(subject.select_header_content_type([xml, html])).to eq(xml)
244
- end
245
- end
246
- end
247
- end
248
- end