ZOHOCRMSDK2_0 3.0.0 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/src/ZOHOCRMSDK2_0.rb +1 -0
  3. data/src/com/zoho/api/authenticator/oauth_token.rb +51 -43
  4. data/src/com/zoho/api/authenticator/store/db_store.rb +0 -0
  5. data/src/com/zoho/api/authenticator/store/file_store.rb +0 -0
  6. data/src/com/zoho/api/authenticator/store/token_store.rb +0 -0
  7. data/src/com/zoho/api/authenticator/token.rb +0 -0
  8. data/src/com/zoho/api/logger/sdk_logger.rb +0 -0
  9. data/src/com/zoho/crm/api/dc/au_datacenter.rb +0 -0
  10. data/src/com/zoho/crm/api/dc/cn_datacenter.rb +0 -0
  11. data/src/com/zoho/crm/api/dc/datacenter.rb +0 -0
  12. data/src/com/zoho/crm/api/dc/eu_datacenter.rb +0 -0
  13. data/src/com/zoho/crm/api/dc/in_datacenter.rb +0 -0
  14. data/src/com/zoho/crm/api/dc/jp_datacenter.rb +21 -0
  15. data/src/com/zoho/crm/api/dc/us_datacenter.rb +0 -0
  16. data/src/com/zoho/crm/api/exception/sdk_exception.rb +1 -1
  17. data/src/com/zoho/crm/api/header.rb +0 -0
  18. data/src/com/zoho/crm/api/header_map.rb +0 -0
  19. data/src/com/zoho/crm/api/initializer.rb +35 -8
  20. data/src/com/zoho/crm/api/param.rb +0 -0
  21. data/src/com/zoho/crm/api/parameter_map.rb +1 -1
  22. data/src/com/zoho/crm/api/request_proxy.rb +0 -0
  23. data/src/com/zoho/crm/api/sdk_config.rb +0 -0
  24. data/src/com/zoho/crm/api/user_signature.rb +0 -0
  25. data/src/com/zoho/crm/api/util/api_http_connector.rb +0 -0
  26. data/src/com/zoho/crm/api/util/api_response.rb +0 -0
  27. data/src/com/zoho/crm/api/util/choice.rb +0 -0
  28. data/src/com/zoho/crm/api/util/common_api_handler.rb +0 -0
  29. data/src/com/zoho/crm/api/util/constants.rb +12 -5
  30. data/src/com/zoho/crm/api/util/converter.rb +8 -2
  31. data/src/com/zoho/crm/api/util/data_type_converter.rb +0 -0
  32. data/src/com/zoho/crm/api/util/downloader.rb +0 -0
  33. data/src/com/zoho/crm/api/util/form_data_converter.rb +0 -0
  34. data/src/com/zoho/crm/api/util/header_param_validator.rb +0 -0
  35. data/src/com/zoho/crm/api/util/json_converter.rb +0 -0
  36. data/src/com/zoho/crm/api/util/model.rb +0 -0
  37. data/src/com/zoho/crm/api/util/module_fields_handler.rb +0 -0
  38. data/src/com/zoho/crm/api/util/stream_wrapper.rb +0 -0
  39. data/src/com/zoho/crm/api/util/utility.rb +3 -2
  40. data/src/resources/JSONDetails.json +1 -1
  41. data/src/version.rb +1 -1
  42. metadata +5 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 03d299e56d131411933e4782f22b1dc9fa09c876cd65a499ee60bd4fed382c68
4
- data.tar.gz: fb7567e5159da8d9c02ef5c81dc70e93b5156c46503559709c75a59115db254e
3
+ metadata.gz: fbd73e065c84249f4ca89a7a65e1610df644254e238973950a182f45deb4a9aa
4
+ data.tar.gz: b8c868c5db1b793b6c1b8790cc66908a23be1b9f594ea59090cb26bf898f350e
5
5
  SHA512:
6
- metadata.gz: 7767ac62c6088b5fd12a0b96f431cbf7b8d2d1e7d02edfd087e5b3e642b70a1a95bef570ed54954dd2d7899807e64aabbd33069c0086607a4343858c52d98bf7
7
- data.tar.gz: 669b4d9ee236a466f57a04f5248bae2e98e1a6a937f2332802604105e7a71aeb971abf55ea1ca257aab26de939166322f9d8737045a3ced9bdfa165c3aa74810
6
+ metadata.gz: 30afef4e1d99a19f48a6db2b509403213f96cc3bb507c2a2a92dc9ba526dcf4c1fb30642cc7e90789e962b919ad8f591674906a4870c3e94d0b8531421e1d2f9
7
+ data.tar.gz: d4d666d871ea1b63c478b833d039f2e696f28ccf7c5ec68cf5b1707b3c9dbb7e9e959f51ab35781d160a5ee710d20d4bf3a0d56217012e405d79d774a880f923
data/src/ZOHOCRMSDK2_0.rb CHANGED
@@ -265,6 +265,7 @@ require 'com/zoho/crm/api/dc/au_datacenter.rb'
265
265
  require 'com/zoho/crm/api/dc/cn_datacenter.rb'
266
266
  require 'com/zoho/crm/api/dc/us_datacenter.rb'
267
267
  require 'com/zoho/crm/api/dc/datacenter.rb'
268
+ require 'com/zoho/crm/api/dc/jp_datacenter.rb'
268
269
  require 'com/zoho/crm/api/files/file_operations.rb'
269
270
  require 'com/zoho/crm/api/files/body_wrapper.rb'
270
271
  require 'com/zoho/crm/api/files/action_handler.rb'
@@ -12,7 +12,7 @@ module ZOHOCRMSDK
12
12
  module Authenticator
13
13
  # This class gets and refreshes the tokens based on the expiry time.
14
14
  class OAuthToken < Token
15
- attr_accessor :client_id , :client_secret ,:redirect_url ,:grant_token,:refresh_token, :access_token ,:user_mail ,:id ,:expires_in
15
+ attr_accessor :client_id, :client_secret, :redirect_url, :grant_token, :refresh_token, :access_token, :user_mail, :id, :expires_in
16
16
  @@sync_lock = Monitor.new
17
17
 
18
18
  # Creates an OAuthToken class instance with the specified parameters.
@@ -23,61 +23,68 @@ module ZOHOCRMSDK
23
23
  # @param redirect_url [string] A String containing the OAuth redirect URL.
24
24
  # @param id [string] A String containing ID
25
25
 
26
- def initialize(client_id:, client_secret:, grant_token: nil, refresh_token: nil, redirect_url: nil,id: nil)
27
- error ={}
28
- unless client_id.is_a?(String)
29
- error[Constants::ERROR_HASH_FIELD] = Constants::CLIENT_ID
26
+ def initialize(client_id: nil, client_secret: nil, grant_token: nil, refresh_token: nil, redirect_url: nil, id: nil, access_token: nil)
27
+ error = {}
30
28
 
31
- error[Constants::ERROR_HASH_EXPECTED_TYPE] = String
29
+ if grant_token.nil? && refresh_token.nil? && id.nil? && access_token.nil?
30
+ raise SDKException.new(Constants::MANDATORY_VALUE_ERROR, Constants::MANDATORY_KEY_ERROR, Constants::OAUTH_MANDATORY_KEYS)
31
+ end
32
32
 
33
- error[Constants::ERROR_HASH_CLASS] = OAuthToken.class
33
+ if id.nil? and access_token.nil?
34
+ unless client_id.is_a?(String)
35
+ error[Constants::ERROR_HASH_FIELD] = Constants::CLIENT_ID
34
36
 
35
- raise SDKException.new(Constants::INPUT_ERROR, nil, error, nil)
37
+ error[Constants::ERROR_HASH_EXPECTED_TYPE] = String
36
38
 
37
- end
39
+ error[Constants::ERROR_HASH_CLASS] = OAuthToken.class
38
40
 
39
- unless client_secret.is_a?(String)
40
- error[Constants::ERROR_HASH_FIELD] = Constants::CLIENT_SECRET
41
+ raise SDKException.new(Constants::INPUT_ERROR, nil, error, nil)
41
42
 
42
- error[Constants::ERROR_HASH_EXPECTED_TYPE] = String
43
+ end
43
44
 
44
- error[Constants::ERROR_HASH_CLASS] = OAuthToken.class
45
+ unless client_secret.is_a?(String)
46
+ error[Constants::ERROR_HASH_FIELD] = Constants::CLIENT_SECRET
45
47
 
46
- raise SDKException.new(Constants::INPUT_ERROR, nil, error, nil)
48
+ error[Constants::ERROR_HASH_EXPECTED_TYPE] = String
47
49
 
48
- end
50
+ error[Constants::ERROR_HASH_CLASS] = OAuthToken.class
49
51
 
50
- if !grant_token.nil? && !grant_token.is_a?(String)
51
- error[Constants::ERROR_HASH_FIELD] = Constants::GRANT_TOKEN
52
+ raise SDKException.new(Constants::INPUT_ERROR, nil, error, nil)
52
53
 
53
- error[Constants::ERROR_HASH_EXPECTED_TYPE] = String
54
+ end
54
55
 
55
- error[Constants::ERROR_HASH_CLASS] = OAuthToken.class
56
+ if !grant_token.nil? && !grant_token.is_a?(String)
57
+ error[Constants::ERROR_HASH_FIELD] = Constants::GRANT_TOKEN
56
58
 
57
- raise SDKException.new(Constants::INPUT_ERROR, nil, error, nil)
59
+ error[Constants::ERROR_HASH_EXPECTED_TYPE] = String
58
60
 
59
- end
61
+ error[Constants::ERROR_HASH_CLASS] = OAuthToken.class
60
62
 
61
- if !refresh_token.nil? && !refresh_token.is_a?(String)
62
- error[Constants::ERROR_HASH_FIELD] = Constants::REFRESH_TOKEN
63
+ raise SDKException.new(Constants::INPUT_ERROR, nil, error, nil)
63
64
 
64
- error[Constants::ERROR_HASH_EXPECTED_TYPE] = String
65
+ end
65
66
 
66
- error[Constants::ERROR_HASH_CLASS] = OAuthToken.class
67
+ if !refresh_token.nil? && !refresh_token.is_a?(String)
68
+ error[Constants::ERROR_HASH_FIELD] = Constants::REFRESH_TOKEN
67
69
 
68
- raise SDKException.new(Constants::INPUT_ERROR, nil, error, nil)
70
+ error[Constants::ERROR_HASH_EXPECTED_TYPE] = String
69
71
 
70
- end
72
+ error[Constants::ERROR_HASH_CLASS] = OAuthToken.class
71
73
 
72
- if !redirect_url.nil? && !redirect_url.is_a?(String)
73
- error[Constants::ERROR_HASH_FIELD] = Constants::REDIRECT_URL
74
+ raise SDKException.new(Constants::INPUT_ERROR, nil, error, nil)
74
75
 
75
- error[Constants::ERROR_HASH_EXPECTED_TYPE] = String
76
+ end
76
77
 
77
- error[Constants::ERROR_HASH_CLASS] = OAuthToken.class
78
+ if !redirect_url.nil? && !redirect_url.is_a?(String)
79
+ error[Constants::ERROR_HASH_FIELD] = Constants::REDIRECT_URL
78
80
 
79
- raise SDKException.new(Constants::INPUT_ERROR, nil, error, nil)
81
+ error[Constants::ERROR_HASH_EXPECTED_TYPE] = String
82
+
83
+ error[Constants::ERROR_HASH_CLASS] = OAuthToken.class
80
84
 
85
+ raise SDKException.new(Constants::INPUT_ERROR, nil, error, nil)
86
+
87
+ end
81
88
  end
82
89
 
83
90
  if !id.nil? && !id.is_a?(String)
@@ -91,15 +98,16 @@ module ZOHOCRMSDK
91
98
 
92
99
  end
93
100
 
94
- if grant_token.nil? && refresh_token.nil?
95
- error[Constants::ERROR_HASH_FIELD] = Constants::TYPE
101
+ if !access_token.nil? && !access_token.is_a?(String)
102
+ error[Constants::ERROR_HASH_FIELD] = Constants::ACCESS_TOKEN
96
103
 
97
- error[Constants::ERROR_HASH_EXPECTED_TYPE] = Constants::EXPECTED_TOKEN_TYPES
104
+ error[Constants::ERROR_HASH_EXPECTED_TYPE] = String
98
105
 
99
106
  error[Constants::ERROR_HASH_CLASS] = OAuthToken.class
100
107
 
101
108
  raise SDKException.new(Constants::INPUT_ERROR, nil, error, nil)
102
109
  end
110
+
103
111
  @client_id = client_id
104
112
 
105
113
  @client_secret = client_secret
@@ -110,7 +118,7 @@ module ZOHOCRMSDK
110
118
 
111
119
  @grant_token = grant_token
112
120
 
113
- @access_token = nil
121
+ @access_token = access_token
114
122
 
115
123
  @expires_in = nil
116
124
 
@@ -140,7 +148,7 @@ module ZOHOCRMSDK
140
148
 
141
149
  if oauth_token.nil?
142
150
  token = @refresh_token.nil? ? generate_access_token(user, store).access_token : refresh_access_token(user, store).access_token
143
- elsif oauth_token.expires_in.to_f - get_current_time_in_millis < 5000
151
+ elsif !oauth_token.expires_in.nil? && oauth_token.expires_in.to_f - get_current_time_in_millis < 5000
144
152
  SDKLog::SDKLogger.info(Constants::REFRESH_TOKEN_MESSAGE)
145
153
  token = oauth_token.refresh_access_token(user, store).access_token
146
154
  else
@@ -177,7 +185,7 @@ module ZOHOCRMSDK
177
185
 
178
186
  generate_id()
179
187
 
180
- store.save_token(user,self)
188
+ store.save_token(user, self)
181
189
  rescue SDKException => e
182
190
  raise e
183
191
  rescue StandardError => e
@@ -193,8 +201,6 @@ module ZOHOCRMSDK
193
201
 
194
202
  json_body[Constants::CLIENT_SECRET] = @client_secret
195
203
 
196
- json_body[Constants::REDIRECT_URI] = @redirect_url if !@redirect_url.nil?
197
-
198
204
  json_body[Constants::GRANT_TYPE] = Constants::REFRESH_TOKEN
199
205
 
200
206
  json_body[Constants::REFRESH_TOKEN] = @refresh_token
@@ -204,9 +210,11 @@ module ZOHOCRMSDK
204
210
  begin
205
211
  parse_response(response)
206
212
 
207
- generate_id()
213
+ if @id.nil?
214
+ generate_id()
215
+ end
208
216
 
209
- store.save_token(user,self)
217
+ store.save_token(user, self)
210
218
  rescue SDKException => e
211
219
  raise e
212
220
  rescue StandardError => e
@@ -268,7 +276,7 @@ module ZOHOCRMSDK
268
276
  id = ""
269
277
  email = Initializer.get_initializer.user.email
270
278
  environment = Initializer.get_initializer.environment.name
271
- id = id + "ruby_" +email[0..email.index(Constants::AT) - 1] + Constants::UNDERSCORE
279
+ id = id + (Constants::RUBY) + email[0..email.index(Constants::AT) - 1] + Constants::UNDERSCORE
272
280
  id = id + environment + Constants::UNDERSCORE + @refresh_token[@refresh_token.length-4..@refresh_token.length-1]
273
281
  @id = id
274
282
  end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,21 @@
1
+ require_relative 'datacenter'
2
+
3
+ module ZOHOCRMSDK
4
+ module DC
5
+ class JPDataCenter < DataCenter
6
+ def initialize; end
7
+
8
+ def get_iam_url
9
+ 'https://accounts.zoho.jp/oauth/v2/token'
10
+ end
11
+
12
+ def get_file_upload_url
13
+ 'https://content.zohoapis.jp'
14
+ end
15
+
16
+ PRODUCTION = Environment.new('https://www.zohoapis.jp', JPDataCenter.new.get_iam_url, JPDataCenter.new.get_file_upload_url,"jp_prd")
17
+ SANDBOX = Environment.new('https://sandbox.zohoapis.jp', JPDataCenter.new.get_iam_url, JPDataCenter.new.get_file_upload_url,"jp_sdb")
18
+ DEVELOPER = Environment.new('https://developer.zohoapis.jp', JPDataCenter.new.get_iam_url, JPDataCenter.new.get_file_upload_url,"jp_dev")
19
+ end
20
+ end
21
+ end
File without changes
@@ -8,7 +8,7 @@ module ZOHOCRMSDK
8
8
  # @param message A String containing the Exception error message.
9
9
  # @param details A hash containing the error response.
10
10
  # @param cause An Exception class instance.
11
- def initialize(code, message, details = nil, cause = nil)
11
+ def initialize(code, message, details=nil, cause=nil)
12
12
  @code = code
13
13
  @message = message
14
14
  @cause = cause
File without changes
File without changes
@@ -1,3 +1,20 @@
1
+ =begin
2
+ Copyright (c) 2021, ZOHO CORPORATION PRIVATE LIMITED
3
+ All rights reserved.
4
+
5
+ Licensed under the Apache License, Version 2.0 (the "License");
6
+ you may not use this file except in compliance with the License.
7
+ You may obtain a copy of the License at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
16
+ =end
17
+
1
18
  require 'uri'
2
19
  require 'net/http'
3
20
  require 'cgi'
@@ -17,7 +34,7 @@ module ZOHOCRMSDK
17
34
  @@json_details
18
35
  end
19
36
 
20
- def self.initialize(user:, environment:, token:, store:, sdk_config:, resources_path:, log: nil, request_proxy: nil)
37
+ def self.initialize(user:, environment:, token:, store: nil, sdk_config: nil, resources_path: nil, log: nil, request_proxy: nil)
21
38
  error = {}
22
39
 
23
40
  require_relative 'user_signature'
@@ -55,7 +72,7 @@ module ZOHOCRMSDK
55
72
 
56
73
  require_relative '../../api/authenticator/store/token_store'
57
74
 
58
- unless store.is_a?(Store::TokenStore)
75
+ if !store.nil? && !store.is_a?(Store::TokenStore)
59
76
  error[Constants::ERROR_HASH_FIELD] = 'store'
60
77
 
61
78
  error[Constants::ERROR_HASH_EXPECTED_TYPE] = Store::TokenStore
@@ -66,7 +83,7 @@ module ZOHOCRMSDK
66
83
 
67
84
  require_relative 'sdk_config'
68
85
 
69
- unless sdk_config.is_a?(SDKConfig)
86
+ if !sdk_config.nil? && !sdk_config.is_a?(SDKConfig)
70
87
  error[Constants::ERROR_HASH_FIELD] = 'sdk_config'
71
88
 
72
89
  error[Constants::ERROR_HASH_EXPECTED_TYPE] = SDKConfig
@@ -75,20 +92,30 @@ module ZOHOCRMSDK
75
92
 
76
93
  end
77
94
 
78
- if !request_proxy.nil? && !sdk_config.is_a?(RequestProxy)
79
-
95
+ if !request_proxy.nil? && !request_proxy.is_a?(RequestProxy)
80
96
  raise SDKException.new(Constants::INITIALIZATION_ERROR, Constants::REQUEST_PROXY_ERROR, nil, nil)
81
97
  end
82
98
 
83
- if resources_path.nil? || resources_path.empty?
84
- raise SDKException.new(Constants::INITIALIZATION_ERROR, Constants::RESOURCE_PATH_ERROR_MESSAGE, nil, nil)
99
+ if store.nil?
100
+ require_relative '../../api/authenticator/store/file_store'
101
+
102
+ store = Store::FileStore.new(File.join(Dir.pwd, Constants::TOKEN_FILE))
103
+
104
+ end
105
+
106
+ if sdk_config.nil?
107
+ sdk_config = SDKConfig.new()
108
+ end
109
+
110
+ if resources_path.nil?
111
+ resources_path = Dir.pwd
85
112
  end
86
113
 
87
114
  if !File.directory?(resources_path)
88
115
  raise SDKException.new(Constants::INITIALIZATION_ERROR, Constants::RESOURCE_PATH_INVALID_ERROR_MESSAGE, nil, nil)
89
116
  end
90
117
 
91
- log = SDKLog::Log.initialize(level: Levels::INFO, path: File.join(Dir.pwd, Constants::LOGFILE_NAME)) if log.nil?
118
+ log = SDKLog::Log.initialize(level: Levels::INFO, path: File.join(Dir.pwd, Constants::LOG_FILE_NAME)) if log.nil?
92
119
  SDKLog::SDKLogger.initialize(log)
93
120
 
94
121
  @@initializer = Initializer.new
File without changes
@@ -25,7 +25,7 @@ module ZOHOCRMSDK
25
25
  end
26
26
 
27
27
  if value.nil?
28
- raise SDKException.new(Constants::PARAMETER_NULL_ERROR, header_name + Constants::NULL_VALUE_ERROR_MESSAGE)
28
+ raise SDKException.new(Constants::PARAMETER_NULL_ERROR, param_name + Constants::NULL_VALUE_ERROR_MESSAGE)
29
29
  end
30
30
 
31
31
  param_value = nil
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -157,7 +157,7 @@ module ZOHOCRMSDK
157
157
 
158
158
  ZOHO_SDK = 'X-ZOHO-SDK'
159
159
 
160
- SDK_VERSION = '3.0.0'
160
+ SDK_VERSION = '6.0.0'
161
161
 
162
162
  ZOHO_API_VERSION = '2.0'
163
163
 
@@ -167,13 +167,13 @@ module ZOHOCRMSDK
167
167
 
168
168
  IS_GENERATE_REQUEST_BODY = [REQUEST_METHOD_POST,REQUEST_METHOD_PUT,REQUEST_METHOD_PATCH]
169
169
 
170
- REQUIRED_IN_UPDATE = 'required_in_update'
170
+ REQUIRED_IN_UPDATE = 'required-in-update'
171
171
 
172
172
  PHOTO = "photo"
173
173
 
174
174
  CRM = "crm"
175
175
 
176
- PHOTO_SUPPORTED_MODULES = ["leads", "contacts", "accounts", "products", "vendors", "deals", "cases", "solutions"]
176
+ PHOTO_SUPPORTED_MODULES = ["leads", "contacts", "accounts", "products", "vendors"]
177
177
 
178
178
  PARAMETER_NULL_ERROR = 'NULL PARAMETER ERROR'
179
179
 
@@ -275,7 +275,7 @@ module ZOHOCRMSDK
275
275
 
276
276
  CALLS = 'Calls'
277
277
 
278
- SKIP_MANDATORY = 'skip_mandatory'
278
+ SKIP_MANDATORY = 'skip-mandatory'
279
279
 
280
280
  CALL_DURATION = 'Call_Duration'
281
281
 
@@ -571,7 +571,9 @@ module ZOHOCRMSDK
571
571
 
572
572
  KEY_MODIFIED = 'key_modified'
573
573
 
574
- LOGFILE_NAME = 'SDKLogs.log'
574
+ LOG_FILE_NAME = 'sdk_logs.log'
575
+
576
+ TOKEN_FILE = "sdk_tokens.txt"
575
577
 
576
578
  INITIALIZATION_ERROR = 'INITIALIZATION ERROR'
577
579
 
@@ -635,5 +637,10 @@ module ZOHOCRMSDK
635
637
 
636
638
  SKIP_MODULES = ['deals']
637
639
 
640
+ RUBY = "ruby_"
641
+
642
+ OAUTH_MANDATORY_KEYS = ["grant_token", "refresh_token", "id", "access_token"]
643
+
644
+ OWNER_LOOKUP = "ownerlookup"
638
645
  end
639
646
  end
@@ -56,9 +56,10 @@ module ZOHOCRMSDK
56
56
  var_type = nil
57
57
  check = true
58
58
 
59
- unless value.nil?
59
+ unless value.nil?
60
+ var_type = value.class.name
60
61
  if key_details.key? Constants::INTERFACE and key_details[Constants::INTERFACE] == true
61
- json_details = Initializer.get_initializer.json_details
62
+ json_details = Initializer.json_details
62
63
  interface_details = json_details[key_details[Constants::STRUCTURE_NAME]]
63
64
  classes = interface_details[Constants::CLASSES]
64
65
  check = false
@@ -101,6 +102,11 @@ module ZOHOCRMSDK
101
102
  if type.downcase != Util::Utility.path_to_package(var_type).downcase
102
103
  check = false
103
104
  end
105
+ if !check
106
+ if Object.const_get(var_type).new.is_a? Object.const_get(Util::Utility.class_to_load(type))
107
+ check = true
108
+ end
109
+ end
104
110
  end
105
111
  if !check
106
112
  error[Constants::ERROR_HASH_CLASS] = class_name
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -591,8 +591,9 @@ module ZOHOCRMSDK
591
591
  return
592
592
  end
593
593
  field_detail[Constants::LOOKUP] = true if data_type.downcase.include? Constants::LOOKUP
594
- field_detail[Constants::SKIP_MANDATORY] = true if data_type.downcase.include? Constants::CONSENT_LOOKUP
595
-
594
+ if (data_type.downcase.include? Constants::CONSENT_LOOKUP) || (data_type.downcase.include? Constants::OWNER_LOOKUP)
595
+ field_detail[Constants::SKIP_MANDATORY] = true
596
+ end
596
597
  if @@apitype_vs_structurename.include? data_type
597
598
  field_detail[Constants::STRUCTURE_NAME] = @@apitype_vs_structurename[data_type]
598
599
  end