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,268 @@
|
|
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 V1Asset
|
17
|
+
attr_accessor :id
|
18
|
+
|
19
|
+
attr_accessor :archived
|
20
|
+
|
21
|
+
attr_accessor :address_line_1
|
22
|
+
|
23
|
+
attr_accessor :address_line_2
|
24
|
+
|
25
|
+
attr_accessor :city
|
26
|
+
|
27
|
+
attr_accessor :state
|
28
|
+
|
29
|
+
attr_accessor :postal_code
|
30
|
+
|
31
|
+
attr_accessor :country
|
32
|
+
|
33
|
+
attr_accessor :unit
|
34
|
+
|
35
|
+
attr_accessor :property
|
36
|
+
|
37
|
+
|
38
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
39
|
+
def self.attribute_map
|
40
|
+
{
|
41
|
+
:'id' => :'id',
|
42
|
+
:'archived' => :'archived',
|
43
|
+
:'address_line_1' => :'address_line_1',
|
44
|
+
:'address_line_2' => :'address_line_2',
|
45
|
+
:'city' => :'city',
|
46
|
+
:'state' => :'state',
|
47
|
+
:'postal_code' => :'postal_code',
|
48
|
+
:'country' => :'country',
|
49
|
+
:'unit' => :'unit',
|
50
|
+
:'property' => :'property'
|
51
|
+
}
|
52
|
+
end
|
53
|
+
|
54
|
+
# Attribute type mapping.
|
55
|
+
def self.swagger_types
|
56
|
+
{
|
57
|
+
:'id' => :'V1IntegrationID',
|
58
|
+
:'archived' => :'BOOLEAN',
|
59
|
+
:'address_line_1' => :'String',
|
60
|
+
:'address_line_2' => :'String',
|
61
|
+
:'city' => :'String',
|
62
|
+
:'state' => :'String',
|
63
|
+
:'postal_code' => :'String',
|
64
|
+
:'country' => :'String',
|
65
|
+
:'unit' => :'V1Unit',
|
66
|
+
:'property' => :'V1Property'
|
67
|
+
}
|
68
|
+
end
|
69
|
+
|
70
|
+
# Initializes the object
|
71
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
72
|
+
def initialize(attributes = {})
|
73
|
+
return unless attributes.is_a?(Hash)
|
74
|
+
|
75
|
+
# convert string to symbol for hash key
|
76
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
77
|
+
|
78
|
+
if attributes.has_key?(:'id')
|
79
|
+
self.id = attributes[:'id']
|
80
|
+
end
|
81
|
+
|
82
|
+
if attributes.has_key?(:'archived')
|
83
|
+
self.archived = attributes[:'archived']
|
84
|
+
end
|
85
|
+
|
86
|
+
if attributes.has_key?(:'address_line_1')
|
87
|
+
self.address_line_1 = attributes[:'address_line_1']
|
88
|
+
end
|
89
|
+
|
90
|
+
if attributes.has_key?(:'address_line_2')
|
91
|
+
self.address_line_2 = attributes[:'address_line_2']
|
92
|
+
end
|
93
|
+
|
94
|
+
if attributes.has_key?(:'city')
|
95
|
+
self.city = attributes[:'city']
|
96
|
+
end
|
97
|
+
|
98
|
+
if attributes.has_key?(:'state')
|
99
|
+
self.state = attributes[:'state']
|
100
|
+
end
|
101
|
+
|
102
|
+
if attributes.has_key?(:'postal_code')
|
103
|
+
self.postal_code = attributes[:'postal_code']
|
104
|
+
end
|
105
|
+
|
106
|
+
if attributes.has_key?(:'country')
|
107
|
+
self.country = attributes[:'country']
|
108
|
+
end
|
109
|
+
|
110
|
+
if attributes.has_key?(:'unit')
|
111
|
+
self.unit = attributes[:'unit']
|
112
|
+
end
|
113
|
+
|
114
|
+
if attributes.has_key?(:'property')
|
115
|
+
self.property = attributes[:'property']
|
116
|
+
end
|
117
|
+
|
118
|
+
end
|
119
|
+
|
120
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
121
|
+
# @return Array for valid properies with the reasons
|
122
|
+
def list_invalid_properties
|
123
|
+
invalid_properties = Array.new
|
124
|
+
return invalid_properties
|
125
|
+
end
|
126
|
+
|
127
|
+
# Check to see if the all the properties in the model are valid
|
128
|
+
# @return true if the model is valid
|
129
|
+
def valid?
|
130
|
+
return true
|
131
|
+
end
|
132
|
+
|
133
|
+
# Checks equality by comparing each attribute.
|
134
|
+
# @param [Object] Object to be compared
|
135
|
+
def ==(o)
|
136
|
+
return true if self.equal?(o)
|
137
|
+
self.class == o.class &&
|
138
|
+
id == o.id &&
|
139
|
+
archived == o.archived &&
|
140
|
+
address_line_1 == o.address_line_1 &&
|
141
|
+
address_line_2 == o.address_line_2 &&
|
142
|
+
city == o.city &&
|
143
|
+
state == o.state &&
|
144
|
+
postal_code == o.postal_code &&
|
145
|
+
country == o.country &&
|
146
|
+
unit == o.unit &&
|
147
|
+
property == o.property
|
148
|
+
end
|
149
|
+
|
150
|
+
# @see the `==` method
|
151
|
+
# @param [Object] Object to be compared
|
152
|
+
def eql?(o)
|
153
|
+
self == o
|
154
|
+
end
|
155
|
+
|
156
|
+
# Calculates hash code according to all attributes.
|
157
|
+
# @return [Fixnum] Hash code
|
158
|
+
def hash
|
159
|
+
[id, archived, address_line_1, address_line_2, city, state, postal_code, country, unit, property].hash
|
160
|
+
end
|
161
|
+
|
162
|
+
# Builds the object from hash
|
163
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
164
|
+
# @return [Object] Returns the model itself
|
165
|
+
def build_from_hash(attributes)
|
166
|
+
return nil unless attributes.is_a?(Hash)
|
167
|
+
self.class.swagger_types.each_pair do |key, type|
|
168
|
+
if type =~ /\AArray<(.*)>/i
|
169
|
+
# check to ensure the input is an array given that the the attribute
|
170
|
+
# is documented as an array but the input is not
|
171
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
172
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
173
|
+
end
|
174
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
175
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
176
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
177
|
+
end
|
178
|
+
|
179
|
+
self
|
180
|
+
end
|
181
|
+
|
182
|
+
# Deserializes the data based on type
|
183
|
+
# @param string type Data type
|
184
|
+
# @param string value Value to be deserialized
|
185
|
+
# @return [Object] Deserialized data
|
186
|
+
def _deserialize(type, value)
|
187
|
+
case type.to_sym
|
188
|
+
when :DateTime
|
189
|
+
DateTime.parse(value)
|
190
|
+
when :Date
|
191
|
+
Date.parse(value)
|
192
|
+
when :String
|
193
|
+
value.to_s
|
194
|
+
when :Integer
|
195
|
+
value.to_i
|
196
|
+
when :Float
|
197
|
+
value.to_f
|
198
|
+
when :BOOLEAN
|
199
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
200
|
+
true
|
201
|
+
else
|
202
|
+
false
|
203
|
+
end
|
204
|
+
when :Object
|
205
|
+
# generic object (usually a Hash), return directly
|
206
|
+
value
|
207
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
208
|
+
inner_type = Regexp.last_match[:inner_type]
|
209
|
+
value.map { |v| _deserialize(inner_type, v) }
|
210
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
211
|
+
k_type = Regexp.last_match[:k_type]
|
212
|
+
v_type = Regexp.last_match[:v_type]
|
213
|
+
{}.tap do |hash|
|
214
|
+
value.each do |k, v|
|
215
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
216
|
+
end
|
217
|
+
end
|
218
|
+
else # model
|
219
|
+
temp_model = HappyCo.const_get(type).new
|
220
|
+
temp_model.build_from_hash(value)
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
224
|
+
# Returns the string representation of the object
|
225
|
+
# @return [String] String presentation of the object
|
226
|
+
def to_s
|
227
|
+
to_hash.to_s
|
228
|
+
end
|
229
|
+
|
230
|
+
# to_body is an alias to to_hash (backward compatibility)
|
231
|
+
# @return [Hash] Returns the object in the form of hash
|
232
|
+
def to_body
|
233
|
+
to_hash
|
234
|
+
end
|
235
|
+
|
236
|
+
# Returns the object in the form of hash
|
237
|
+
# @return [Hash] Returns the object in the form of hash
|
238
|
+
def to_hash
|
239
|
+
hash = {}
|
240
|
+
self.class.attribute_map.each_pair do |attr, param|
|
241
|
+
value = self.send(attr)
|
242
|
+
next if value.nil?
|
243
|
+
hash[param] = _to_hash(value)
|
244
|
+
end
|
245
|
+
hash
|
246
|
+
end
|
247
|
+
|
248
|
+
# Outputs non-array value in the form of hash
|
249
|
+
# For object, use to_hash. Otherwise, just return the value
|
250
|
+
# @param [Object] value Any valid value
|
251
|
+
# @return [Hash] Returns the value in the form of hash
|
252
|
+
def _to_hash(value)
|
253
|
+
if value.is_a?(Array)
|
254
|
+
value.compact.map{ |v| _to_hash(v) }
|
255
|
+
elsif value.is_a?(Hash)
|
256
|
+
{}.tap do |hash|
|
257
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
258
|
+
end
|
259
|
+
elsif value.respond_to? :to_hash
|
260
|
+
value.to_hash
|
261
|
+
else
|
262
|
+
value
|
263
|
+
end
|
264
|
+
end
|
265
|
+
|
266
|
+
end
|
267
|
+
|
268
|
+
end
|
@@ -0,0 +1,189 @@
|
|
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 V1CreateAccountsRequest
|
17
|
+
attr_accessor :account_with_admins
|
18
|
+
|
19
|
+
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
21
|
+
def self.attribute_map
|
22
|
+
{
|
23
|
+
:'account_with_admins' => :'account_with_admins'
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
# Attribute type mapping.
|
28
|
+
def self.swagger_types
|
29
|
+
{
|
30
|
+
:'account_with_admins' => :'Array<CreateAccountsRequestAccountWithAdmin>'
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
# Initializes the object
|
35
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
36
|
+
def initialize(attributes = {})
|
37
|
+
return unless attributes.is_a?(Hash)
|
38
|
+
|
39
|
+
# convert string to symbol for hash key
|
40
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
41
|
+
|
42
|
+
if attributes.has_key?(:'account_with_admins')
|
43
|
+
if (value = attributes[:'account_with_admins']).is_a?(Array)
|
44
|
+
self.account_with_admins = value
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
51
|
+
# @return Array for valid properies with the reasons
|
52
|
+
def list_invalid_properties
|
53
|
+
invalid_properties = Array.new
|
54
|
+
return invalid_properties
|
55
|
+
end
|
56
|
+
|
57
|
+
# Check to see if the all the properties in the model are valid
|
58
|
+
# @return true if the model is valid
|
59
|
+
def valid?
|
60
|
+
return true
|
61
|
+
end
|
62
|
+
|
63
|
+
# Checks equality by comparing each attribute.
|
64
|
+
# @param [Object] Object to be compared
|
65
|
+
def ==(o)
|
66
|
+
return true if self.equal?(o)
|
67
|
+
self.class == o.class &&
|
68
|
+
account_with_admins == o.account_with_admins
|
69
|
+
end
|
70
|
+
|
71
|
+
# @see the `==` method
|
72
|
+
# @param [Object] Object to be compared
|
73
|
+
def eql?(o)
|
74
|
+
self == o
|
75
|
+
end
|
76
|
+
|
77
|
+
# Calculates hash code according to all attributes.
|
78
|
+
# @return [Fixnum] Hash code
|
79
|
+
def hash
|
80
|
+
[account_with_admins].hash
|
81
|
+
end
|
82
|
+
|
83
|
+
# Builds the object from hash
|
84
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
85
|
+
# @return [Object] Returns the model itself
|
86
|
+
def build_from_hash(attributes)
|
87
|
+
return nil unless attributes.is_a?(Hash)
|
88
|
+
self.class.swagger_types.each_pair do |key, type|
|
89
|
+
if type =~ /\AArray<(.*)>/i
|
90
|
+
# check to ensure the input is an array given that the the attribute
|
91
|
+
# is documented as an array but the input is not
|
92
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
93
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
94
|
+
end
|
95
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
96
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
97
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
98
|
+
end
|
99
|
+
|
100
|
+
self
|
101
|
+
end
|
102
|
+
|
103
|
+
# Deserializes the data based on type
|
104
|
+
# @param string type Data type
|
105
|
+
# @param string value Value to be deserialized
|
106
|
+
# @return [Object] Deserialized data
|
107
|
+
def _deserialize(type, value)
|
108
|
+
case type.to_sym
|
109
|
+
when :DateTime
|
110
|
+
DateTime.parse(value)
|
111
|
+
when :Date
|
112
|
+
Date.parse(value)
|
113
|
+
when :String
|
114
|
+
value.to_s
|
115
|
+
when :Integer
|
116
|
+
value.to_i
|
117
|
+
when :Float
|
118
|
+
value.to_f
|
119
|
+
when :BOOLEAN
|
120
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
121
|
+
true
|
122
|
+
else
|
123
|
+
false
|
124
|
+
end
|
125
|
+
when :Object
|
126
|
+
# generic object (usually a Hash), return directly
|
127
|
+
value
|
128
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
129
|
+
inner_type = Regexp.last_match[:inner_type]
|
130
|
+
value.map { |v| _deserialize(inner_type, v) }
|
131
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
132
|
+
k_type = Regexp.last_match[:k_type]
|
133
|
+
v_type = Regexp.last_match[:v_type]
|
134
|
+
{}.tap do |hash|
|
135
|
+
value.each do |k, v|
|
136
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
137
|
+
end
|
138
|
+
end
|
139
|
+
else # model
|
140
|
+
temp_model = HappyCo.const_get(type).new
|
141
|
+
temp_model.build_from_hash(value)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
# Returns the string representation of the object
|
146
|
+
# @return [String] String presentation of the object
|
147
|
+
def to_s
|
148
|
+
to_hash.to_s
|
149
|
+
end
|
150
|
+
|
151
|
+
# to_body is an alias to to_hash (backward compatibility)
|
152
|
+
# @return [Hash] Returns the object in the form of hash
|
153
|
+
def to_body
|
154
|
+
to_hash
|
155
|
+
end
|
156
|
+
|
157
|
+
# Returns the object in the form of hash
|
158
|
+
# @return [Hash] Returns the object in the form of hash
|
159
|
+
def to_hash
|
160
|
+
hash = {}
|
161
|
+
self.class.attribute_map.each_pair do |attr, param|
|
162
|
+
value = self.send(attr)
|
163
|
+
next if value.nil?
|
164
|
+
hash[param] = _to_hash(value)
|
165
|
+
end
|
166
|
+
hash
|
167
|
+
end
|
168
|
+
|
169
|
+
# Outputs non-array value in the form of hash
|
170
|
+
# For object, use to_hash. Otherwise, just return the value
|
171
|
+
# @param [Object] value Any valid value
|
172
|
+
# @return [Hash] Returns the value in the form of hash
|
173
|
+
def _to_hash(value)
|
174
|
+
if value.is_a?(Array)
|
175
|
+
value.compact.map{ |v| _to_hash(v) }
|
176
|
+
elsif value.is_a?(Hash)
|
177
|
+
{}.tap do |hash|
|
178
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
179
|
+
end
|
180
|
+
elsif value.respond_to? :to_hash
|
181
|
+
value.to_hash
|
182
|
+
else
|
183
|
+
value
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
end
|
188
|
+
|
189
|
+
end
|
@@ -0,0 +1,189 @@
|
|
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 V1CreateAccountsResponse
|
17
|
+
attr_accessor :account_id_with_admin_ids
|
18
|
+
|
19
|
+
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
21
|
+
def self.attribute_map
|
22
|
+
{
|
23
|
+
:'account_id_with_admin_ids' => :'account_id_with_admin_ids'
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
# Attribute type mapping.
|
28
|
+
def self.swagger_types
|
29
|
+
{
|
30
|
+
:'account_id_with_admin_ids' => :'Array<CreateAccountsResponseAccountIDWithAdminID>'
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
# Initializes the object
|
35
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
36
|
+
def initialize(attributes = {})
|
37
|
+
return unless attributes.is_a?(Hash)
|
38
|
+
|
39
|
+
# convert string to symbol for hash key
|
40
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
41
|
+
|
42
|
+
if attributes.has_key?(:'account_id_with_admin_ids')
|
43
|
+
if (value = attributes[:'account_id_with_admin_ids']).is_a?(Array)
|
44
|
+
self.account_id_with_admin_ids = value
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
51
|
+
# @return Array for valid properies with the reasons
|
52
|
+
def list_invalid_properties
|
53
|
+
invalid_properties = Array.new
|
54
|
+
return invalid_properties
|
55
|
+
end
|
56
|
+
|
57
|
+
# Check to see if the all the properties in the model are valid
|
58
|
+
# @return true if the model is valid
|
59
|
+
def valid?
|
60
|
+
return true
|
61
|
+
end
|
62
|
+
|
63
|
+
# Checks equality by comparing each attribute.
|
64
|
+
# @param [Object] Object to be compared
|
65
|
+
def ==(o)
|
66
|
+
return true if self.equal?(o)
|
67
|
+
self.class == o.class &&
|
68
|
+
account_id_with_admin_ids == o.account_id_with_admin_ids
|
69
|
+
end
|
70
|
+
|
71
|
+
# @see the `==` method
|
72
|
+
# @param [Object] Object to be compared
|
73
|
+
def eql?(o)
|
74
|
+
self == o
|
75
|
+
end
|
76
|
+
|
77
|
+
# Calculates hash code according to all attributes.
|
78
|
+
# @return [Fixnum] Hash code
|
79
|
+
def hash
|
80
|
+
[account_id_with_admin_ids].hash
|
81
|
+
end
|
82
|
+
|
83
|
+
# Builds the object from hash
|
84
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
85
|
+
# @return [Object] Returns the model itself
|
86
|
+
def build_from_hash(attributes)
|
87
|
+
return nil unless attributes.is_a?(Hash)
|
88
|
+
self.class.swagger_types.each_pair do |key, type|
|
89
|
+
if type =~ /\AArray<(.*)>/i
|
90
|
+
# check to ensure the input is an array given that the the attribute
|
91
|
+
# is documented as an array but the input is not
|
92
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
93
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
94
|
+
end
|
95
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
96
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
97
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
98
|
+
end
|
99
|
+
|
100
|
+
self
|
101
|
+
end
|
102
|
+
|
103
|
+
# Deserializes the data based on type
|
104
|
+
# @param string type Data type
|
105
|
+
# @param string value Value to be deserialized
|
106
|
+
# @return [Object] Deserialized data
|
107
|
+
def _deserialize(type, value)
|
108
|
+
case type.to_sym
|
109
|
+
when :DateTime
|
110
|
+
DateTime.parse(value)
|
111
|
+
when :Date
|
112
|
+
Date.parse(value)
|
113
|
+
when :String
|
114
|
+
value.to_s
|
115
|
+
when :Integer
|
116
|
+
value.to_i
|
117
|
+
when :Float
|
118
|
+
value.to_f
|
119
|
+
when :BOOLEAN
|
120
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
121
|
+
true
|
122
|
+
else
|
123
|
+
false
|
124
|
+
end
|
125
|
+
when :Object
|
126
|
+
# generic object (usually a Hash), return directly
|
127
|
+
value
|
128
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
129
|
+
inner_type = Regexp.last_match[:inner_type]
|
130
|
+
value.map { |v| _deserialize(inner_type, v) }
|
131
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
132
|
+
k_type = Regexp.last_match[:k_type]
|
133
|
+
v_type = Regexp.last_match[:v_type]
|
134
|
+
{}.tap do |hash|
|
135
|
+
value.each do |k, v|
|
136
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
137
|
+
end
|
138
|
+
end
|
139
|
+
else # model
|
140
|
+
temp_model = HappyCo.const_get(type).new
|
141
|
+
temp_model.build_from_hash(value)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
# Returns the string representation of the object
|
146
|
+
# @return [String] String presentation of the object
|
147
|
+
def to_s
|
148
|
+
to_hash.to_s
|
149
|
+
end
|
150
|
+
|
151
|
+
# to_body is an alias to to_hash (backward compatibility)
|
152
|
+
# @return [Hash] Returns the object in the form of hash
|
153
|
+
def to_body
|
154
|
+
to_hash
|
155
|
+
end
|
156
|
+
|
157
|
+
# Returns the object in the form of hash
|
158
|
+
# @return [Hash] Returns the object in the form of hash
|
159
|
+
def to_hash
|
160
|
+
hash = {}
|
161
|
+
self.class.attribute_map.each_pair do |attr, param|
|
162
|
+
value = self.send(attr)
|
163
|
+
next if value.nil?
|
164
|
+
hash[param] = _to_hash(value)
|
165
|
+
end
|
166
|
+
hash
|
167
|
+
end
|
168
|
+
|
169
|
+
# Outputs non-array value in the form of hash
|
170
|
+
# For object, use to_hash. Otherwise, just return the value
|
171
|
+
# @param [Object] value Any valid value
|
172
|
+
# @return [Hash] Returns the value in the form of hash
|
173
|
+
def _to_hash(value)
|
174
|
+
if value.is_a?(Array)
|
175
|
+
value.compact.map{ |v| _to_hash(v) }
|
176
|
+
elsif value.is_a?(Hash)
|
177
|
+
{}.tap do |hash|
|
178
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
179
|
+
end
|
180
|
+
elsif value.respond_to? :to_hash
|
181
|
+
value.to_hash
|
182
|
+
else
|
183
|
+
value
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
end
|
188
|
+
|
189
|
+
end
|