happyco_json 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,254 @@
|
|
|
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
|
+
# * Item contains most of the inspection information such as; selected rating values, notes and photos. The name of an item should make sense in context of the section which they are a child of. An item corresponds to an individual inspection row within the inspection.
|
|
16
|
+
class V1Item
|
|
17
|
+
# * Name is an optional field but should be set to something that makes sense in context of the parent section. For example; 'Kitchen': 'Sink', 'Floor 1': 'Water Heater'.
|
|
18
|
+
attr_accessor :name
|
|
19
|
+
|
|
20
|
+
# * Notes is an optional field where inspectors can type custom notes (optionally using SnapText) that pertain to this item.
|
|
21
|
+
attr_accessor :notes
|
|
22
|
+
|
|
23
|
+
# * Info is an optional field that can be used to provide helpful information to the inspector. It is not shown on the report and is primarily used to help training.
|
|
24
|
+
attr_accessor :info
|
|
25
|
+
|
|
26
|
+
# * Photos data can be added with the AddInspectionPhotos api.
|
|
27
|
+
attr_accessor :photos
|
|
28
|
+
|
|
29
|
+
# * Rating group key is a string that can be used to access a rating group from the parent inspection. A rating group must exist for this key within the inspection for the value to be valid.
|
|
30
|
+
attr_accessor :rating_group_key
|
|
31
|
+
|
|
32
|
+
# * Values are a map of rating keys and the selected value(s). That can be referenced using the item's associated rating group.
|
|
33
|
+
attr_accessor :values
|
|
34
|
+
|
|
35
|
+
# * Scores are a map of rating keys and the selected score(s). That can be referenced using the item's associated rating group.
|
|
36
|
+
attr_accessor :scores
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
40
|
+
def self.attribute_map
|
|
41
|
+
{
|
|
42
|
+
:'name' => :'name',
|
|
43
|
+
:'notes' => :'notes',
|
|
44
|
+
:'info' => :'info',
|
|
45
|
+
:'photos' => :'photos',
|
|
46
|
+
:'rating_group_key' => :'rating_group_key',
|
|
47
|
+
:'values' => :'values',
|
|
48
|
+
:'scores' => :'scores'
|
|
49
|
+
}
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Attribute type mapping.
|
|
53
|
+
def self.swagger_types
|
|
54
|
+
{
|
|
55
|
+
:'name' => :'String',
|
|
56
|
+
:'notes' => :'String',
|
|
57
|
+
:'info' => :'String',
|
|
58
|
+
:'photos' => :'Array<V1Photo>',
|
|
59
|
+
:'rating_group_key' => :'String',
|
|
60
|
+
:'values' => :'Hash<String, V1RatingValues>',
|
|
61
|
+
:'scores' => :'Hash<String, V1FloatArray>'
|
|
62
|
+
}
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Initializes the object
|
|
66
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
67
|
+
def initialize(attributes = {})
|
|
68
|
+
return unless attributes.is_a?(Hash)
|
|
69
|
+
|
|
70
|
+
# convert string to symbol for hash key
|
|
71
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
|
72
|
+
|
|
73
|
+
if attributes.has_key?(:'name')
|
|
74
|
+
self.name = attributes[:'name']
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
if attributes.has_key?(:'notes')
|
|
78
|
+
self.notes = attributes[:'notes']
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
if attributes.has_key?(:'info')
|
|
82
|
+
self.info = attributes[:'info']
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
if attributes.has_key?(:'photos')
|
|
86
|
+
if (value = attributes[:'photos']).is_a?(Array)
|
|
87
|
+
self.photos = value
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
if attributes.has_key?(:'rating_group_key')
|
|
92
|
+
self.rating_group_key = attributes[:'rating_group_key']
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if attributes.has_key?(:'values')
|
|
96
|
+
if (value = attributes[:'values']).is_a?(Array)
|
|
97
|
+
self.values = value
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
if attributes.has_key?(:'scores')
|
|
102
|
+
if (value = attributes[:'scores']).is_a?(Array)
|
|
103
|
+
self.scores = value
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
110
|
+
# @return Array for valid properies with the reasons
|
|
111
|
+
def list_invalid_properties
|
|
112
|
+
invalid_properties = Array.new
|
|
113
|
+
return invalid_properties
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Check to see if the all the properties in the model are valid
|
|
117
|
+
# @return true if the model is valid
|
|
118
|
+
def valid?
|
|
119
|
+
return true
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# Checks equality by comparing each attribute.
|
|
123
|
+
# @param [Object] Object to be compared
|
|
124
|
+
def ==(o)
|
|
125
|
+
return true if self.equal?(o)
|
|
126
|
+
self.class == o.class &&
|
|
127
|
+
name == o.name &&
|
|
128
|
+
notes == o.notes &&
|
|
129
|
+
info == o.info &&
|
|
130
|
+
photos == o.photos &&
|
|
131
|
+
rating_group_key == o.rating_group_key &&
|
|
132
|
+
values == o.values &&
|
|
133
|
+
scores == o.scores
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# @see the `==` method
|
|
137
|
+
# @param [Object] Object to be compared
|
|
138
|
+
def eql?(o)
|
|
139
|
+
self == o
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# Calculates hash code according to all attributes.
|
|
143
|
+
# @return [Fixnum] Hash code
|
|
144
|
+
def hash
|
|
145
|
+
[name, notes, info, photos, rating_group_key, values, scores].hash
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# Builds the object from hash
|
|
149
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
150
|
+
# @return [Object] Returns the model itself
|
|
151
|
+
def build_from_hash(attributes)
|
|
152
|
+
return nil unless attributes.is_a?(Hash)
|
|
153
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
154
|
+
if type =~ /\AArray<(.*)>/i
|
|
155
|
+
# check to ensure the input is an array given that the the attribute
|
|
156
|
+
# is documented as an array but the input is not
|
|
157
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
158
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
|
159
|
+
end
|
|
160
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
161
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
162
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
self
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# Deserializes the data based on type
|
|
169
|
+
# @param string type Data type
|
|
170
|
+
# @param string value Value to be deserialized
|
|
171
|
+
# @return [Object] Deserialized data
|
|
172
|
+
def _deserialize(type, value)
|
|
173
|
+
case type.to_sym
|
|
174
|
+
when :DateTime
|
|
175
|
+
DateTime.parse(value)
|
|
176
|
+
when :Date
|
|
177
|
+
Date.parse(value)
|
|
178
|
+
when :String
|
|
179
|
+
value.to_s
|
|
180
|
+
when :Integer
|
|
181
|
+
value.to_i
|
|
182
|
+
when :Float
|
|
183
|
+
value.to_f
|
|
184
|
+
when :BOOLEAN
|
|
185
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
186
|
+
true
|
|
187
|
+
else
|
|
188
|
+
false
|
|
189
|
+
end
|
|
190
|
+
when :Object
|
|
191
|
+
# generic object (usually a Hash), return directly
|
|
192
|
+
value
|
|
193
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
194
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
195
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
196
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
197
|
+
k_type = Regexp.last_match[:k_type]
|
|
198
|
+
v_type = Regexp.last_match[:v_type]
|
|
199
|
+
{}.tap do |hash|
|
|
200
|
+
value.each do |k, v|
|
|
201
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
202
|
+
end
|
|
203
|
+
end
|
|
204
|
+
else # model
|
|
205
|
+
temp_model = HappyCo.const_get(type).new
|
|
206
|
+
temp_model.build_from_hash(value)
|
|
207
|
+
end
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
# Returns the string representation of the object
|
|
211
|
+
# @return [String] String presentation of the object
|
|
212
|
+
def to_s
|
|
213
|
+
to_hash.to_s
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
217
|
+
# @return [Hash] Returns the object in the form of hash
|
|
218
|
+
def to_body
|
|
219
|
+
to_hash
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
# Returns the object in the form of hash
|
|
223
|
+
# @return [Hash] Returns the object in the form of hash
|
|
224
|
+
def to_hash
|
|
225
|
+
hash = {}
|
|
226
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
227
|
+
value = self.send(attr)
|
|
228
|
+
next if value.nil?
|
|
229
|
+
hash[param] = _to_hash(value)
|
|
230
|
+
end
|
|
231
|
+
hash
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
# Outputs non-array value in the form of hash
|
|
235
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
236
|
+
# @param [Object] value Any valid value
|
|
237
|
+
# @return [Hash] Returns the value in the form of hash
|
|
238
|
+
def _to_hash(value)
|
|
239
|
+
if value.is_a?(Array)
|
|
240
|
+
value.compact.map{ |v| _to_hash(v) }
|
|
241
|
+
elsif value.is_a?(Hash)
|
|
242
|
+
{}.tap do |hash|
|
|
243
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
244
|
+
end
|
|
245
|
+
elsif value.respond_to? :to_hash
|
|
246
|
+
value.to_hash
|
|
247
|
+
else
|
|
248
|
+
value
|
|
249
|
+
end
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
end
|
|
@@ -0,0 +1,207 @@
|
|
|
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 V1ListAccountsRequest
|
|
17
|
+
attr_accessor :account_ids
|
|
18
|
+
|
|
19
|
+
attr_accessor :include_inactive
|
|
20
|
+
|
|
21
|
+
attr_accessor :paging
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
|
+
def self.attribute_map
|
|
26
|
+
{
|
|
27
|
+
:'account_ids' => :'account_ids',
|
|
28
|
+
:'include_inactive' => :'include_inactive',
|
|
29
|
+
:'paging' => :'paging'
|
|
30
|
+
}
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Attribute type mapping.
|
|
34
|
+
def self.swagger_types
|
|
35
|
+
{
|
|
36
|
+
:'account_ids' => :'Array<V1IntegrationID>',
|
|
37
|
+
:'include_inactive' => :'BOOLEAN',
|
|
38
|
+
:'paging' => :'V1Paging'
|
|
39
|
+
}
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Initializes the object
|
|
43
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
44
|
+
def initialize(attributes = {})
|
|
45
|
+
return unless attributes.is_a?(Hash)
|
|
46
|
+
|
|
47
|
+
# convert string to symbol for hash key
|
|
48
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
|
49
|
+
|
|
50
|
+
if attributes.has_key?(:'account_ids')
|
|
51
|
+
if (value = attributes[:'account_ids']).is_a?(Array)
|
|
52
|
+
self.account_ids = value
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
if attributes.has_key?(:'include_inactive')
|
|
57
|
+
self.include_inactive = attributes[:'include_inactive']
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
if attributes.has_key?(:'paging')
|
|
61
|
+
self.paging = attributes[:'paging']
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
67
|
+
# @return Array for valid properies with the reasons
|
|
68
|
+
def list_invalid_properties
|
|
69
|
+
invalid_properties = Array.new
|
|
70
|
+
return invalid_properties
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Check to see if the all the properties in the model are valid
|
|
74
|
+
# @return true if the model is valid
|
|
75
|
+
def valid?
|
|
76
|
+
return true
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Checks equality by comparing each attribute.
|
|
80
|
+
# @param [Object] Object to be compared
|
|
81
|
+
def ==(o)
|
|
82
|
+
return true if self.equal?(o)
|
|
83
|
+
self.class == o.class &&
|
|
84
|
+
account_ids == o.account_ids &&
|
|
85
|
+
include_inactive == o.include_inactive &&
|
|
86
|
+
paging == o.paging
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# @see the `==` method
|
|
90
|
+
# @param [Object] Object to be compared
|
|
91
|
+
def eql?(o)
|
|
92
|
+
self == o
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Calculates hash code according to all attributes.
|
|
96
|
+
# @return [Fixnum] Hash code
|
|
97
|
+
def hash
|
|
98
|
+
[account_ids, include_inactive, paging].hash
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Builds the object from hash
|
|
102
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
103
|
+
# @return [Object] Returns the model itself
|
|
104
|
+
def build_from_hash(attributes)
|
|
105
|
+
return nil unless attributes.is_a?(Hash)
|
|
106
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
107
|
+
if type =~ /\AArray<(.*)>/i
|
|
108
|
+
# check to ensure the input is an array given that the the attribute
|
|
109
|
+
# is documented as an array but the input is not
|
|
110
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
111
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
|
112
|
+
end
|
|
113
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
114
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
115
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
self
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Deserializes the data based on type
|
|
122
|
+
# @param string type Data type
|
|
123
|
+
# @param string value Value to be deserialized
|
|
124
|
+
# @return [Object] Deserialized data
|
|
125
|
+
def _deserialize(type, value)
|
|
126
|
+
case type.to_sym
|
|
127
|
+
when :DateTime
|
|
128
|
+
DateTime.parse(value)
|
|
129
|
+
when :Date
|
|
130
|
+
Date.parse(value)
|
|
131
|
+
when :String
|
|
132
|
+
value.to_s
|
|
133
|
+
when :Integer
|
|
134
|
+
value.to_i
|
|
135
|
+
when :Float
|
|
136
|
+
value.to_f
|
|
137
|
+
when :BOOLEAN
|
|
138
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
139
|
+
true
|
|
140
|
+
else
|
|
141
|
+
false
|
|
142
|
+
end
|
|
143
|
+
when :Object
|
|
144
|
+
# generic object (usually a Hash), return directly
|
|
145
|
+
value
|
|
146
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
147
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
148
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
149
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
150
|
+
k_type = Regexp.last_match[:k_type]
|
|
151
|
+
v_type = Regexp.last_match[:v_type]
|
|
152
|
+
{}.tap do |hash|
|
|
153
|
+
value.each do |k, v|
|
|
154
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
155
|
+
end
|
|
156
|
+
end
|
|
157
|
+
else # model
|
|
158
|
+
temp_model = HappyCo.const_get(type).new
|
|
159
|
+
temp_model.build_from_hash(value)
|
|
160
|
+
end
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# Returns the string representation of the object
|
|
164
|
+
# @return [String] String presentation of the object
|
|
165
|
+
def to_s
|
|
166
|
+
to_hash.to_s
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
170
|
+
# @return [Hash] Returns the object in the form of hash
|
|
171
|
+
def to_body
|
|
172
|
+
to_hash
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Returns the object in the form of hash
|
|
176
|
+
# @return [Hash] Returns the object in the form of hash
|
|
177
|
+
def to_hash
|
|
178
|
+
hash = {}
|
|
179
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
180
|
+
value = self.send(attr)
|
|
181
|
+
next if value.nil?
|
|
182
|
+
hash[param] = _to_hash(value)
|
|
183
|
+
end
|
|
184
|
+
hash
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# Outputs non-array value in the form of hash
|
|
188
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
189
|
+
# @param [Object] value Any valid value
|
|
190
|
+
# @return [Hash] Returns the value in the form of hash
|
|
191
|
+
def _to_hash(value)
|
|
192
|
+
if value.is_a?(Array)
|
|
193
|
+
value.compact.map{ |v| _to_hash(v) }
|
|
194
|
+
elsif value.is_a?(Hash)
|
|
195
|
+
{}.tap do |hash|
|
|
196
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
197
|
+
end
|
|
198
|
+
elsif value.respond_to? :to_hash
|
|
199
|
+
value.to_hash
|
|
200
|
+
else
|
|
201
|
+
value
|
|
202
|
+
end
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
end
|
|
@@ -0,0 +1,198 @@
|
|
|
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 V1ListAccountsResponse
|
|
17
|
+
attr_accessor :accounts
|
|
18
|
+
|
|
19
|
+
attr_accessor :paging
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
|
+
def self.attribute_map
|
|
24
|
+
{
|
|
25
|
+
:'accounts' => :'accounts',
|
|
26
|
+
:'paging' => :'paging'
|
|
27
|
+
}
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Attribute type mapping.
|
|
31
|
+
def self.swagger_types
|
|
32
|
+
{
|
|
33
|
+
:'accounts' => :'Array<V1Account>',
|
|
34
|
+
:'paging' => :'V1PagingResponse'
|
|
35
|
+
}
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Initializes the object
|
|
39
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
40
|
+
def initialize(attributes = {})
|
|
41
|
+
return unless attributes.is_a?(Hash)
|
|
42
|
+
|
|
43
|
+
# convert string to symbol for hash key
|
|
44
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
|
45
|
+
|
|
46
|
+
if attributes.has_key?(:'accounts')
|
|
47
|
+
if (value = attributes[:'accounts']).is_a?(Array)
|
|
48
|
+
self.accounts = value
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
if attributes.has_key?(:'paging')
|
|
53
|
+
self.paging = attributes[:'paging']
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
59
|
+
# @return Array for valid properies with the reasons
|
|
60
|
+
def list_invalid_properties
|
|
61
|
+
invalid_properties = Array.new
|
|
62
|
+
return invalid_properties
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Check to see if the all the properties in the model are valid
|
|
66
|
+
# @return true if the model is valid
|
|
67
|
+
def valid?
|
|
68
|
+
return true
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Checks equality by comparing each attribute.
|
|
72
|
+
# @param [Object] Object to be compared
|
|
73
|
+
def ==(o)
|
|
74
|
+
return true if self.equal?(o)
|
|
75
|
+
self.class == o.class &&
|
|
76
|
+
accounts == o.accounts &&
|
|
77
|
+
paging == o.paging
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# @see the `==` method
|
|
81
|
+
# @param [Object] Object to be compared
|
|
82
|
+
def eql?(o)
|
|
83
|
+
self == o
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Calculates hash code according to all attributes.
|
|
87
|
+
# @return [Fixnum] Hash code
|
|
88
|
+
def hash
|
|
89
|
+
[accounts, paging].hash
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Builds the object from hash
|
|
93
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
94
|
+
# @return [Object] Returns the model itself
|
|
95
|
+
def build_from_hash(attributes)
|
|
96
|
+
return nil unless attributes.is_a?(Hash)
|
|
97
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
98
|
+
if type =~ /\AArray<(.*)>/i
|
|
99
|
+
# check to ensure the input is an array given that the the attribute
|
|
100
|
+
# is documented as an array but the input is not
|
|
101
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
102
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
|
103
|
+
end
|
|
104
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
105
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
106
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
self
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Deserializes the data based on type
|
|
113
|
+
# @param string type Data type
|
|
114
|
+
# @param string value Value to be deserialized
|
|
115
|
+
# @return [Object] Deserialized data
|
|
116
|
+
def _deserialize(type, value)
|
|
117
|
+
case type.to_sym
|
|
118
|
+
when :DateTime
|
|
119
|
+
DateTime.parse(value)
|
|
120
|
+
when :Date
|
|
121
|
+
Date.parse(value)
|
|
122
|
+
when :String
|
|
123
|
+
value.to_s
|
|
124
|
+
when :Integer
|
|
125
|
+
value.to_i
|
|
126
|
+
when :Float
|
|
127
|
+
value.to_f
|
|
128
|
+
when :BOOLEAN
|
|
129
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
130
|
+
true
|
|
131
|
+
else
|
|
132
|
+
false
|
|
133
|
+
end
|
|
134
|
+
when :Object
|
|
135
|
+
# generic object (usually a Hash), return directly
|
|
136
|
+
value
|
|
137
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
138
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
139
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
140
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
141
|
+
k_type = Regexp.last_match[:k_type]
|
|
142
|
+
v_type = Regexp.last_match[:v_type]
|
|
143
|
+
{}.tap do |hash|
|
|
144
|
+
value.each do |k, v|
|
|
145
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
else # model
|
|
149
|
+
temp_model = HappyCo.const_get(type).new
|
|
150
|
+
temp_model.build_from_hash(value)
|
|
151
|
+
end
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Returns the string representation of the object
|
|
155
|
+
# @return [String] String presentation of the object
|
|
156
|
+
def to_s
|
|
157
|
+
to_hash.to_s
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
161
|
+
# @return [Hash] Returns the object in the form of hash
|
|
162
|
+
def to_body
|
|
163
|
+
to_hash
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Returns the object in the form of hash
|
|
167
|
+
# @return [Hash] Returns the object in the form of hash
|
|
168
|
+
def to_hash
|
|
169
|
+
hash = {}
|
|
170
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
171
|
+
value = self.send(attr)
|
|
172
|
+
next if value.nil?
|
|
173
|
+
hash[param] = _to_hash(value)
|
|
174
|
+
end
|
|
175
|
+
hash
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# Outputs non-array value in the form of hash
|
|
179
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
180
|
+
# @param [Object] value Any valid value
|
|
181
|
+
# @return [Hash] Returns the value in the form of hash
|
|
182
|
+
def _to_hash(value)
|
|
183
|
+
if value.is_a?(Array)
|
|
184
|
+
value.compact.map{ |v| _to_hash(v) }
|
|
185
|
+
elsif value.is_a?(Hash)
|
|
186
|
+
{}.tap do |hash|
|
|
187
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
188
|
+
end
|
|
189
|
+
elsif value.respond_to? :to_hash
|
|
190
|
+
value.to_hash
|
|
191
|
+
else
|
|
192
|
+
value
|
|
193
|
+
end
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
end
|