ZCRMSDK 1.0.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/src/ZCRMSDK.rb +362 -0
- data/src/com/zoho/api/authenticator/oauth_token.rb +217 -0
- data/src/com/zoho/api/authenticator/store/db_store.rb +149 -0
- data/src/com/zoho/api/authenticator/store/file_store.rb +165 -0
- data/src/com/zoho/api/authenticator/store/token_store.rb +26 -0
- data/src/com/zoho/api/authenticator/token.rb +10 -0
- data/src/com/zoho/api/logger/sdk_logger.rb +69 -0
- data/src/com/zoho/crm/api/attachments/action_handler.rb +10 -0
- data/src/com/zoho/crm/api/attachments/action_response.rb +10 -0
- data/src/com/zoho/crm/api/attachments/action_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/attachments/api_exception.rb +125 -0
- data/src/com/zoho/crm/api/attachments/attachment.rb +367 -0
- data/src/com/zoho/crm/api/attachments/attachments_operations.rb +196 -0
- data/src/com/zoho/crm/api/attachments/file_body_wrapper.rb +64 -0
- data/src/com/zoho/crm/api/attachments/response_handler.rb +10 -0
- data/src/com/zoho/crm/api/attachments/response_wrapper.rb +83 -0
- data/src/com/zoho/crm/api/attachments/success_response.rb +121 -0
- data/src/com/zoho/crm/api/blue_print/action_response.rb +10 -0
- data/src/com/zoho/crm/api/blue_print/api_exception.rb +123 -0
- data/src/com/zoho/crm/api/blue_print/blue_print.rb +119 -0
- data/src/com/zoho/crm/api/blue_print/blue_print_operations.rb +67 -0
- data/src/com/zoho/crm/api/blue_print/body_wrapper.rb +61 -0
- data/src/com/zoho/crm/api/blue_print/next_transition.rb +80 -0
- data/src/com/zoho/crm/api/blue_print/process_info.rb +251 -0
- data/src/com/zoho/crm/api/blue_print/response_handler.rb +10 -0
- data/src/com/zoho/crm/api/blue_print/response_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/blue_print/success_response.rb +121 -0
- data/src/com/zoho/crm/api/blue_print/transition.rb +253 -0
- data/src/com/zoho/crm/api/blue_print/validation_error.rb +80 -0
- data/src/com/zoho/crm/api/bulk_read/action_handler.rb +10 -0
- data/src/com/zoho/crm/api/bulk_read/action_response.rb +10 -0
- data/src/com/zoho/crm/api/bulk_read/action_wrapper.rb +82 -0
- data/src/com/zoho/crm/api/bulk_read/api_exception.rb +125 -0
- data/src/com/zoho/crm/api/bulk_read/bulk_read_operations.rb +74 -0
- data/src/com/zoho/crm/api/bulk_read/call_back.rb +81 -0
- data/src/com/zoho/crm/api/bulk_read/criteria.rb +135 -0
- data/src/com/zoho/crm/api/bulk_read/file_body_wrapper.rb +64 -0
- data/src/com/zoho/crm/api/bulk_read/job_detail.rb +196 -0
- data/src/com/zoho/crm/api/bulk_read/query.rb +137 -0
- data/src/com/zoho/crm/api/bulk_read/request_wrapper.rb +100 -0
- data/src/com/zoho/crm/api/bulk_read/response_handler.rb +10 -0
- data/src/com/zoho/crm/api/bulk_read/response_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/bulk_read/result.rb +137 -0
- data/src/com/zoho/crm/api/bulk_read/success_response.rb +121 -0
- data/src/com/zoho/crm/api/bulk_write/action_response.rb +10 -0
- data/src/com/zoho/crm/api/bulk_write/api_exception.rb +239 -0
- data/src/com/zoho/crm/api/bulk_write/bulk_write_operations.rb +112 -0
- data/src/com/zoho/crm/api/bulk_write/bulk_write_response.rb +216 -0
- data/src/com/zoho/crm/api/bulk_write/call_back.rb +81 -0
- data/src/com/zoho/crm/api/bulk_write/field_mapping.rb +156 -0
- data/src/com/zoho/crm/api/bulk_write/file.rb +157 -0
- data/src/com/zoho/crm/api/bulk_write/file_body_wrapper.rb +64 -0
- data/src/com/zoho/crm/api/bulk_write/request_wrapper.rb +119 -0
- data/src/com/zoho/crm/api/bulk_write/resource.rb +195 -0
- data/src/com/zoho/crm/api/bulk_write/response_handler.rb +10 -0
- data/src/com/zoho/crm/api/bulk_write/response_wrapper.rb +10 -0
- data/src/com/zoho/crm/api/bulk_write/result.rb +61 -0
- data/src/com/zoho/crm/api/bulk_write/success_response.rb +121 -0
- data/src/com/zoho/crm/api/contact_roles/action_handler.rb +10 -0
- data/src/com/zoho/crm/api/contact_roles/action_response.rb +10 -0
- data/src/com/zoho/crm/api/contact_roles/action_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/contact_roles/api_exception.rb +125 -0
- data/src/com/zoho/crm/api/contact_roles/body_wrapper.rb +61 -0
- data/src/com/zoho/crm/api/contact_roles/contact_role.rb +99 -0
- data/src/com/zoho/crm/api/contact_roles/contact_roles_operations.rb +161 -0
- data/src/com/zoho/crm/api/contact_roles/response_handler.rb +10 -0
- data/src/com/zoho/crm/api/contact_roles/response_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/contact_roles/success_response.rb +121 -0
- data/src/com/zoho/crm/api/currencies/action_handler.rb +10 -0
- data/src/com/zoho/crm/api/currencies/action_response.rb +10 -0
- data/src/com/zoho/crm/api/currencies/action_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/currencies/api_exception.rb +127 -0
- data/src/com/zoho/crm/api/currencies/base_currency_action_handler.rb +10 -0
- data/src/com/zoho/crm/api/currencies/base_currency_action_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/currencies/base_currency_wrapper.rb +61 -0
- data/src/com/zoho/crm/api/currencies/body_wrapper.rb +61 -0
- data/src/com/zoho/crm/api/currencies/currencies_operations.rb +156 -0
- data/src/com/zoho/crm/api/currencies/currency.rb +290 -0
- data/src/com/zoho/crm/api/currencies/format.rb +100 -0
- data/src/com/zoho/crm/api/currencies/response_handler.rb +10 -0
- data/src/com/zoho/crm/api/currencies/response_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/currencies/success_response.rb +121 -0
- data/src/com/zoho/crm/api/custom_views/api_exception.rb +121 -0
- data/src/com/zoho/crm/api/custom_views/criteria.rb +135 -0
- data/src/com/zoho/crm/api/custom_views/custom_view.rb +327 -0
- data/src/com/zoho/crm/api/custom_views/custom_views_operations.rb +75 -0
- data/src/com/zoho/crm/api/custom_views/info.rb +156 -0
- data/src/com/zoho/crm/api/custom_views/range.rb +80 -0
- data/src/com/zoho/crm/api/custom_views/response_handler.rb +10 -0
- data/src/com/zoho/crm/api/custom_views/response_wrapper.rb +82 -0
- data/src/com/zoho/crm/api/custom_views/shared_details.rb +118 -0
- data/src/com/zoho/crm/api/custom_views/translation.rb +118 -0
- data/src/com/zoho/crm/api/dc/au_datacenter.rb +18 -0
- data/src/com/zoho/crm/api/dc/cn_datacenter.rb +18 -0
- data/src/com/zoho/crm/api/dc/datacenter.rb +20 -0
- data/src/com/zoho/crm/api/dc/eu_datacenter.rb +18 -0
- data/src/com/zoho/crm/api/dc/in_datacenter.rb +18 -0
- data/src/com/zoho/crm/api/dc/us_datacenter.rb +18 -0
- data/src/com/zoho/crm/api/exception/sdk_exception.rb +47 -0
- data/src/com/zoho/crm/api/fields/api_exception.rb +121 -0
- data/src/com/zoho/crm/api/fields/association_details.rb +80 -0
- data/src/com/zoho/crm/api/fields/auto_number.rb +99 -0
- data/src/com/zoho/crm/api/fields/crypt.rb +156 -0
- data/src/com/zoho/crm/api/fields/currency.rb +80 -0
- data/src/com/zoho/crm/api/fields/field.rb +956 -0
- data/src/com/zoho/crm/api/fields/fields_operations.rb +71 -0
- data/src/com/zoho/crm/api/fields/formula.rb +80 -0
- data/src/com/zoho/crm/api/fields/lookup_field.rb +80 -0
- data/src/com/zoho/crm/api/fields/module.rb +157 -0
- data/src/com/zoho/crm/api/fields/multi_select_lookup.rb +156 -0
- data/src/com/zoho/crm/api/fields/pick_list_value.rb +175 -0
- data/src/com/zoho/crm/api/fields/private.rb +99 -0
- data/src/com/zoho/crm/api/fields/related_details.rb +137 -0
- data/src/com/zoho/crm/api/fields/response_handler.rb +10 -0
- data/src/com/zoho/crm/api/fields/response_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/fields/tool_tip.rb +80 -0
- data/src/com/zoho/crm/api/fields/unique.rb +61 -0
- data/src/com/zoho/crm/api/fields/view_type.rb +118 -0
- data/src/com/zoho/crm/api/files/action_handler.rb +10 -0
- data/src/com/zoho/crm/api/files/action_response.rb +10 -0
- data/src/com/zoho/crm/api/files/action_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/files/api_exception.rb +125 -0
- data/src/com/zoho/crm/api/files/body_wrapper.rb +62 -0
- data/src/com/zoho/crm/api/files/file_body_wrapper.rb +64 -0
- data/src/com/zoho/crm/api/files/file_operations.rb +75 -0
- data/src/com/zoho/crm/api/files/response_handler.rb +10 -0
- data/src/com/zoho/crm/api/files/success_response.rb +121 -0
- data/src/com/zoho/crm/api/header.rb +10 -0
- data/src/com/zoho/crm/api/header_map.rb +55 -0
- data/src/com/zoho/crm/api/initializer.rb +192 -0
- data/src/com/zoho/crm/api/layouts/api_exception.rb +121 -0
- data/src/com/zoho/crm/api/layouts/layout.rb +272 -0
- data/src/com/zoho/crm/api/layouts/layouts_operations.rb +61 -0
- data/src/com/zoho/crm/api/layouts/properties.rb +100 -0
- data/src/com/zoho/crm/api/layouts/response_handler.rb +10 -0
- data/src/com/zoho/crm/api/layouts/response_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/layouts/section.rb +233 -0
- data/src/com/zoho/crm/api/modules/action_handler.rb +10 -0
- data/src/com/zoho/crm/api/modules/action_response.rb +10 -0
- data/src/com/zoho/crm/api/modules/action_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/modules/api_exception.rb +125 -0
- data/src/com/zoho/crm/api/modules/argument.rb +80 -0
- data/src/com/zoho/crm/api/modules/body_wrapper.rb +61 -0
- data/src/com/zoho/crm/api/modules/module.rb +882 -0
- data/src/com/zoho/crm/api/modules/modules_operations.rb +111 -0
- data/src/com/zoho/crm/api/modules/related_list_properties.rb +99 -0
- data/src/com/zoho/crm/api/modules/response_handler.rb +10 -0
- data/src/com/zoho/crm/api/modules/response_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/modules/success_response.rb +121 -0
- data/src/com/zoho/crm/api/modules/territory.rb +99 -0
- data/src/com/zoho/crm/api/notes/action_handler.rb +10 -0
- data/src/com/zoho/crm/api/notes/action_response.rb +10 -0
- data/src/com/zoho/crm/api/notes/action_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/notes/api_exception.rb +125 -0
- data/src/com/zoho/crm/api/notes/body_wrapper.rb +61 -0
- data/src/com/zoho/crm/api/notes/info.rb +118 -0
- data/src/com/zoho/crm/api/notes/note.rb +349 -0
- data/src/com/zoho/crm/api/notes/notes_operations.rb +219 -0
- data/src/com/zoho/crm/api/notes/response_handler.rb +10 -0
- data/src/com/zoho/crm/api/notes/response_wrapper.rb +82 -0
- data/src/com/zoho/crm/api/notes/success_response.rb +121 -0
- data/src/com/zoho/crm/api/notification/action_handler.rb +10 -0
- data/src/com/zoho/crm/api/notification/action_response.rb +10 -0
- data/src/com/zoho/crm/api/notification/action_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/notification/api_exception.rb +125 -0
- data/src/com/zoho/crm/api/notification/body_wrapper.rb +61 -0
- data/src/com/zoho/crm/api/notification/info.rb +118 -0
- data/src/com/zoho/crm/api/notification/notification.rb +251 -0
- data/src/com/zoho/crm/api/notification/notification_operations.rb +164 -0
- data/src/com/zoho/crm/api/notification/response_handler.rb +10 -0
- data/src/com/zoho/crm/api/notification/response_wrapper.rb +82 -0
- data/src/com/zoho/crm/api/notification/success_response.rb +121 -0
- data/src/com/zoho/crm/api/org/action_response.rb +10 -0
- data/src/com/zoho/crm/api/org/api_exception.rb +123 -0
- data/src/com/zoho/crm/api/org/file_body_wrapper.rb +62 -0
- data/src/com/zoho/crm/api/org/license_details.rb +156 -0
- data/src/com/zoho/crm/api/org/org.rb +631 -0
- data/src/com/zoho/crm/api/org/org_operations.rb +49 -0
- data/src/com/zoho/crm/api/org/response_handler.rb +10 -0
- data/src/com/zoho/crm/api/org/response_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/org/success_response.rb +121 -0
- data/src/com/zoho/crm/api/param.rb +10 -0
- data/src/com/zoho/crm/api/parameter_map.rb +54 -0
- data/src/com/zoho/crm/api/profiles/api_exception.rb +121 -0
- data/src/com/zoho/crm/api/profiles/category.rb +99 -0
- data/src/com/zoho/crm/api/profiles/permission_detail.rb +137 -0
- data/src/com/zoho/crm/api/profiles/profile.rb +290 -0
- data/src/com/zoho/crm/api/profiles/profiles_operations.rb +61 -0
- data/src/com/zoho/crm/api/profiles/response_handler.rb +10 -0
- data/src/com/zoho/crm/api/profiles/response_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/profiles/section.rb +80 -0
- data/src/com/zoho/crm/api/query/api_exception.rb +121 -0
- data/src/com/zoho/crm/api/query/body_wrapper.rb +61 -0
- data/src/com/zoho/crm/api/query/query_operations.rb +35 -0
- data/src/com/zoho/crm/api/query/response_handler.rb +10 -0
- data/src/com/zoho/crm/api/query/response_wrapper.rb +84 -0
- data/src/com/zoho/crm/api/record/action_handler.rb +10 -0
- data/src/com/zoho/crm/api/record/action_response.rb +10 -0
- data/src/com/zoho/crm/api/record/action_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/record/api_exception.rb +143 -0
- data/src/com/zoho/crm/api/record/body_wrapper.rb +156 -0
- data/src/com/zoho/crm/api/record/carry_over_tags.rb +99 -0
- data/src/com/zoho/crm/api/record/comment.rb +118 -0
- data/src/com/zoho/crm/api/record/consent.rb +185 -0
- data/src/com/zoho/crm/api/record/convert_action_handler.rb +10 -0
- data/src/com/zoho/crm/api/record/convert_action_response.rb +10 -0
- data/src/com/zoho/crm/api/record/convert_action_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/record/convert_body_wrapper.rb +61 -0
- data/src/com/zoho/crm/api/record/criteria.rb +135 -0
- data/src/com/zoho/crm/api/record/deleted_record.rb +157 -0
- data/src/com/zoho/crm/api/record/deleted_records_handler.rb +10 -0
- data/src/com/zoho/crm/api/record/deleted_records_wrapper.rb +82 -0
- data/src/com/zoho/crm/api/record/download_handler.rb +10 -0
- data/src/com/zoho/crm/api/record/field.rb +2109 -0
- data/src/com/zoho/crm/api/record/file_body_wrapper.rb +66 -0
- data/src/com/zoho/crm/api/record/file_details.rb +327 -0
- data/src/com/zoho/crm/api/record/file_handler.rb +10 -0
- data/src/com/zoho/crm/api/record/info.rb +118 -0
- data/src/com/zoho/crm/api/record/inventory_line_items.rb +235 -0
- data/src/com/zoho/crm/api/record/lead_converter.rb +194 -0
- data/src/com/zoho/crm/api/record/line_item_product.rb +65 -0
- data/src/com/zoho/crm/api/record/line_tax.rb +118 -0
- data/src/com/zoho/crm/api/record/mass_update.rb +140 -0
- data/src/com/zoho/crm/api/record/mass_update_action_handler.rb +10 -0
- data/src/com/zoho/crm/api/record/mass_update_action_response.rb +10 -0
- data/src/com/zoho/crm/api/record/mass_update_action_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/record/mass_update_body_wrapper.rb +156 -0
- data/src/com/zoho/crm/api/record/mass_update_response.rb +10 -0
- data/src/com/zoho/crm/api/record/mass_update_response_handler.rb +10 -0
- data/src/com/zoho/crm/api/record/mass_update_response_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/record/mass_update_success_response.rb +121 -0
- data/src/com/zoho/crm/api/record/options.rb +10 -0
- data/src/com/zoho/crm/api/record/participants.rb +116 -0
- data/src/com/zoho/crm/api/record/pricing_details.rb +65 -0
- data/src/com/zoho/crm/api/record/record.rb +192 -0
- data/src/com/zoho/crm/api/record/record_operations.rb +677 -0
- data/src/com/zoho/crm/api/record/recurring_activity.rb +61 -0
- data/src/com/zoho/crm/api/record/remind_at.rb +61 -0
- data/src/com/zoho/crm/api/record/reminder.rb +80 -0
- data/src/com/zoho/crm/api/record/response_handler.rb +10 -0
- data/src/com/zoho/crm/api/record/response_wrapper.rb +82 -0
- data/src/com/zoho/crm/api/record/success_response.rb +161 -0
- data/src/com/zoho/crm/api/record/successful_convert.rb +101 -0
- data/src/com/zoho/crm/api/record/territory.rb +80 -0
- data/src/com/zoho/crm/api/related_lists/api_exception.rb +121 -0
- data/src/com/zoho/crm/api/related_lists/related_list.rb +251 -0
- data/src/com/zoho/crm/api/related_lists/related_lists_operations.rb +61 -0
- data/src/com/zoho/crm/api/related_lists/response_handler.rb +10 -0
- data/src/com/zoho/crm/api/related_lists/response_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/related_records/action_handler.rb +10 -0
- data/src/com/zoho/crm/api/related_records/action_response.rb +10 -0
- data/src/com/zoho/crm/api/related_records/action_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/related_records/api_exception.rb +125 -0
- data/src/com/zoho/crm/api/related_records/body_wrapper.rb +62 -0
- data/src/com/zoho/crm/api/related_records/file_body_wrapper.rb +64 -0
- data/src/com/zoho/crm/api/related_records/related_records_operations.rb +235 -0
- data/src/com/zoho/crm/api/related_records/response_handler.rb +10 -0
- data/src/com/zoho/crm/api/related_records/response_wrapper.rb +84 -0
- data/src/com/zoho/crm/api/related_records/success_response.rb +121 -0
- data/src/com/zoho/crm/api/request_proxy.rb +16 -0
- data/src/com/zoho/crm/api/roles/api_exception.rb +121 -0
- data/src/com/zoho/crm/api/roles/response_handler.rb +10 -0
- data/src/com/zoho/crm/api/roles/response_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/roles/role.rb +195 -0
- data/src/com/zoho/crm/api/roles/roles_operations.rb +47 -0
- data/src/com/zoho/crm/api/sdk_config.rb +78 -0
- data/src/com/zoho/crm/api/share_records/action_handler.rb +10 -0
- data/src/com/zoho/crm/api/share_records/action_response.rb +10 -0
- data/src/com/zoho/crm/api/share_records/action_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/share_records/api_exception.rb +129 -0
- data/src/com/zoho/crm/api/share_records/body_wrapper.rb +61 -0
- data/src/com/zoho/crm/api/share_records/delete_action_handler.rb +10 -0
- data/src/com/zoho/crm/api/share_records/delete_action_response.rb +10 -0
- data/src/com/zoho/crm/api/share_records/delete_action_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/share_records/response_handler.rb +10 -0
- data/src/com/zoho/crm/api/share_records/response_wrapper.rb +83 -0
- data/src/com/zoho/crm/api/share_records/share_record.rb +157 -0
- data/src/com/zoho/crm/api/share_records/share_records_operations.rb +128 -0
- data/src/com/zoho/crm/api/share_records/shared_through.rb +100 -0
- data/src/com/zoho/crm/api/share_records/success_response.rb +123 -0
- data/src/com/zoho/crm/api/tags/action_handler.rb +10 -0
- data/src/com/zoho/crm/api/tags/action_response.rb +10 -0
- data/src/com/zoho/crm/api/tags/action_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/tags/api_exception.rb +131 -0
- data/src/com/zoho/crm/api/tags/body_wrapper.rb +61 -0
- data/src/com/zoho/crm/api/tags/conflict_wrapper.rb +61 -0
- data/src/com/zoho/crm/api/tags/count_handler.rb +10 -0
- data/src/com/zoho/crm/api/tags/count_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/tags/info.rb +80 -0
- data/src/com/zoho/crm/api/tags/merge_wrapper.rb +61 -0
- data/src/com/zoho/crm/api/tags/record_action_handler.rb +10 -0
- data/src/com/zoho/crm/api/tags/record_action_response.rb +10 -0
- data/src/com/zoho/crm/api/tags/record_action_wrapper.rb +120 -0
- data/src/com/zoho/crm/api/tags/response_handler.rb +10 -0
- data/src/com/zoho/crm/api/tags/response_wrapper.rb +82 -0
- data/src/com/zoho/crm/api/tags/success_response.rb +123 -0
- data/src/com/zoho/crm/api/tags/tag.rb +157 -0
- data/src/com/zoho/crm/api/tags/tags_operations.rb +387 -0
- data/src/com/zoho/crm/api/taxes/action_handler.rb +10 -0
- data/src/com/zoho/crm/api/taxes/action_response.rb +10 -0
- data/src/com/zoho/crm/api/taxes/action_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/taxes/api_exception.rb +125 -0
- data/src/com/zoho/crm/api/taxes/body_wrapper.rb +61 -0
- data/src/com/zoho/crm/api/taxes/preference.rb +80 -0
- data/src/com/zoho/crm/api/taxes/response_handler.rb +10 -0
- data/src/com/zoho/crm/api/taxes/response_wrapper.rb +82 -0
- data/src/com/zoho/crm/api/taxes/success_response.rb +121 -0
- data/src/com/zoho/crm/api/taxes/tax.rb +137 -0
- data/src/com/zoho/crm/api/taxes/taxes_operations.rb +136 -0
- data/src/com/zoho/crm/api/territories/api_exception.rb +121 -0
- data/src/com/zoho/crm/api/territories/response_handler.rb +10 -0
- data/src/com/zoho/crm/api/territories/response_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/territories/territories_operations.rb +47 -0
- data/src/com/zoho/crm/api/territories/territory.rb +234 -0
- data/src/com/zoho/crm/api/user_signature.rb +27 -0
- data/src/com/zoho/crm/api/users/action_handler.rb +10 -0
- data/src/com/zoho/crm/api/users/action_response.rb +10 -0
- data/src/com/zoho/crm/api/users/action_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/users/api_exception.rb +125 -0
- data/src/com/zoho/crm/api/users/body_wrapper.rb +61 -0
- data/src/com/zoho/crm/api/users/customize_info.rb +156 -0
- data/src/com/zoho/crm/api/users/info.rb +118 -0
- data/src/com/zoho/crm/api/users/request_wrapper.rb +61 -0
- data/src/com/zoho/crm/api/users/response_handler.rb +10 -0
- data/src/com/zoho/crm/api/users/response_wrapper.rb +82 -0
- data/src/com/zoho/crm/api/users/shift.rb +80 -0
- data/src/com/zoho/crm/api/users/success_response.rb +121 -0
- data/src/com/zoho/crm/api/users/tab_theme.rb +80 -0
- data/src/com/zoho/crm/api/users/territory.rb +99 -0
- data/src/com/zoho/crm/api/users/theme.rb +156 -0
- data/src/com/zoho/crm/api/users/user.rb +696 -0
- data/src/com/zoho/crm/api/users/users_operations.rb +181 -0
- data/src/com/zoho/crm/api/util/api_http_connector.rb +111 -0
- data/src/com/zoho/crm/api/util/api_response.rb +16 -0
- data/src/com/zoho/crm/api/util/choice.rb +9 -0
- data/src/com/zoho/crm/api/util/common_api_handler.rb +235 -0
- data/src/com/zoho/crm/api/util/constants.rb +536 -0
- data/src/com/zoho/crm/api/util/converter.rb +213 -0
- data/src/com/zoho/crm/api/util/data_type_converter.rb +162 -0
- data/src/com/zoho/crm/api/util/downloader.rb +83 -0
- data/src/com/zoho/crm/api/util/form_data_converter.rb +167 -0
- data/src/com/zoho/crm/api/util/header_param_validator.rb +55 -0
- data/src/com/zoho/crm/api/util/json_converter.rb +726 -0
- data/src/com/zoho/crm/api/util/model.rb +5 -0
- data/src/com/zoho/crm/api/util/module_fields_handler.rb +78 -0
- data/src/com/zoho/crm/api/util/stream_wrapper.rb +37 -0
- data/src/com/zoho/crm/api/util/utility.rb +727 -0
- data/src/com/zoho/crm/api/variable_groups/api_exception.rb +121 -0
- data/src/com/zoho/crm/api/variable_groups/response_handler.rb +10 -0
- data/src/com/zoho/crm/api/variable_groups/response_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/variable_groups/variable_group.rb +137 -0
- data/src/com/zoho/crm/api/variable_groups/variable_groups_operations.rb +66 -0
- data/src/com/zoho/crm/api/variables/action_handler.rb +10 -0
- data/src/com/zoho/crm/api/variables/action_response.rb +10 -0
- data/src/com/zoho/crm/api/variables/action_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/variables/api_exception.rb +125 -0
- data/src/com/zoho/crm/api/variables/body_wrapper.rb +61 -0
- data/src/com/zoho/crm/api/variables/response_handler.rb +10 -0
- data/src/com/zoho/crm/api/variables/response_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/variables/success_response.rb +121 -0
- data/src/com/zoho/crm/api/variables/variable.rb +173 -0
- data/src/com/zoho/crm/api/variables/variables_operations.rb +241 -0
- data/src/resources/JSONDetails.json +1 -0
- data/src/version.rb +3 -0
- metadata +395 -45
- data/lib/ZCRMSDK.rb +0 -14
- data/lib/ZCRMSDK/handler.rb +0 -3290
- data/lib/ZCRMSDK/oauth_client.rb +0 -253
- data/lib/ZCRMSDK/oauth_utility.rb +0 -161
- data/lib/ZCRMSDK/operations.rb +0 -1091
- data/lib/ZCRMSDK/org.rb +0 -174
- data/lib/ZCRMSDK/persistence.rb +0 -127
- data/lib/ZCRMSDK/request.rb +0 -83
- data/lib/ZCRMSDK/response.rb +0 -216
- data/lib/ZCRMSDK/restclient.rb +0 -65
- data/lib/ZCRMSDK/test.rb +0 -5748
- data/lib/ZCRMSDK/utility.rb +0 -309
- data/lib/ZCRMSDK/version.rb +0 -5
data/lib/ZCRMSDK/oauth_client.rb
DELETED
@@ -1,253 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'json'
|
4
|
-
require_relative 'oauth_utility'
|
5
|
-
require_relative 'persistence'
|
6
|
-
module ZCRMSDK
|
7
|
-
module OAuthClient
|
8
|
-
# THIS CLASS IS USED TO STORE OAUTH RELATED CREDENTIALS
|
9
|
-
class ZohoOAuth
|
10
|
-
$OAUTH_CONFIG_PROPERTIES = {}
|
11
|
-
def self.get_instance(config_details)
|
12
|
-
ZohoOAuth.new(config_details)
|
13
|
-
end
|
14
|
-
|
15
|
-
def initialize(config_details)
|
16
|
-
$OAUTH_CONFIG_PROPERTIES = {}
|
17
|
-
$OAUTH_CONFIG_PROPERTIES = config_details
|
18
|
-
mandatory_keys = [OAuthUtility::ZohoOAuthConstants::CLIENT_ID, OAuthUtility::ZohoOAuthConstants::CLIENT_SECRET, OAuthUtility::ZohoOAuthConstants::REDIRECT_URL]
|
19
|
-
mandatory_keys.each do |item|
|
20
|
-
if $OAUTH_CONFIG_PROPERTIES[item].nil?
|
21
|
-
raise OAuthUtility::ZohoOAuthException.get_instance('initialize(config_details)', item + ' is mandatory!', 'Exception occured while reading oauth configurations', OAuthUtility::ZohoOAuthConstants::ERROR)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
if $OAUTH_CONFIG_PROPERTIES.key? OAuthUtility::ZohoOAuthConstants::CURRENT_USER_EMAIL
|
25
|
-
unless $OAUTH_CONFIG_PROPERTIES[OAuthUtility::ZohoOAuthConstants::CURRENT_USER_EMAIL].nil?
|
26
|
-
ZCRMSDK::RestClient::ZCRMRestClient.current_user_email = $OAUTH_CONFIG_PROPERTIES[OAuthUtility::ZohoOAuthConstants::CURRENT_USER_EMAIL]
|
27
|
-
end
|
28
|
-
end
|
29
|
-
if $OAUTH_CONFIG_PROPERTIES[OAuthUtility::ZohoOAuthConstants::ACCESS_TYPE].nil?
|
30
|
-
$OAUTH_CONFIG_PROPERTIES[OAuthUtility::ZohoOAuthConstants::ACCESS_TYPE] = 'offline'
|
31
|
-
end
|
32
|
-
if $OAUTH_CONFIG_PROPERTIES[OAuthUtility::ZohoOAuthConstants::PERSISTENCE_HANDLER_CLASS_PATH].nil?
|
33
|
-
$OAUTH_CONFIG_PROPERTIES[OAuthUtility::ZohoOAuthConstants::PERSISTENCE_HANDLER_CLASS_PATH] = nil
|
34
|
-
end
|
35
|
-
if $OAUTH_CONFIG_PROPERTIES[OAuthUtility::ZohoOAuthConstants::PERSISTENCE_HANDLER_CLASS].nil?
|
36
|
-
$OAUTH_CONFIG_PROPERTIES[OAuthUtility::ZohoOAuthConstants::PERSISTENCE_HANDLER_CLASS] = nil
|
37
|
-
end
|
38
|
-
if $OAUTH_CONFIG_PROPERTIES[OAuthUtility::ZohoOAuthConstants::IAM_URL].nil?
|
39
|
-
$OAUTH_CONFIG_PROPERTIES[OAuthUtility::ZohoOAuthConstants::IAM_URL] = 'https://accounts.zoho.com'
|
40
|
-
end
|
41
|
-
if $OAUTH_CONFIG_PROPERTIES[OAuthUtility::ZohoOAuthConstants::TOKEN_PERSISTENCE_PATH].nil?
|
42
|
-
$OAUTH_CONFIG_PROPERTIES[OAuthUtility::ZohoOAuthConstants::TOKEN_PERSISTENCE_PATH] = nil
|
43
|
-
if $OAUTH_CONFIG_PROPERTIES[OAuthUtility::ZohoOAuthConstants::DATABASE_PORT].nil?
|
44
|
-
$OAUTH_CONFIG_PROPERTIES[OAuthUtility::ZohoOAuthConstants::DATABASE_PORT] = '3306'
|
45
|
-
end
|
46
|
-
if $OAUTH_CONFIG_PROPERTIES[OAuthUtility::ZohoOAuthConstants::DATABASE_USERNAME].nil?
|
47
|
-
$OAUTH_CONFIG_PROPERTIES[OAuthUtility::ZohoOAuthConstants::DATABASE_USERNAME] = 'root'
|
48
|
-
end
|
49
|
-
if $OAUTH_CONFIG_PROPERTIES[OAuthUtility::ZohoOAuthConstants::DATABASE_PASSWORD].nil?
|
50
|
-
$OAUTH_CONFIG_PROPERTIES[OAuthUtility::ZohoOAuthConstants::DATABASE_PASSWORD] = ''
|
51
|
-
end
|
52
|
-
end
|
53
|
-
if $OAUTH_CONFIG_PROPERTIES[OAuthUtility::ZohoOAuthConstants::SANDBOX].nil?
|
54
|
-
$OAUTH_CONFIG_PROPERTIES[OAuthUtility::ZohoOAuthConstants::SANDBOX] = 'false'
|
55
|
-
end
|
56
|
-
oauth_params = OAuthUtility::ZohoOAuthParams.get_instance($OAUTH_CONFIG_PROPERTIES[OAuthUtility::ZohoOAuthConstants::CLIENT_ID].dup, $OAUTH_CONFIG_PROPERTIES[OAuthUtility::ZohoOAuthConstants::CLIENT_SECRET].dup, $OAUTH_CONFIG_PROPERTIES[OAuthUtility::ZohoOAuthConstants::REDIRECT_URL].dup)
|
57
|
-
ZohoOAuthClient.get_instance(oauth_params)
|
58
|
-
end
|
59
|
-
|
60
|
-
def self.get_grant_url
|
61
|
-
($OAUTH_CONFIG_PROPERTIES[OAuthUtility::ZohoOAuthConstants::IAM_URL].dup + '/oauth/v2/auth')
|
62
|
-
end
|
63
|
-
|
64
|
-
def self.get_token_url
|
65
|
-
($OAUTH_CONFIG_PROPERTIES[OAuthUtility::ZohoOAuthConstants::IAM_URL].dup + '/oauth/v2/token')
|
66
|
-
end
|
67
|
-
|
68
|
-
def self.get_refresh_token_url
|
69
|
-
($OAUTH_CONFIG_PROPERTIES[OAuthUtility::ZohoOAuthConstants::IAM_URL].dup + '/oauth/v2/token')
|
70
|
-
end
|
71
|
-
|
72
|
-
def self.get_revoke_token_url
|
73
|
-
($OAUTH_CONFIG_PROPERTIES[OAuthUtility::ZohoOAuthConstants::IAM_URL].dup + '/oauth/v2/token/revoke')
|
74
|
-
end
|
75
|
-
|
76
|
-
def self.get_user_info_url
|
77
|
-
($OAUTH_CONFIG_PROPERTIES[OAuthUtility::ZohoOAuthConstants::IAM_URL].dup + '/oauth/user/info')
|
78
|
-
end
|
79
|
-
|
80
|
-
def self.get_client_instance
|
81
|
-
oauth_client_ins = ZohoOAuthClient.get_instance
|
82
|
-
if oauth_client_ins.nil?
|
83
|
-
raise OAuthUtility::ZohoOAuthException.get_instance('get_client_instance', 'ZCRMSDK::RestClient::ZCRMRestClient.init(config_details) must be called before this', 'Error occured while getting client instance', OAuthUtility::ZohoOAuthConstants::ERROR)
|
84
|
-
end
|
85
|
-
|
86
|
-
oauth_client_ins
|
87
|
-
end
|
88
|
-
|
89
|
-
def self.get_persistence_instance
|
90
|
-
if !$OAUTH_CONFIG_PROPERTIES[OAuthUtility::ZohoOAuthConstants::PERSISTENCE_HANDLER_CLASS_PATH].nil?
|
91
|
-
if !File.exist?($OAUTH_CONFIG_PROPERTIES[OAuthUtility::ZohoOAuthConstants::PERSISTENCE_HANDLER_CLASS_PATH])
|
92
|
-
raise OAuthUtility::ZohoOAuthException.get_instance('get_persistence_instance', 'file does not exist!', 'Error occured while getting persistence instance', OAuthUtility::ZohoOAuthConstants::ERROR)
|
93
|
-
end
|
94
|
-
|
95
|
-
require $OAUTH_CONFIG_PROPERTIES[OAuthUtility::ZohoOAuthConstants::PERSISTENCE_HANDLER_CLASS_PATH]
|
96
|
-
if $OAUTH_CONFIG_PROPERTIES[OAuthUtility::ZohoOAuthConstants::PERSISTENCE_HANDLER_CLASS].nil?
|
97
|
-
raise OAuthUtility::ZohoOAuthException.get_instance('get_persistence_instance', 'class name not given', 'Exception occured while getting persistence instance', OAuthUtility::ZohoOAuthConstants::ERROR)
|
98
|
-
end
|
99
|
-
|
100
|
-
class_name = $OAUTH_CONFIG_PROPERTIES[OAuthUtility::ZohoOAuthConstants::PERSISTENCE_HANDLER_CLASS].dup
|
101
|
-
begin
|
102
|
-
persistence_instance = Object.const_get(class_name).new
|
103
|
-
rescue NameError
|
104
|
-
raise OAuthUtility::ZohoOAuthException.get_instance('get_persistence_instance', 'Please check the handler class details', 'Error occured while getting persistence instance', OAuthUtility::ZohoOAuthConstants::ERROR)
|
105
|
-
end
|
106
|
-
persistence_instance
|
107
|
-
elsif !$OAUTH_CONFIG_PROPERTIES[OAuthUtility::ZohoOAuthConstants::TOKEN_PERSISTENCE_PATH].nil?
|
108
|
-
Persistence::ZohoOAuthFilePersistenceHandler.get_instance
|
109
|
-
else
|
110
|
-
require 'mysql2'
|
111
|
-
Persistence::ZohoOAuthPersistenceHandler.get_instance
|
112
|
-
end
|
113
|
-
end
|
114
|
-
end
|
115
|
-
# THIS CLASS IS USED TO GENERATED TOKENS
|
116
|
-
class ZohoOAuthClient
|
117
|
-
@@oauth_params = nil
|
118
|
-
@@oauth_client_instance = nil
|
119
|
-
def initialize(oauth_params)
|
120
|
-
@@oauth_params = oauth_params
|
121
|
-
end
|
122
|
-
|
123
|
-
def self.get_oauth_params
|
124
|
-
@@oauth_params
|
125
|
-
end
|
126
|
-
|
127
|
-
def self.get_instance(param = nil)
|
128
|
-
if !param.nil?
|
129
|
-
@@oauth_client_instance = ZohoOAuthClient.new(param)
|
130
|
-
end
|
131
|
-
@@oauth_client_instance
|
132
|
-
end
|
133
|
-
|
134
|
-
def get_access_token(user_email)
|
135
|
-
handler = ZohoOAuth.get_persistence_instance
|
136
|
-
oauth_tokens = handler.get_oauth_tokens(user_email)
|
137
|
-
begin
|
138
|
-
return oauth_tokens.get_access_token
|
139
|
-
rescue ZCRMSDK::OAuthUtility::ZohoOAuthException
|
140
|
-
oauth_tokens = refresh_access_token(oauth_tokens.refresh_token, user_email)
|
141
|
-
return oauth_tokens.access_token
|
142
|
-
end
|
143
|
-
end
|
144
|
-
|
145
|
-
def generate_access_token_from_refresh_token(refresh_token,user_email)
|
146
|
-
refresh_access_token(refresh_token, user_email)
|
147
|
-
end
|
148
|
-
|
149
|
-
def refresh_access_token(refresh_token, user_email)
|
150
|
-
if refresh_token.nil?
|
151
|
-
raise OAuthUtility::ZohoOAuthException.get_instance('refresh_access_token(refresh_token, user_email)', 'Refresh token not provided!', 'Exception occured while refreshing oauthtoken', OAuthUtility::ZohoOAuthConstants::ERROR)
|
152
|
-
end
|
153
|
-
|
154
|
-
begin
|
155
|
-
connector = get_connector(ZohoOAuth.get_refresh_token_url)
|
156
|
-
connector.add_http_request_params(OAuthUtility::ZohoOAuthConstants::GRANT_TYPE, OAuthUtility::ZohoOAuthConstants::GRANT_TYPE_REFRESH)
|
157
|
-
connector.add_http_request_params(OAuthUtility::ZohoOAuthConstants::REFRESH_TOKEN, refresh_token)
|
158
|
-
connector.set_http_request_method(OAuthUtility::ZohoOAuthConstants::REQUEST_METHOD_POST)
|
159
|
-
response = connector.trigger_request
|
160
|
-
response_json = JSON.parse(response.body)
|
161
|
-
if response_json[OAuthUtility::ZohoOAuthConstants::ACCESS_TOKEN].nil?
|
162
|
-
raise OAuthUtility::ZohoOAuthException.get_instance('refresh_access_token(refresh_token, user_email)', 'Response is' + response_json.to_s, 'Exception occured while refreshing oauthtoken', OAuthUtility::ZohoOAuthConstants::ERROR)
|
163
|
-
else
|
164
|
-
oauth_tokens = get_tokens_from_json(response_json)
|
165
|
-
oauth_tokens.user_identifier = user_email
|
166
|
-
oauth_tokens.refresh_token = refresh_token
|
167
|
-
ZohoOAuth.get_persistence_instance.save_oauth_tokens(oauth_tokens)
|
168
|
-
return oauth_tokens
|
169
|
-
end
|
170
|
-
end
|
171
|
-
end
|
172
|
-
|
173
|
-
def generate_access_token(grant_token)
|
174
|
-
if grant_token.nil?
|
175
|
-
raise OAuthUtility::ZohoOAuthException.get_instance('generate_access_token(grant_token)', 'Grant token not provided!', 'Exception occured while fetching accesstoken from Grant Token', OAuthUtility::ZohoOAuthConstants::ERROR)
|
176
|
-
end
|
177
|
-
|
178
|
-
connector = get_connector(ZohoOAuth.get_token_url)
|
179
|
-
connector.add_http_request_params(OAuthUtility::ZohoOAuthConstants::GRANT_TYPE, OAuthUtility::ZohoOAuthConstants::GRANT_TYPE_AUTH_CODE)
|
180
|
-
connector.add_http_request_params(OAuthUtility::ZohoOAuthConstants::CODE, grant_token)
|
181
|
-
connector.set_http_request_method(OAuthUtility::ZohoOAuthConstants::REQUEST_METHOD_POST)
|
182
|
-
response = connector.trigger_request
|
183
|
-
response_json = JSON.parse(response.body)
|
184
|
-
if !response_json[OAuthUtility::ZohoOAuthConstants::ACCESS_TOKEN].nil?
|
185
|
-
oauth_tokens = get_tokens_from_json(response_json)
|
186
|
-
oauth_tokens.user_identifier = get_user_email_from_iam(oauth_tokens.access_token)
|
187
|
-
ZohoOAuth.get_persistence_instance.save_oauth_tokens(oauth_tokens)
|
188
|
-
return oauth_tokens
|
189
|
-
else
|
190
|
-
raise OAuthUtility::ZohoOAuthException.get_instance('generate_access_token(grant_token)', 'Response is' + response_json.to_s, 'Exception occured while fetching accesstoken from Grant Token', OAuthUtility::ZohoOAuthConstants::ERROR)
|
191
|
-
end
|
192
|
-
end
|
193
|
-
|
194
|
-
def get_tokens_from_json(response_json)
|
195
|
-
expires_in = response_json[OAuthUtility::ZohoOAuthConstants::EXPIRES_IN]
|
196
|
-
unless response_json.has_key?(OAuthUtility::ZohoOAuthConstants::EXPIRES_IN_SEC)
|
197
|
-
expires_in = expires_in * 1000
|
198
|
-
end
|
199
|
-
expires_in += ZCRMSDK::OAuthClient::ZohoOAuthTokens.get_current_time_in_millis
|
200
|
-
access_token = response_json[OAuthUtility::ZohoOAuthConstants::ACCESS_TOKEN]
|
201
|
-
refresh_token = nil
|
202
|
-
unless response_json[OAuthUtility::ZohoOAuthConstants::REFRESH_TOKEN].nil?
|
203
|
-
refresh_token = response_json[OAuthUtility::ZohoOAuthConstants::REFRESH_TOKEN]
|
204
|
-
end
|
205
|
-
oauth_tokens = ZohoOAuthTokens.get_instance(refresh_token, access_token, expires_in)
|
206
|
-
oauth_tokens
|
207
|
-
end
|
208
|
-
|
209
|
-
def get_connector(url)
|
210
|
-
connector = OAuthUtility::ZohoOAuthHTTPConnector.get_instance(url, {})
|
211
|
-
connector.add_http_request_params(OAuthUtility::ZohoOAuthConstants::CLIENT_ID, OAuthClient::ZohoOAuthClient.get_oauth_params.client_id)
|
212
|
-
connector.add_http_request_params(OAuthUtility::ZohoOAuthConstants::CLIENT_SECRET, OAuthClient::ZohoOAuthClient.get_oauth_params.client_secret)
|
213
|
-
connector.add_http_request_params(OAuthUtility::ZohoOAuthConstants::REDIRECT_URL, OAuthClient::ZohoOAuthClient.get_oauth_params.redirect_uri)
|
214
|
-
connector
|
215
|
-
end
|
216
|
-
|
217
|
-
def get_user_email_from_iam(access_token)
|
218
|
-
header = {}
|
219
|
-
header[OAuthUtility::ZohoOAuthConstants::AUTHORIZATION] = OAuthUtility::ZohoOAuthConstants::OAUTH_HEADER_PREFIX + access_token
|
220
|
-
connector = OAuthUtility::ZohoOAuthHTTPConnector.get_instance(ZohoOAuth.get_user_info_url, nil, header, nil, OAuthUtility::ZohoOAuthConstants::REQUEST_METHOD_GET)
|
221
|
-
response = connector.trigger_request
|
222
|
-
JSON.parse(response.body)[OAuthUtility::ZohoOAuthConstants::EMAIL]
|
223
|
-
end
|
224
|
-
end
|
225
|
-
# THIS CLASS IS USED TO STORE THE TOKEN AS A INSTANCE AND CHECK THE VALIDITY OF THE TOKEN
|
226
|
-
class ZohoOAuthTokens
|
227
|
-
attr_accessor :refresh_token, :access_token, :expiry_time, :user_email, :user_identifier
|
228
|
-
@user_email = nil
|
229
|
-
def self.get_instance(refresh_token, access_token, expiry_time, user_identifier = nil)
|
230
|
-
ZohoOAuthTokens.new(refresh_token, access_token, expiry_time, user_identifier)
|
231
|
-
end
|
232
|
-
|
233
|
-
def initialize(refresh_token, access_token, expiry_time, user_identifier = nil)
|
234
|
-
@refresh_token = refresh_token
|
235
|
-
@access_token = access_token
|
236
|
-
@expiry_time = expiry_time
|
237
|
-
@user_identifier = user_identifier
|
238
|
-
end
|
239
|
-
|
240
|
-
def get_access_token
|
241
|
-
if (@expiry_time - ZCRMSDK::OAuthClient::ZohoOAuthTokens.get_current_time_in_millis) > 15_000
|
242
|
-
@access_token
|
243
|
-
else
|
244
|
-
raise OAuthUtility::ZohoOAuthException.get_instance('get_access_token', 'Access token got expired!', 'Access token expired hence refreshing', OAuthUtility::ZohoOAuthConstants::INFO)
|
245
|
-
end
|
246
|
-
end
|
247
|
-
|
248
|
-
def self.get_current_time_in_millis
|
249
|
-
(Time.now.to_f * 1000).to_i
|
250
|
-
end
|
251
|
-
end
|
252
|
-
end
|
253
|
-
end
|
@@ -1,161 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'logger'
|
4
|
-
require 'net/http'
|
5
|
-
require_relative 'utility'
|
6
|
-
module ZCRMSDK
|
7
|
-
module OAuthUtility
|
8
|
-
# THIS CLASS IS USED TO DECLARE CONSTANTS THAT ARE USED FREQUENTLY
|
9
|
-
class ZohoOAuthConstants
|
10
|
-
IAM_URL = 'accounts_url'
|
11
|
-
SCOPES = 'scope'
|
12
|
-
STATE = 'state'
|
13
|
-
STATE_OBTAINING_GRANT_TOKEN = 'OBTAIN_GRANT_TOKEN'
|
14
|
-
RESPONSE_TYPE = 'response_type'
|
15
|
-
RESPONSE_TYPE_CODE = 'code'
|
16
|
-
CLIENT_ID = 'client_id'
|
17
|
-
CLIENT_SECRET = 'client_secret'
|
18
|
-
REDIRECT_URL = 'redirect_uri'
|
19
|
-
ACCESS_TYPE = 'access_type'
|
20
|
-
ACCESS_TYPE_OFFLINE = 'offline'
|
21
|
-
ACCESS_TYPE_ONLINE = 'online'
|
22
|
-
PROMPT = 'prompt'
|
23
|
-
PROMPT_CONSENT = 'consent'
|
24
|
-
GRANT_TYPE = 'grant_type'
|
25
|
-
GRANT_TYPE_AUTH_CODE = 'authorization_code'
|
26
|
-
TOKEN_PERSISTENCE_PATH = 'token_persistence_path'
|
27
|
-
DATABASE_PORT = 'db_port'
|
28
|
-
DATABASE_USERNAME = 'db_username'
|
29
|
-
DATABASE_PASSWORD = 'db_password'
|
30
|
-
GRANT_TYPE_REFRESH = 'refresh_token'
|
31
|
-
CODE = 'code'
|
32
|
-
GRANT_TOKEN = 'grant_token'
|
33
|
-
ACCESS_TOKEN = 'access_token'
|
34
|
-
REFRESH_TOKEN = 'refresh_token'
|
35
|
-
EXPIRES_IN = 'expires_in'
|
36
|
-
EXPIRIY_TIME = 'expiry_time'
|
37
|
-
EXPIRES_IN_SEC = 'expires_in_sec'
|
38
|
-
PERSISTENCE_HANDLER_CLASS_PATH = 'persistence_handler_class_path'
|
39
|
-
PERSISTENCE_HANDLER_CLASS = 'persistence_handler_class'
|
40
|
-
TOKEN = 'token'
|
41
|
-
DISPATCH_TO = 'dispatchTo'
|
42
|
-
OAUTH_TOKENS_PARAM = 'oauth_tokens'
|
43
|
-
SANDBOX = 'sandbox'
|
44
|
-
OAUTH_HEADER_PREFIX = 'Zoho-oauthtoken '
|
45
|
-
AUTHORIZATION = 'Authorization'
|
46
|
-
REQUEST_METHOD_GET = 'GET'
|
47
|
-
REQUEST_METHOD_POST = 'POST'
|
48
|
-
CURRENT_USER_EMAIL = 'current_user_email'
|
49
|
-
RESPONSECODE_OK = 200
|
50
|
-
EMAIL = 'Email'
|
51
|
-
ERROR = 'error'
|
52
|
-
INFO = 'info'
|
53
|
-
WARNING = 'warning'
|
54
|
-
end
|
55
|
-
# THIS CLASS IS USED TO HANDLE CUSTOM OAUTH EXCEPTIONS
|
56
|
-
class ZohoOAuthException < StandardError
|
57
|
-
attr_accessor :url, :err_message, :error, :level
|
58
|
-
def initialize(url, err_message, error, level)
|
59
|
-
@err_message = err_message
|
60
|
-
@error = error
|
61
|
-
@level = level
|
62
|
-
@url = url
|
63
|
-
Utility::SDKLogger.add_log(err_message, level, self)
|
64
|
-
end
|
65
|
-
|
66
|
-
def self.get_instance(url, err_message, error, level)
|
67
|
-
ZohoOAuthException.new(url, err_message, error, level)
|
68
|
-
end
|
69
|
-
end
|
70
|
-
# THIS CLASS IS USED TO STORE OAuthParams
|
71
|
-
class ZohoOAuthParams
|
72
|
-
attr_accessor :client_id, :client_secret, :redirect_uri
|
73
|
-
def initialize(client_id, client_secret, redirect_uri)
|
74
|
-
@client_id = client_id
|
75
|
-
@client_secret = client_secret
|
76
|
-
@redirect_uri = redirect_uri
|
77
|
-
end
|
78
|
-
|
79
|
-
def self.get_instance(client_id, client_secret, redirect_uri)
|
80
|
-
ZohoOAuthParams.new(client_id, client_secret, redirect_uri)
|
81
|
-
end
|
82
|
-
end
|
83
|
-
# THIS CLASS IS USED TO FIRE OAUTH RELATED REQUESTS
|
84
|
-
class ZohoOAuthHTTPConnector
|
85
|
-
attr_accessor :url, :req_headers, :req_method, :req_params, :req_body
|
86
|
-
def self.get_instance(url, params = nil, headers = nil, body = nil, method = nil)
|
87
|
-
ZohoOAuthHTTPConnector.new(url, params, headers, body, method)
|
88
|
-
end
|
89
|
-
|
90
|
-
def initialize(url, params = nil, headers = nil, body = nil, method = nil)
|
91
|
-
@url = url
|
92
|
-
@req_headers = headers
|
93
|
-
@req_method = method
|
94
|
-
@req_params = params
|
95
|
-
@req_body = body
|
96
|
-
end
|
97
|
-
|
98
|
-
def trigger_request
|
99
|
-
query_string = @req_params.to_a.map { |x| "#{x[0]}=#{x[1]}" }.join('&')
|
100
|
-
if !query_string.nil? && (query_string.strip != '')
|
101
|
-
@url += '?' + query_string
|
102
|
-
end
|
103
|
-
url = URI(@url)
|
104
|
-
http = Net::HTTP.new(url.host, url.port)
|
105
|
-
http.use_ssl = true
|
106
|
-
if @req_method == OAuthUtility::ZohoOAuthConstants::REQUEST_METHOD_GET
|
107
|
-
req = Net::HTTP::Get.new(url.request_uri)
|
108
|
-
elsif @req_method == OAuthUtility::ZohoOAuthConstants::REQUEST_METHOD_POST
|
109
|
-
req = Net::HTTP::Post.new(url.request_uri)
|
110
|
-
end
|
111
|
-
unless @req_headers.nil?
|
112
|
-
@req_headers.each do |key, value|
|
113
|
-
req.add_field(key, value)
|
114
|
-
end
|
115
|
-
end
|
116
|
-
response = http.request(req)
|
117
|
-
response
|
118
|
-
end
|
119
|
-
|
120
|
-
def self.set_url(url)
|
121
|
-
@url = url
|
122
|
-
end
|
123
|
-
|
124
|
-
def self.get_url
|
125
|
-
@url
|
126
|
-
end
|
127
|
-
|
128
|
-
def add_http_header(key, value)
|
129
|
-
@req_headers[key] = value
|
130
|
-
end
|
131
|
-
|
132
|
-
def get_http_headers
|
133
|
-
req_headers
|
134
|
-
end
|
135
|
-
|
136
|
-
def set_http_request_method(method)
|
137
|
-
@req_method = method
|
138
|
-
end
|
139
|
-
|
140
|
-
def get_http_request_method
|
141
|
-
@req_method
|
142
|
-
end
|
143
|
-
|
144
|
-
def set_request_body(req_body)
|
145
|
-
@req_body = req_body
|
146
|
-
end
|
147
|
-
|
148
|
-
def get_request_body
|
149
|
-
@req_body
|
150
|
-
end
|
151
|
-
|
152
|
-
def add_http_request_params(key, value)
|
153
|
-
@req_params[key] = value
|
154
|
-
end
|
155
|
-
|
156
|
-
def get_http_request_params
|
157
|
-
@req_params
|
158
|
-
end
|
159
|
-
end
|
160
|
-
end
|
161
|
-
end
|
data/lib/ZCRMSDK/operations.rb
DELETED
@@ -1,1091 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative 'utility'
|
4
|
-
require_relative 'handler'
|
5
|
-
module ZCRMSDK
|
6
|
-
module Operations
|
7
|
-
# THIS CLASS IS USED TO STORE AND EXECTUTE MODULE RELATED FUNCTIONS
|
8
|
-
class ZCRMModule
|
9
|
-
attr_accessor :is_inventory_template_supported, :layouts, :visibility, :is_feeds_required, :is_quick_create, :is_email_template_support, :is_webform_supported, :is_filter_supported, :is_kanban_view_supported, :generated_type, :arguments, :parent_module, :is_filter_status, :is_kanban_view, :is_presence_sub_menu, :api_name, :is_convertable, :is_creatable, :is_editable, :is_deletable, :web_link, :singular_label, :plural_label, :modified_by, :modified_time, :is_viewable, :is_api_supported, :is_custom_module, :is_scoring_supported, :id, :module_name, :business_card_field_limit, :business_card_fields, :profiles, :display_field_name, :display_field_id, :related_lists, :fields, :related_list_properties, :properties, :per_page, :search_layout_fields, :default_territory_name, :default_territory_id, :default_custom_view_id, :default_custom_view, :is_global_search_supported, :sequence_number
|
10
|
-
def initialize(module_apiname)
|
11
|
-
@api_name = module_apiname
|
12
|
-
@visibility = nil
|
13
|
-
@fields = nil
|
14
|
-
@layouts = nil
|
15
|
-
@is_convertable = nil
|
16
|
-
@is_feeds_required = nil
|
17
|
-
@is_creatable = nil
|
18
|
-
@is_editable = nil
|
19
|
-
@is_deletable = nil
|
20
|
-
@web_link = nil
|
21
|
-
@singular_label = nil
|
22
|
-
@plural_label = nil
|
23
|
-
@modified_by = nil
|
24
|
-
@modified_time = nil
|
25
|
-
@is_viewable = nil
|
26
|
-
@is_api_supported = nil
|
27
|
-
@is_custom_module = nil
|
28
|
-
@is_scoring_supported = nil
|
29
|
-
@is_webform_supported = nil
|
30
|
-
@is_email_template_support = nil
|
31
|
-
@is_inventory_template_supported = nil
|
32
|
-
@id = nil
|
33
|
-
@module_name = nil
|
34
|
-
@business_card_field_limit = nil
|
35
|
-
@business_card_fields = []
|
36
|
-
@profiles = []
|
37
|
-
@display_field_name = nil
|
38
|
-
@related_lists = nil
|
39
|
-
@related_list_properties = nil
|
40
|
-
@properties = nil
|
41
|
-
@per_page = nil
|
42
|
-
@search_layout_fields = nil
|
43
|
-
@default_territory_name = nil
|
44
|
-
@default_territory_id = nil
|
45
|
-
@default_custom_view_id = nil
|
46
|
-
@default_custom_view = nil
|
47
|
-
@is_global_search_supported = nil
|
48
|
-
@sequence_number = nil
|
49
|
-
@is_kanban_view = nil
|
50
|
-
@is_filter_status = nil
|
51
|
-
@parent_module = nil
|
52
|
-
@is_presence_sub_menu = nil
|
53
|
-
@arguments = []
|
54
|
-
@generated_type = nil
|
55
|
-
@is_quick_create = nil
|
56
|
-
@is_kanban_view_supported = nil
|
57
|
-
@is_filter_supported = nil
|
58
|
-
end
|
59
|
-
|
60
|
-
def self.get_instance(module_apiname)
|
61
|
-
ZCRMModule.new(module_apiname)
|
62
|
-
end
|
63
|
-
|
64
|
-
def get_record(entity_id)
|
65
|
-
record = ZCRMRecord.get_instance(@api_name, entity_id)
|
66
|
-
Handler::EntityAPIHandler.get_instance(record).get_record
|
67
|
-
end
|
68
|
-
|
69
|
-
def get_records(cvid = nil, sort_by = nil, sort_order = nil, page = 1, per_page = 200, headers = nil)
|
70
|
-
Handler::MassEntityAPIHandler.get_instance(self).get_records(cvid, sort_by, sort_order, page, per_page, headers)
|
71
|
-
end
|
72
|
-
|
73
|
-
def get_all_deleted_records(page = 1, per_page = 200)
|
74
|
-
Handler::MassEntityAPIHandler.get_instance(self).get_deleted_records('all', page, per_page)
|
75
|
-
end
|
76
|
-
|
77
|
-
def get_recyclebin_records(page = 1, per_page = 200)
|
78
|
-
Handler::MassEntityAPIHandler.get_instance(self).get_deleted_records('recycle', page, per_page)
|
79
|
-
end
|
80
|
-
|
81
|
-
def get_permanently_deleted_records(page = 1, per_page = 200)
|
82
|
-
Handler::MassEntityAPIHandler.get_instance(self).get_deleted_records('permanent', page, per_page)
|
83
|
-
end
|
84
|
-
|
85
|
-
def get_all_fields
|
86
|
-
Handler::ModuleAPIHandler.get_instance(self).get_all_fields
|
87
|
-
end
|
88
|
-
|
89
|
-
def get_field(field_id)
|
90
|
-
Handler::ModuleAPIHandler.get_instance(self).get_field(field_id)
|
91
|
-
end
|
92
|
-
|
93
|
-
def get_all_layouts
|
94
|
-
Handler::ModuleAPIHandler.get_instance(self).get_all_layouts
|
95
|
-
end
|
96
|
-
|
97
|
-
def get_layout(layout_id)
|
98
|
-
Handler::ModuleAPIHandler.get_instance(self).get_layout(layout_id)
|
99
|
-
end
|
100
|
-
|
101
|
-
def get_all_customviews
|
102
|
-
Handler::ModuleAPIHandler.get_instance(self).get_all_customviews
|
103
|
-
end
|
104
|
-
|
105
|
-
def get_customview(customview_id)
|
106
|
-
Handler::ModuleAPIHandler.get_instance(self).get_customview(customview_id)
|
107
|
-
end
|
108
|
-
|
109
|
-
def get_all_relatedlists
|
110
|
-
Handler::ModuleAPIHandler.get_instance(self).get_all_relatedlists
|
111
|
-
end
|
112
|
-
|
113
|
-
def get_relatedlist(relatedlist_id)
|
114
|
-
Handler::ModuleAPIHandler.get_instance(self).get_relatedlist(relatedlist_id)
|
115
|
-
end
|
116
|
-
|
117
|
-
def create_records(record_ins_list, lar_id = nil)
|
118
|
-
Handler::MassEntityAPIHandler.get_instance(self).create_records(record_ins_list, lar_id)
|
119
|
-
end
|
120
|
-
|
121
|
-
def upsert_records(record_ins_list, duplicate_check_fields = nil, lar_id = nil)
|
122
|
-
Handler::MassEntityAPIHandler.get_instance(self).upsert_records(record_ins_list, duplicate_check_fields, lar_id)
|
123
|
-
end
|
124
|
-
|
125
|
-
def update_records(record_ins_list)
|
126
|
-
Handler::MassEntityAPIHandler.get_instance(self).update_records(record_ins_list)
|
127
|
-
end
|
128
|
-
|
129
|
-
def update_customview(customview_instance)
|
130
|
-
Handler::ModuleAPIHandler.get_instance(self).update_customview(customview_instance)
|
131
|
-
end
|
132
|
-
|
133
|
-
def mass_update_records(entityid_list, field_api_name, value)
|
134
|
-
Handler::MassEntityAPIHandler.get_instance(self).mass_update_records(entityid_list, field_api_name, value)
|
135
|
-
end
|
136
|
-
|
137
|
-
def delete_records(entityid_list)
|
138
|
-
Handler::MassEntityAPIHandler.get_instance(self).delete_records(entityid_list)
|
139
|
-
end
|
140
|
-
|
141
|
-
def search_records(search_word, page = 1, per_page = 200)
|
142
|
-
Handler::MassEntityAPIHandler.get_instance(self).search_records(search_word, page, per_page, 'word')
|
143
|
-
end
|
144
|
-
|
145
|
-
def search_records_by_phone(phone, page = 1, per_page = 200)
|
146
|
-
Handler::MassEntityAPIHandler.get_instance(self).search_records(phone, page, per_page, 'phone')
|
147
|
-
end
|
148
|
-
|
149
|
-
def search_records_by_email(email, page = 1, per_page = 200)
|
150
|
-
Handler::MassEntityAPIHandler.get_instance(self).search_records(email, page, per_page, 'email')
|
151
|
-
end
|
152
|
-
|
153
|
-
def search_records_by_criteria(criteria, page = 1, per_page = 200)
|
154
|
-
Handler::MassEntityAPIHandler.get_instance(self).search_records(criteria, page, per_page, 'criteria')
|
155
|
-
end
|
156
|
-
|
157
|
-
def get_tags
|
158
|
-
Handler::TagAPIHandler.get_instance(self).get_tags
|
159
|
-
end
|
160
|
-
|
161
|
-
def get_tag_count(tag_id)
|
162
|
-
Handler::TagAPIHandler.get_instance(self).get_tag_count(tag_id)
|
163
|
-
end
|
164
|
-
|
165
|
-
def create_tags(tags_list)
|
166
|
-
Handler::TagAPIHandler.get_instance(self).create_tags(tags_list)
|
167
|
-
end
|
168
|
-
|
169
|
-
def update_tags(tags_list)
|
170
|
-
Handler::TagAPIHandler.get_instance(self).update_tags(tags_list)
|
171
|
-
end
|
172
|
-
|
173
|
-
def add_tags_to_multiple_records(tags_list, record_list)
|
174
|
-
Handler::TagAPIHandler.get_instance(self).add_tags_to_multiple_records(tags_list, record_list)
|
175
|
-
end
|
176
|
-
|
177
|
-
def remove_tags_from_multiple_records(tags_list, record_list)
|
178
|
-
Handler::TagAPIHandler.get_instance(self).remove_tags_from_multiple_records(tags_list, record_list)
|
179
|
-
end
|
180
|
-
end
|
181
|
-
# THIS CLASS IS USED TO STORE SUBFORM RELATED DATA
|
182
|
-
class ZCRMSubForm
|
183
|
-
attr_accessor :id, :name, :owner, :created_time, :modified_time, :layout, :field_data, :properties
|
184
|
-
def initialize(id = nil)
|
185
|
-
@id = id
|
186
|
-
@name = nil
|
187
|
-
@owner = nil
|
188
|
-
@created_time = nil
|
189
|
-
@modified_time = nil
|
190
|
-
@layout = nil
|
191
|
-
@field_data = {}
|
192
|
-
@properties = {}
|
193
|
-
end
|
194
|
-
|
195
|
-
def self.get_instance(id = nil)
|
196
|
-
ZCRMSubForm.new(id)
|
197
|
-
end
|
198
|
-
end
|
199
|
-
# THIS CLASS IS USED TO STORE AND EXECTUTE TAG RELATED FUNCTIONS
|
200
|
-
class ZCRMTag
|
201
|
-
attr_accessor :id, :module_apiname, :name, :created_by, :modified_by, :created_time, :modified_time, :count
|
202
|
-
def initialize(id = nil, name = nil)
|
203
|
-
@id = id
|
204
|
-
@module_apiname = nil
|
205
|
-
@name = name
|
206
|
-
@created_by = nil
|
207
|
-
@modified_by = nil
|
208
|
-
@created_time = nil
|
209
|
-
@modified_time = nil
|
210
|
-
@count = nil
|
211
|
-
end
|
212
|
-
|
213
|
-
def self.get_instance(id = nil, name = nil)
|
214
|
-
ZCRMTag.new(id, name)
|
215
|
-
end
|
216
|
-
|
217
|
-
def delete
|
218
|
-
Handler::TagAPIHandler.get_instance.delete(@id)
|
219
|
-
end
|
220
|
-
|
221
|
-
def merge(merge_tag)
|
222
|
-
Handler::TagAPIHandler.get_instance.merge(@id, merge_tag.id)
|
223
|
-
end
|
224
|
-
|
225
|
-
def update
|
226
|
-
Handler::TagAPIHandler.get_instance.update(self)
|
227
|
-
end
|
228
|
-
end
|
229
|
-
# THIS CLASS IS USED TO STORE AND EXECTUTE RECORD RELATED FUNCTIONS
|
230
|
-
class ZCRMRecord
|
231
|
-
attr_accessor :tag_list, :name, :module_api_name, :entity_id, :line_items, :lookup_label, :owner, :created_by, :modified_by, :created_time, :modified_time, :field_data, :properties, :participants, :price_details, :layout, :tax_list, :last_activity_time
|
232
|
-
def initialize(module_apiname, entity_id = nil)
|
233
|
-
@module_api_name = module_apiname
|
234
|
-
@entity_id = entity_id
|
235
|
-
@line_items = []
|
236
|
-
@lookup_label = nil
|
237
|
-
@name = nil
|
238
|
-
@owner = nil
|
239
|
-
@created_by = nil
|
240
|
-
@modified_by = nil
|
241
|
-
@created_time = nil
|
242
|
-
@modified_time = nil
|
243
|
-
@field_data = {}
|
244
|
-
@properties = {}
|
245
|
-
@participants = []
|
246
|
-
@price_details = []
|
247
|
-
@layout = nil
|
248
|
-
@tax_list = []
|
249
|
-
@tag_list = []
|
250
|
-
end
|
251
|
-
|
252
|
-
def self.get_instance(module_api_name, entity_id = nil)
|
253
|
-
ZCRMRecord.new(module_api_name, entity_id)
|
254
|
-
end
|
255
|
-
|
256
|
-
def get
|
257
|
-
Handler::EntityAPIHandler.get_instance(self).get_record
|
258
|
-
end
|
259
|
-
|
260
|
-
def create
|
261
|
-
Handler::EntityAPIHandler.get_instance(self).create_record
|
262
|
-
end
|
263
|
-
|
264
|
-
def update
|
265
|
-
Handler::EntityAPIHandler.get_instance(self).update_record
|
266
|
-
end
|
267
|
-
|
268
|
-
def delete
|
269
|
-
Handler::EntityAPIHandler.get_instance(self).delete_record
|
270
|
-
end
|
271
|
-
|
272
|
-
def convert(potential_record = nil, details = nil)
|
273
|
-
Handler::EntityAPIHandler.get_instance(self).convert_record(potential_record, details)
|
274
|
-
end
|
275
|
-
|
276
|
-
def upload_attachment(file_path)
|
277
|
-
ZCRMModuleRelation.get_instance(self, 'Attachments').upload_attachment(file_path)
|
278
|
-
end
|
279
|
-
|
280
|
-
def upload_link_as_attachment(link_url)
|
281
|
-
ZCRMModuleRelation.get_instance(self, 'Attachments').upload_link_as_attachment(link_url)
|
282
|
-
end
|
283
|
-
|
284
|
-
def download_attachment(attachment_id)
|
285
|
-
ZCRMModuleRelation.get_instance(self, 'Attachments').download_attachment(attachment_id)
|
286
|
-
end
|
287
|
-
|
288
|
-
def delete_attachment(attachment_id)
|
289
|
-
ZCRMModuleRelation.get_instance(self, 'Attachments').delete_attachment(attachment_id)
|
290
|
-
end
|
291
|
-
|
292
|
-
def upload_photo(file_path)
|
293
|
-
Handler::EntityAPIHandler.get_instance(self).upload_photo(file_path)
|
294
|
-
end
|
295
|
-
|
296
|
-
def download_photo
|
297
|
-
Handler::EntityAPIHandler.get_instance(self).download_photo
|
298
|
-
end
|
299
|
-
|
300
|
-
def delete_photo
|
301
|
-
Handler::EntityAPIHandler.get_instance(self).delete_photo
|
302
|
-
end
|
303
|
-
|
304
|
-
def add_relation(junction_record)
|
305
|
-
ZCRMModuleRelation.get_instance(self, junction_record).add_relation
|
306
|
-
end
|
307
|
-
|
308
|
-
def remove_relation(junction_record)
|
309
|
-
ZCRMModuleRelation.get_instance(self, junction_record).remove_relation
|
310
|
-
end
|
311
|
-
|
312
|
-
def add_notes(note_instances)
|
313
|
-
ZCRMModuleRelation.get_instance(self, 'Notes').add_notes(note_instances)
|
314
|
-
end
|
315
|
-
|
316
|
-
def update_note(note_ins)
|
317
|
-
ZCRMModuleRelation.get_instance(self, 'Notes').update_note(note_ins)
|
318
|
-
end
|
319
|
-
|
320
|
-
def delete_note(note_ins)
|
321
|
-
ZCRMModuleRelation.get_instance(self, 'Notes').delete_note(note_ins)
|
322
|
-
end
|
323
|
-
|
324
|
-
def get_notes(sort_by = nil, sort_order = nil, page = 1, per_page = 20)
|
325
|
-
ZCRMModuleRelation.get_instance(self, 'Notes').get_notes(sort_by, sort_order, page, per_page)
|
326
|
-
end
|
327
|
-
|
328
|
-
def get_attachments(page = 1, per_page = 20)
|
329
|
-
ZCRMModuleRelation.get_instance(self, 'Attachments').get_attachments(page, per_page)
|
330
|
-
end
|
331
|
-
|
332
|
-
def get_relatedlist_records(relatedlist_api_name, sort_by = nil, sort_order = nil, page = 1, per_page = 20)
|
333
|
-
ZCRMModuleRelation.get_instance(self, relatedlist_api_name).get_records(sort_by, sort_order, page, per_page)
|
334
|
-
end
|
335
|
-
|
336
|
-
def add_tags(tagnames)
|
337
|
-
Handler::TagAPIHandler.get_instance.add_tags(self, tagnames)
|
338
|
-
end
|
339
|
-
|
340
|
-
def remove_tags(tagnames)
|
341
|
-
Handler::TagAPIHandler.get_instance.remove_tags(self, tagnames)
|
342
|
-
end
|
343
|
-
end
|
344
|
-
# THIS CLASS IS USED TO STORE LINE ITEM RELATED DATA
|
345
|
-
class ZCRMInventoryLineItem
|
346
|
-
attr_accessor :product, :id, :discount_percentage, :list_price, :quantity, :description, :total, :discount, :total_after_discount, :tax_amount, :net_total, :delete_flag, :line_tax
|
347
|
-
def initialize(param = nil)
|
348
|
-
if param.is_a?(Operations::ZCRMRecord)
|
349
|
-
@product = param
|
350
|
-
@id = nil
|
351
|
-
else
|
352
|
-
@id = param
|
353
|
-
@product = nil
|
354
|
-
@list_price = nil
|
355
|
-
@quantity = nil
|
356
|
-
@description = nil
|
357
|
-
@total = nil
|
358
|
-
@discount = nil
|
359
|
-
@discount_percentage = nil
|
360
|
-
@total_after_discount = nil
|
361
|
-
@tax_amount = nil
|
362
|
-
@net_total = nil
|
363
|
-
@delete_flag = false
|
364
|
-
@line_tax = []
|
365
|
-
end
|
366
|
-
end
|
367
|
-
|
368
|
-
def self.get_instance(param = nil)
|
369
|
-
ZCRMInventoryLineItem.new(param)
|
370
|
-
end
|
371
|
-
end
|
372
|
-
# THIS CLASS IS USED TO STORE TAX RELATED DATA
|
373
|
-
class ZCRMTax
|
374
|
-
attr_accessor :name, :percentage, :value
|
375
|
-
def initialize(name)
|
376
|
-
@name = name
|
377
|
-
@percentage = nil
|
378
|
-
@value = nil
|
379
|
-
end
|
380
|
-
|
381
|
-
def self.get_instance(name)
|
382
|
-
ZCRMTax.new(name)
|
383
|
-
end
|
384
|
-
end
|
385
|
-
# THIS CLASS IS USED TO STORE ORG TAX RELATED DATA
|
386
|
-
class ZCRMOrgTax
|
387
|
-
attr_accessor :id, :name, :display_label, :value, :sequence_number
|
388
|
-
def initialize(id = nil, name = nil)
|
389
|
-
@id = id
|
390
|
-
@name = name
|
391
|
-
@display_label = nil
|
392
|
-
@value = nil
|
393
|
-
@sequence_number = nil
|
394
|
-
end
|
395
|
-
|
396
|
-
def self.get_instance(id = nil, name = nil)
|
397
|
-
ZCRMOrgTax.new(id, name)
|
398
|
-
end
|
399
|
-
end
|
400
|
-
# THIS CLASS IS USED TO STORE EVENT PARTICIPANT RELATED DATA
|
401
|
-
class ZCRMEventParticipant
|
402
|
-
attr_accessor :id, :type, :email, :name, :is_invited, :status
|
403
|
-
def initialize(participant_type, participant_id)
|
404
|
-
@id = participant_id
|
405
|
-
@type = participant_type
|
406
|
-
@email = nil
|
407
|
-
@name = nil
|
408
|
-
@is_invited = nil
|
409
|
-
@status = nil
|
410
|
-
end
|
411
|
-
|
412
|
-
def self.get_instance(participant_type, participant_id)
|
413
|
-
ZCRMEventParticipant.new(participant_type, participant_id)
|
414
|
-
end
|
415
|
-
end
|
416
|
-
# THIS CLASS IS USED TO STORE PRICING BOOK RELATED DATA
|
417
|
-
class ZCRMPriceBookPricing
|
418
|
-
attr_accessor :id, :to_range, :from_range, :discount
|
419
|
-
def initialize(price_book_id = nil)
|
420
|
-
@id = price_book_id
|
421
|
-
@to_range = nil
|
422
|
-
@from_range = nil
|
423
|
-
@discount = nil
|
424
|
-
end
|
425
|
-
|
426
|
-
def self.get_instance(price_book_id = nil)
|
427
|
-
ZCRMPriceBookPricing.new(price_book_id)
|
428
|
-
end
|
429
|
-
end
|
430
|
-
# THIS CLASS IS USED TO STORE USER RELATED DATA
|
431
|
-
class ZCRMUser
|
432
|
-
attr_accessor :id, :is_microsoft, :offset, :name, :field_apiname_vs_value, :signature, :country, :role, :customize_info, :city, :name_format, :language, :locale, :is_personal_account, :default_tab_group, :street, :alias_aka, :theme, :state, :country_locale, :fax, :first_name, :email, :zip, :decimal_separator, :website, :time_format, :profile, :mobile, :last_name, :time_zone, :zuid, :is_confirm, :full_name, :phone, :dob, :date_format, :status, :created_by, :modified_by, :territories, :reporting_to, :is_online, :currency, :created_time, :modified_time
|
433
|
-
def initialize(user_id = nil, name = nil)
|
434
|
-
@id = user_id
|
435
|
-
@name = name
|
436
|
-
@offset = nil
|
437
|
-
@is_microsoft = nil
|
438
|
-
@signature = nil
|
439
|
-
@country = nil
|
440
|
-
@role = nil
|
441
|
-
@customize_info = nil
|
442
|
-
@city = nil
|
443
|
-
@name_format = nil
|
444
|
-
@language = nil
|
445
|
-
@locale = nil
|
446
|
-
@is_personal_account = nil
|
447
|
-
@default_tab_group = nil
|
448
|
-
@street = nil
|
449
|
-
@alias_aka = nil
|
450
|
-
@theme = nil
|
451
|
-
@state = nil
|
452
|
-
@country_locale = nil
|
453
|
-
@fax = nil
|
454
|
-
@first_name = nil
|
455
|
-
@email = nil
|
456
|
-
@zip = nil
|
457
|
-
@decimal_separator = nil
|
458
|
-
@website = nil
|
459
|
-
@time_format = nil
|
460
|
-
@profile = nil
|
461
|
-
@mobile = nil
|
462
|
-
@last_name = nil
|
463
|
-
@time_zone = nil
|
464
|
-
@zuid = nil
|
465
|
-
@is_confirm = nil
|
466
|
-
@full_name = nil
|
467
|
-
@phone = nil
|
468
|
-
@dob = nil
|
469
|
-
@date_format = nil
|
470
|
-
@status = nil
|
471
|
-
@created_by = nil
|
472
|
-
@modified_by = nil
|
473
|
-
@territories = nil
|
474
|
-
@reporting_to = nil
|
475
|
-
@is_online = nil
|
476
|
-
@currency = nil
|
477
|
-
@created_time = nil
|
478
|
-
@modified_time = nil
|
479
|
-
@field_apiname_vs_value = nil
|
480
|
-
end
|
481
|
-
|
482
|
-
def self.get_instance(user_id = nil, name = nil)
|
483
|
-
ZCRMUser.new(user_id, name)
|
484
|
-
end
|
485
|
-
end
|
486
|
-
# THIS CLASS IS USED TO STORE USER CUSTOM INFO RELATED DATA
|
487
|
-
class ZCRMUserCustomizeInfo
|
488
|
-
attr_accessor :notes_desc, :is_to_show_right_panel, :is_bc_view, :is_to_show_home, :is_to_show_detail_view, :unpin_recent_item
|
489
|
-
def initialize
|
490
|
-
@notes_desc = nil
|
491
|
-
@is_to_show_right_panel = nil
|
492
|
-
@is_bc_view = nil
|
493
|
-
@is_to_show_home = nil
|
494
|
-
@is_to_show_detail_view = nil
|
495
|
-
@unpin_recent_item = nil
|
496
|
-
end
|
497
|
-
|
498
|
-
def self.get_instance
|
499
|
-
ZCRMUserCustomizeInfo.new
|
500
|
-
end
|
501
|
-
end
|
502
|
-
# THIS CLASS IS USED TO STORE USER THEME RELATED DATA
|
503
|
-
class ZCRMUserTheme
|
504
|
-
attr_accessor :normal_tab_font_color, :normal_tab_background, :selected_tab_font_color, :selected_tab_background, :new_background, :background, :screen, :type
|
505
|
-
def initialize
|
506
|
-
@normal_tab_font_color = nil
|
507
|
-
@normal_tab_background = nil
|
508
|
-
@selected_tab_font_color = nil
|
509
|
-
@selected_tab_background = nil
|
510
|
-
@new_background = nil
|
511
|
-
@background = nil
|
512
|
-
@screen = nil
|
513
|
-
@type = nil
|
514
|
-
end
|
515
|
-
|
516
|
-
def self.get_instance
|
517
|
-
ZCRMUserTheme.new
|
518
|
-
end
|
519
|
-
end
|
520
|
-
# THIS CLASS IS USED TO STORE ROLE RELATED DATA
|
521
|
-
class ZCRMRole
|
522
|
-
attr_accessor :name, :id, :reporting_to, :display_label, :is_admin, :forecast_manager, :is_share_with_peers, :description
|
523
|
-
def initialize(role_id, role_name = nil)
|
524
|
-
@name = role_name
|
525
|
-
@id = role_id
|
526
|
-
@reporting_to = nil
|
527
|
-
@display_label = nil
|
528
|
-
@is_admin = nil
|
529
|
-
@forecast_manager = nil
|
530
|
-
@is_share_with_peers = nil
|
531
|
-
@description = nil
|
532
|
-
end
|
533
|
-
|
534
|
-
def self.get_instance(role_id, role_name = nil)
|
535
|
-
ZCRMRole.new(role_id, role_name)
|
536
|
-
end
|
537
|
-
end
|
538
|
-
# THIS CLASS IS USED TO STORE LAYOUT RELATED DATA
|
539
|
-
class ZCRMLayout
|
540
|
-
attr_accessor :created_for, :id, :name, :created_time, :modified_time, :is_visible, :modified_by, :accessible_profiles, :created_by, :sections, :status, :convert_mapping
|
541
|
-
def initialize(layout_id)
|
542
|
-
@id = layout_id
|
543
|
-
@name = nil
|
544
|
-
@created_time = nil
|
545
|
-
@modified_time = nil
|
546
|
-
@is_visible = nil
|
547
|
-
@modified_by = nil
|
548
|
-
@accessible_profiles = nil
|
549
|
-
@created_by = nil
|
550
|
-
@sections = nil
|
551
|
-
@status = nil
|
552
|
-
@convert_mapping = {}
|
553
|
-
@created_for = nil
|
554
|
-
end
|
555
|
-
|
556
|
-
def self.get_instance(layout_id)
|
557
|
-
ZCRMLayout.new(layout_id)
|
558
|
-
end
|
559
|
-
end
|
560
|
-
# THIS CLASS IS USED TO STORE ATTACHMENT RELATED DATA
|
561
|
-
class ZCRMAttachment
|
562
|
-
attr_accessor :is_editable, :link_url, :file_id, :id, :parent_record, :file_name, :type, :size, :owner, :created_by, :created_time, :modified_by, :modified_time, :parent_module, :attachment_type, :parent_name, :parent_id
|
563
|
-
def initialize(parent_record, attachment_id = nil)
|
564
|
-
@id = attachment_id
|
565
|
-
@parent_record = parent_record
|
566
|
-
@file_name = nil
|
567
|
-
@type = nil
|
568
|
-
@size = nil
|
569
|
-
@owner = nil
|
570
|
-
@created_by = nil
|
571
|
-
@created_time = nil
|
572
|
-
@modified_by = nil
|
573
|
-
@modified_time = nil
|
574
|
-
@parent_module = nil
|
575
|
-
@attachment_type = nil
|
576
|
-
@parent_name = nil
|
577
|
-
@parent_id = nil
|
578
|
-
@file_id = nil
|
579
|
-
@link_url = nil
|
580
|
-
@is_editable = nil
|
581
|
-
end
|
582
|
-
|
583
|
-
def self.get_instance(parent_record, attachment_id = nil)
|
584
|
-
ZCRMAttachment.new(parent_record, attachment_id)
|
585
|
-
end
|
586
|
-
end
|
587
|
-
# THIS CLASS IS USED TO STORE CUSTOM VIEW RELATED DATA
|
588
|
-
class ZCRMCustomView
|
589
|
-
attr_accessor :is_system_defined, :shared_details, :criteria_pattern, :criteria_condition, :id, :module_api_name, :display_value, :is_default, :name, :system_name, :sort_by, :category, :fields, :favorite, :sort_order, :criteria, :categories, :is_off_line
|
590
|
-
def initialize(custom_view_id, module_api_name = nil)
|
591
|
-
@id = custom_view_id
|
592
|
-
@module_api_name = module_api_name
|
593
|
-
@display_value = nil
|
594
|
-
@is_default = nil
|
595
|
-
@name = nil
|
596
|
-
@system_name = nil
|
597
|
-
@sort_by = nil
|
598
|
-
@category = nil
|
599
|
-
@fields = []
|
600
|
-
@favorite = nil
|
601
|
-
@sort_order = nil
|
602
|
-
@criteria = nil
|
603
|
-
@criteria_pattern = nil
|
604
|
-
@criteria_condition = nil
|
605
|
-
@categories = []
|
606
|
-
@is_off_line = nil
|
607
|
-
@shared_details = nil
|
608
|
-
@is_system_defined = nil
|
609
|
-
end
|
610
|
-
|
611
|
-
def self.get_instance(custom_view_id, module_api_name = nil)
|
612
|
-
ZCRMCustomView.new(custom_view_id, module_api_name)
|
613
|
-
end
|
614
|
-
|
615
|
-
def get_records(sort_by = nil, sort_order = nil, page = 1, per_page = 200, headers = nil)
|
616
|
-
Operations::ZCRMModule.get_instance(module_api_name).get_records(id, sort_by, sort_order, page, per_page, headers)
|
617
|
-
end
|
618
|
-
end
|
619
|
-
# THIS CLASS IS USED TO STORE CUSTOMVIEW CATEGORY RELATED DATA
|
620
|
-
class ZCRMCustomViewCategory
|
621
|
-
attr_accessor :display_value, :actual_value
|
622
|
-
def initialize
|
623
|
-
@display_value = nil
|
624
|
-
@actual_value = nil
|
625
|
-
end
|
626
|
-
|
627
|
-
def self.get_instance
|
628
|
-
ZCRMCustomViewCategory.new
|
629
|
-
end
|
630
|
-
end
|
631
|
-
# THIS CLASS IS USED TO STORE CUSTOMVIEW CATEGORY CRITERIA RELATED DATA
|
632
|
-
class ZCRMCustomViewCriteria
|
633
|
-
attr_accessor :comparator, :field, :value, :group, :group_operator, :pattern, :index, :criteria
|
634
|
-
def initialize
|
635
|
-
@comparator = nil
|
636
|
-
@field = nil
|
637
|
-
@value = nil
|
638
|
-
@group = nil
|
639
|
-
@group_operator = nil
|
640
|
-
@pattern = nil
|
641
|
-
@index = nil
|
642
|
-
@criteria = nil
|
643
|
-
end
|
644
|
-
|
645
|
-
def self.get_instance
|
646
|
-
ZCRMCustomViewCriteria.new
|
647
|
-
end
|
648
|
-
end
|
649
|
-
# THIS CLASS IS USED TO STORE FIELD RELATED DATA
|
650
|
-
class ZCRMField
|
651
|
-
attr_accessor :is_webhook, :crypt, :tooltip, :is_field_read_only, :association_details, :subform, :is_mass_update, :multiselectlookup, :api_name, :is_custom_field, :lookup_field, :convert_mapping, :is_visible, :field_label, :length, :created_source, :default_value, :is_mandatory, :sequence_number, :is_read_only, :is_unique_field, :is_case_sensitive, :data_type, :is_formula_field, :is_currency_field, :id, :picklist_values, :is_auto_number, :is_business_card_supported, :field_layout_permissions, :decimal_place, :precision, :rounding_option, :formula_return_type, :formula_expression, :prefix, :suffix, :start_number, :json_type
|
652
|
-
def initialize(api_name, id = nil)
|
653
|
-
@api_name = api_name
|
654
|
-
@is_webhook = nil
|
655
|
-
@crypt = nil
|
656
|
-
@tooltip = nil
|
657
|
-
@is_field_read_only = nil
|
658
|
-
@association_details = nil
|
659
|
-
@subform = nil
|
660
|
-
@is_mass_update = nil
|
661
|
-
@multiselectlookup = {}
|
662
|
-
@is_custom_field = nil
|
663
|
-
@lookup_field = {}
|
664
|
-
@convert_mapping = nil
|
665
|
-
@is_visible = nil
|
666
|
-
@field_label = nil
|
667
|
-
@length = nil
|
668
|
-
@created_source = nil
|
669
|
-
@default_value = nil
|
670
|
-
@is_mandatory = nil
|
671
|
-
@sequence_number = nil
|
672
|
-
@is_read_only = nil
|
673
|
-
@is_unique_field = nil
|
674
|
-
@is_case_sensitive = nil
|
675
|
-
@data_type = nil
|
676
|
-
@is_formula_field = nil
|
677
|
-
@is_currency_field = nil
|
678
|
-
@id = id
|
679
|
-
@picklist_values = []
|
680
|
-
@is_auto_number = nil
|
681
|
-
@is_business_card_supported = nil
|
682
|
-
@field_layout_permissions = nil
|
683
|
-
@decimal_place = nil
|
684
|
-
@precision = nil
|
685
|
-
@rounding_option = nil
|
686
|
-
@formula_return_type = nil
|
687
|
-
@formula_expression = nil
|
688
|
-
@prefix = nil
|
689
|
-
@suffix = nil
|
690
|
-
@start_number = nil
|
691
|
-
@json_type = nil
|
692
|
-
end
|
693
|
-
|
694
|
-
def self.get_instance(api_name, id = nil)
|
695
|
-
ZCRMField.new(api_name, id)
|
696
|
-
end
|
697
|
-
end
|
698
|
-
# THIS CLASS IS USED TO STORE JUNCTION RECORD RELATED DATA
|
699
|
-
class ZCRMJunctionRecord
|
700
|
-
attr_accessor :id, :api_name, :related_data
|
701
|
-
def initialize(api_name, record_id)
|
702
|
-
@id = record_id
|
703
|
-
@api_name = api_name
|
704
|
-
@related_data = {}
|
705
|
-
end
|
706
|
-
|
707
|
-
def self.get_instance(api_name, record_id)
|
708
|
-
ZCRMJunctionRecord.new(api_name, record_id)
|
709
|
-
end
|
710
|
-
end
|
711
|
-
# THIS CLASS IS USED TO STORE LEAD CONVERT MAPPING RELATED DATA
|
712
|
-
class ZCRMLeadConvertMapping
|
713
|
-
attr_accessor :id, :name, :fields
|
714
|
-
def initialize(name, converted_id)
|
715
|
-
@id = converted_id
|
716
|
-
@name = name
|
717
|
-
@fields = []
|
718
|
-
end
|
719
|
-
|
720
|
-
def self.get_instance(name, converted_id)
|
721
|
-
ZCRMLeadConvertMapping.new(name, converted_id)
|
722
|
-
end
|
723
|
-
end
|
724
|
-
# THIS CLASS IS USED TO STORE LEAD CONVERT MAPPING FIELD RELATED DATA
|
725
|
-
class ZCRMLeadConvertMappingField
|
726
|
-
attr_accessor :id, :api_name, :field_label, :is_required
|
727
|
-
def initialize(api_name, field_id)
|
728
|
-
@id = field_id
|
729
|
-
@api_name = api_name
|
730
|
-
@field_label = nil
|
731
|
-
@is_required = nil
|
732
|
-
end
|
733
|
-
|
734
|
-
def self.get_instance(api_name, field_id)
|
735
|
-
ZCRMLeadConvertMappingField.new(api_name, field_id)
|
736
|
-
end
|
737
|
-
end
|
738
|
-
# THIS CLASS IS USED TO STORE LOOKUP FIELD RELATED DATA
|
739
|
-
class ZCRMLookupField
|
740
|
-
attr_accessor :api_name, :display_label, :module_apiname, :id
|
741
|
-
def initialize(api_name)
|
742
|
-
@api_name = api_name
|
743
|
-
@display_label = nil
|
744
|
-
@module_apiname = nil
|
745
|
-
@id = nil
|
746
|
-
end
|
747
|
-
|
748
|
-
def self.get_instance(api_name)
|
749
|
-
ZCRMLookupField.new(api_name)
|
750
|
-
end
|
751
|
-
end
|
752
|
-
# THIS CLASS IS USED TO STORE MODULE RELATED LIST RELATED DATA
|
753
|
-
class ZCRMModuleRelatedList
|
754
|
-
attr_accessor :api_name, :module_apiname, :display_label, :is_visible, :name, :id, :href, :type, :action, :sequence_number
|
755
|
-
def initialize(api_name)
|
756
|
-
@api_name = api_name
|
757
|
-
@module_apiname = nil
|
758
|
-
@display_label = nil
|
759
|
-
@is_visible = nil
|
760
|
-
@name = nil
|
761
|
-
@id = nil
|
762
|
-
@href = nil
|
763
|
-
@type = nil
|
764
|
-
@action = nil
|
765
|
-
@sequence_number = nil
|
766
|
-
end
|
767
|
-
|
768
|
-
def self.get_instance(api_name)
|
769
|
-
ZCRMModuleRelatedList.new(api_name)
|
770
|
-
end
|
771
|
-
end
|
772
|
-
# THIS CLASS IS USED TO STORE MODULE RELATION RELATED DATA
|
773
|
-
class ZCRMModuleRelation
|
774
|
-
attr_accessor :parent_record, :parent_module_api_name, :junction_record, :api_name, :label, :id, :is_visible
|
775
|
-
def initialize(parentmodule_apiname_or_parentrecord, related_list_apiname_or_junction_record = nil)
|
776
|
-
if parentmodule_apiname_or_parentrecord.is_a?(Operations::ZCRMRecord)
|
777
|
-
@parent_record = parentmodule_apiname_or_parentrecord
|
778
|
-
@parent_module_api_name = nil
|
779
|
-
else
|
780
|
-
@parent_module_api_name = parentmodule_apiname_or_parentrecord
|
781
|
-
@parent_record = nil
|
782
|
-
end
|
783
|
-
if related_list_apiname_or_junction_record.is_a?(Operations::ZCRMJunctionRecord)
|
784
|
-
@junction_record = related_list_apiname_or_junction_record
|
785
|
-
@api_name = nil
|
786
|
-
else
|
787
|
-
@api_name = related_list_apiname_or_junction_record
|
788
|
-
@junction_record = nil
|
789
|
-
end
|
790
|
-
@label = nil
|
791
|
-
@id = nil
|
792
|
-
@is_visible = nil
|
793
|
-
end
|
794
|
-
|
795
|
-
def self.get_instance(parentmodule_apiname_or_parentrecord, related_list_apiname_or_junction_record)
|
796
|
-
ZCRMModuleRelation.new(parentmodule_apiname_or_parentrecord, related_list_apiname_or_junction_record)
|
797
|
-
end
|
798
|
-
|
799
|
-
def get_records(sort_by_field = nil, sort_order = nil, page = 1, per_page = 20)
|
800
|
-
Handler::RelatedListAPIHandler.get_instance(@parent_record, self).get_records(sort_by_field, sort_order, page, per_page)
|
801
|
-
end
|
802
|
-
|
803
|
-
def upload_attachment(file_path)
|
804
|
-
Handler::RelatedListAPIHandler.get_instance(@parent_record, self).upload_attachment(file_path)
|
805
|
-
end
|
806
|
-
|
807
|
-
def upload_link_as_attachment(link_url)
|
808
|
-
Handler::RelatedListAPIHandler.get_instance(@parent_record, self).upload_link_as_attachment(link_url)
|
809
|
-
end
|
810
|
-
|
811
|
-
def download_attachment(attachment_id)
|
812
|
-
Handler::RelatedListAPIHandler.get_instance(@parent_record, self).download_attachment(attachment_id)
|
813
|
-
end
|
814
|
-
|
815
|
-
def delete_attachment(attachment_id)
|
816
|
-
Handler::RelatedListAPIHandler.get_instance(@parent_record, self).delete_attachment(attachment_id)
|
817
|
-
end
|
818
|
-
|
819
|
-
def add_relation
|
820
|
-
Handler::RelatedListAPIHandler.get_instance(@parent_record, @junction_record).add_relation
|
821
|
-
end
|
822
|
-
|
823
|
-
def remove_relation
|
824
|
-
Handler::RelatedListAPIHandler.get_instance(@parent_record, @junction_record).remove_relation
|
825
|
-
end
|
826
|
-
|
827
|
-
def add_notes(zcrm_note_instances)
|
828
|
-
Handler::RelatedListAPIHandler.get_instance(@parent_record, self).add_notes(zcrm_note_instances)
|
829
|
-
end
|
830
|
-
|
831
|
-
def update_note(zcrm_note_ins)
|
832
|
-
Handler::RelatedListAPIHandler.get_instance(@parent_record, self).update_note(zcrm_note_ins)
|
833
|
-
end
|
834
|
-
|
835
|
-
def delete_note(zcrm_note_ins)
|
836
|
-
Handler::RelatedListAPIHandler.get_instance(@parent_record, self).delete_note(zcrm_note_ins)
|
837
|
-
end
|
838
|
-
|
839
|
-
def get_notes(sort_by = nil, sort_order = nil, page = 1, per_page = 200)
|
840
|
-
Handler::RelatedListAPIHandler.get_instance(@parent_record, self).get_notes(sort_by, sort_order, page, per_page)
|
841
|
-
end
|
842
|
-
|
843
|
-
def get_attachments(page = 1, per_page = 20)
|
844
|
-
Handler::RelatedListAPIHandler.get_instance(@parent_record, self).get_attachments(page, per_page)
|
845
|
-
end
|
846
|
-
end
|
847
|
-
# THIS CLASS IS USED TO STORE AND EXECUTE NOTES RELATED FUNCTIONALITY
|
848
|
-
class ZCRMNote
|
849
|
-
attr_accessor :is_editable, :id, :parent_record, :title, :content, :owner, :created_by, :created_time, :modified_by, :modified_time, :attachments, :size, :is_voice_note, :parent_module, :parent_name, :parent_id
|
850
|
-
def initialize(parent_record = nil, note_id = nil)
|
851
|
-
@id = note_id
|
852
|
-
@parent_record = parent_record
|
853
|
-
@title = nil
|
854
|
-
@content = nil
|
855
|
-
@owner = nil
|
856
|
-
@created_by = nil
|
857
|
-
@created_time = nil
|
858
|
-
@modified_by = nil
|
859
|
-
@modified_time = nil
|
860
|
-
@attachments = nil
|
861
|
-
@size = nil
|
862
|
-
@is_voice_note = nil
|
863
|
-
unless parent_record.nil?
|
864
|
-
@parent_module = parent_record.module_api_name
|
865
|
-
@parent_id = parent_record.entity_id
|
866
|
-
end
|
867
|
-
@parent_name = nil
|
868
|
-
@is_editable = nil
|
869
|
-
end
|
870
|
-
|
871
|
-
def upload_attachment(file_path)
|
872
|
-
ZCRMModuleRelation.get_instance(ZCRMRecord.get_instance('Notes', @id), 'Attachments').upload_attachment(file_path)
|
873
|
-
end
|
874
|
-
|
875
|
-
def download_attachment(attachment_id)
|
876
|
-
ZCRMModuleRelation.get_instance(ZCRMRecord.get_instance('Notes', @id), 'Attachments').download_attachment(attachment_id)
|
877
|
-
end
|
878
|
-
|
879
|
-
def get_attachments(page = 1, per_page = 20)
|
880
|
-
ZCRMModuleRelation.get_instance(ZCRMRecord.get_instance('Notes', @id), 'Attachments').get_attachments(page, per_page)
|
881
|
-
end
|
882
|
-
|
883
|
-
def delete_attachment(attachment_id)
|
884
|
-
ZCRMModuleRelation.get_instance(ZCRMRecord.get_instance('Notes', @id), 'Attachments').delete_attachment(attachment_id)
|
885
|
-
end
|
886
|
-
|
887
|
-
def self.get_instance(parent_record = nil, note_id = nil)
|
888
|
-
ZCRMNote.new(parent_record , note_id)
|
889
|
-
end
|
890
|
-
end
|
891
|
-
# THIS CLASS IS USED TO STORE PROFILE PERMISSIONS RELATED DATA
|
892
|
-
class ZCRMPermission
|
893
|
-
attr_accessor :id, :name, :display_label, :module_api_name, :is_enabled
|
894
|
-
def initialize(permission_name, permission_id)
|
895
|
-
@id = permission_id
|
896
|
-
@name = permission_name
|
897
|
-
@display_label = nil
|
898
|
-
@module_api_name = nil
|
899
|
-
@is_enabled = nil
|
900
|
-
end
|
901
|
-
|
902
|
-
def self.get_instance(permission_name, permission_id)
|
903
|
-
ZCRMPermission.new(permission_name, permission_id)
|
904
|
-
end
|
905
|
-
end
|
906
|
-
# THIS CLASS IS USED TO STORE PICK LIST VALUE RELATED DATA
|
907
|
-
class ZCRMPickListValue
|
908
|
-
attr_accessor :display_value, :sequence_number, :actual_value, :maps
|
909
|
-
def initialize
|
910
|
-
@display_value = nil
|
911
|
-
@sequence_number = nil
|
912
|
-
@actual_value = nil
|
913
|
-
@maps = nil
|
914
|
-
end
|
915
|
-
|
916
|
-
def self.get_instance
|
917
|
-
ZCRMPickListValue.new
|
918
|
-
end
|
919
|
-
end
|
920
|
-
# THIS CLASS IS USED TO STORE MULTI SELECT LOOKUP RELATED DATA
|
921
|
-
class ZCRMMultiSelectLookupField
|
922
|
-
attr_accessor :display_label, :linking_module, :connected_module, :api_name, :id
|
923
|
-
def initialize(api_name)
|
924
|
-
@display_label = nil
|
925
|
-
@linking_module = nil
|
926
|
-
@connected_module = nil
|
927
|
-
@api_name = api_name
|
928
|
-
@id = nil
|
929
|
-
end
|
930
|
-
|
931
|
-
def self.get_instance(api_name)
|
932
|
-
ZCRMMultiSelectLookupField.new(api_name)
|
933
|
-
end
|
934
|
-
end
|
935
|
-
# THIS CLASS IS USED TO STORE PROFILE RELATED DATA
|
936
|
-
class ZCRMProfile
|
937
|
-
attr_accessor :name, :id, :is_default, :created_time, :modified_time, :modified_by, :description, :created_by, :category, :permissions, :sections
|
938
|
-
def initialize(profile_id, profile_name = nil)
|
939
|
-
@name = profile_name
|
940
|
-
@id = profile_id
|
941
|
-
@is_default = nil
|
942
|
-
@created_time = nil
|
943
|
-
@modified_time = nil
|
944
|
-
@modified_by = nil
|
945
|
-
@description = nil
|
946
|
-
@created_by = nil
|
947
|
-
@category = nil
|
948
|
-
@permissions = []
|
949
|
-
@sections = []
|
950
|
-
end
|
951
|
-
|
952
|
-
def self.get_instance(profile_id, profile_name = nil)
|
953
|
-
ZCRMProfile.new(profile_id, profile_name)
|
954
|
-
end
|
955
|
-
end
|
956
|
-
# THIS CLASS IS USED TO STORE PROFILE CATEGORY DATA
|
957
|
-
class ZCRMProfileCategory
|
958
|
-
attr_accessor :name, :module_api_name, :display_label, :permission_ids
|
959
|
-
def initialize(profile_category_name)
|
960
|
-
@name = profile_category_name
|
961
|
-
@module_api_name = nil
|
962
|
-
@display_label = nil
|
963
|
-
@permission_ids = []
|
964
|
-
end
|
965
|
-
|
966
|
-
def self.get_instance(profile_category_name)
|
967
|
-
ZCRMProfileCategory.new(profile_category_name)
|
968
|
-
end
|
969
|
-
end
|
970
|
-
# THIS CLASS IS USED TO STORE PROFILE SECTION DATA
|
971
|
-
class ZCRMProfileSection
|
972
|
-
attr_accessor :name, :categories
|
973
|
-
def initialize(section_name)
|
974
|
-
@name = section_name
|
975
|
-
@categories = []
|
976
|
-
end
|
977
|
-
|
978
|
-
def self.get_instance(section_name)
|
979
|
-
ZCRMProfileSection.new(section_name)
|
980
|
-
end
|
981
|
-
end
|
982
|
-
# THIS CLASS IS USED TO STORE RELATED LIST PROPERTIES RELATED DATA
|
983
|
-
class ZCRMRelatedListProperties
|
984
|
-
attr_accessor :sort_by, :sort_order, :fields
|
985
|
-
def initialize
|
986
|
-
@sort_by = nil
|
987
|
-
@sort_order = nil
|
988
|
-
@fields = nil
|
989
|
-
end
|
990
|
-
|
991
|
-
def self.get_instance
|
992
|
-
ZCRMRelatedListProperties.new
|
993
|
-
end
|
994
|
-
end
|
995
|
-
# THIS CLASS IS USED TO STORE SECTIONS RELATED DATA
|
996
|
-
class ZCRMSection
|
997
|
-
attr_accessor :properties, :api_name, :name, :display_label, :column_count, :sequence_number, :fields, :is_subform_section, :tab_traversal
|
998
|
-
def initialize(section_name)
|
999
|
-
@name = section_name
|
1000
|
-
@display_label = nil
|
1001
|
-
@column_count = nil
|
1002
|
-
@sequence_number = nil
|
1003
|
-
@fields = nil
|
1004
|
-
@is_subform_section = nil
|
1005
|
-
@tab_traversal = nil
|
1006
|
-
@api_name = nil
|
1007
|
-
@properties = nil
|
1008
|
-
end
|
1009
|
-
|
1010
|
-
def self.get_instance(section_name)
|
1011
|
-
ZCRMSection.new(section_name)
|
1012
|
-
end
|
1013
|
-
end
|
1014
|
-
# THIS CLASS IS USED TO STORE SECTION PROPERTIES RELATED DATA
|
1015
|
-
class ZCRMSectionProperties
|
1016
|
-
attr_accessor :reorder_rows, :tooltip, :maximum_rows
|
1017
|
-
def initialize
|
1018
|
-
@reorder_rows = nil
|
1019
|
-
@tooltip = nil
|
1020
|
-
@maximum_rows = nil
|
1021
|
-
end
|
1022
|
-
|
1023
|
-
def self.get_instance
|
1024
|
-
ZCRMSectionProperties.new
|
1025
|
-
end
|
1026
|
-
end
|
1027
|
-
# THIS CLASS IS USED TO STORE TRASH RECORD RELATED DATA
|
1028
|
-
class ZCRMTrashRecord
|
1029
|
-
attr_accessor :id, :type, :display_name, :deleted_time, :created_by, :deleted_by, :module_api_name
|
1030
|
-
def initialize(module_api_name, entity_type, entity_id = nil)
|
1031
|
-
@id = entity_id
|
1032
|
-
@module_api_name = module_api_name
|
1033
|
-
@type = entity_type
|
1034
|
-
@display_name = nil
|
1035
|
-
@deleted_time = nil
|
1036
|
-
@created_by = nil
|
1037
|
-
@deleted_by = nil
|
1038
|
-
end
|
1039
|
-
|
1040
|
-
def self.get_instance(module_api_name, entity_type, entity_id = nil)
|
1041
|
-
ZCRMTrashRecord.new(module_api_name, entity_type, entity_id)
|
1042
|
-
end
|
1043
|
-
end
|
1044
|
-
class ZCRMVariable
|
1045
|
-
attr_accessor :id, :name, :api_name, :type, :value, :variable_group, :description
|
1046
|
-
def initialize(api_name =nil ,id = nil)
|
1047
|
-
@id = id
|
1048
|
-
@name = nil
|
1049
|
-
@api_name = api_name
|
1050
|
-
@type = nil
|
1051
|
-
@value = nil
|
1052
|
-
@variable_group = nil
|
1053
|
-
@description = nil
|
1054
|
-
end
|
1055
|
-
|
1056
|
-
def self.get_instance(api_name=nil,id = nil)
|
1057
|
-
ZCRMVariable.new(api_name,id)
|
1058
|
-
end
|
1059
|
-
|
1060
|
-
def get(group_id)
|
1061
|
-
Handler::VariableAPIHandler.get_instance(self).get_variable(group_id)
|
1062
|
-
end
|
1063
|
-
|
1064
|
-
def update
|
1065
|
-
Handler::VariableAPIHandler.get_instance(self).update_variable
|
1066
|
-
end
|
1067
|
-
|
1068
|
-
def delete
|
1069
|
-
Handler::VariableAPIHandler.get_instance(self).delete_variable
|
1070
|
-
end
|
1071
|
-
end
|
1072
|
-
class ZCRMVariableGroup
|
1073
|
-
attr_accessor :id, :name, :api_name,:display_label, :description
|
1074
|
-
def initialize(api_name=nil,id = nil)
|
1075
|
-
@id = id
|
1076
|
-
@name = nil
|
1077
|
-
@api_name = api_name
|
1078
|
-
@display_label = nil
|
1079
|
-
@description = nil
|
1080
|
-
end
|
1081
|
-
|
1082
|
-
def self.get_instance(api_name=nil,id = nil)
|
1083
|
-
ZCRMVariableGroup.new(api_name,id)
|
1084
|
-
end
|
1085
|
-
|
1086
|
-
def get
|
1087
|
-
Handler::VariableGroupAPIHandler.get_instance(self).get_variable_group
|
1088
|
-
end
|
1089
|
-
end
|
1090
|
-
end
|
1091
|
-
end
|