ZOHOCRMSDK2_0 5.0.0 → 6.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/src/ZOHOCRMSDK2_0.rb +2 -0
- data/src/com/zoho/api/authenticator/oauth_token.rb +3 -3
- data/src/com/zoho/crm/api/dc/jp_datacenter.rb +21 -0
- data/src/com/zoho/crm/api/initializer.rb +17 -0
- data/src/com/zoho/crm/api/parameter_map.rb +1 -1
- data/src/com/zoho/crm/api/record/apply_feature_execution.rb +63 -0
- data/src/com/zoho/crm/api/record/body_wrapper.rb +19 -0
- data/src/com/zoho/crm/api/util/constants.rb +3 -1
- data/src/com/zoho/crm/api/util/converter.rb +8 -2
- data/src/com/zoho/crm/api/util/utility.rb +3 -2
- data/src/resources/JSONDetails.json +1 -1
- data/src/version.rb +1 -1
- metadata +10 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44d0367c336d8655cad9c2ee03e8e68715e75eebdba3186e3b1b7c499ee8399e
|
4
|
+
data.tar.gz: 4e9b68c820b428cb6757103984555771e05472c63fe3890036335754874db6da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f005a9264b64640c4dcc7bc25dbdcb16f2e777f4e37e54226373c2df1855c79634c69d58e9283110d8fa3fca82fd4eb6cbf68c12ba719df5120898ec4c1bba68
|
7
|
+
data.tar.gz: 1d49cef15493d6d5fd483f1ba4c8bd9aa13a1c57e3da7803c31f78cc09666123f23b3d8a52e4404d100d7184cdf704de083723ff02d2d4ab995457cd7f559d84
|
data/src/ZOHOCRMSDK2_0.rb
CHANGED
@@ -28,6 +28,7 @@ require 'com/zoho/crm/api/record/info.rb'
|
|
28
28
|
require 'com/zoho/crm/api/record/download_handler.rb'
|
29
29
|
require 'com/zoho/crm/api/record/convert_action_response.rb'
|
30
30
|
require 'com/zoho/crm/api/record/action_handler.rb'
|
31
|
+
require 'com/zoho/crm/api/record/apply_feature_execution.rb'
|
31
32
|
require 'com/zoho/crm/api/record/deleted_records_wrapper.rb'
|
32
33
|
require 'com/zoho/crm/api/record/lead_converter.rb'
|
33
34
|
require 'com/zoho/crm/api/record/record_operations.rb'
|
@@ -265,6 +266,7 @@ require 'com/zoho/crm/api/dc/au_datacenter.rb'
|
|
265
266
|
require 'com/zoho/crm/api/dc/cn_datacenter.rb'
|
266
267
|
require 'com/zoho/crm/api/dc/us_datacenter.rb'
|
267
268
|
require 'com/zoho/crm/api/dc/datacenter.rb'
|
269
|
+
require 'com/zoho/crm/api/dc/jp_datacenter.rb'
|
268
270
|
require 'com/zoho/crm/api/files/file_operations.rb'
|
269
271
|
require 'com/zoho/crm/api/files/body_wrapper.rb'
|
270
272
|
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
|
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.
|
@@ -27,7 +27,7 @@ module ZOHOCRMSDK
|
|
27
27
|
error = {}
|
28
28
|
|
29
29
|
if grant_token.nil? && refresh_token.nil? && id.nil? && access_token.nil?
|
30
|
-
raise SDKException.new(
|
30
|
+
raise SDKException.new(Constants::MANDATORY_VALUE_ERROR, Constants::MANDATORY_KEY_ERROR, Constants::OAUTH_MANDATORY_KEYS)
|
31
31
|
end
|
32
32
|
|
33
33
|
if id.nil? and access_token.nil?
|
@@ -185,7 +185,7 @@ module ZOHOCRMSDK
|
|
185
185
|
|
186
186
|
generate_id()
|
187
187
|
|
188
|
-
store.save_token(user,self)
|
188
|
+
store.save_token(user, self)
|
189
189
|
rescue SDKException => e
|
190
190
|
raise e
|
191
191
|
rescue StandardError => e
|
@@ -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
|
@@ -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'
|
@@ -25,7 +25,7 @@ module ZOHOCRMSDK
|
|
25
25
|
end
|
26
26
|
|
27
27
|
if value.nil?
|
28
|
-
raise SDKException.new(Constants::PARAMETER_NULL_ERROR,
|
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
|
@@ -0,0 +1,63 @@
|
|
1
|
+
require_relative '../util/model'
|
2
|
+
|
3
|
+
module ZOHOCRMSDK
|
4
|
+
module Record
|
5
|
+
class ApplyFeatureExecution
|
6
|
+
include Util::Model
|
7
|
+
|
8
|
+
# Creates an instance of ApplyFeatureExecution
|
9
|
+
def initialize
|
10
|
+
@name = nil
|
11
|
+
@key_modified = Hash.new
|
12
|
+
end
|
13
|
+
|
14
|
+
# The method to get the name
|
15
|
+
# @return A String value
|
16
|
+
|
17
|
+
def name
|
18
|
+
@name
|
19
|
+
end
|
20
|
+
|
21
|
+
# The method to set the value to name
|
22
|
+
# @param name [String] A String
|
23
|
+
|
24
|
+
def name=(name)
|
25
|
+
if name!=nil and !name.is_a? String
|
26
|
+
raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: name EXPECTED TYPE: String', nil, nil)
|
27
|
+
end
|
28
|
+
@name = name
|
29
|
+
@key_modified['name'] = 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
|
63
|
+
end
|
@@ -8,6 +8,7 @@ module ZOHOCRMSDK
|
|
8
8
|
# Creates an instance of BodyWrapper
|
9
9
|
def initialize
|
10
10
|
@data = nil
|
11
|
+
@apply_feature_execution = nil
|
11
12
|
@trigger = nil
|
12
13
|
@process = nil
|
13
14
|
@duplicate_check_fields = nil
|
@@ -34,6 +35,24 @@ module ZOHOCRMSDK
|
|
34
35
|
@key_modified['data'] = 1
|
35
36
|
end
|
36
37
|
|
38
|
+
# The method to get the apply_feature_execution
|
39
|
+
# @return An instance of Array
|
40
|
+
|
41
|
+
def apply_feature_execution
|
42
|
+
@apply_feature_execution
|
43
|
+
end
|
44
|
+
|
45
|
+
# The method to set the value to apply_feature_execution
|
46
|
+
# @param apply_feature_execution [Array] An instance of Array
|
47
|
+
|
48
|
+
def apply_feature_execution=(apply_feature_execution)
|
49
|
+
if apply_feature_execution!=nil and !apply_feature_execution.is_a? Array
|
50
|
+
raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: apply_feature_execution EXPECTED TYPE: Array', nil, nil)
|
51
|
+
end
|
52
|
+
@apply_feature_execution = apply_feature_execution
|
53
|
+
@key_modified['apply_feature_execution'] = 1
|
54
|
+
end
|
55
|
+
|
37
56
|
# The method to get the trigger
|
38
57
|
# @return An instance of Array
|
39
58
|
|
@@ -157,7 +157,7 @@ module ZOHOCRMSDK
|
|
157
157
|
|
158
158
|
ZOHO_SDK = 'X-ZOHO-SDK'
|
159
159
|
|
160
|
-
SDK_VERSION = '
|
160
|
+
SDK_VERSION = '6.1.0'
|
161
161
|
|
162
162
|
ZOHO_API_VERSION = '2.0'
|
163
163
|
|
@@ -640,5 +640,7 @@ module ZOHOCRMSDK
|
|
640
640
|
RUBY = "ruby_"
|
641
641
|
|
642
642
|
OAUTH_MANDATORY_KEYS = ["grant_token", "refresh_token", "id", "access_token"]
|
643
|
+
|
644
|
+
OWNER_LOOKUP = "ownerlookup"
|
643
645
|
end
|
644
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.
|
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
|
@@ -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
|
-
|
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
|