ZCRMSDK 1.0.4 → 3.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 +447 -0
- data/src/com/zoho/api/authenticator/oauth_token.rb +272 -0
- data/src/com/zoho/api/authenticator/store/db_store.rb +191 -0
- data/src/com/zoho/api/authenticator/store/file_store.rb +235 -0
- data/src/com/zoho/api/authenticator/store/token_store.rb +33 -0
- data/src/com/zoho/api/authenticator/token.rb +10 -0
- data/src/com/zoho/api/logger/sdk_logger.rb +78 -0
- data/src/com/zoho/crm/api/assignment_rules/api_exception.rb +121 -0
- data/src/com/zoho/crm/api/assignment_rules/assignment_rule.rb +215 -0
- data/src/com/zoho/crm/api/assignment_rules/assignment_rules_operations.rb +61 -0
- data/src/com/zoho/crm/api/assignment_rules/default_user.rb +80 -0
- data/src/com/zoho/crm/api/assignment_rules/response_handler.rb +10 -0
- data/src/com/zoho/crm/api/assignment_rules/response_wrapper.rb +63 -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 +405 -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/escalation.rb +80 -0
- data/src/com/zoho/crm/api/blue_print/field.rb +1127 -0
- data/src/com/zoho/crm/api/blue_print/next_transition.rb +118 -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 +271 -0
- data/src/com/zoho/crm/api/blue_print/validation_error.rb +137 -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 +155 -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 +138 -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 +215 -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 +136 -0
- data/src/com/zoho/crm/api/custom_views/custom_view.rb +386 -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_to.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 +21 -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/email_templates/api_exception.rb +121 -0
- data/src/com/zoho/crm/api/email_templates/attachment.rb +118 -0
- data/src/com/zoho/crm/api/email_templates/email_template.rb +390 -0
- data/src/com/zoho/crm/api/email_templates/email_templates_operations.rb +61 -0
- data/src/com/zoho/crm/api/email_templates/response_handler.rb +10 -0
- data/src/com/zoho/crm/api/email_templates/response_wrapper.rb +83 -0
- data/src/com/zoho/crm/api/exception/sdk_exception.rb +47 -0
- data/src/com/zoho/crm/api/field_attachments/api_exception.rb +121 -0
- data/src/com/zoho/crm/api/field_attachments/body_wrapper.rb +62 -0
- data/src/com/zoho/crm/api/field_attachments/field_attachments_operations.rb +52 -0
- data/src/com/zoho/crm/api/field_attachments/file_body_wrapper.rb +64 -0
- data/src/com/zoho/crm/api/field_attachments/response_handler.rb +10 -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/external.rb +99 -0
- data/src/com/zoho/crm/api/fields/field.rb +1110 -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/history_tracking.rb +80 -0
- data/src/com/zoho/crm/api/fields/lookup_field.rb +80 -0
- data/src/com/zoho/crm/api/fields/maps.rb +80 -0
- data/src/com/zoho/crm/api/fields/module.rb +157 -0
- data/src/com/zoho/crm/api/fields/multi_module_lookup.rb +99 -0
- data/src/com/zoho/crm/api/fields/multi_select_lookup.rb +175 -0
- data/src/com/zoho/crm/api/fields/multi_user_lookup.rb +175 -0
- data/src/com/zoho/crm/api/fields/pick_list_value.rb +194 -0
- data/src/com/zoho/crm/api/fields/private.rb +99 -0
- data/src/com/zoho/crm/api/fields/related_details.rb +156 -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 +220 -0
- data/src/com/zoho/crm/api/inventory_templates/api_exception.rb +121 -0
- data/src/com/zoho/crm/api/inventory_templates/inventory_template.rb +352 -0
- data/src/com/zoho/crm/api/inventory_templates/inventory_templates_operations.rb +82 -0
- data/src/com/zoho/crm/api/inventory_templates/response_handler.rb +10 -0
- data/src/com/zoho/crm/api/inventory_templates/response_wrapper.rb +83 -0
- data/src/com/zoho/crm/api/layouts/api_exception.rb +121 -0
- data/src/com/zoho/crm/api/layouts/layout.rb +310 -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 +252 -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 +939 -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 +368 -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/hierarchy_preference.rb +61 -0
- data/src/com/zoho/crm/api/org/license_details.rb +156 -0
- data/src/com/zoho/crm/api/org/org.rb +669 -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/pipeline/action_handler.rb +10 -0
- data/src/com/zoho/crm/api/pipeline/action_response.rb +10 -0
- data/src/com/zoho/crm/api/pipeline/action_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/pipeline/api_exception.rb +129 -0
- data/src/com/zoho/crm/api/pipeline/body_wrapper.rb +61 -0
- data/src/com/zoho/crm/api/pipeline/forecast_category.rb +80 -0
- data/src/com/zoho/crm/api/pipeline/pick_list_value.rb +175 -0
- data/src/com/zoho/crm/api/pipeline/pipeline.rb +213 -0
- data/src/com/zoho/crm/api/pipeline/pipeline_operations.rb +165 -0
- data/src/com/zoho/crm/api/pipeline/response_handler.rb +10 -0
- data/src/com/zoho/crm/api/pipeline/response_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/pipeline/stage.rb +80 -0
- data/src/com/zoho/crm/api/pipeline/success_response.rb +123 -0
- data/src/com/zoho/crm/api/pipeline/transfer_action_handler.rb +10 -0
- data/src/com/zoho/crm/api/pipeline/transfer_action_response.rb +10 -0
- data/src/com/zoho/crm/api/pipeline/transfer_action_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/pipeline/transfer_and_delete_wrapper.rb +61 -0
- data/src/com/zoho/crm/api/pipeline/transfer_pipe_line.rb +80 -0
- data/src/com/zoho/crm/api/profiles/api_exception.rb +121 -0
- data/src/com/zoho/crm/api/profiles/category.rb +118 -0
- data/src/com/zoho/crm/api/profiles/default_view.rb +99 -0
- data/src/com/zoho/crm/api/profiles/permission_detail.rb +137 -0
- data/src/com/zoho/crm/api/profiles/profile.rb +328 -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 +145 -0
- data/src/com/zoho/crm/api/record/body_wrapper.rb +137 -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/count_handler.rb +10 -0
- data/src/com/zoho/crm/api/record/count_wrapper.rb +63 -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/image_upload.rb +213 -0
- data/src/com/zoho/crm/api/record/info.rb +118 -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 +137 -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/mass_update_territory.rb +80 -0
- data/src/com/zoho/crm/api/record/multi_select_lookup.rb +99 -0
- data/src/com/zoho/crm/api/record/multi_select_picklist.rb +80 -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/price_book.rb +31 -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 +847 -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/tax.rb +80 -0
- data/src/com/zoho/crm/api/record/territory.rb +138 -0
- data/src/com/zoho/crm/api/record/widget.rb +80 -0
- data/src/com/zoho/crm/api/record/wizard.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 +15 -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 +12 -0
- data/src/com/zoho/crm/api/send_mail/action_handler.rb +10 -0
- data/src/com/zoho/crm/api/send_mail/action_response.rb +10 -0
- data/src/com/zoho/crm/api/send_mail/action_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/send_mail/api_exception.rb +125 -0
- data/src/com/zoho/crm/api/send_mail/body_wrapper.rb +61 -0
- data/src/com/zoho/crm/api/send_mail/data_subject_request.rb +80 -0
- data/src/com/zoho/crm/api/send_mail/inventory_details.rb +100 -0
- data/src/com/zoho/crm/api/send_mail/mail.rb +423 -0
- data/src/com/zoho/crm/api/send_mail/response_handler.rb +10 -0
- data/src/com/zoho/crm/api/send_mail/response_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/send_mail/send_mail_operations.rb +61 -0
- data/src/com/zoho/crm/api/send_mail/success_response.rb +121 -0
- data/src/com/zoho/crm/api/send_mail/template.rb +10 -0
- data/src/com/zoho/crm/api/send_mail/user_address.rb +137 -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 +176 -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 +83 -0
- data/src/com/zoho/crm/api/territories/territories_operations.rb +47 -0
- data/src/com/zoho/crm/api/territories/territory.rb +272 -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 +730 -0
- data/src/com/zoho/crm/api/users/users_operations.rb +181 -0
- data/src/com/zoho/crm/api/util/api_http_connector.rb +112 -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 +237 -0
- data/src/com/zoho/crm/api/util/constants.rb +661 -0
- data/src/com/zoho/crm/api/util/converter.rb +236 -0
- data/src/com/zoho/crm/api/util/data_type_converter.rb +168 -0
- data/src/com/zoho/crm/api/util/downloader.rb +83 -0
- data/src/com/zoho/crm/api/util/form_data_converter.rb +156 -0
- data/src/com/zoho/crm/api/util/header_param_validator.rb +55 -0
- data/src/com/zoho/crm/api/util/json_converter.rb +724 -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 +914 -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/com/zoho/crm/api/wizards/api_exception.rb +121 -0
- data/src/com/zoho/crm/api/wizards/button.rb +252 -0
- data/src/com/zoho/crm/api/wizards/chart_data.rb +118 -0
- data/src/com/zoho/crm/api/wizards/connection.rb +80 -0
- data/src/com/zoho/crm/api/wizards/container.rb +119 -0
- data/src/com/zoho/crm/api/wizards/node.rb +118 -0
- data/src/com/zoho/crm/api/wizards/response_handler.rb +10 -0
- data/src/com/zoho/crm/api/wizards/response_wrapper.rb +63 -0
- data/src/com/zoho/crm/api/wizards/screen.rb +99 -0
- data/src/com/zoho/crm/api/wizards/segment.rb +176 -0
- data/src/com/zoho/crm/api/wizards/transition.rb +80 -0
- data/src/com/zoho/crm/api/wizards/wizard.rb +273 -0
- data/src/com/zoho/crm/api/wizards/wizards_operations.rb +61 -0
- data/src/resources/JSONDetails.json +1 -0
- data/src/version.rb +3 -0
- metadata +476 -41
- data/lib/ZCRMSDK.rb +0 -14
- data/lib/ZCRMSDK/handler.rb +0 -3290
- data/lib/ZCRMSDK/oauth_client.rb +0 -257
- 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 -129
- 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 -310
- data/lib/ZCRMSDK/version.rb +0 -5
@@ -0,0 +1,62 @@
|
|
1
|
+
require_relative '../util/stream_wrapper'
|
2
|
+
require_relative '../util/model'
|
3
|
+
|
4
|
+
module Files
|
5
|
+
class BodyWrapper
|
6
|
+
include Util::Model
|
7
|
+
|
8
|
+
# Creates an instance of BodyWrapper
|
9
|
+
def initialize
|
10
|
+
@file = nil
|
11
|
+
@key_modified = Hash.new
|
12
|
+
end
|
13
|
+
|
14
|
+
# The method to get the file
|
15
|
+
# @return An instance of Array
|
16
|
+
|
17
|
+
def file
|
18
|
+
@file
|
19
|
+
end
|
20
|
+
|
21
|
+
# The method to set the value to file
|
22
|
+
# @param file [Array] An instance of Array
|
23
|
+
|
24
|
+
def file=(file)
|
25
|
+
if file!=nil and !file.is_a? Array
|
26
|
+
raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: file EXPECTED TYPE: Array', nil, nil)
|
27
|
+
end
|
28
|
+
@file = file
|
29
|
+
@key_modified['file'] = 1
|
30
|
+
end
|
31
|
+
|
32
|
+
# The method to check if the user has modified the given key
|
33
|
+
# @param key [String] A String
|
34
|
+
# @return A Integer value
|
35
|
+
|
36
|
+
def is_key_modified(key)
|
37
|
+
if key!=nil and !key.is_a? String
|
38
|
+
raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: String', nil, nil)
|
39
|
+
end
|
40
|
+
if @key_modified.key?(key)
|
41
|
+
return @key_modified[key]
|
42
|
+
end
|
43
|
+
|
44
|
+
nil
|
45
|
+
end
|
46
|
+
|
47
|
+
# The method to mark the given key as modified
|
48
|
+
# @param key [String] A String
|
49
|
+
# @param modification [Integer] A Integer
|
50
|
+
|
51
|
+
def set_key_modified(key, modification)
|
52
|
+
if key!=nil and !key.is_a? String
|
53
|
+
raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: String', nil, nil)
|
54
|
+
end
|
55
|
+
if modification!=nil and !modification.is_a? Integer
|
56
|
+
raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: Integer', nil, nil)
|
57
|
+
end
|
58
|
+
@key_modified[key] = modification
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
require_relative '../util/stream_wrapper'
|
2
|
+
require_relative '../util/model'
|
3
|
+
|
4
|
+
module Files
|
5
|
+
require_relative 'response_handler'
|
6
|
+
class FileBodyWrapper
|
7
|
+
include Util::Model
|
8
|
+
include ResponseHandler
|
9
|
+
|
10
|
+
# Creates an instance of FileBodyWrapper
|
11
|
+
def initialize
|
12
|
+
@file = nil
|
13
|
+
@key_modified = Hash.new
|
14
|
+
end
|
15
|
+
|
16
|
+
# The method to get the file
|
17
|
+
# @return An instance of Util::StreamWrapper
|
18
|
+
|
19
|
+
def file
|
20
|
+
@file
|
21
|
+
end
|
22
|
+
|
23
|
+
# The method to set the value to file
|
24
|
+
# @param file [Util::StreamWrapper] An instance of Util::StreamWrapper
|
25
|
+
|
26
|
+
def file=(file)
|
27
|
+
if file!=nil and !file.is_a? Util::StreamWrapper
|
28
|
+
raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: file EXPECTED TYPE: Util::StreamWrapper', nil, nil)
|
29
|
+
end
|
30
|
+
@file = file
|
31
|
+
@key_modified['file'] = 1
|
32
|
+
end
|
33
|
+
|
34
|
+
# The method to check if the user has modified the given key
|
35
|
+
# @param key [String] A String
|
36
|
+
# @return A Integer value
|
37
|
+
|
38
|
+
def is_key_modified(key)
|
39
|
+
if key!=nil and !key.is_a? String
|
40
|
+
raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: String', nil, nil)
|
41
|
+
end
|
42
|
+
if @key_modified.key?(key)
|
43
|
+
return @key_modified[key]
|
44
|
+
end
|
45
|
+
|
46
|
+
nil
|
47
|
+
end
|
48
|
+
|
49
|
+
# The method to mark the given key as modified
|
50
|
+
# @param key [String] A String
|
51
|
+
# @param modification [Integer] A Integer
|
52
|
+
|
53
|
+
def set_key_modified(key, modification)
|
54
|
+
if key!=nil and !key.is_a? String
|
55
|
+
raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: String', nil, nil)
|
56
|
+
end
|
57
|
+
if modification!=nil and !modification.is_a? Integer
|
58
|
+
raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: Integer', nil, nil)
|
59
|
+
end
|
60
|
+
@key_modified[key] = modification
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
require_relative '../param'
|
2
|
+
require_relative '../parameter_map'
|
3
|
+
require_relative '../exception/sdk_exception'
|
4
|
+
require_relative '../util/api_response'
|
5
|
+
require_relative '../util/common_api_handler'
|
6
|
+
require_relative '../util/constants'
|
7
|
+
|
8
|
+
module Files
|
9
|
+
class FileOperations
|
10
|
+
|
11
|
+
# Creates an instance of FileOperations
|
12
|
+
def initialize
|
13
|
+
end
|
14
|
+
|
15
|
+
# The method to upload files
|
16
|
+
# @param request [BodyWrapper] An instance of BodyWrapper
|
17
|
+
# @param param_instance [ParameterMap] An instance of ParameterMap
|
18
|
+
# @return An instance of APIResponse
|
19
|
+
# @raise SDKException
|
20
|
+
def upload_files(request, param_instance=nil)
|
21
|
+
if request!=nil and !request.is_a? BodyWrapper
|
22
|
+
raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: request EXPECTED TYPE: BodyWrapper', nil, nil)
|
23
|
+
end
|
24
|
+
if param_instance!=nil and !param_instance.is_a? ParameterMap
|
25
|
+
raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: param_instance EXPECTED TYPE: ParameterMap', nil, nil)
|
26
|
+
end
|
27
|
+
handler_instance = Handler::CommonAPIHandler.new
|
28
|
+
api_path = ''
|
29
|
+
api_path = api_path + '/crm/v2.1/files'
|
30
|
+
handler_instance.api_path = api_path
|
31
|
+
handler_instance.http_method = Constants::REQUEST_METHOD_POST
|
32
|
+
handler_instance.category_method = 'CREATE'
|
33
|
+
handler_instance.content_type = 'multipart/form-data'
|
34
|
+
handler_instance.request = request
|
35
|
+
handler_instance.mandatory_checker = true
|
36
|
+
handler_instance.param = param_instance
|
37
|
+
require_relative 'action_handler'
|
38
|
+
handler_instance.api_call(ActionHandler.name, 'application/json')
|
39
|
+
end
|
40
|
+
|
41
|
+
# The method to get file
|
42
|
+
# @param param_instance [ParameterMap] An instance of ParameterMap
|
43
|
+
# @return An instance of APIResponse
|
44
|
+
# @raise SDKException
|
45
|
+
def get_file(param_instance=nil)
|
46
|
+
if param_instance!=nil and !param_instance.is_a? ParameterMap
|
47
|
+
raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: param_instance EXPECTED TYPE: ParameterMap', nil, nil)
|
48
|
+
end
|
49
|
+
handler_instance = Handler::CommonAPIHandler.new
|
50
|
+
api_path = ''
|
51
|
+
api_path = api_path + '/crm/v2.1/files'
|
52
|
+
handler_instance.api_path = api_path
|
53
|
+
handler_instance.http_method = Constants::REQUEST_METHOD_GET
|
54
|
+
handler_instance.category_method = 'READ'
|
55
|
+
handler_instance.param = param_instance
|
56
|
+
require_relative 'response_handler'
|
57
|
+
handler_instance.api_call(ResponseHandler.name, 'application/x-download')
|
58
|
+
end
|
59
|
+
|
60
|
+
class UploadFilesParam
|
61
|
+
@@type = Param.new('type', 'com.zoho.crm.api.File.UploadFilesParam')
|
62
|
+
def self.type
|
63
|
+
@@type
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
class GetFileParam
|
68
|
+
@@id = Param.new('id', 'com.zoho.crm.api.File.GetFileParam')
|
69
|
+
def self.id
|
70
|
+
@@id
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,121 @@
|
|
1
|
+
require_relative '../util/choice'
|
2
|
+
require_relative '../util/model'
|
3
|
+
|
4
|
+
module Files
|
5
|
+
require_relative 'action_response'
|
6
|
+
class SuccessResponse
|
7
|
+
include Util::Model
|
8
|
+
include ActionResponse
|
9
|
+
|
10
|
+
# Creates an instance of SuccessResponse
|
11
|
+
def initialize
|
12
|
+
@status = nil
|
13
|
+
@code = nil
|
14
|
+
@message = nil
|
15
|
+
@details = nil
|
16
|
+
@key_modified = Hash.new
|
17
|
+
end
|
18
|
+
|
19
|
+
# The method to get the status
|
20
|
+
# @return An instance of Util::Choice
|
21
|
+
|
22
|
+
def status
|
23
|
+
@status
|
24
|
+
end
|
25
|
+
|
26
|
+
# The method to set the value to status
|
27
|
+
# @param status [Util::Choice] An instance of Util::Choice
|
28
|
+
|
29
|
+
def status=(status)
|
30
|
+
if status!=nil and !status.is_a? Util::Choice
|
31
|
+
raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: status EXPECTED TYPE: Util::Choice', nil, nil)
|
32
|
+
end
|
33
|
+
@status = status
|
34
|
+
@key_modified['status'] = 1
|
35
|
+
end
|
36
|
+
|
37
|
+
# The method to get the code
|
38
|
+
# @return An instance of Util::Choice
|
39
|
+
|
40
|
+
def code
|
41
|
+
@code
|
42
|
+
end
|
43
|
+
|
44
|
+
# The method to set the value to code
|
45
|
+
# @param code [Util::Choice] An instance of Util::Choice
|
46
|
+
|
47
|
+
def code=(code)
|
48
|
+
if code!=nil and !code.is_a? Util::Choice
|
49
|
+
raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: code EXPECTED TYPE: Util::Choice', nil, nil)
|
50
|
+
end
|
51
|
+
@code = code
|
52
|
+
@key_modified['code'] = 1
|
53
|
+
end
|
54
|
+
|
55
|
+
# The method to get the message
|
56
|
+
# @return An instance of Util::Choice
|
57
|
+
|
58
|
+
def message
|
59
|
+
@message
|
60
|
+
end
|
61
|
+
|
62
|
+
# The method to set the value to message
|
63
|
+
# @param message [Util::Choice] An instance of Util::Choice
|
64
|
+
|
65
|
+
def message=(message)
|
66
|
+
if message!=nil and !message.is_a? Util::Choice
|
67
|
+
raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: message EXPECTED TYPE: Util::Choice', nil, nil)
|
68
|
+
end
|
69
|
+
@message = message
|
70
|
+
@key_modified['message'] = 1
|
71
|
+
end
|
72
|
+
|
73
|
+
# The method to get the details
|
74
|
+
# @return An instance of Hash
|
75
|
+
|
76
|
+
def details
|
77
|
+
@details
|
78
|
+
end
|
79
|
+
|
80
|
+
# The method to set the value to details
|
81
|
+
# @param details [Hash] An instance of Hash
|
82
|
+
|
83
|
+
def details=(details)
|
84
|
+
if details!=nil and !details.is_a? Hash
|
85
|
+
raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: details EXPECTED TYPE: Hash', nil, nil)
|
86
|
+
end
|
87
|
+
@details = details
|
88
|
+
@key_modified['details'] = 1
|
89
|
+
end
|
90
|
+
|
91
|
+
# The method to check if the user has modified the given key
|
92
|
+
# @param key [String] A String
|
93
|
+
# @return A Integer value
|
94
|
+
|
95
|
+
def is_key_modified(key)
|
96
|
+
if key!=nil and !key.is_a? String
|
97
|
+
raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: String', nil, nil)
|
98
|
+
end
|
99
|
+
if @key_modified.key?(key)
|
100
|
+
return @key_modified[key]
|
101
|
+
end
|
102
|
+
|
103
|
+
nil
|
104
|
+
end
|
105
|
+
|
106
|
+
# The method to mark the given key as modified
|
107
|
+
# @param key [String] A String
|
108
|
+
# @param modification [Integer] A Integer
|
109
|
+
|
110
|
+
def set_key_modified(key, modification)
|
111
|
+
if key!=nil and !key.is_a? String
|
112
|
+
raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: String', nil, nil)
|
113
|
+
end
|
114
|
+
if modification!=nil and !modification.is_a? Integer
|
115
|
+
raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: Integer', nil, nil)
|
116
|
+
end
|
117
|
+
@key_modified[key] = modification
|
118
|
+
end
|
119
|
+
|
120
|
+
end
|
121
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# This class represents the HTTP header name
|
2
|
+
class Header
|
3
|
+
attr_accessor :name, :class_name
|
4
|
+
# Creates an Header class instance with the specified header name.
|
5
|
+
# @param name [String] A String containing the header name.
|
6
|
+
def initialize(name, class_name = nil)
|
7
|
+
@name = name
|
8
|
+
@class_name = class_name
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# This class represents the HTTP header name and value.
|
2
|
+
require_relative 'util/data_type_converter'
|
3
|
+
require_relative 'exception/sdk_exception'
|
4
|
+
require_relative 'util/header_param_validator'
|
5
|
+
|
6
|
+
class HeaderMap
|
7
|
+
attr_accessor :header_hash
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
@header_hash = {}
|
11
|
+
end
|
12
|
+
|
13
|
+
# This method is to add header name and value.
|
14
|
+
# @param header [Header] A Header class instance.
|
15
|
+
# @param value [Object] An object containing the header value.
|
16
|
+
def add(header, value)
|
17
|
+
unless header.is_a? Header
|
18
|
+
raise SDKException.new(Constants::HEADER_NULL_ERROR, Constants::HEADER_INSTANCE_NULL_ERROR)
|
19
|
+
end
|
20
|
+
|
21
|
+
header_name = header.name
|
22
|
+
|
23
|
+
if header_name.nil?
|
24
|
+
raise SDKException.new(Constants::HEADER_NAME_NULL_ERROR, Constants::HEADER_NAME_NULL_ERROR_MESSAGE)
|
25
|
+
end
|
26
|
+
|
27
|
+
if value.nil?
|
28
|
+
raise SDKException.new(Constants::HEADER_NULL_ERROR, header_name + Constants::NULL_VALUE_ERROR_MESSAGE)
|
29
|
+
end
|
30
|
+
|
31
|
+
header_value = nil
|
32
|
+
|
33
|
+
if header.class_name.nil?
|
34
|
+
begin
|
35
|
+
header_value = value.to_s
|
36
|
+
rescue StandardError
|
37
|
+
header_value = value
|
38
|
+
end
|
39
|
+
else
|
40
|
+
header_param_validator = Util::HeaderParamValidator.new
|
41
|
+
header_value = header_param_validator.validate(header, value)
|
42
|
+
end
|
43
|
+
|
44
|
+
header_value = header_value.to_s
|
45
|
+
if (@header_hash.key? header_name) && !@header_hash[header_name].nil?
|
46
|
+
existing_header_value = @header_hash[header_name]
|
47
|
+
|
48
|
+
existing_header_value = existing_header_value + ',' + header_value
|
49
|
+
|
50
|
+
@header_hash[header_name] = existing_header_value
|
51
|
+
else
|
52
|
+
@header_hash[header_name] = header_value
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,220 @@
|
|
1
|
+
require 'uri'
|
2
|
+
require 'net/http'
|
3
|
+
require 'cgi'
|
4
|
+
require 'json'
|
5
|
+
require_relative '../../api/logger/sdk_logger'
|
6
|
+
require_relative 'util/constants'
|
7
|
+
|
8
|
+
# This class to initialize Zoho CRM SDK.
|
9
|
+
class Initializer
|
10
|
+
attr_accessor :json_details,:user, :environment, :store, :token, :initializer, :local, :sdk_config, :resources_path, :request_proxy
|
11
|
+
@@json_details = nil
|
12
|
+
|
13
|
+
Thread.current['initi'] = nil
|
14
|
+
|
15
|
+
def self.json_details
|
16
|
+
@@json_details
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.initialize(user:, environment:, token:, store:, sdk_config:, resources_path:, log: nil, request_proxy: nil)
|
20
|
+
error = {}
|
21
|
+
|
22
|
+
require_relative 'user_signature'
|
23
|
+
|
24
|
+
unless user.is_a?(UserSignature)
|
25
|
+
error[Constants::ERROR_HASH_FIELD] = 'user'
|
26
|
+
|
27
|
+
error[Constants::ERROR_HASH_EXPECTED_TYPE] = UserSignature
|
28
|
+
|
29
|
+
raise SDKException.new(Constants::INITIALIZATION_ERROR, Constants::USER_SIGNATURE_ERROR_MESSAGE, error, nil)
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
require_relative '../../crm/api/dc/datacenter'
|
34
|
+
|
35
|
+
unless environment.is_a?(DC::DataCenter::Environment)
|
36
|
+
error[Constants::ERROR_HASH_FIELD] = 'environment'
|
37
|
+
|
38
|
+
error[Constants::ERROR_HASH_EXPECTED_TYPE] = DC::DataCenter::Environment
|
39
|
+
|
40
|
+
raise SDKException.new(Constants::INITIALIZATION_ERROR, Constants::ENVIRONMENT_ERROR_MESSAGE, error, nil)
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
require_relative '../../api/authenticator/token'
|
45
|
+
|
46
|
+
unless token.is_a?(Authenticator::Token)
|
47
|
+
error[Constants::ERROR_HASH_FIELD] = 'token'
|
48
|
+
|
49
|
+
error[Constants::ERROR_HASH_EXPECTED_TYPE] = Authenticator::Token
|
50
|
+
|
51
|
+
raise SDKException.new(Constants::INITIALIZATION_ERROR, Constants::TOKEN_ERROR_MESSAGE, error, nil)
|
52
|
+
|
53
|
+
end
|
54
|
+
|
55
|
+
require_relative '../../api/authenticator/store/token_store'
|
56
|
+
|
57
|
+
unless store.is_a?(Store::TokenStore)
|
58
|
+
error[Constants::ERROR_HASH_FIELD] = 'store'
|
59
|
+
|
60
|
+
error[Constants::ERROR_HASH_EXPECTED_TYPE] = Store::TokenStore
|
61
|
+
|
62
|
+
raise SDKException.new(Constants::INITIALIZATION_ERROR, Constants::STORE_ERROR_MESSAGE, error, nil)
|
63
|
+
|
64
|
+
end
|
65
|
+
|
66
|
+
require_relative 'sdk_config'
|
67
|
+
|
68
|
+
unless sdk_config.is_a?(SDKConfig)
|
69
|
+
error[Constants::ERROR_HASH_FIELD] = 'sdk_config'
|
70
|
+
|
71
|
+
error[Constants::ERROR_HASH_EXPECTED_TYPE] = SDKConfig
|
72
|
+
|
73
|
+
raise SDKException.new(Constants::INITIALIZATION_ERROR, Constants::SDK_CONFIG_ERROR_MESSAGE, error, nil)
|
74
|
+
|
75
|
+
end
|
76
|
+
|
77
|
+
if !request_proxy.nil? && !sdk_config.is_a?(RequestProxy)
|
78
|
+
|
79
|
+
raise SDKException.new(Constants::INITIALIZATION_ERROR, Constants::REQUEST_PROXY_ERROR, nil, nil)
|
80
|
+
end
|
81
|
+
|
82
|
+
if resources_path.nil? || resources_path.empty?
|
83
|
+
raise SDKException.new(Constants::INITIALIZATION_ERROR, Constants::RESOURCE_PATH_ERROR_MESSAGE, nil, nil)
|
84
|
+
end
|
85
|
+
|
86
|
+
if !File.directory?(resources_path)
|
87
|
+
raise SDKException.new(Constants::INITIALIZATION_ERROR, Constants::RESOURCE_PATH_INVALID_ERROR_MESSAGE, nil, nil)
|
88
|
+
end
|
89
|
+
|
90
|
+
log = SDKLog::Log.initialize(level: Levels::INFO, path: File.join(Dir.pwd, Constants::LOGFILE_NAME)) if log.nil?
|
91
|
+
SDKLog::SDKLogger.initialize(log)
|
92
|
+
|
93
|
+
@@initializer = Initializer.new
|
94
|
+
|
95
|
+
@@initializer.user = user
|
96
|
+
|
97
|
+
@@initializer.environment = environment
|
98
|
+
|
99
|
+
@@initializer.sdk_config = sdk_config
|
100
|
+
|
101
|
+
@@initializer.token = token
|
102
|
+
|
103
|
+
@@initializer.store = store
|
104
|
+
|
105
|
+
@@initializer.resources_path = resources_path
|
106
|
+
|
107
|
+
@@initializer.request_proxy = request_proxy
|
108
|
+
|
109
|
+
@@json_details = get_JSONDetails
|
110
|
+
|
111
|
+
SDKLog::SDKLogger.info(Constants::INITIALIZATION_SUCCESSFUL + @@initializer.to_s)
|
112
|
+
rescue SDKException => e
|
113
|
+
raise e
|
114
|
+
rescue StandardError => e
|
115
|
+
raise SDKException.new(nil, Constants::INITIALIZATION_ERROR, nil, e)
|
116
|
+
end
|
117
|
+
|
118
|
+
def self.get_JSONDetails
|
119
|
+
if @@json_details.nil? || @@json_details.length == 0
|
120
|
+
return JSON.parse(File.open(File.join(File.dirname(File.expand_path(__FILE__)), '../../../../' + Constants::JSON_DETAILS_FILE_PATH)).read)
|
121
|
+
end
|
122
|
+
@@json_details
|
123
|
+
rescue StandardError => e
|
124
|
+
raise SDKException.new(nil, Constants::EXCEPTION_JSONDETAILS, nil, e)
|
125
|
+
end
|
126
|
+
|
127
|
+
def self.get_initializer
|
128
|
+
return Thread.current['initi'] unless Thread.current['initi'].nil?
|
129
|
+
|
130
|
+
@@initializer
|
131
|
+
end
|
132
|
+
|
133
|
+
def self.switch_user(user:nil, environment:nil, token:nil, sdk_config:nil, request_proxy: nil)
|
134
|
+
|
135
|
+
if @@initializer.nil?
|
136
|
+
raise SDKException.new(Constants::SDK_UNINITIALIZATION_ERROR, Constants::SDK_UNINITIALIZATION_MESSAGE)
|
137
|
+
end
|
138
|
+
|
139
|
+
require_relative 'user_signature'
|
140
|
+
|
141
|
+
if !user.nil? and !user.is_a?(UserSignature)
|
142
|
+
error[Constants::ERROR_HASH_FIELD] = 'user'
|
143
|
+
|
144
|
+
error[Constants::ERROR_HASH_EXPECTED_TYPE] = UserSignature
|
145
|
+
|
146
|
+
raise SDKException.new(Constants::SWITCH_USER_ERROR, Constants::USER_SIGNATURE_ERROR_MESSAGE, error, nil)
|
147
|
+
|
148
|
+
end
|
149
|
+
|
150
|
+
require_relative '../../crm/api/dc/datacenter'
|
151
|
+
|
152
|
+
if !environment.nil? and !environment.is_a?(DC::DataCenter::Environment)
|
153
|
+
error[Constants::ERROR_HASH_FIELD] = 'environment'
|
154
|
+
|
155
|
+
error[Constants::ERROR_HASH_EXPECTED_TYPE] = DC::DataCenter::Environment
|
156
|
+
|
157
|
+
raise SDKException.new(Constants::SWITCH_USER_ERROR, Constants::ENVIRONMENT_ERROR_MESSAGE, error, nil)
|
158
|
+
|
159
|
+
end
|
160
|
+
|
161
|
+
require_relative '../../api/authenticator/token'
|
162
|
+
|
163
|
+
if !token.nil? and !token.is_a?(Authenticator::Token)
|
164
|
+
error[Constants::ERROR_HASH_FIELD] = 'token'
|
165
|
+
|
166
|
+
error[Constants::ERROR_HASH_EXPECTED_TYPE] = Authenticator::Token
|
167
|
+
|
168
|
+
raise SDKException.new(Constants::SWITCH_USER_ERROR, Constants::TOKEN_ERROR_MESSAGE, error, nil)
|
169
|
+
|
170
|
+
end
|
171
|
+
|
172
|
+
require_relative 'request_proxy'
|
173
|
+
|
174
|
+
if !request_proxy.nil? and !request_proxy.is_a?(RequestProxy)
|
175
|
+
error[Constants::ERROR_HASH_FIELD] = 'request_proxy'
|
176
|
+
|
177
|
+
error[Constants::ERROR_HASH_EXPECTED_TYPE] = RequestProxy
|
178
|
+
|
179
|
+
raise SDKException.new(Constants::SWITCH_USER_ERROR, Constants::REQUEST_PROXY_ERROR_MESSAGE, error, nil)
|
180
|
+
|
181
|
+
end
|
182
|
+
|
183
|
+
require_relative 'sdk_config'
|
184
|
+
|
185
|
+
if !sdk_config.nil? and !sdk_config.is_a?(SDKConfig)
|
186
|
+
error[Constants::ERROR_HASH_FIELD] = 'sdk_config'
|
187
|
+
|
188
|
+
error[Constants::ERROR_HASH_EXPECTED_TYPE] = SDKConfig
|
189
|
+
|
190
|
+
raise SDKException.new(Constants::SWITCH_USER_ERROR, Constants::SDK_CONFIG_ERROR_MESSAGE, error, nil)
|
191
|
+
|
192
|
+
end
|
193
|
+
|
194
|
+
initializer = Initializer.new
|
195
|
+
|
196
|
+
previous_initializer = Initializer.get_initializer
|
197
|
+
|
198
|
+
initializer.user = user.nil? ? previous_initializer.user : user
|
199
|
+
|
200
|
+
initializer.environment = environment.nil? ? previous_initializer.environment : environment
|
201
|
+
|
202
|
+
initializer.sdk_config = sdk_config.nil? ? previous_initializer.sdk_config : sdk_config
|
203
|
+
|
204
|
+
initializer.token = token.nil? ? previous_initializer.token : token
|
205
|
+
|
206
|
+
initializer.store = @@initializer.store
|
207
|
+
|
208
|
+
initializer.resources_path = @@initializer.resources_path
|
209
|
+
|
210
|
+
initializer.request_proxy = request_proxy
|
211
|
+
|
212
|
+
Thread.current['initi'] = initializer
|
213
|
+
|
214
|
+
SDKLog::SDKLogger.info(Constants::INITIALIZATION_SWITCHED + initializer.to_s)
|
215
|
+
end
|
216
|
+
|
217
|
+
def to_s
|
218
|
+
Constants::FOR_EMAIL_ID + Initializer.get_initializer.user.email + Constants::IN_ENVIRONMENT + Initializer.get_initializer.environment.url + '.'
|
219
|
+
end
|
220
|
+
end
|