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.
- checksums.yaml +4 -4
- data/LICENSE +20 -0
- data/lib/vsphere-automation-content/version.rb +1 -1
- metadata +8 -518
- data/Gemfile +0 -14
- data/Gemfile.lock +0 -86
- data/README.md +0 -276
- data/Rakefile +0 -18
- data/docs/ConfigurationApi.md +0 -105
- data/docs/ContentConfigurationModel.md +0 -11
- data/docs/ContentConfigurationResult.md +0 -8
- data/docs/ContentConfigurationUpdate.md +0 -8
- data/docs/ContentLibraryFind.md +0 -8
- data/docs/ContentLibraryFindResult.md +0 -8
- data/docs/ContentLibraryFindSpec.md +0 -9
- data/docs/ContentLibraryItemCopy.md +0 -9
- data/docs/ContentLibraryItemCopyResult.md +0 -8
- data/docs/ContentLibraryItemCreate.md +0 -9
- data/docs/ContentLibraryItemCreateResult.md +0 -8
- data/docs/ContentLibraryItemDestinationSpec.md +0 -8
- data/docs/ContentLibraryItemDownloadSessionCreate.md +0 -9
- data/docs/ContentLibraryItemDownloadSessionCreateResult.md +0 -8
- data/docs/ContentLibraryItemDownloadSessionFail.md +0 -8
- data/docs/ContentLibraryItemDownloadSessionKeepAlive.md +0 -8
- data/docs/ContentLibraryItemDownloadSessionListResult.md +0 -8
- data/docs/ContentLibraryItemDownloadSessionModel.md +0 -14
- data/docs/ContentLibraryItemDownloadSessionModelState.md +0 -7
- data/docs/ContentLibraryItemDownloadSessionResult.md +0 -8
- data/docs/ContentLibraryItemDownloadsessionFileEndpointType.md +0 -7
- data/docs/ContentLibraryItemDownloadsessionFileGet.md +0 -8
- data/docs/ContentLibraryItemDownloadsessionFileInfo.md +0 -14
- data/docs/ContentLibraryItemDownloadsessionFileListResult.md +0 -8
- data/docs/ContentLibraryItemDownloadsessionFilePrepare.md +0 -9
- data/docs/ContentLibraryItemDownloadsessionFilePrepareResult.md +0 -8
- data/docs/ContentLibraryItemDownloadsessionFilePrepareStatus.md +0 -7
- data/docs/ContentLibraryItemDownloadsessionFileResult.md +0 -8
- data/docs/ContentLibraryItemFileChecksumAlgorithm.md +0 -7
- data/docs/ContentLibraryItemFileChecksumInfo.md +0 -9
- data/docs/ContentLibraryItemFileGet.md +0 -8
- data/docs/ContentLibraryItemFileInfo.md +0 -12
- data/docs/ContentLibraryItemFileListResult.md +0 -8
- data/docs/ContentLibraryItemFileResult.md +0 -8
- data/docs/ContentLibraryItemFind.md +0 -8
- data/docs/ContentLibraryItemFindResult.md +0 -8
- data/docs/ContentLibraryItemFindSpec.md +0 -12
- data/docs/ContentLibraryItemListResult.md +0 -8
- data/docs/ContentLibraryItemModel.md +0 -21
- data/docs/ContentLibraryItemPublish.md +0 -9
- data/docs/ContentLibraryItemResult.md +0 -8
- data/docs/ContentLibraryItemStorageGet.md +0 -8
- data/docs/ContentLibraryItemStorageInfo.md +0 -14
- data/docs/ContentLibraryItemStorageListResult.md +0 -8
- data/docs/ContentLibraryItemStorageResult.md +0 -8
- data/docs/ContentLibraryItemTransferEndpoint.md +0 -9
- data/docs/ContentLibraryItemTransferStatus.md +0 -7
- data/docs/ContentLibraryItemUpdate.md +0 -8
- data/docs/ContentLibraryItemUpdateSessionCreate.md +0 -9
- data/docs/ContentLibraryItemUpdateSessionCreateResult.md +0 -8
- data/docs/ContentLibraryItemUpdateSessionFail.md +0 -8
- data/docs/ContentLibraryItemUpdateSessionKeepAlive.md +0 -8
- data/docs/ContentLibraryItemUpdateSessionListResult.md +0 -8
- data/docs/ContentLibraryItemUpdateSessionModel.md +0 -16
- data/docs/ContentLibraryItemUpdateSessionModelState.md +0 -7
- data/docs/ContentLibraryItemUpdateSessionResult.md +0 -8
- data/docs/ContentLibraryItemUpdateSessionUpdate.md +0 -8
- data/docs/ContentLibraryItemUpdatesessionCertificateInfo.md +0 -11
- data/docs/ContentLibraryItemUpdatesessionFileAdd.md +0 -8
- data/docs/ContentLibraryItemUpdatesessionFileAddResult.md +0 -8
- data/docs/ContentLibraryItemUpdatesessionFileAddSpec.md +0 -12
- data/docs/ContentLibraryItemUpdatesessionFileGet.md +0 -8
- data/docs/ContentLibraryItemUpdatesessionFileInfo.md +0 -17
- data/docs/ContentLibraryItemUpdatesessionFileListResult.md +0 -8
- data/docs/ContentLibraryItemUpdatesessionFileRemove.md +0 -8
- data/docs/ContentLibraryItemUpdatesessionFileResult.md +0 -8
- data/docs/ContentLibraryItemUpdatesessionFileSourceType.md +0 -7
- data/docs/ContentLibraryItemUpdatesessionFileValidateResult.md +0 -8
- data/docs/ContentLibraryItemUpdatesessionFileValidationError.md +0 -9
- data/docs/ContentLibraryItemUpdatesessionFileValidationResult.md +0 -10
- data/docs/ContentLibraryItemUpdatesessionPreviewInfo.md +0 -10
- data/docs/ContentLibraryItemUpdatesessionPreviewInfoState.md +0 -7
- data/docs/ContentLibraryItemUpdatesessionPreviewWarningInfo.md +0 -10
- data/docs/ContentLibraryItemUpdatesessionWarningBehavior.md +0 -9
- data/docs/ContentLibraryItemUpdatesessionWarningType.md +0 -7
- data/docs/ContentLibraryListResult.md +0 -8
- data/docs/ContentLibraryModel.md +0 -20
- data/docs/ContentLibraryModelLibraryType.md +0 -7
- data/docs/ContentLibraryOptimizationInfo.md +0 -8
- data/docs/ContentLibraryPublishInfo.md +0 -14
- data/docs/ContentLibraryPublishInfoAuthenticationMethod.md +0 -7
- data/docs/ContentLibraryResult.md +0 -8
- data/docs/ContentLibrarySourceInfo.md +0 -9
- data/docs/ContentLibraryStorageBacking.md +0 -10
- data/docs/ContentLibraryStorageBackingType.md +0 -7
- data/docs/ContentLibrarySubscribedItemSync.md +0 -8
- data/docs/ContentLibrarySubscriptionInfo.md +0 -15
- data/docs/ContentLibrarySubscriptionInfoAuthenticationMethod.md +0 -7
- data/docs/ContentLibrarySubscriptionsCreate.md +0 -9
- data/docs/ContentLibrarySubscriptionsCreateResult.md +0 -8
- data/docs/ContentLibrarySubscriptionsCreateSpec.md +0 -8
- data/docs/ContentLibrarySubscriptionsCreateSpecNewSubscribedLibrary.md +0 -12
- data/docs/ContentLibrarySubscriptionsCreateSpecPlacement.md +0 -12
- data/docs/ContentLibrarySubscriptionsCreateSpecSubscribedLibrary.md +0 -13
- data/docs/ContentLibrarySubscriptionsCreateSpecSubscribedLibraryTarget.md +0 -7
- data/docs/ContentLibrarySubscriptionsCreateSpecVcenter.md +0 -9
- data/docs/ContentLibrarySubscriptionsDelete.md +0 -8
- data/docs/ContentLibrarySubscriptionsGet.md +0 -8
- data/docs/ContentLibrarySubscriptionsInfo.md +0 -12
- data/docs/ContentLibrarySubscriptionsListResult.md +0 -8
- data/docs/ContentLibrarySubscriptionsLocation.md +0 -7
- data/docs/ContentLibrarySubscriptionsPlacementInfo.md +0 -12
- data/docs/ContentLibrarySubscriptionsResult.md +0 -8
- data/docs/ContentLibrarySubscriptionsSummary.md +0 -11
- data/docs/ContentLibrarySubscriptionsUpdate.md +0 -9
- data/docs/ContentLibrarySubscriptionsUpdateSpec.md +0 -9
- data/docs/ContentLibrarySubscriptionsUpdateSpecPlacement.md +0 -12
- data/docs/ContentLibrarySubscriptionsUpdateSpecVcenter.md +0 -9
- data/docs/ContentLibrarySubscriptionsVcenterInfo.md +0 -10
- data/docs/ContentLibraryUpdate.md +0 -8
- data/docs/ContentLocalLibraryCreate.md +0 -9
- data/docs/ContentLocalLibraryCreateResult.md +0 -8
- data/docs/ContentLocalLibraryDestinationSpec.md +0 -8
- data/docs/ContentLocalLibraryListResult.md +0 -8
- data/docs/ContentLocalLibraryPublish.md +0 -8
- data/docs/ContentLocalLibraryResult.md +0 -8
- data/docs/ContentLocalLibraryUpdate.md +0 -8
- data/docs/ContentSubscribedLibraryCreate.md +0 -9
- data/docs/ContentSubscribedLibraryCreateResult.md +0 -8
- data/docs/ContentSubscribedLibraryListResult.md +0 -8
- data/docs/ContentSubscribedLibraryProbe.md +0 -8
- data/docs/ContentSubscribedLibraryProbeResult.md +0 -10
- data/docs/ContentSubscribedLibraryProbeResultStatus.md +0 -7
- data/docs/ContentSubscribedLibraryResult.md +0 -8
- data/docs/ContentSubscribedLibraryUpdate.md +0 -8
- data/docs/LibraryApi.md +0 -209
- data/docs/LibraryItemApi.md +0 -419
- data/docs/LibraryItemDownloadSessionApi.md +0 -369
- data/docs/LibraryItemDownloadsessionFileApi.md +0 -165
- data/docs/LibraryItemFileApi.md +0 -112
- data/docs/LibraryItemStorageApi.md +0 -112
- data/docs/LibraryItemUpdateSessionApi.md +0 -471
- data/docs/LibraryItemUpdatesessionFileApi.md +0 -268
- data/docs/LibrarySubscribedItemApi.md +0 -110
- data/docs/LibrarySubscriptionsApi.md +0 -269
- data/docs/LocalLibraryApi.md +0 -313
- data/docs/SubscribedLibraryApi.md +0 -410
- data/docs/VapiStdErrorsAlreadyExists.md +0 -9
- data/docs/VapiStdErrorsAlreadyExistsError.md +0 -9
- data/docs/VapiStdErrorsConcurrentChange.md +0 -9
- data/docs/VapiStdErrorsConcurrentChangeError.md +0 -9
- data/docs/VapiStdErrorsError.md +0 -9
- data/docs/VapiStdErrorsErrorError.md +0 -9
- data/docs/VapiStdErrorsInvalidArgument.md +0 -9
- data/docs/VapiStdErrorsInvalidArgumentError.md +0 -9
- data/docs/VapiStdErrorsInvalidElementConfiguration.md +0 -9
- data/docs/VapiStdErrorsInvalidElementConfigurationError.md +0 -9
- data/docs/VapiStdErrorsInvalidElementType.md +0 -9
- data/docs/VapiStdErrorsInvalidElementTypeError.md +0 -9
- data/docs/VapiStdErrorsNotAllowedInCurrentState.md +0 -9
- data/docs/VapiStdErrorsNotAllowedInCurrentStateError.md +0 -9
- data/docs/VapiStdErrorsNotFound.md +0 -9
- data/docs/VapiStdErrorsNotFoundError.md +0 -9
- data/docs/VapiStdErrorsResourceBusy.md +0 -9
- data/docs/VapiStdErrorsResourceBusyError.md +0 -9
- data/docs/VapiStdErrorsResourceInaccessible.md +0 -9
- data/docs/VapiStdErrorsResourceInaccessibleError.md +0 -9
- data/docs/VapiStdErrorsUnauthenticated.md +0 -9
- data/docs/VapiStdErrorsUnauthenticatedError.md +0 -9
- data/docs/VapiStdErrorsUnauthorized.md +0 -9
- data/docs/VapiStdErrorsUnauthorizedError.md +0 -9
- data/docs/VapiStdErrorsUnsupported.md +0 -9
- data/docs/VapiStdErrorsUnsupportedError.md +0 -9
- data/docs/VapiStdLocalizableMessage.md +0 -10
- data/git_push.sh +0 -55
- data/lib/vsphere-automation-content/api_client.rb +0 -260
- data/lib/vsphere-automation-content/api_error.rb +0 -34
- data/lib/vsphere-automation-content/configuration.rb +0 -212
- data/pkg/vsphere-automation-content-0.4.1.gem +0 -0
- data/pkg/vsphere-automation-content-0.4.2.gem +0 -0
- data/pkg/vsphere-automation-content-0.4.3.gem +0 -0
- data/pkg/vsphere-automation-content-0.4.4.gem +0 -0
- data/spec/api/configuration_api_spec.rb +0 -52
- data/spec/api/library_api_spec.rb +0 -75
- data/spec/api/library_item_api_spec.rb +0 -122
- data/spec/api/library_item_download_session_api_spec.rb +0 -110
- data/spec/api/library_item_downloadsession_file_api_spec.rb +0 -66
- data/spec/api/library_item_file_api_spec.rb +0 -54
- data/spec/api/library_item_storage_api_spec.rb +0 -54
- data/spec/api/library_item_update_session_api_spec.rb +0 -133
- data/spec/api/library_item_updatesession_file_api_spec.rb +0 -89
- data/spec/api/library_subscribed_item_api_spec.rb +0 -54
- data/spec/api/library_subscriptions_api_spec.rb +0 -90
- data/spec/api/local_library_api_spec.rb +0 -98
- data/spec/api/subscribed_library_api_spec.rb +0 -119
- data/spec/api_client_spec.rb +0 -248
- data/spec/configuration_spec.rb +0 -38
- data/spec/models/content_configuration_model_spec.rb +0 -55
- data/spec/models/content_configuration_result_spec.rb +0 -37
- data/spec/models/content_configuration_update_spec.rb +0 -37
- data/spec/models/content_library_find_result_spec.rb +0 -37
- data/spec/models/content_library_find_spec.rb +0 -37
- data/spec/models/content_library_find_spec_spec.rb +0 -43
- data/spec/models/content_library_item_copy_result_spec.rb +0 -37
- data/spec/models/content_library_item_copy_spec.rb +0 -43
- data/spec/models/content_library_item_create_result_spec.rb +0 -37
- data/spec/models/content_library_item_create_spec.rb +0 -43
- data/spec/models/content_library_item_destination_spec_spec.rb +0 -37
- data/spec/models/content_library_item_download_session_create_result_spec.rb +0 -37
- data/spec/models/content_library_item_download_session_create_spec.rb +0 -43
- data/spec/models/content_library_item_download_session_fail_spec.rb +0 -37
- data/spec/models/content_library_item_download_session_keep_alive_spec.rb +0 -37
- data/spec/models/content_library_item_download_session_list_result_spec.rb +0 -37
- data/spec/models/content_library_item_download_session_model_spec.rb +0 -73
- data/spec/models/content_library_item_download_session_model_state_spec.rb +0 -31
- data/spec/models/content_library_item_download_session_result_spec.rb +0 -37
- data/spec/models/content_library_item_downloadsession_file_endpoint_type_spec.rb +0 -31
- data/spec/models/content_library_item_downloadsession_file_get_spec.rb +0 -37
- data/spec/models/content_library_item_downloadsession_file_info_spec.rb +0 -73
- data/spec/models/content_library_item_downloadsession_file_list_result_spec.rb +0 -37
- data/spec/models/content_library_item_downloadsession_file_prepare_result_spec.rb +0 -37
- data/spec/models/content_library_item_downloadsession_file_prepare_spec.rb +0 -43
- data/spec/models/content_library_item_downloadsession_file_prepare_status_spec.rb +0 -31
- data/spec/models/content_library_item_downloadsession_file_result_spec.rb +0 -37
- data/spec/models/content_library_item_file_checksum_algorithm_spec.rb +0 -31
- data/spec/models/content_library_item_file_checksum_info_spec.rb +0 -43
- data/spec/models/content_library_item_file_get_spec.rb +0 -37
- data/spec/models/content_library_item_file_info_spec.rb +0 -61
- data/spec/models/content_library_item_file_list_result_spec.rb +0 -37
- data/spec/models/content_library_item_file_result_spec.rb +0 -37
- data/spec/models/content_library_item_find_result_spec.rb +0 -37
- data/spec/models/content_library_item_find_spec.rb +0 -37
- data/spec/models/content_library_item_find_spec_spec.rb +0 -61
- data/spec/models/content_library_item_list_result_spec.rb +0 -37
- data/spec/models/content_library_item_model_spec.rb +0 -115
- data/spec/models/content_library_item_publish_spec.rb +0 -43
- data/spec/models/content_library_item_result_spec.rb +0 -37
- data/spec/models/content_library_item_storage_get_spec.rb +0 -37
- data/spec/models/content_library_item_storage_info_spec.rb +0 -73
- data/spec/models/content_library_item_storage_list_result_spec.rb +0 -37
- data/spec/models/content_library_item_storage_result_spec.rb +0 -37
- data/spec/models/content_library_item_transfer_endpoint_spec.rb +0 -43
- data/spec/models/content_library_item_transfer_status_spec.rb +0 -31
- data/spec/models/content_library_item_update_session_create_result_spec.rb +0 -37
- data/spec/models/content_library_item_update_session_create_spec.rb +0 -43
- data/spec/models/content_library_item_update_session_fail_spec.rb +0 -37
- data/spec/models/content_library_item_update_session_keep_alive_spec.rb +0 -37
- data/spec/models/content_library_item_update_session_list_result_spec.rb +0 -37
- data/spec/models/content_library_item_update_session_model_spec.rb +0 -85
- data/spec/models/content_library_item_update_session_model_state_spec.rb +0 -31
- data/spec/models/content_library_item_update_session_result_spec.rb +0 -37
- data/spec/models/content_library_item_update_session_update_spec.rb +0 -37
- data/spec/models/content_library_item_update_spec.rb +0 -37
- data/spec/models/content_library_item_updatesession_certificate_info_spec.rb +0 -55
- data/spec/models/content_library_item_updatesession_file_add_result_spec.rb +0 -37
- data/spec/models/content_library_item_updatesession_file_add_spec.rb +0 -37
- data/spec/models/content_library_item_updatesession_file_add_spec_spec.rb +0 -61
- data/spec/models/content_library_item_updatesession_file_get_spec.rb +0 -37
- data/spec/models/content_library_item_updatesession_file_info_spec.rb +0 -91
- data/spec/models/content_library_item_updatesession_file_list_result_spec.rb +0 -37
- data/spec/models/content_library_item_updatesession_file_remove_spec.rb +0 -37
- data/spec/models/content_library_item_updatesession_file_result_spec.rb +0 -37
- data/spec/models/content_library_item_updatesession_file_source_type_spec.rb +0 -31
- data/spec/models/content_library_item_updatesession_file_validate_result_spec.rb +0 -37
- data/spec/models/content_library_item_updatesession_file_validation_error_spec.rb +0 -43
- data/spec/models/content_library_item_updatesession_file_validation_result_spec.rb +0 -49
- data/spec/models/content_library_item_updatesession_preview_info_spec.rb +0 -49
- data/spec/models/content_library_item_updatesession_preview_info_state_spec.rb +0 -31
- data/spec/models/content_library_item_updatesession_preview_warning_info_spec.rb +0 -49
- data/spec/models/content_library_item_updatesession_warning_behavior_spec.rb +0 -43
- data/spec/models/content_library_item_updatesession_warning_type_spec.rb +0 -31
- data/spec/models/content_library_list_result_spec.rb +0 -37
- data/spec/models/content_library_model_library_type_spec.rb +0 -31
- data/spec/models/content_library_model_spec.rb +0 -109
- data/spec/models/content_library_optimization_info_spec.rb +0 -37
- data/spec/models/content_library_publish_info_authentication_method_spec.rb +0 -31
- data/spec/models/content_library_publish_info_spec.rb +0 -73
- data/spec/models/content_library_result_spec.rb +0 -37
- data/spec/models/content_library_source_info_spec.rb +0 -43
- data/spec/models/content_library_storage_backing_spec.rb +0 -49
- data/spec/models/content_library_storage_backing_type_spec.rb +0 -31
- data/spec/models/content_library_subscribed_item_sync_spec.rb +0 -37
- data/spec/models/content_library_subscription_info_authentication_method_spec.rb +0 -31
- data/spec/models/content_library_subscription_info_spec.rb +0 -79
- data/spec/models/content_library_subscriptions_create_result_spec.rb +0 -37
- data/spec/models/content_library_subscriptions_create_spec.rb +0 -43
- data/spec/models/content_library_subscriptions_create_spec_new_subscribed_library_spec.rb +0 -61
- data/spec/models/content_library_subscriptions_create_spec_placement_spec.rb +0 -61
- data/spec/models/content_library_subscriptions_create_spec_spec.rb +0 -37
- data/spec/models/content_library_subscriptions_create_spec_subscribed_library_spec.rb +0 -67
- data/spec/models/content_library_subscriptions_create_spec_subscribed_library_target_spec.rb +0 -31
- data/spec/models/content_library_subscriptions_create_spec_vcenter_spec.rb +0 -43
- data/spec/models/content_library_subscriptions_delete_spec.rb +0 -37
- data/spec/models/content_library_subscriptions_get_spec.rb +0 -37
- data/spec/models/content_library_subscriptions_info_spec.rb +0 -61
- data/spec/models/content_library_subscriptions_list_result_spec.rb +0 -37
- data/spec/models/content_library_subscriptions_location_spec.rb +0 -31
- data/spec/models/content_library_subscriptions_placement_info_spec.rb +0 -61
- data/spec/models/content_library_subscriptions_result_spec.rb +0 -37
- data/spec/models/content_library_subscriptions_summary_spec.rb +0 -55
- data/spec/models/content_library_subscriptions_update_spec.rb +0 -43
- data/spec/models/content_library_subscriptions_update_spec_placement_spec.rb +0 -61
- data/spec/models/content_library_subscriptions_update_spec_spec.rb +0 -43
- data/spec/models/content_library_subscriptions_update_spec_vcenter_spec.rb +0 -43
- data/spec/models/content_library_subscriptions_vcenter_info_spec.rb +0 -49
- data/spec/models/content_library_update_spec.rb +0 -37
- data/spec/models/content_local_library_create_result_spec.rb +0 -37
- data/spec/models/content_local_library_create_spec.rb +0 -43
- data/spec/models/content_local_library_destination_spec_spec.rb +0 -37
- data/spec/models/content_local_library_list_result_spec.rb +0 -37
- data/spec/models/content_local_library_publish_spec.rb +0 -37
- data/spec/models/content_local_library_result_spec.rb +0 -37
- data/spec/models/content_local_library_update_spec.rb +0 -37
- data/spec/models/content_subscribed_library_create_result_spec.rb +0 -37
- data/spec/models/content_subscribed_library_create_spec.rb +0 -43
- data/spec/models/content_subscribed_library_list_result_spec.rb +0 -37
- data/spec/models/content_subscribed_library_probe_result_spec.rb +0 -49
- data/spec/models/content_subscribed_library_probe_result_status_spec.rb +0 -31
- data/spec/models/content_subscribed_library_probe_spec.rb +0 -37
- data/spec/models/content_subscribed_library_result_spec.rb +0 -37
- data/spec/models/content_subscribed_library_update_spec.rb +0 -37
- data/spec/models/vapi_std_errors_already_exists_error_spec.rb +0 -43
- data/spec/models/vapi_std_errors_already_exists_spec.rb +0 -43
- data/spec/models/vapi_std_errors_concurrent_change_error_spec.rb +0 -43
- data/spec/models/vapi_std_errors_concurrent_change_spec.rb +0 -43
- data/spec/models/vapi_std_errors_error_error_spec.rb +0 -43
- data/spec/models/vapi_std_errors_error_spec.rb +0 -43
- data/spec/models/vapi_std_errors_invalid_argument_error_spec.rb +0 -43
- data/spec/models/vapi_std_errors_invalid_argument_spec.rb +0 -43
- data/spec/models/vapi_std_errors_invalid_element_configuration_error_spec.rb +0 -43
- data/spec/models/vapi_std_errors_invalid_element_configuration_spec.rb +0 -43
- data/spec/models/vapi_std_errors_invalid_element_type_error_spec.rb +0 -43
- data/spec/models/vapi_std_errors_invalid_element_type_spec.rb +0 -43
- data/spec/models/vapi_std_errors_not_allowed_in_current_state_error_spec.rb +0 -43
- data/spec/models/vapi_std_errors_not_allowed_in_current_state_spec.rb +0 -43
- data/spec/models/vapi_std_errors_not_found_error_spec.rb +0 -43
- data/spec/models/vapi_std_errors_not_found_spec.rb +0 -43
- data/spec/models/vapi_std_errors_resource_busy_error_spec.rb +0 -43
- data/spec/models/vapi_std_errors_resource_busy_spec.rb +0 -43
- data/spec/models/vapi_std_errors_resource_inaccessible_error_spec.rb +0 -43
- data/spec/models/vapi_std_errors_resource_inaccessible_spec.rb +0 -43
- data/spec/models/vapi_std_errors_unauthenticated_error_spec.rb +0 -43
- data/spec/models/vapi_std_errors_unauthenticated_spec.rb +0 -43
- data/spec/models/vapi_std_errors_unauthorized_error_spec.rb +0 -43
- data/spec/models/vapi_std_errors_unauthorized_spec.rb +0 -43
- data/spec/models/vapi_std_errors_unsupported_error_spec.rb +0 -43
- data/spec/models/vapi_std_errors_unsupported_spec.rb +0 -43
- data/spec/models/vapi_std_localizable_message_spec.rb +0 -49
- data/spec/spec_helper.rb +0 -110
- 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
|
data/spec/api_client_spec.rb
DELETED
@@ -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
|