happyco_json 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/README.md +215 -0
- data/Rakefile +8 -0
- data/docs/AccountProvisioningServiceApi.md +98 -0
- data/docs/AccountServiceApi.md +98 -0
- data/docs/AccountUsersServiceApi.md +188 -0
- data/docs/AssetServiceApi.md +233 -0
- data/docs/CreateAccountsRequestAccountWithAdmin.md +9 -0
- data/docs/CreateAccountsResponseAccountIDWithAdminID.md +9 -0
- data/docs/FolderServiceApi.md +188 -0
- data/docs/InspectionServiceApi.md +329 -0
- data/docs/InspectionStatusChangeStatus.md +7 -0
- data/docs/InspectionStatusChangesEventInspectionStatusChange.md +10 -0
- data/docs/TemplateServiceApi.md +233 -0
- data/docs/UpdateAccountsRequestAccountWithAdminId.md +9 -0
- data/docs/V1Account.md +17 -0
- data/docs/V1AddInspectionPhotoRequest.md +11 -0
- data/docs/V1AddInspectionPhotoResponse.md +9 -0
- data/docs/V1AddInspectionPhotosRequest.md +9 -0
- data/docs/V1AddInspectionPhotosResponse.md +8 -0
- data/docs/V1AddUsersRequest.md +9 -0
- data/docs/V1AddUsersResponse.md +8 -0
- data/docs/V1Asset.md +17 -0
- data/docs/V1CreateAccountsRequest.md +8 -0
- data/docs/V1CreateAccountsResponse.md +8 -0
- data/docs/V1CreateAssetsRequest.md +10 -0
- data/docs/V1CreateAssetsResponse.md +8 -0
- data/docs/V1CreateDelegatedInspectionLinkRequest.md +12 -0
- data/docs/V1CreateDelegatedInspectionLinkResponse.md +9 -0
- data/docs/V1CreateDelegatedInspectionLinksRequest.md +13 -0
- data/docs/V1CreateDelegatedInspectionLinksResponse.md +8 -0
- data/docs/V1CreateFoldersRequest.md +9 -0
- data/docs/V1CreateFoldersResponse.md +8 -0
- data/docs/V1CreateInspectionsRequest.md +9 -0
- data/docs/V1CreateInspectionsResponse.md +8 -0
- data/docs/V1CreateTemplatesRequest.md +10 -0
- data/docs/V1CreateTemplatesResponse.md +8 -0
- data/docs/V1DateTime.md +13 -0
- data/docs/V1Event.md +8 -0
- data/docs/V1EventAck.md +10 -0
- data/docs/V1EventHandlerOptions.md +8 -0
- data/docs/V1FloatArray.md +8 -0
- data/docs/V1Folder.md +11 -0
- data/docs/V1FolderType.md +7 -0
- data/docs/V1FooterField.md +10 -0
- data/docs/V1HeaderField.md +10 -0
- data/docs/V1Inspection.md +16 -0
- data/docs/V1InspectionData.md +15 -0
- data/docs/V1InspectionStatusChangesEvent.md +9 -0
- data/docs/V1InspectionStatusChangesEventAck.md +8 -0
- data/docs/V1InspectionStatusChangesEventAckResponse.md +7 -0
- data/docs/V1InspectionStatusChangesEventRequest.md +9 -0
- data/docs/V1IntegrationID.md +10 -0
- data/docs/V1Item.md +14 -0
- data/docs/V1ListAccountsRequest.md +10 -0
- data/docs/V1ListAccountsResponse.md +9 -0
- data/docs/V1ListAssetsRequest.md +12 -0
- data/docs/V1ListAssetsResponse.md +9 -0
- data/docs/V1ListFoldersRequest.md +11 -0
- data/docs/V1ListFoldersResponse.md +9 -0
- data/docs/V1ListInspectionsRequest.md +13 -0
- data/docs/V1ListInspectionsResponse.md +10 -0
- data/docs/V1ListTemplatesRequest.md +12 -0
- data/docs/V1ListTemplatesResponse.md +10 -0
- data/docs/V1ListUsersRequest.md +11 -0
- data/docs/V1ListUsersResponse.md +9 -0
- data/docs/V1Paging.md +7 -0
- data/docs/V1PagingResponse.md +7 -0
- data/docs/V1Photo.md +9 -0
- data/docs/V1Property.md +8 -0
- data/docs/V1RatingCheckbox.md +12 -0
- data/docs/V1RatingControl.md +11 -0
- data/docs/V1RatingDropDown.md +9 -0
- data/docs/V1RatingDropDownOption.md +12 -0
- data/docs/V1RatingGroups.md +9 -0
- data/docs/V1RatingImage.md +7 -0
- data/docs/V1RatingRadioGroup.md +9 -0
- data/docs/V1RatingRadioGroupOption.md +11 -0
- data/docs/V1RatingValues.md +9 -0
- data/docs/V1ScheduledInspection.md +11 -0
- data/docs/V1Section.md +9 -0
- data/docs/V1SetAssetsArchivedRequest.md +10 -0
- data/docs/V1SetAssetsArchivedResponse.md +7 -0
- data/docs/V1SetInspectionsArchivedRequest.md +9 -0
- data/docs/V1SetInspectionsArchivedResponse.md +7 -0
- data/docs/V1SetTemplatesArchivedRequest.md +10 -0
- data/docs/V1SetTemplatesArchivedResponse.md +7 -0
- data/docs/V1StringArray.md +8 -0
- data/docs/V1Template.md +18 -0
- data/docs/V1Unit.md +9 -0
- data/docs/V1UpdateAccountStatusesRequest.md +9 -0
- data/docs/V1UpdateAccountStatusesResponse.md +7 -0
- data/docs/V1UpdateAccountsRequest.md +8 -0
- data/docs/V1UpdateAccountsResponse.md +7 -0
- data/docs/V1UpdateAssetsRequest.md +10 -0
- data/docs/V1UpdateAssetsResponse.md +7 -0
- data/docs/V1UpdateFolderStatusesRequest.md +10 -0
- data/docs/V1UpdateFolderStatusesResponse.md +7 -0
- data/docs/V1UpdateFoldersRequest.md +9 -0
- data/docs/V1UpdateFoldersResponse.md +8 -0
- data/docs/V1UpdateInspectionsRequest.md +9 -0
- data/docs/V1UpdateInspectionsResponse.md +7 -0
- data/docs/V1UpdateTemplatesRequest.md +10 -0
- data/docs/V1UpdateTemplatesResponse.md +7 -0
- data/docs/V1UpdateUserStatusesRequest.md +10 -0
- data/docs/V1UpdateUserStatusesResponse.md +7 -0
- data/docs/V1UpdateUsersRequest.md +9 -0
- data/docs/V1UpdateUsersResponse.md +8 -0
- data/docs/V1User.md +13 -0
- data/git_push.sh +55 -0
- data/happyco_json.gemspec +45 -0
- data/lib/happyco_json/api/account_provisioning_service_api.rb +128 -0
- data/lib/happyco_json/api/account_service_api.rb +128 -0
- data/lib/happyco_json/api/account_users_service_api.rb +234 -0
- data/lib/happyco_json/api/asset_service_api.rb +287 -0
- data/lib/happyco_json/api/folder_service_api.rb +234 -0
- data/lib/happyco_json/api/inspection_service_api.rb +393 -0
- data/lib/happyco_json/api/template_service_api.rb +287 -0
- data/lib/happyco_json/api_client.rb +375 -0
- data/lib/happyco_json/api_error.rb +37 -0
- data/lib/happyco_json/configuration.rb +195 -0
- data/lib/happyco_json/helpers.rb +30 -0
- data/lib/happyco_json/models/create_accounts_request_account_with_admin.rb +196 -0
- data/lib/happyco_json/models/create_accounts_response_account_id_with_admin_id.rb +196 -0
- data/lib/happyco_json/models/inspection_status_change_status.rb +22 -0
- data/lib/happyco_json/models/inspection_status_changes_event_inspection_status_change.rb +256 -0
- data/lib/happyco_json/models/update_accounts_request_account_with_admin_id.rb +196 -0
- data/lib/happyco_json/models/v1_account.rb +268 -0
- data/lib/happyco_json/models/v1_add_inspection_photo_request.rb +216 -0
- data/lib/happyco_json/models/v1_add_inspection_photo_response.rb +197 -0
- data/lib/happyco_json/models/v1_add_inspection_photos_request.rb +200 -0
- data/lib/happyco_json/models/v1_add_inspection_photos_response.rb +190 -0
- data/lib/happyco_json/models/v1_add_users_request.rb +198 -0
- data/lib/happyco_json/models/v1_add_users_response.rb +189 -0
- data/lib/happyco_json/models/v1_asset.rb +268 -0
- data/lib/happyco_json/models/v1_create_accounts_request.rb +189 -0
- data/lib/happyco_json/models/v1_create_accounts_response.rb +189 -0
- data/lib/happyco_json/models/v1_create_assets_request.rb +207 -0
- data/lib/happyco_json/models/v1_create_assets_response.rb +189 -0
- data/lib/happyco_json/models/v1_create_delegated_inspection_link_request.rb +223 -0
- data/lib/happyco_json/models/v1_create_delegated_inspection_link_response.rb +196 -0
- data/lib/happyco_json/models/v1_create_delegated_inspection_links_request.rb +234 -0
- data/lib/happyco_json/models/v1_create_delegated_inspection_links_response.rb +189 -0
- data/lib/happyco_json/models/v1_create_folders_request.rb +198 -0
- data/lib/happyco_json/models/v1_create_folders_response.rb +189 -0
- data/lib/happyco_json/models/v1_create_inspections_request.rb +200 -0
- data/lib/happyco_json/models/v1_create_inspections_response.rb +189 -0
- data/lib/happyco_json/models/v1_create_templates_request.rb +207 -0
- data/lib/happyco_json/models/v1_create_templates_response.rb +189 -0
- data/lib/happyco_json/models/v1_date_time.rb +232 -0
- data/lib/happyco_json/models/v1_event.rb +187 -0
- data/lib/happyco_json/models/v1_event_ack.rb +207 -0
- data/lib/happyco_json/models/v1_event_handler_options.rb +187 -0
- data/lib/happyco_json/models/v1_float_array.rb +189 -0
- data/lib/happyco_json/models/v1_folder.rb +249 -0
- data/lib/happyco_json/models/v1_folder_type.rb +21 -0
- data/lib/happyco_json/models/v1_footer_field.rb +208 -0
- data/lib/happyco_json/models/v1_header_field.rb +208 -0
- data/lib/happyco_json/models/v1_inspection.rb +264 -0
- data/lib/happyco_json/models/v1_inspection_data.rb +266 -0
- data/lib/happyco_json/models/v1_inspection_status_changes_event.rb +198 -0
- data/lib/happyco_json/models/v1_inspection_status_changes_event_ack.rb +188 -0
- data/lib/happyco_json/models/v1_inspection_status_changes_event_ack_response.rb +178 -0
- data/lib/happyco_json/models/v1_inspection_status_changes_event_request.rb +198 -0
- data/lib/happyco_json/models/v1_integration_id.rb +205 -0
- data/lib/happyco_json/models/v1_item.rb +254 -0
- data/lib/happyco_json/models/v1_list_accounts_request.rb +207 -0
- data/lib/happyco_json/models/v1_list_accounts_response.rb +198 -0
- data/lib/happyco_json/models/v1_list_assets_request.rb +225 -0
- data/lib/happyco_json/models/v1_list_assets_response.rb +198 -0
- data/lib/happyco_json/models/v1_list_folders_request.rb +216 -0
- data/lib/happyco_json/models/v1_list_folders_response.rb +198 -0
- data/lib/happyco_json/models/v1_list_inspections_request.rb +244 -0
- data/lib/happyco_json/models/v1_list_inspections_response.rb +210 -0
- data/lib/happyco_json/models/v1_list_templates_request.rb +227 -0
- data/lib/happyco_json/models/v1_list_templates_response.rb +207 -0
- data/lib/happyco_json/models/v1_list_users_request.rb +216 -0
- data/lib/happyco_json/models/v1_list_users_response.rb +198 -0
- data/lib/happyco_json/models/v1_paging.rb +178 -0
- data/lib/happyco_json/models/v1_paging_response.rb +178 -0
- data/lib/happyco_json/models/v1_photo.rb +196 -0
- data/lib/happyco_json/models/v1_property.rb +187 -0
- data/lib/happyco_json/models/v1_rating_checkbox.rb +261 -0
- data/lib/happyco_json/models/v1_rating_control.rb +215 -0
- data/lib/happyco_json/models/v1_rating_drop_down.rb +199 -0
- data/lib/happyco_json/models/v1_rating_drop_down_option.rb +261 -0
- data/lib/happyco_json/models/v1_rating_groups.rb +200 -0
- data/lib/happyco_json/models/v1_rating_image.rb +137 -0
- data/lib/happyco_json/models/v1_rating_radio_group.rb +199 -0
- data/lib/happyco_json/models/v1_rating_radio_group_option.rb +251 -0
- data/lib/happyco_json/models/v1_rating_values.rb +196 -0
- data/lib/happyco_json/models/v1_scheduled_inspection.rb +223 -0
- data/lib/happyco_json/models/v1_section.rb +200 -0
- data/lib/happyco_json/models/v1_set_assets_archived_request.rb +207 -0
- data/lib/happyco_json/models/v1_set_assets_archived_response.rb +178 -0
- data/lib/happyco_json/models/v1_set_inspections_archived_request.rb +200 -0
- data/lib/happyco_json/models/v1_set_inspections_archived_response.rb +178 -0
- data/lib/happyco_json/models/v1_set_templates_archived_request.rb +207 -0
- data/lib/happyco_json/models/v1_set_templates_archived_response.rb +178 -0
- data/lib/happyco_json/models/v1_string_array.rb +189 -0
- data/lib/happyco_json/models/v1_template.rb +287 -0
- data/lib/happyco_json/models/v1_unit.rb +196 -0
- data/lib/happyco_json/models/v1_update_account_statuses_request.rb +198 -0
- data/lib/happyco_json/models/v1_update_account_statuses_response.rb +178 -0
- data/lib/happyco_json/models/v1_update_accounts_request.rb +189 -0
- data/lib/happyco_json/models/v1_update_accounts_response.rb +178 -0
- data/lib/happyco_json/models/v1_update_assets_request.rb +207 -0
- data/lib/happyco_json/models/v1_update_assets_response.rb +178 -0
- data/lib/happyco_json/models/v1_update_folder_statuses_request.rb +207 -0
- data/lib/happyco_json/models/v1_update_folder_statuses_response.rb +178 -0
- data/lib/happyco_json/models/v1_update_folders_request.rb +198 -0
- data/lib/happyco_json/models/v1_update_folders_response.rb +189 -0
- data/lib/happyco_json/models/v1_update_inspections_request.rb +200 -0
- data/lib/happyco_json/models/v1_update_inspections_response.rb +178 -0
- data/lib/happyco_json/models/v1_update_templates_request.rb +207 -0
- data/lib/happyco_json/models/v1_update_templates_response.rb +178 -0
- data/lib/happyco_json/models/v1_update_user_statuses_request.rb +207 -0
- data/lib/happyco_json/models/v1_update_user_statuses_response.rb +178 -0
- data/lib/happyco_json/models/v1_update_users_request.rb +198 -0
- data/lib/happyco_json/models/v1_update_users_response.rb +189 -0
- data/lib/happyco_json/models/v1_user.rb +232 -0
- data/lib/happyco_json/version.rb +14 -0
- data/lib/happyco_json.rb +145 -0
- data/spec/api/account_provisioning_service_api_spec.rb +58 -0
- data/spec/api/account_service_api_spec.rb +58 -0
- data/spec/api/account_users_service_api_spec.rb +82 -0
- data/spec/api/asset_service_api_spec.rb +94 -0
- data/spec/api/folder_service_api_spec.rb +82 -0
- data/spec/api/inspection_service_api_spec.rb +118 -0
- data/spec/api/template_service_api_spec.rb +94 -0
- data/spec/api_client_spec.rb +225 -0
- data/spec/configuration_spec.rb +41 -0
- data/spec/models/create_accounts_request_account_with_admin_spec.rb +47 -0
- data/spec/models/create_accounts_response_account_id_with_admin_id_spec.rb +47 -0
- data/spec/models/inspection_status_change_status_spec.rb +35 -0
- data/spec/models/inspection_status_changes_event_inspection_status_change_spec.rb +61 -0
- data/spec/models/update_accounts_request_account_with_admin_id_spec.rb +47 -0
- data/spec/models/v1_account_spec.rb +95 -0
- data/spec/models/v1_add_inspection_photo_request_spec.rb +59 -0
- data/spec/models/v1_add_inspection_photo_response_spec.rb +47 -0
- data/spec/models/v1_add_inspection_photos_request_spec.rb +47 -0
- data/spec/models/v1_add_inspection_photos_response_spec.rb +41 -0
- data/spec/models/v1_add_users_request_spec.rb +47 -0
- data/spec/models/v1_add_users_response_spec.rb +41 -0
- data/spec/models/v1_asset_spec.rb +95 -0
- data/spec/models/v1_create_accounts_request_spec.rb +41 -0
- data/spec/models/v1_create_accounts_response_spec.rb +41 -0
- data/spec/models/v1_create_assets_request_spec.rb +53 -0
- data/spec/models/v1_create_assets_response_spec.rb +41 -0
- data/spec/models/v1_create_delegated_inspection_link_request_spec.rb +65 -0
- data/spec/models/v1_create_delegated_inspection_link_response_spec.rb +47 -0
- data/spec/models/v1_create_delegated_inspection_links_request_spec.rb +71 -0
- data/spec/models/v1_create_delegated_inspection_links_response_spec.rb +41 -0
- data/spec/models/v1_create_folders_request_spec.rb +47 -0
- data/spec/models/v1_create_folders_response_spec.rb +41 -0
- data/spec/models/v1_create_inspections_request_spec.rb +47 -0
- data/spec/models/v1_create_inspections_response_spec.rb +41 -0
- data/spec/models/v1_create_templates_request_spec.rb +53 -0
- data/spec/models/v1_create_templates_response_spec.rb +41 -0
- data/spec/models/v1_date_time_spec.rb +71 -0
- data/spec/models/v1_event_ack_spec.rb +53 -0
- data/spec/models/v1_event_handler_options_spec.rb +41 -0
- data/spec/models/v1_event_spec.rb +41 -0
- data/spec/models/v1_float_array_spec.rb +41 -0
- data/spec/models/v1_folder_spec.rb +63 -0
- data/spec/models/v1_folder_type_spec.rb +35 -0
- data/spec/models/v1_footer_field_spec.rb +53 -0
- data/spec/models/v1_header_field_spec.rb +53 -0
- data/spec/models/v1_inspection_data_spec.rb +83 -0
- data/spec/models/v1_inspection_spec.rb +89 -0
- data/spec/models/v1_inspection_status_changes_event_ack_response_spec.rb +35 -0
- data/spec/models/v1_inspection_status_changes_event_ack_spec.rb +41 -0
- data/spec/models/v1_inspection_status_changes_event_request_spec.rb +47 -0
- data/spec/models/v1_inspection_status_changes_event_spec.rb +47 -0
- data/spec/models/v1_integration_id_spec.rb +53 -0
- data/spec/models/v1_item_spec.rb +77 -0
- data/spec/models/v1_list_accounts_request_spec.rb +53 -0
- data/spec/models/v1_list_accounts_response_spec.rb +47 -0
- data/spec/models/v1_list_assets_request_spec.rb +65 -0
- data/spec/models/v1_list_assets_response_spec.rb +47 -0
- data/spec/models/v1_list_folders_request_spec.rb +59 -0
- data/spec/models/v1_list_folders_response_spec.rb +47 -0
- data/spec/models/v1_list_inspections_request_spec.rb +71 -0
- data/spec/models/v1_list_inspections_response_spec.rb +53 -0
- data/spec/models/v1_list_templates_request_spec.rb +65 -0
- data/spec/models/v1_list_templates_response_spec.rb +53 -0
- data/spec/models/v1_list_users_request_spec.rb +59 -0
- data/spec/models/v1_list_users_response_spec.rb +47 -0
- data/spec/models/v1_paging_response_spec.rb +35 -0
- data/spec/models/v1_paging_spec.rb +35 -0
- data/spec/models/v1_photo_spec.rb +47 -0
- data/spec/models/v1_property_spec.rb +41 -0
- data/spec/models/v1_rating_checkbox_spec.rb +69 -0
- data/spec/models/v1_rating_control_spec.rb +59 -0
- data/spec/models/v1_rating_drop_down_option_spec.rb +69 -0
- data/spec/models/v1_rating_drop_down_spec.rb +47 -0
- data/spec/models/v1_rating_groups_spec.rb +47 -0
- data/spec/models/v1_rating_image_spec.rb +35 -0
- data/spec/models/v1_rating_radio_group_option_spec.rb +63 -0
- data/spec/models/v1_rating_radio_group_spec.rb +47 -0
- data/spec/models/v1_rating_values_spec.rb +47 -0
- data/spec/models/v1_scheduled_inspection_spec.rb +59 -0
- data/spec/models/v1_section_spec.rb +47 -0
- data/spec/models/v1_set_assets_archived_request_spec.rb +53 -0
- data/spec/models/v1_set_assets_archived_response_spec.rb +35 -0
- data/spec/models/v1_set_inspections_archived_request_spec.rb +47 -0
- data/spec/models/v1_set_inspections_archived_response_spec.rb +35 -0
- data/spec/models/v1_set_templates_archived_request_spec.rb +53 -0
- data/spec/models/v1_set_templates_archived_response_spec.rb +35 -0
- data/spec/models/v1_string_array_spec.rb +41 -0
- data/spec/models/v1_template_spec.rb +101 -0
- data/spec/models/v1_unit_spec.rb +47 -0
- data/spec/models/v1_update_account_statuses_request_spec.rb +47 -0
- data/spec/models/v1_update_account_statuses_response_spec.rb +35 -0
- data/spec/models/v1_update_accounts_request_spec.rb +41 -0
- data/spec/models/v1_update_accounts_response_spec.rb +35 -0
- data/spec/models/v1_update_assets_request_spec.rb +53 -0
- data/spec/models/v1_update_assets_response_spec.rb +35 -0
- data/spec/models/v1_update_folder_statuses_request_spec.rb +53 -0
- data/spec/models/v1_update_folder_statuses_response_spec.rb +35 -0
- data/spec/models/v1_update_folders_request_spec.rb +47 -0
- data/spec/models/v1_update_folders_response_spec.rb +41 -0
- data/spec/models/v1_update_inspections_request_spec.rb +47 -0
- data/spec/models/v1_update_inspections_response_spec.rb +35 -0
- data/spec/models/v1_update_templates_request_spec.rb +53 -0
- data/spec/models/v1_update_templates_response_spec.rb +35 -0
- data/spec/models/v1_update_user_statuses_request_spec.rb +53 -0
- data/spec/models/v1_update_user_statuses_response_spec.rb +35 -0
- data/spec/models/v1_update_users_request_spec.rb +47 -0
- data/spec/models/v1_update_users_response_spec.rb +41 -0
- data/spec/models/v1_user_spec.rb +71 -0
- data/spec/spec_helper.rb +110 -0
- metadata +658 -0
@@ -0,0 +1,215 @@
|
|
1
|
+
=begin
|
2
|
+
#Merged swaggers
|
3
|
+
|
4
|
+
#All happy services merged together
|
5
|
+
|
6
|
+
OpenAPI spec version: 0.0.1
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
=end
|
11
|
+
|
12
|
+
require 'date'
|
13
|
+
|
14
|
+
module HappyCo
|
15
|
+
|
16
|
+
class V1RatingControl
|
17
|
+
# * Key is a required field. It is used when a control has a selected value. The key and its selected value(s) will be inserted into an item's values map field and the key and the selected score(s) will be inserted into the item's scores map field. It is also the default string displayed to the user unless custom label(s) are set (see each control type).
|
18
|
+
attr_accessor :key
|
19
|
+
|
20
|
+
attr_accessor :checkbox
|
21
|
+
|
22
|
+
attr_accessor :radio_group
|
23
|
+
|
24
|
+
attr_accessor :drop_down
|
25
|
+
|
26
|
+
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
28
|
+
def self.attribute_map
|
29
|
+
{
|
30
|
+
:'key' => :'key',
|
31
|
+
:'checkbox' => :'checkbox',
|
32
|
+
:'radio_group' => :'radio_group',
|
33
|
+
:'drop_down' => :'drop_down'
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# Attribute type mapping.
|
38
|
+
def self.swagger_types
|
39
|
+
{
|
40
|
+
:'key' => :'String',
|
41
|
+
:'checkbox' => :'V1RatingCheckbox',
|
42
|
+
:'radio_group' => :'V1RatingRadioGroup',
|
43
|
+
:'drop_down' => :'V1RatingDropDown'
|
44
|
+
}
|
45
|
+
end
|
46
|
+
|
47
|
+
# Initializes the object
|
48
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
49
|
+
def initialize(attributes = {})
|
50
|
+
return unless attributes.is_a?(Hash)
|
51
|
+
|
52
|
+
# convert string to symbol for hash key
|
53
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
54
|
+
|
55
|
+
if attributes.has_key?(:'key')
|
56
|
+
self.key = attributes[:'key']
|
57
|
+
end
|
58
|
+
|
59
|
+
if attributes.has_key?(:'checkbox')
|
60
|
+
self.checkbox = attributes[:'checkbox']
|
61
|
+
end
|
62
|
+
|
63
|
+
if attributes.has_key?(:'radio_group')
|
64
|
+
self.radio_group = attributes[:'radio_group']
|
65
|
+
end
|
66
|
+
|
67
|
+
if attributes.has_key?(:'drop_down')
|
68
|
+
self.drop_down = attributes[:'drop_down']
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
72
|
+
|
73
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
74
|
+
# @return Array for valid properies with the reasons
|
75
|
+
def list_invalid_properties
|
76
|
+
invalid_properties = Array.new
|
77
|
+
return invalid_properties
|
78
|
+
end
|
79
|
+
|
80
|
+
# Check to see if the all the properties in the model are valid
|
81
|
+
# @return true if the model is valid
|
82
|
+
def valid?
|
83
|
+
return true
|
84
|
+
end
|
85
|
+
|
86
|
+
# Checks equality by comparing each attribute.
|
87
|
+
# @param [Object] Object to be compared
|
88
|
+
def ==(o)
|
89
|
+
return true if self.equal?(o)
|
90
|
+
self.class == o.class &&
|
91
|
+
key == o.key &&
|
92
|
+
checkbox == o.checkbox &&
|
93
|
+
radio_group == o.radio_group &&
|
94
|
+
drop_down == o.drop_down
|
95
|
+
end
|
96
|
+
|
97
|
+
# @see the `==` method
|
98
|
+
# @param [Object] Object to be compared
|
99
|
+
def eql?(o)
|
100
|
+
self == o
|
101
|
+
end
|
102
|
+
|
103
|
+
# Calculates hash code according to all attributes.
|
104
|
+
# @return [Fixnum] Hash code
|
105
|
+
def hash
|
106
|
+
[key, checkbox, radio_group, drop_down].hash
|
107
|
+
end
|
108
|
+
|
109
|
+
# Builds the object from hash
|
110
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
111
|
+
# @return [Object] Returns the model itself
|
112
|
+
def build_from_hash(attributes)
|
113
|
+
return nil unless attributes.is_a?(Hash)
|
114
|
+
self.class.swagger_types.each_pair do |key, type|
|
115
|
+
if type =~ /\AArray<(.*)>/i
|
116
|
+
# check to ensure the input is an array given that the the attribute
|
117
|
+
# is documented as an array but the input is not
|
118
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
119
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
120
|
+
end
|
121
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
122
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
123
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
124
|
+
end
|
125
|
+
|
126
|
+
self
|
127
|
+
end
|
128
|
+
|
129
|
+
# Deserializes the data based on type
|
130
|
+
# @param string type Data type
|
131
|
+
# @param string value Value to be deserialized
|
132
|
+
# @return [Object] Deserialized data
|
133
|
+
def _deserialize(type, value)
|
134
|
+
case type.to_sym
|
135
|
+
when :DateTime
|
136
|
+
DateTime.parse(value)
|
137
|
+
when :Date
|
138
|
+
Date.parse(value)
|
139
|
+
when :String
|
140
|
+
value.to_s
|
141
|
+
when :Integer
|
142
|
+
value.to_i
|
143
|
+
when :Float
|
144
|
+
value.to_f
|
145
|
+
when :BOOLEAN
|
146
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
147
|
+
true
|
148
|
+
else
|
149
|
+
false
|
150
|
+
end
|
151
|
+
when :Object
|
152
|
+
# generic object (usually a Hash), return directly
|
153
|
+
value
|
154
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
155
|
+
inner_type = Regexp.last_match[:inner_type]
|
156
|
+
value.map { |v| _deserialize(inner_type, v) }
|
157
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
158
|
+
k_type = Regexp.last_match[:k_type]
|
159
|
+
v_type = Regexp.last_match[:v_type]
|
160
|
+
{}.tap do |hash|
|
161
|
+
value.each do |k, v|
|
162
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
163
|
+
end
|
164
|
+
end
|
165
|
+
else # model
|
166
|
+
temp_model = HappyCo.const_get(type).new
|
167
|
+
temp_model.build_from_hash(value)
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
# Returns the string representation of the object
|
172
|
+
# @return [String] String presentation of the object
|
173
|
+
def to_s
|
174
|
+
to_hash.to_s
|
175
|
+
end
|
176
|
+
|
177
|
+
# to_body is an alias to to_hash (backward compatibility)
|
178
|
+
# @return [Hash] Returns the object in the form of hash
|
179
|
+
def to_body
|
180
|
+
to_hash
|
181
|
+
end
|
182
|
+
|
183
|
+
# Returns the object in the form of hash
|
184
|
+
# @return [Hash] Returns the object in the form of hash
|
185
|
+
def to_hash
|
186
|
+
hash = {}
|
187
|
+
self.class.attribute_map.each_pair do |attr, param|
|
188
|
+
value = self.send(attr)
|
189
|
+
next if value.nil?
|
190
|
+
hash[param] = _to_hash(value)
|
191
|
+
end
|
192
|
+
hash
|
193
|
+
end
|
194
|
+
|
195
|
+
# Outputs non-array value in the form of hash
|
196
|
+
# For object, use to_hash. Otherwise, just return the value
|
197
|
+
# @param [Object] value Any valid value
|
198
|
+
# @return [Hash] Returns the value in the form of hash
|
199
|
+
def _to_hash(value)
|
200
|
+
if value.is_a?(Array)
|
201
|
+
value.compact.map{ |v| _to_hash(v) }
|
202
|
+
elsif value.is_a?(Hash)
|
203
|
+
{}.tap do |hash|
|
204
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
205
|
+
end
|
206
|
+
elsif value.respond_to? :to_hash
|
207
|
+
value.to_hash
|
208
|
+
else
|
209
|
+
value
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
213
|
+
end
|
214
|
+
|
215
|
+
end
|
@@ -0,0 +1,199 @@
|
|
1
|
+
=begin
|
2
|
+
#Merged swaggers
|
3
|
+
|
4
|
+
#All happy services merged together
|
5
|
+
|
6
|
+
OpenAPI spec version: 0.0.1
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
=end
|
11
|
+
|
12
|
+
require 'date'
|
13
|
+
|
14
|
+
module HappyCo
|
15
|
+
# * Rating drop downs are currently mutually exclusive controls. They can have none or one option selected. They differ from radio controls in that each option can have its own label.
|
16
|
+
class V1RatingDropDown
|
17
|
+
# * Label is an optional field that will override key as the user to be displayed. This is useful for localization of inspections.
|
18
|
+
attr_accessor :label
|
19
|
+
|
20
|
+
attr_accessor :options
|
21
|
+
|
22
|
+
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
24
|
+
def self.attribute_map
|
25
|
+
{
|
26
|
+
:'label' => :'label',
|
27
|
+
:'options' => :'options'
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
# Attribute type mapping.
|
32
|
+
def self.swagger_types
|
33
|
+
{
|
34
|
+
:'label' => :'String',
|
35
|
+
:'options' => :'Array<V1RatingDropDownOption>'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# Initializes the object
|
40
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
41
|
+
def initialize(attributes = {})
|
42
|
+
return unless attributes.is_a?(Hash)
|
43
|
+
|
44
|
+
# convert string to symbol for hash key
|
45
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
46
|
+
|
47
|
+
if attributes.has_key?(:'label')
|
48
|
+
self.label = attributes[:'label']
|
49
|
+
end
|
50
|
+
|
51
|
+
if attributes.has_key?(:'options')
|
52
|
+
if (value = attributes[:'options']).is_a?(Array)
|
53
|
+
self.options = value
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
|
59
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
60
|
+
# @return Array for valid properies with the reasons
|
61
|
+
def list_invalid_properties
|
62
|
+
invalid_properties = Array.new
|
63
|
+
return invalid_properties
|
64
|
+
end
|
65
|
+
|
66
|
+
# Check to see if the all the properties in the model are valid
|
67
|
+
# @return true if the model is valid
|
68
|
+
def valid?
|
69
|
+
return true
|
70
|
+
end
|
71
|
+
|
72
|
+
# Checks equality by comparing each attribute.
|
73
|
+
# @param [Object] Object to be compared
|
74
|
+
def ==(o)
|
75
|
+
return true if self.equal?(o)
|
76
|
+
self.class == o.class &&
|
77
|
+
label == o.label &&
|
78
|
+
options == o.options
|
79
|
+
end
|
80
|
+
|
81
|
+
# @see the `==` method
|
82
|
+
# @param [Object] Object to be compared
|
83
|
+
def eql?(o)
|
84
|
+
self == o
|
85
|
+
end
|
86
|
+
|
87
|
+
# Calculates hash code according to all attributes.
|
88
|
+
# @return [Fixnum] Hash code
|
89
|
+
def hash
|
90
|
+
[label, options].hash
|
91
|
+
end
|
92
|
+
|
93
|
+
# Builds the object from hash
|
94
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
95
|
+
# @return [Object] Returns the model itself
|
96
|
+
def build_from_hash(attributes)
|
97
|
+
return nil unless attributes.is_a?(Hash)
|
98
|
+
self.class.swagger_types.each_pair do |key, type|
|
99
|
+
if type =~ /\AArray<(.*)>/i
|
100
|
+
# check to ensure the input is an array given that the the attribute
|
101
|
+
# is documented as an array but the input is not
|
102
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
103
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
104
|
+
end
|
105
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
106
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
107
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
108
|
+
end
|
109
|
+
|
110
|
+
self
|
111
|
+
end
|
112
|
+
|
113
|
+
# Deserializes the data based on type
|
114
|
+
# @param string type Data type
|
115
|
+
# @param string value Value to be deserialized
|
116
|
+
# @return [Object] Deserialized data
|
117
|
+
def _deserialize(type, value)
|
118
|
+
case type.to_sym
|
119
|
+
when :DateTime
|
120
|
+
DateTime.parse(value)
|
121
|
+
when :Date
|
122
|
+
Date.parse(value)
|
123
|
+
when :String
|
124
|
+
value.to_s
|
125
|
+
when :Integer
|
126
|
+
value.to_i
|
127
|
+
when :Float
|
128
|
+
value.to_f
|
129
|
+
when :BOOLEAN
|
130
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
131
|
+
true
|
132
|
+
else
|
133
|
+
false
|
134
|
+
end
|
135
|
+
when :Object
|
136
|
+
# generic object (usually a Hash), return directly
|
137
|
+
value
|
138
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
139
|
+
inner_type = Regexp.last_match[:inner_type]
|
140
|
+
value.map { |v| _deserialize(inner_type, v) }
|
141
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
142
|
+
k_type = Regexp.last_match[:k_type]
|
143
|
+
v_type = Regexp.last_match[:v_type]
|
144
|
+
{}.tap do |hash|
|
145
|
+
value.each do |k, v|
|
146
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
147
|
+
end
|
148
|
+
end
|
149
|
+
else # model
|
150
|
+
temp_model = HappyCo.const_get(type).new
|
151
|
+
temp_model.build_from_hash(value)
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
# Returns the string representation of the object
|
156
|
+
# @return [String] String presentation of the object
|
157
|
+
def to_s
|
158
|
+
to_hash.to_s
|
159
|
+
end
|
160
|
+
|
161
|
+
# to_body is an alias to to_hash (backward compatibility)
|
162
|
+
# @return [Hash] Returns the object in the form of hash
|
163
|
+
def to_body
|
164
|
+
to_hash
|
165
|
+
end
|
166
|
+
|
167
|
+
# Returns the object in the form of hash
|
168
|
+
# @return [Hash] Returns the object in the form of hash
|
169
|
+
def to_hash
|
170
|
+
hash = {}
|
171
|
+
self.class.attribute_map.each_pair do |attr, param|
|
172
|
+
value = self.send(attr)
|
173
|
+
next if value.nil?
|
174
|
+
hash[param] = _to_hash(value)
|
175
|
+
end
|
176
|
+
hash
|
177
|
+
end
|
178
|
+
|
179
|
+
# Outputs non-array value in the form of hash
|
180
|
+
# For object, use to_hash. Otherwise, just return the value
|
181
|
+
# @param [Object] value Any valid value
|
182
|
+
# @return [Hash] Returns the value in the form of hash
|
183
|
+
def _to_hash(value)
|
184
|
+
if value.is_a?(Array)
|
185
|
+
value.compact.map{ |v| _to_hash(v) }
|
186
|
+
elsif value.is_a?(Hash)
|
187
|
+
{}.tap do |hash|
|
188
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
189
|
+
end
|
190
|
+
elsif value.respond_to? :to_hash
|
191
|
+
value.to_hash
|
192
|
+
else
|
193
|
+
value
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
197
|
+
end
|
198
|
+
|
199
|
+
end
|
@@ -0,0 +1,261 @@
|
|
1
|
+
=begin
|
2
|
+
#Merged swaggers
|
3
|
+
|
4
|
+
#All happy services merged together
|
5
|
+
|
6
|
+
OpenAPI spec version: 0.0.1
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
=end
|
11
|
+
|
12
|
+
require 'date'
|
13
|
+
|
14
|
+
module HappyCo
|
15
|
+
# * Rating drop down options represent one of the selectable options in a drop down.
|
16
|
+
class V1RatingDropDownOption
|
17
|
+
# * Label is an optional field that will override the value as the defaul option to be displayed to the user for this option. This is useful for localization of inspections.
|
18
|
+
attr_accessor :label
|
19
|
+
|
20
|
+
# * Value is a required field that will be inserted into the item and shown on reports if this radio option is selected. No two options in the same drop down can have the same value.
|
21
|
+
attr_accessor :value
|
22
|
+
|
23
|
+
# * Score is an optional field that will be inserted into the item and can be shown on reports if this drop down option is selected.
|
24
|
+
attr_accessor :score
|
25
|
+
|
26
|
+
attr_accessor :color
|
27
|
+
|
28
|
+
attr_accessor :image
|
29
|
+
|
30
|
+
class EnumAttributeValidator
|
31
|
+
attr_reader :datatype
|
32
|
+
attr_reader :allowable_values
|
33
|
+
|
34
|
+
def initialize(datatype, allowable_values)
|
35
|
+
@allowable_values = allowable_values.map do |value|
|
36
|
+
case datatype.to_s
|
37
|
+
when /Integer/i
|
38
|
+
value.to_i
|
39
|
+
when /Float/i
|
40
|
+
value.to_f
|
41
|
+
else
|
42
|
+
value
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def valid?(value)
|
48
|
+
!value || allowable_values.include?(value)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
53
|
+
def self.attribute_map
|
54
|
+
{
|
55
|
+
:'label' => :'label',
|
56
|
+
:'value' => :'value',
|
57
|
+
:'score' => :'score',
|
58
|
+
:'color' => :'color',
|
59
|
+
:'image' => :'image'
|
60
|
+
}
|
61
|
+
end
|
62
|
+
|
63
|
+
# Attribute type mapping.
|
64
|
+
def self.swagger_types
|
65
|
+
{
|
66
|
+
:'label' => :'String',
|
67
|
+
:'value' => :'String',
|
68
|
+
:'score' => :'Float',
|
69
|
+
:'color' => :'String',
|
70
|
+
:'image' => :'String'
|
71
|
+
}
|
72
|
+
end
|
73
|
+
|
74
|
+
# Initializes the object
|
75
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
76
|
+
def initialize(attributes = {})
|
77
|
+
return unless attributes.is_a?(Hash)
|
78
|
+
|
79
|
+
# convert string to symbol for hash key
|
80
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
81
|
+
|
82
|
+
if attributes.has_key?(:'label')
|
83
|
+
self.label = attributes[:'label']
|
84
|
+
end
|
85
|
+
|
86
|
+
if attributes.has_key?(:'value')
|
87
|
+
self.value = attributes[:'value']
|
88
|
+
end
|
89
|
+
|
90
|
+
if attributes.has_key?(:'score')
|
91
|
+
self.score = attributes[:'score']
|
92
|
+
end
|
93
|
+
|
94
|
+
if attributes.has_key?(:'color')
|
95
|
+
self.color = attributes[:'color']
|
96
|
+
end
|
97
|
+
|
98
|
+
if attributes.has_key?(:'image')
|
99
|
+
self.image = attributes[:'image']
|
100
|
+
else
|
101
|
+
self.image = "UNDEFINED"
|
102
|
+
end
|
103
|
+
|
104
|
+
end
|
105
|
+
|
106
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
107
|
+
# @return Array for valid properies with the reasons
|
108
|
+
def list_invalid_properties
|
109
|
+
invalid_properties = Array.new
|
110
|
+
return invalid_properties
|
111
|
+
end
|
112
|
+
|
113
|
+
# Check to see if the all the properties in the model are valid
|
114
|
+
# @return true if the model is valid
|
115
|
+
def valid?
|
116
|
+
image_validator = EnumAttributeValidator.new('String', ["UNDEFINED", "STAR_FULL", "STAR_HALF", "STAR_EMPTY", "TICK_ROUND", "CLEAN", "SCRATCHES", "SPLAT", "BROKEN", "TICK", "CROSS", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "DIGIT_0", "DIGIT_1", "DIGIT_2", "DIGIT_3", "DIGIT_4", "DIGIT_5", "DIGIT_6", "DIGIT_7", "DIGIT_8", "DIGIT_9", "EXCLAMATION", "QUESTION", "EXCLAMATION_QUESTION", "DOUBLE_EXCLAMATION", "DOLLAR", "POUND", "CENTS", "THUMBS_UP", "THUMBS_DOWN", "AWARD", "FEMALE", "MALE", "CALENDAR", "BUILDINGS", "BUILDING", "HOUSE", "NO_ENTRY", "DOG", "CAT", "RAT", "CIGARETTE", "NO_SMOKING", "POOP", "WEED", "GUN", "BROKEN_GLASS", "CRACKED", "DEAD_FACE", "HANDICAP", "BROKEN_HEART", "HEART", "SYRINGE", "CLOCK", "MUSIC_NOTE", "PLANT", "NOSE", "DROPLET", "ELECTRIC", "BUG", "ARROW_RIGHT", "ARROW_LEFT", "ARROW_UP", "ARROW_DOWN", "RECYCLE", "TRASH", "KEY", "LOCK", "UNLOCK", "CLOUD", "SUNSHINE", "PLUS", "MINUS", "TEXTFIELD", "METER", "CAR", "CHART", "WRENCH", "CALCULATOR", "CREDIT_CARD", "PAINTBRUSH", "ROLLER", "MOBILE", "FLAG", "DOOR_OPEN", "DOOR_SHUT", "BED", "SHOWER", "SMOKE_ALARM", "LIGHT_BULB", "SMILEY_HAPPY", "SMILEY_SAD"])
|
117
|
+
return false unless image_validator.valid?(@image)
|
118
|
+
return true
|
119
|
+
end
|
120
|
+
|
121
|
+
# Custom attribute writer method checking allowed values (enum).
|
122
|
+
# @param [Object] image Object to be assigned
|
123
|
+
def image=(image)
|
124
|
+
validator = EnumAttributeValidator.new('String', ["UNDEFINED", "STAR_FULL", "STAR_HALF", "STAR_EMPTY", "TICK_ROUND", "CLEAN", "SCRATCHES", "SPLAT", "BROKEN", "TICK", "CROSS", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "DIGIT_0", "DIGIT_1", "DIGIT_2", "DIGIT_3", "DIGIT_4", "DIGIT_5", "DIGIT_6", "DIGIT_7", "DIGIT_8", "DIGIT_9", "EXCLAMATION", "QUESTION", "EXCLAMATION_QUESTION", "DOUBLE_EXCLAMATION", "DOLLAR", "POUND", "CENTS", "THUMBS_UP", "THUMBS_DOWN", "AWARD", "FEMALE", "MALE", "CALENDAR", "BUILDINGS", "BUILDING", "HOUSE", "NO_ENTRY", "DOG", "CAT", "RAT", "CIGARETTE", "NO_SMOKING", "POOP", "WEED", "GUN", "BROKEN_GLASS", "CRACKED", "DEAD_FACE", "HANDICAP", "BROKEN_HEART", "HEART", "SYRINGE", "CLOCK", "MUSIC_NOTE", "PLANT", "NOSE", "DROPLET", "ELECTRIC", "BUG", "ARROW_RIGHT", "ARROW_LEFT", "ARROW_UP", "ARROW_DOWN", "RECYCLE", "TRASH", "KEY", "LOCK", "UNLOCK", "CLOUD", "SUNSHINE", "PLUS", "MINUS", "TEXTFIELD", "METER", "CAR", "CHART", "WRENCH", "CALCULATOR", "CREDIT_CARD", "PAINTBRUSH", "ROLLER", "MOBILE", "FLAG", "DOOR_OPEN", "DOOR_SHUT", "BED", "SHOWER", "SMOKE_ALARM", "LIGHT_BULB", "SMILEY_HAPPY", "SMILEY_SAD"])
|
125
|
+
unless validator.valid?(image)
|
126
|
+
fail ArgumentError, "invalid value for 'image', must be one of #{validator.allowable_values}."
|
127
|
+
end
|
128
|
+
@image = image
|
129
|
+
end
|
130
|
+
|
131
|
+
# Checks equality by comparing each attribute.
|
132
|
+
# @param [Object] Object to be compared
|
133
|
+
def ==(o)
|
134
|
+
return true if self.equal?(o)
|
135
|
+
self.class == o.class &&
|
136
|
+
label == o.label &&
|
137
|
+
value == o.value &&
|
138
|
+
score == o.score &&
|
139
|
+
color == o.color &&
|
140
|
+
image == o.image
|
141
|
+
end
|
142
|
+
|
143
|
+
# @see the `==` method
|
144
|
+
# @param [Object] Object to be compared
|
145
|
+
def eql?(o)
|
146
|
+
self == o
|
147
|
+
end
|
148
|
+
|
149
|
+
# Calculates hash code according to all attributes.
|
150
|
+
# @return [Fixnum] Hash code
|
151
|
+
def hash
|
152
|
+
[label, value, score, color, image].hash
|
153
|
+
end
|
154
|
+
|
155
|
+
# Builds the object from hash
|
156
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
157
|
+
# @return [Object] Returns the model itself
|
158
|
+
def build_from_hash(attributes)
|
159
|
+
return nil unless attributes.is_a?(Hash)
|
160
|
+
self.class.swagger_types.each_pair do |key, type|
|
161
|
+
if type =~ /\AArray<(.*)>/i
|
162
|
+
# check to ensure the input is an array given that the the attribute
|
163
|
+
# is documented as an array but the input is not
|
164
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
165
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
166
|
+
end
|
167
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
168
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
169
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
170
|
+
end
|
171
|
+
|
172
|
+
self
|
173
|
+
end
|
174
|
+
|
175
|
+
# Deserializes the data based on type
|
176
|
+
# @param string type Data type
|
177
|
+
# @param string value Value to be deserialized
|
178
|
+
# @return [Object] Deserialized data
|
179
|
+
def _deserialize(type, value)
|
180
|
+
case type.to_sym
|
181
|
+
when :DateTime
|
182
|
+
DateTime.parse(value)
|
183
|
+
when :Date
|
184
|
+
Date.parse(value)
|
185
|
+
when :String
|
186
|
+
value.to_s
|
187
|
+
when :Integer
|
188
|
+
value.to_i
|
189
|
+
when :Float
|
190
|
+
value.to_f
|
191
|
+
when :BOOLEAN
|
192
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
193
|
+
true
|
194
|
+
else
|
195
|
+
false
|
196
|
+
end
|
197
|
+
when :Object
|
198
|
+
# generic object (usually a Hash), return directly
|
199
|
+
value
|
200
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
201
|
+
inner_type = Regexp.last_match[:inner_type]
|
202
|
+
value.map { |v| _deserialize(inner_type, v) }
|
203
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
204
|
+
k_type = Regexp.last_match[:k_type]
|
205
|
+
v_type = Regexp.last_match[:v_type]
|
206
|
+
{}.tap do |hash|
|
207
|
+
value.each do |k, v|
|
208
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
209
|
+
end
|
210
|
+
end
|
211
|
+
else # model
|
212
|
+
temp_model = HappyCo.const_get(type).new
|
213
|
+
temp_model.build_from_hash(value)
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
217
|
+
# Returns the string representation of the object
|
218
|
+
# @return [String] String presentation of the object
|
219
|
+
def to_s
|
220
|
+
to_hash.to_s
|
221
|
+
end
|
222
|
+
|
223
|
+
# to_body is an alias to to_hash (backward compatibility)
|
224
|
+
# @return [Hash] Returns the object in the form of hash
|
225
|
+
def to_body
|
226
|
+
to_hash
|
227
|
+
end
|
228
|
+
|
229
|
+
# Returns the object in the form of hash
|
230
|
+
# @return [Hash] Returns the object in the form of hash
|
231
|
+
def to_hash
|
232
|
+
hash = {}
|
233
|
+
self.class.attribute_map.each_pair do |attr, param|
|
234
|
+
value = self.send(attr)
|
235
|
+
next if value.nil?
|
236
|
+
hash[param] = _to_hash(value)
|
237
|
+
end
|
238
|
+
hash
|
239
|
+
end
|
240
|
+
|
241
|
+
# Outputs non-array value in the form of hash
|
242
|
+
# For object, use to_hash. Otherwise, just return the value
|
243
|
+
# @param [Object] value Any valid value
|
244
|
+
# @return [Hash] Returns the value in the form of hash
|
245
|
+
def _to_hash(value)
|
246
|
+
if value.is_a?(Array)
|
247
|
+
value.compact.map{ |v| _to_hash(v) }
|
248
|
+
elsif value.is_a?(Hash)
|
249
|
+
{}.tap do |hash|
|
250
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
251
|
+
end
|
252
|
+
elsif value.respond_to? :to_hash
|
253
|
+
value.to_hash
|
254
|
+
else
|
255
|
+
value
|
256
|
+
end
|
257
|
+
end
|
258
|
+
|
259
|
+
end
|
260
|
+
|
261
|
+
end
|