tremendous_ruby 5.0.1 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/tremendous/api/tremendous_api.rb +677 -9
- data/lib/tremendous/models/campaign.rb +25 -14
- data/lib/tremendous/models/campaign_base.rb +287 -0
- data/lib/tremendous/models/{get_campaign200_response.rb → create_campaign201_response.rb} +3 -3
- data/lib/tremendous/models/create_campaign_request.rb +273 -0
- data/lib/tremendous/models/create_member.rb +2 -53
- data/lib/tremendous/models/create_member_request.rb +2 -53
- data/lib/tremendous/models/create_order_request_reward.rb +1 -1
- data/lib/tremendous/models/create_order_request_reward_custom_fields_inner.rb +248 -0
- data/lib/tremendous/models/create_organization_request_copy_settings.rb +29 -5
- data/lib/tremendous/models/{list_products200_response_products_inner_countries_inner.rb → create_public_key.rb} +15 -15
- data/lib/tremendous/models/create_public_key200_response.rb +221 -0
- data/lib/tremendous/models/create_public_key_request.rb +222 -0
- data/lib/tremendous/models/custom_field.rb +15 -5
- data/lib/tremendous/models/get_member200_response_member.rb +13 -21
- data/lib/tremendous/models/invoice.rb +2 -2
- data/lib/tremendous/models/list_campaigns200_response_campaigns_inner.rb +25 -14
- data/lib/tremendous/models/list_campaigns200_response_campaigns_inner_email_style.rb +270 -0
- data/lib/tremendous/models/list_campaigns200_response_campaigns_inner_webpage_style.rb +270 -0
- data/lib/tremendous/models/{get_product200_response.rb → list_forex_response.rb} +16 -14
- data/lib/tremendous/models/list_invoices200_response_invoices_inner.rb +2 -2
- data/lib/tremendous/models/list_members200_response_members_inner.rb +13 -21
- data/lib/tremendous/models/list_rewards200_response_rewards_inner_custom_fields_inner.rb +15 -5
- data/lib/tremendous/models/{list_products200_response.rb → list_roles200_response.rb} +15 -15
- data/lib/tremendous/models/{list_products200_response_products_inner_images_inner.rb → list_roles200_response_roles_inner.rb} +59 -57
- data/lib/tremendous/models/member.rb +13 -21
- data/lib/tremendous/models/member_base.rb +13 -21
- data/lib/tremendous/models/member_with_events.rb +13 -21
- data/lib/tremendous/models/member_without_events.rb +13 -21
- data/lib/tremendous/models/public_key.rb +257 -0
- data/lib/tremendous/models/public_keys_response.rb +223 -0
- data/lib/tremendous/models/public_keys_response_public_keys_inner.rb +257 -0
- data/lib/tremendous/models/reward_base_custom_fields_inner.rb +15 -5
- data/lib/tremendous/models/{list_products200_response_products_inner_skus_inner.rb → role.rb} +51 -53
- data/lib/tremendous/models/test_public_key.rb +222 -0
- data/lib/tremendous/models/test_public_key_request.rb +222 -0
- data/lib/tremendous/models/update_campaign.rb +287 -0
- data/lib/tremendous/models/update_campaign_request.rb +257 -0
- data/lib/tremendous/version.rb +1 -1
- data/lib/tremendous.rb +20 -1
- metadata +23 -10
- data/lib/tremendous/models/list_products200_response_products_inner.rb +0 -457
|
@@ -18,39 +18,13 @@ module Tremendous
|
|
|
18
18
|
# Email address of the member
|
|
19
19
|
attr_accessor :email
|
|
20
20
|
|
|
21
|
-
#
|
|
22
|
-
attr_accessor :name
|
|
23
|
-
|
|
24
|
-
# Role of the member within the organization. <table> <thead> <tr> <th>Role</th> <th>Description</th> </tr> </thead> <tr> <td><code>MEMBER</code></td> <td>Limited permissions. Can view their own reward and order histories only.</td> </tr> <tr> <td><code>ADMIN</code></td> <td>Update organization settings, invite other members to the organization, and view all member order and reward histories within their organization.</td> </tr> <tbody> </table>
|
|
21
|
+
# The role ID of the member within the organization.
|
|
25
22
|
attr_accessor :role
|
|
26
23
|
|
|
27
|
-
class EnumAttributeValidator
|
|
28
|
-
attr_reader :datatype
|
|
29
|
-
attr_reader :allowable_values
|
|
30
|
-
|
|
31
|
-
def initialize(datatype, allowable_values)
|
|
32
|
-
@allowable_values = allowable_values.map do |value|
|
|
33
|
-
case datatype.to_s
|
|
34
|
-
when /Integer/i
|
|
35
|
-
value.to_i
|
|
36
|
-
when /Float/i
|
|
37
|
-
value.to_f
|
|
38
|
-
else
|
|
39
|
-
value
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
def valid?(value)
|
|
45
|
-
!value || allowable_values.include?(value)
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
|
|
49
24
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
50
25
|
def self.attribute_map
|
|
51
26
|
{
|
|
52
27
|
:'email' => :'email',
|
|
53
|
-
:'name' => :'name',
|
|
54
28
|
:'role' => :'role'
|
|
55
29
|
}
|
|
56
30
|
end
|
|
@@ -64,7 +38,6 @@ module Tremendous
|
|
|
64
38
|
def self.openapi_types
|
|
65
39
|
{
|
|
66
40
|
:'email' => :'String',
|
|
67
|
-
:'name' => :'String',
|
|
68
41
|
:'role' => :'String'
|
|
69
42
|
}
|
|
70
43
|
end
|
|
@@ -96,12 +69,6 @@ module Tremendous
|
|
|
96
69
|
self.email = nil
|
|
97
70
|
end
|
|
98
71
|
|
|
99
|
-
if attributes.key?(:'name')
|
|
100
|
-
self.name = attributes[:'name']
|
|
101
|
-
else
|
|
102
|
-
self.name = nil
|
|
103
|
-
end
|
|
104
|
-
|
|
105
72
|
if attributes.key?(:'role')
|
|
106
73
|
self.role = attributes[:'role']
|
|
107
74
|
else
|
|
@@ -118,10 +85,6 @@ module Tremendous
|
|
|
118
85
|
invalid_properties.push('invalid value for "email", email cannot be nil.')
|
|
119
86
|
end
|
|
120
87
|
|
|
121
|
-
if @name.nil?
|
|
122
|
-
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
123
|
-
end
|
|
124
|
-
|
|
125
88
|
if @role.nil?
|
|
126
89
|
invalid_properties.push('invalid value for "role", role cannot be nil.')
|
|
127
90
|
end
|
|
@@ -134,30 +97,16 @@ module Tremendous
|
|
|
134
97
|
def valid?
|
|
135
98
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
136
99
|
return false if @email.nil?
|
|
137
|
-
return false if @name.nil?
|
|
138
100
|
return false if @role.nil?
|
|
139
|
-
role_validator = EnumAttributeValidator.new('String', ["MEMBER", "ADMIN"])
|
|
140
|
-
return false unless role_validator.valid?(@role)
|
|
141
101
|
true
|
|
142
102
|
end
|
|
143
103
|
|
|
144
|
-
# Custom attribute writer method checking allowed values (enum).
|
|
145
|
-
# @param [Object] role Object to be assigned
|
|
146
|
-
def role=(role)
|
|
147
|
-
validator = EnumAttributeValidator.new('String', ["MEMBER", "ADMIN"])
|
|
148
|
-
unless validator.valid?(role)
|
|
149
|
-
fail ArgumentError, "invalid value for \"role\", must be one of #{validator.allowable_values}."
|
|
150
|
-
end
|
|
151
|
-
@role = role
|
|
152
|
-
end
|
|
153
|
-
|
|
154
104
|
# Checks equality by comparing each attribute.
|
|
155
105
|
# @param [Object] Object to be compared
|
|
156
106
|
def ==(o)
|
|
157
107
|
return true if self.equal?(o)
|
|
158
108
|
self.class == o.class &&
|
|
159
109
|
email == o.email &&
|
|
160
|
-
name == o.name &&
|
|
161
110
|
role == o.role
|
|
162
111
|
end
|
|
163
112
|
|
|
@@ -170,7 +119,7 @@ module Tremendous
|
|
|
170
119
|
# Calculates hash code according to all attributes.
|
|
171
120
|
# @return [Integer] Hash code
|
|
172
121
|
def hash
|
|
173
|
-
[email,
|
|
122
|
+
[email, role].hash
|
|
174
123
|
end
|
|
175
124
|
|
|
176
125
|
# Builds the object from hash
|
|
@@ -18,39 +18,13 @@ module Tremendous
|
|
|
18
18
|
# Email address of the member
|
|
19
19
|
attr_accessor :email
|
|
20
20
|
|
|
21
|
-
#
|
|
22
|
-
attr_accessor :name
|
|
23
|
-
|
|
24
|
-
# Role of the member within the organization. <table> <thead> <tr> <th>Role</th> <th>Description</th> </tr> </thead> <tr> <td><code>MEMBER</code></td> <td>Limited permissions. Can view their own reward and order histories only.</td> </tr> <tr> <td><code>ADMIN</code></td> <td>Update organization settings, invite other members to the organization, and view all member order and reward histories within their organization.</td> </tr> <tbody> </table>
|
|
21
|
+
# The role ID of the member within the organization.
|
|
25
22
|
attr_accessor :role
|
|
26
23
|
|
|
27
|
-
class EnumAttributeValidator
|
|
28
|
-
attr_reader :datatype
|
|
29
|
-
attr_reader :allowable_values
|
|
30
|
-
|
|
31
|
-
def initialize(datatype, allowable_values)
|
|
32
|
-
@allowable_values = allowable_values.map do |value|
|
|
33
|
-
case datatype.to_s
|
|
34
|
-
when /Integer/i
|
|
35
|
-
value.to_i
|
|
36
|
-
when /Float/i
|
|
37
|
-
value.to_f
|
|
38
|
-
else
|
|
39
|
-
value
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
def valid?(value)
|
|
45
|
-
!value || allowable_values.include?(value)
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
|
|
49
24
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
50
25
|
def self.attribute_map
|
|
51
26
|
{
|
|
52
27
|
:'email' => :'email',
|
|
53
|
-
:'name' => :'name',
|
|
54
28
|
:'role' => :'role'
|
|
55
29
|
}
|
|
56
30
|
end
|
|
@@ -64,7 +38,6 @@ module Tremendous
|
|
|
64
38
|
def self.openapi_types
|
|
65
39
|
{
|
|
66
40
|
:'email' => :'String',
|
|
67
|
-
:'name' => :'String',
|
|
68
41
|
:'role' => :'String'
|
|
69
42
|
}
|
|
70
43
|
end
|
|
@@ -96,12 +69,6 @@ module Tremendous
|
|
|
96
69
|
self.email = nil
|
|
97
70
|
end
|
|
98
71
|
|
|
99
|
-
if attributes.key?(:'name')
|
|
100
|
-
self.name = attributes[:'name']
|
|
101
|
-
else
|
|
102
|
-
self.name = nil
|
|
103
|
-
end
|
|
104
|
-
|
|
105
72
|
if attributes.key?(:'role')
|
|
106
73
|
self.role = attributes[:'role']
|
|
107
74
|
else
|
|
@@ -118,10 +85,6 @@ module Tremendous
|
|
|
118
85
|
invalid_properties.push('invalid value for "email", email cannot be nil.')
|
|
119
86
|
end
|
|
120
87
|
|
|
121
|
-
if @name.nil?
|
|
122
|
-
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
123
|
-
end
|
|
124
|
-
|
|
125
88
|
if @role.nil?
|
|
126
89
|
invalid_properties.push('invalid value for "role", role cannot be nil.')
|
|
127
90
|
end
|
|
@@ -134,30 +97,16 @@ module Tremendous
|
|
|
134
97
|
def valid?
|
|
135
98
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
136
99
|
return false if @email.nil?
|
|
137
|
-
return false if @name.nil?
|
|
138
100
|
return false if @role.nil?
|
|
139
|
-
role_validator = EnumAttributeValidator.new('String', ["MEMBER", "ADMIN"])
|
|
140
|
-
return false unless role_validator.valid?(@role)
|
|
141
101
|
true
|
|
142
102
|
end
|
|
143
103
|
|
|
144
|
-
# Custom attribute writer method checking allowed values (enum).
|
|
145
|
-
# @param [Object] role Object to be assigned
|
|
146
|
-
def role=(role)
|
|
147
|
-
validator = EnumAttributeValidator.new('String', ["MEMBER", "ADMIN"])
|
|
148
|
-
unless validator.valid?(role)
|
|
149
|
-
fail ArgumentError, "invalid value for \"role\", must be one of #{validator.allowable_values}."
|
|
150
|
-
end
|
|
151
|
-
@role = role
|
|
152
|
-
end
|
|
153
|
-
|
|
154
104
|
# Checks equality by comparing each attribute.
|
|
155
105
|
# @param [Object] Object to be compared
|
|
156
106
|
def ==(o)
|
|
157
107
|
return true if self.equal?(o)
|
|
158
108
|
self.class == o.class &&
|
|
159
109
|
email == o.email &&
|
|
160
|
-
name == o.name &&
|
|
161
110
|
role == o.role
|
|
162
111
|
end
|
|
163
112
|
|
|
@@ -170,7 +119,7 @@ module Tremendous
|
|
|
170
119
|
# Calculates hash code according to all attributes.
|
|
171
120
|
# @return [Integer] Hash code
|
|
172
121
|
def hash
|
|
173
|
-
[email,
|
|
122
|
+
[email, role].hash
|
|
174
123
|
end
|
|
175
124
|
|
|
176
125
|
# Builds the object from hash
|
|
@@ -63,7 +63,7 @@ module Tremendous
|
|
|
63
63
|
:'value' => :'ListRewards200ResponseRewardsInnerValue',
|
|
64
64
|
:'recipient' => :'ListRewards200ResponseRewardsInnerRecipient',
|
|
65
65
|
:'deliver_at' => :'Date',
|
|
66
|
-
:'custom_fields' => :'Array<
|
|
66
|
+
:'custom_fields' => :'Array<CreateOrderRequestRewardCustomFieldsInner>',
|
|
67
67
|
:'language' => :'String',
|
|
68
68
|
:'delivery' => :'CreateOrderRequestRewardDelivery'
|
|
69
69
|
}
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#API Endpoints
|
|
3
|
+
|
|
4
|
+
#Deliver monetary rewards and incentives to employees, customers, survey participants, and more through the Tremendous API. For organizational tasks, like managing your organization and it's members within Tremendous, please see the Tremendous Organizational API.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 2
|
|
7
|
+
Contact: developers@tremendous.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
OpenAPI Generator version: 7.3.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Tremendous
|
|
17
|
+
# Reward custom data for searching, tracking or copy (see [Adding custom fields to orders](https://developers.tremendous.com/reference/using-custom-fields-to-add-custom-data-to-rewards).)
|
|
18
|
+
class CreateOrderRequestRewardCustomFieldsInner
|
|
19
|
+
# Tremendous ID of the custom field
|
|
20
|
+
attr_accessor :id
|
|
21
|
+
|
|
22
|
+
# Value of the custom field
|
|
23
|
+
attr_accessor :value
|
|
24
|
+
|
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
26
|
+
def self.attribute_map
|
|
27
|
+
{
|
|
28
|
+
:'id' => :'id',
|
|
29
|
+
:'value' => :'value'
|
|
30
|
+
}
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Returns all the JSON keys this model knows about
|
|
34
|
+
def self.acceptable_attributes
|
|
35
|
+
attribute_map.values
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Attribute type mapping.
|
|
39
|
+
def self.openapi_types
|
|
40
|
+
{
|
|
41
|
+
:'id' => :'String',
|
|
42
|
+
:'value' => :'String'
|
|
43
|
+
}
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# List of attributes with nullable: true
|
|
47
|
+
def self.openapi_nullable
|
|
48
|
+
Set.new([
|
|
49
|
+
:'value'
|
|
50
|
+
])
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Initializes the object
|
|
54
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
55
|
+
def initialize(attributes = {})
|
|
56
|
+
if (!attributes.is_a?(Hash))
|
|
57
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::CreateOrderRequestRewardCustomFieldsInner` initialize method"
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
61
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
62
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
63
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::CreateOrderRequestRewardCustomFieldsInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
64
|
+
end
|
|
65
|
+
h[k.to_sym] = v
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if attributes.key?(:'id')
|
|
69
|
+
self.id = attributes[:'id']
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
if attributes.key?(:'value')
|
|
73
|
+
self.value = attributes[:'value']
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
78
|
+
# @return Array for valid properties with the reasons
|
|
79
|
+
def list_invalid_properties
|
|
80
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
81
|
+
invalid_properties = Array.new
|
|
82
|
+
pattern = Regexp.new(/[A-Z0-9]{4,20}/)
|
|
83
|
+
if !@id.nil? && @id !~ pattern
|
|
84
|
+
invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.")
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
invalid_properties
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Check to see if the all the properties in the model are valid
|
|
91
|
+
# @return true if the model is valid
|
|
92
|
+
def valid?
|
|
93
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
94
|
+
return false if !@id.nil? && @id !~ Regexp.new(/[A-Z0-9]{4,20}/)
|
|
95
|
+
true
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Custom attribute writer method with validation
|
|
99
|
+
# @param [Object] id Value to be assigned
|
|
100
|
+
def id=(id)
|
|
101
|
+
if id.nil?
|
|
102
|
+
fail ArgumentError, 'id cannot be nil'
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
pattern = Regexp.new(/[A-Z0-9]{4,20}/)
|
|
106
|
+
if id !~ pattern
|
|
107
|
+
fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}."
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
@id = id
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# Checks equality by comparing each attribute.
|
|
114
|
+
# @param [Object] Object to be compared
|
|
115
|
+
def ==(o)
|
|
116
|
+
return true if self.equal?(o)
|
|
117
|
+
self.class == o.class &&
|
|
118
|
+
id == o.id &&
|
|
119
|
+
value == o.value
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# @see the `==` method
|
|
123
|
+
# @param [Object] Object to be compared
|
|
124
|
+
def eql?(o)
|
|
125
|
+
self == o
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Calculates hash code according to all attributes.
|
|
129
|
+
# @return [Integer] Hash code
|
|
130
|
+
def hash
|
|
131
|
+
[id, value].hash
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Builds the object from hash
|
|
135
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
136
|
+
# @return [Object] Returns the model itself
|
|
137
|
+
def self.build_from_hash(attributes)
|
|
138
|
+
return nil unless attributes.is_a?(Hash)
|
|
139
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
140
|
+
transformed_hash = {}
|
|
141
|
+
openapi_types.each_pair do |key, type|
|
|
142
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
143
|
+
transformed_hash["#{key}"] = nil
|
|
144
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
145
|
+
# check to ensure the input is an array given that the attribute
|
|
146
|
+
# is documented as an array but the input is not
|
|
147
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
148
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
149
|
+
end
|
|
150
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
151
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
new(transformed_hash)
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Deserializes the data based on type
|
|
158
|
+
# @param string type Data type
|
|
159
|
+
# @param string value Value to be deserialized
|
|
160
|
+
# @return [Object] Deserialized data
|
|
161
|
+
def self._deserialize(type, value)
|
|
162
|
+
case type.to_sym
|
|
163
|
+
when :Time
|
|
164
|
+
Time.parse(value)
|
|
165
|
+
when :Date
|
|
166
|
+
Date.parse(value)
|
|
167
|
+
when :String
|
|
168
|
+
value.to_s
|
|
169
|
+
when :Integer
|
|
170
|
+
value.to_i
|
|
171
|
+
when :Float
|
|
172
|
+
value.to_f
|
|
173
|
+
when :Boolean
|
|
174
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
175
|
+
true
|
|
176
|
+
else
|
|
177
|
+
false
|
|
178
|
+
end
|
|
179
|
+
when :Object
|
|
180
|
+
# generic object (usually a Hash), return directly
|
|
181
|
+
value
|
|
182
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
183
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
184
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
185
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
186
|
+
k_type = Regexp.last_match[:k_type]
|
|
187
|
+
v_type = Regexp.last_match[:v_type]
|
|
188
|
+
{}.tap do |hash|
|
|
189
|
+
value.each do |k, v|
|
|
190
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
191
|
+
end
|
|
192
|
+
end
|
|
193
|
+
else # model
|
|
194
|
+
# models (e.g. Pet) or oneOf
|
|
195
|
+
klass = Tremendous.const_get(type)
|
|
196
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
197
|
+
end
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# Returns the string representation of the object
|
|
201
|
+
# @return [String] String presentation of the object
|
|
202
|
+
def to_s
|
|
203
|
+
to_hash.to_s
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
207
|
+
# @return [Hash] Returns the object in the form of hash
|
|
208
|
+
def to_body
|
|
209
|
+
to_hash
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
# Returns the object in the form of hash
|
|
213
|
+
# @return [Hash] Returns the object in the form of hash
|
|
214
|
+
def to_hash
|
|
215
|
+
hash = {}
|
|
216
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
217
|
+
value = self.send(attr)
|
|
218
|
+
if value.nil?
|
|
219
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
220
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
hash[param] = _to_hash(value)
|
|
224
|
+
end
|
|
225
|
+
hash
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# Outputs non-array value in the form of hash
|
|
229
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
230
|
+
# @param [Object] value Any valid value
|
|
231
|
+
# @return [Hash] Returns the value in the form of hash
|
|
232
|
+
def _to_hash(value)
|
|
233
|
+
if value.is_a?(Array)
|
|
234
|
+
value.compact.map { |v| _to_hash(v) }
|
|
235
|
+
elsif value.is_a?(Hash)
|
|
236
|
+
{}.tap do |hash|
|
|
237
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
238
|
+
end
|
|
239
|
+
elsif value.respond_to? :to_hash
|
|
240
|
+
value.to_hash
|
|
241
|
+
else
|
|
242
|
+
value
|
|
243
|
+
end
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
end
|
|
@@ -31,9 +31,15 @@ module Tremendous
|
|
|
31
31
|
# Copy over the security settings from the current organization to the new organization. Defaults to `true`.
|
|
32
32
|
attr_accessor :security_settings
|
|
33
33
|
|
|
34
|
-
# Copy over the users from the current organization to the new organization. Defaults to `false`.
|
|
34
|
+
# Copy over the users and custom roles from the current organization to the new organization. Defaults to `false`.
|
|
35
35
|
attr_accessor :users
|
|
36
36
|
|
|
37
|
+
# Copy over the custom roles from the current organization to the new organization. Custom roles are always copied if `users` is `true`. Defaults to `false`.
|
|
38
|
+
attr_accessor :custom_roles
|
|
39
|
+
|
|
40
|
+
# Copy over the fraud prevention settings and rules from the current organization to the new organization. Defaults to `false`.
|
|
41
|
+
attr_accessor :fraud_prevention
|
|
42
|
+
|
|
37
43
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
38
44
|
def self.attribute_map
|
|
39
45
|
{
|
|
@@ -42,7 +48,9 @@ module Tremendous
|
|
|
42
48
|
:'order_approvals' => :'order_approvals',
|
|
43
49
|
:'payment_methods' => :'payment_methods',
|
|
44
50
|
:'security_settings' => :'security_settings',
|
|
45
|
-
:'users' => :'users'
|
|
51
|
+
:'users' => :'users',
|
|
52
|
+
:'custom_roles' => :'custom_roles',
|
|
53
|
+
:'fraud_prevention' => :'fraud_prevention'
|
|
46
54
|
}
|
|
47
55
|
end
|
|
48
56
|
|
|
@@ -59,7 +67,9 @@ module Tremendous
|
|
|
59
67
|
:'order_approvals' => :'Boolean',
|
|
60
68
|
:'payment_methods' => :'Boolean',
|
|
61
69
|
:'security_settings' => :'Boolean',
|
|
62
|
-
:'users' => :'Boolean'
|
|
70
|
+
:'users' => :'Boolean',
|
|
71
|
+
:'custom_roles' => :'Boolean',
|
|
72
|
+
:'fraud_prevention' => :'Boolean'
|
|
63
73
|
}
|
|
64
74
|
end
|
|
65
75
|
|
|
@@ -119,6 +129,18 @@ module Tremendous
|
|
|
119
129
|
else
|
|
120
130
|
self.users = false
|
|
121
131
|
end
|
|
132
|
+
|
|
133
|
+
if attributes.key?(:'custom_roles')
|
|
134
|
+
self.custom_roles = attributes[:'custom_roles']
|
|
135
|
+
else
|
|
136
|
+
self.custom_roles = false
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
if attributes.key?(:'fraud_prevention')
|
|
140
|
+
self.fraud_prevention = attributes[:'fraud_prevention']
|
|
141
|
+
else
|
|
142
|
+
self.fraud_prevention = false
|
|
143
|
+
end
|
|
122
144
|
end
|
|
123
145
|
|
|
124
146
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -146,7 +168,9 @@ module Tremendous
|
|
|
146
168
|
order_approvals == o.order_approvals &&
|
|
147
169
|
payment_methods == o.payment_methods &&
|
|
148
170
|
security_settings == o.security_settings &&
|
|
149
|
-
users == o.users
|
|
171
|
+
users == o.users &&
|
|
172
|
+
custom_roles == o.custom_roles &&
|
|
173
|
+
fraud_prevention == o.fraud_prevention
|
|
150
174
|
end
|
|
151
175
|
|
|
152
176
|
# @see the `==` method
|
|
@@ -158,7 +182,7 @@ module Tremendous
|
|
|
158
182
|
# Calculates hash code according to all attributes.
|
|
159
183
|
# @return [Integer] Hash code
|
|
160
184
|
def hash
|
|
161
|
-
[campaigns, custom_fields, order_approvals, payment_methods, security_settings, users].hash
|
|
185
|
+
[campaigns, custom_fields, order_approvals, payment_methods, security_settings, users, custom_roles, fraud_prevention].hash
|
|
162
186
|
end
|
|
163
187
|
|
|
164
188
|
# Builds the object from hash
|
|
@@ -14,14 +14,14 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Tremendous
|
|
17
|
-
class
|
|
18
|
-
#
|
|
19
|
-
attr_accessor :
|
|
17
|
+
class CreatePublicKey
|
|
18
|
+
# Base64 encoded (public) PEM file
|
|
19
|
+
attr_accessor :public_key
|
|
20
20
|
|
|
21
21
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
22
22
|
def self.attribute_map
|
|
23
23
|
{
|
|
24
|
-
:'
|
|
24
|
+
:'public_key' => :'public_key'
|
|
25
25
|
}
|
|
26
26
|
end
|
|
27
27
|
|
|
@@ -33,7 +33,7 @@ module Tremendous
|
|
|
33
33
|
# Attribute type mapping.
|
|
34
34
|
def self.openapi_types
|
|
35
35
|
{
|
|
36
|
-
:'
|
|
36
|
+
:'public_key' => :'String'
|
|
37
37
|
}
|
|
38
38
|
end
|
|
39
39
|
|
|
@@ -47,21 +47,21 @@ module Tremendous
|
|
|
47
47
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
48
48
|
def initialize(attributes = {})
|
|
49
49
|
if (!attributes.is_a?(Hash))
|
|
50
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::
|
|
50
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::CreatePublicKey` initialize method"
|
|
51
51
|
end
|
|
52
52
|
|
|
53
53
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
54
54
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
55
55
|
if (!self.class.attribute_map.key?(k.to_sym))
|
|
56
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::
|
|
56
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::CreatePublicKey`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
57
57
|
end
|
|
58
58
|
h[k.to_sym] = v
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
if attributes.key?(:'
|
|
62
|
-
self.
|
|
61
|
+
if attributes.key?(:'public_key')
|
|
62
|
+
self.public_key = attributes[:'public_key']
|
|
63
63
|
else
|
|
64
|
-
self.
|
|
64
|
+
self.public_key = nil
|
|
65
65
|
end
|
|
66
66
|
end
|
|
67
67
|
|
|
@@ -70,8 +70,8 @@ module Tremendous
|
|
|
70
70
|
def list_invalid_properties
|
|
71
71
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
72
72
|
invalid_properties = Array.new
|
|
73
|
-
if @
|
|
74
|
-
invalid_properties.push('invalid value for "
|
|
73
|
+
if @public_key.nil?
|
|
74
|
+
invalid_properties.push('invalid value for "public_key", public_key cannot be nil.')
|
|
75
75
|
end
|
|
76
76
|
|
|
77
77
|
invalid_properties
|
|
@@ -81,7 +81,7 @@ module Tremendous
|
|
|
81
81
|
# @return true if the model is valid
|
|
82
82
|
def valid?
|
|
83
83
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
84
|
-
return false if @
|
|
84
|
+
return false if @public_key.nil?
|
|
85
85
|
true
|
|
86
86
|
end
|
|
87
87
|
|
|
@@ -90,7 +90,7 @@ module Tremendous
|
|
|
90
90
|
def ==(o)
|
|
91
91
|
return true if self.equal?(o)
|
|
92
92
|
self.class == o.class &&
|
|
93
|
-
|
|
93
|
+
public_key == o.public_key
|
|
94
94
|
end
|
|
95
95
|
|
|
96
96
|
# @see the `==` method
|
|
@@ -102,7 +102,7 @@ module Tremendous
|
|
|
102
102
|
# Calculates hash code according to all attributes.
|
|
103
103
|
# @return [Integer] Hash code
|
|
104
104
|
def hash
|
|
105
|
-
[
|
|
105
|
+
[public_key].hash
|
|
106
106
|
end
|
|
107
107
|
|
|
108
108
|
# Builds the object from hash
|