talon_one 1.1.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +21 -12
- data/docs/AccountAnalytics.md +1 -0
- data/docs/AccountLimits.md +1 -0
- data/docs/Application.md +2 -1
- data/docs/ApplicationCustomer.md +1 -1
- data/docs/ApplicationSession.md +2 -1
- data/docs/Attribute.md +0 -2
- data/docs/AttributesMandatory.md +9 -0
- data/docs/AttributesSettings.md +8 -0
- data/docs/BaseSamlConnection.md +15 -0
- data/docs/Campaign.md +2 -0
- data/docs/CampaignAnalytics.md +9 -3
- data/docs/CampaignCopy.md +4 -0
- data/docs/Change.md +2 -2
- data/docs/CustomerInventory.md +9 -0
- data/docs/CustomerProfile.md +1 -1
- data/docs/ErrorSource.md +1 -0
- data/docs/Event.md +1 -1
- data/docs/InlineResponse20020.md +1 -1
- data/docs/InlineResponse20021.md +1 -1
- data/docs/InlineResponse20022.md +1 -1
- data/docs/InlineResponse20023.md +1 -1
- data/docs/InlineResponse20024.md +1 -1
- data/docs/InlineResponse20025.md +1 -1
- data/docs/InlineResponse20026.md +3 -2
- data/docs/InlineResponse20027.md +1 -1
- data/docs/InlineResponse20028.md +1 -1
- data/docs/InlineResponse20029.md +9 -0
- data/docs/IntegrationApi.md +66 -0
- data/docs/IntegrationEvent.md +10 -0
- data/docs/IntegrationState.md +1 -0
- data/docs/ManagementApi.md +175 -104
- data/docs/Meta.md +1 -0
- data/docs/NewApplication.md +2 -1
- data/docs/NewEvent.md +1 -1
- data/docs/NewSamlConnection.md +16 -0
- data/docs/Notification.md +10 -0
- data/docs/{ApplicationStorageData.md → Notifications.md} +1 -1
- data/docs/ReferralRejectionReason.md +10 -0
- data/docs/SamlConnection.md +18 -0
- data/docs/SamlConnectionMetadata.md +11 -0
- data/docs/UpdateApplication.md +15 -0
- data/docs/UpdateUser.md +1 -0
- data/docs/User.md +2 -0
- data/docs/Webhook.md +0 -1
- data/lib/talon_one.rb +13 -6
- data/lib/talon_one/api/integration_api.rb +60 -0
- data/lib/talon_one/api/management_api.rb +194 -121
- data/lib/talon_one/models/account_analytics.rb +19 -4
- data/lib/talon_one/models/account_limits.rb +11 -1
- data/lib/talon_one/models/application.rb +62 -53
- data/lib/talon_one/models/application_customer.rb +0 -5
- data/lib/talon_one/models/application_session.rb +12 -2
- data/lib/talon_one/models/attribute.rb +4 -38
- data/lib/talon_one/models/attributes_mandatory.rb +199 -0
- data/lib/talon_one/models/{new_application_storage_data.rb → attributes_settings.rb} +13 -4
- data/lib/talon_one/models/{application_storage.rb → base_saml_connection.rb} +122 -78
- data/lib/talon_one/models/campaign.rb +21 -1
- data/lib/talon_one/models/campaign_analytics.rb +94 -4
- data/lib/talon_one/models/campaign_copy.rb +46 -4
- data/lib/talon_one/models/change.rb +2 -2
- data/lib/talon_one/models/coupon_rejection_reason.rb +2 -2
- data/lib/talon_one/models/customer_inventory.rb +194 -0
- data/lib/talon_one/models/customer_profile.rb +0 -5
- data/lib/talon_one/models/error_source.rb +14 -4
- data/lib/talon_one/models/event.rb +11 -35
- data/lib/talon_one/models/inline_response_200_20.rb +1 -1
- data/lib/talon_one/models/inline_response_200_21.rb +1 -1
- data/lib/talon_one/models/inline_response_200_22.rb +1 -1
- data/lib/talon_one/models/inline_response_200_23.rb +1 -1
- data/lib/talon_one/models/inline_response_200_24.rb +1 -1
- data/lib/talon_one/models/inline_response_200_25.rb +1 -1
- data/lib/talon_one/models/inline_response_200_26.rb +11 -7
- data/lib/talon_one/models/inline_response_200_27.rb +1 -1
- data/lib/talon_one/models/inline_response_200_28.rb +1 -1
- data/lib/talon_one/models/{new_application_storage_tuple.rb → inline_response_200_29.rb} +22 -40
- data/lib/talon_one/models/integration_event.rb +234 -0
- data/lib/talon_one/models/integration_state.rb +13 -4
- data/lib/talon_one/models/limit_config.rb +2 -2
- data/lib/talon_one/models/meta.rb +10 -1
- data/lib/talon_one/models/new_application.rb +57 -56
- data/lib/talon_one/models/new_event.rb +38 -38
- data/lib/talon_one/models/new_saml_connection.rb +371 -0
- data/lib/talon_one/models/{new_application_storage.rb → notification.rb} +22 -17
- data/lib/talon_one/models/{application_storage_data.rb → notifications.rb} +1 -2
- data/lib/talon_one/models/referral_rejection_reason.rb +251 -0
- data/lib/talon_one/models/saml_connection.rb +387 -0
- data/lib/talon_one/models/{application_storage_tuple.rb → saml_connection_metadata.rb} +68 -80
- data/lib/talon_one/models/update_application.rb +361 -0
- data/lib/talon_one/models/update_user.rb +13 -4
- data/lib/talon_one/models/user.rb +23 -4
- data/lib/talon_one/models/webhook.rb +4 -21
- data/lib/talon_one/version.rb +1 -1
- data/spec/api/integration_api_spec.rb +14 -0
- data/spec/api/management_api_spec.rb +56 -37
- data/spec/models/account_analytics_spec.rb +6 -0
- data/spec/models/account_limits_spec.rb +6 -0
- data/spec/models/application_session_spec.rb +6 -0
- data/spec/models/application_spec.rb +12 -6
- data/spec/models/attribute_spec.rb +0 -12
- data/spec/models/{new_application_storage_tuple_spec.rb → attributes_mandatory_spec.rb} +8 -8
- data/spec/models/{new_application_storage_data_spec.rb → attributes_settings_spec.rb} +12 -6
- data/spec/models/{application_storage_spec.rb → base_saml_connection_spec.rb} +14 -14
- data/spec/models/campaign_analytics_spec.rb +36 -0
- data/spec/models/campaign_copy_spec.rb +24 -0
- data/spec/models/campaign_spec.rb +12 -0
- data/spec/models/coupon_rejection_reason_spec.rb +1 -1
- data/spec/models/customer_inventory_spec.rb +47 -0
- data/spec/models/error_source_spec.rb +6 -0
- data/spec/models/event_spec.rb +3 -3
- data/spec/models/inline_response_200_26_spec.rb +6 -0
- data/spec/models/inline_response_200_29_spec.rb +47 -0
- data/spec/models/integration_event_spec.rb +53 -0
- data/spec/models/integration_state_spec.rb +6 -0
- data/spec/models/limit_config_spec.rb +1 -1
- data/spec/models/meta_spec.rb +6 -0
- data/spec/models/new_application_spec.rb +12 -6
- data/spec/models/new_event_spec.rb +3 -3
- data/spec/models/new_saml_connection_spec.rb +89 -0
- data/spec/models/{new_application_storage_spec.rb → notification_spec.rb} +8 -8
- data/spec/models/{application_storage_data_spec.rb → notifications_spec.rb} +6 -6
- data/spec/models/referral_rejection_reason_spec.rb +57 -0
- data/spec/models/{application_storage_tuple_spec.rb → saml_connection_metadata_spec.rb} +10 -22
- data/spec/models/saml_connection_spec.rb +101 -0
- data/spec/models/update_application_spec.rb +87 -0
- data/spec/models/update_user_spec.rb +6 -0
- data/spec/models/user_spec.rb +12 -0
- data/spec/models/webhook_spec.rb +0 -6
- data/talon_one-1.0.0.gem +0 -0
- data/talon_one-1.1.0.gem +0 -0
- data/talon_one-1.1.1.gem +0 -0
- data/talon_one-1.1.2.gem +0 -0
- data/talon_one-1.2.0.gem +0 -0
- data/talon_one-1.3.0.gem +0 -0
- data/talon_one.gemspec +1 -1
- metadata +74 -42
- data/docs/ApplicationStorage.md +0 -15
- data/docs/ApplicationStorageTuple.md +0 -13
- data/docs/NewApplicationStorage.md +0 -10
- data/docs/NewApplicationStorageData.md +0 -7
- data/docs/NewApplicationStorageTuple.md +0 -9
- data/fck.rb +0 -64
@@ -13,21 +13,21 @@ Swagger Codegen version: 2.4.7
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module TalonOne
|
16
|
-
class
|
17
|
-
#
|
18
|
-
attr_accessor :
|
16
|
+
class Notification
|
17
|
+
# id of the notification
|
18
|
+
attr_accessor :id
|
19
19
|
|
20
|
-
#
|
21
|
-
attr_accessor :
|
20
|
+
# name of the notification
|
21
|
+
attr_accessor :name
|
22
22
|
|
23
|
-
#
|
23
|
+
# description of the notification
|
24
24
|
attr_accessor :description
|
25
25
|
|
26
26
|
# Attribute mapping from ruby-style variable name to JSON key.
|
27
27
|
def self.attribute_map
|
28
28
|
{
|
29
|
+
:'id' => :'id',
|
29
30
|
:'name' => :'name',
|
30
|
-
:'datatype' => :'datatype',
|
31
31
|
:'description' => :'description'
|
32
32
|
}
|
33
33
|
end
|
@@ -35,8 +35,8 @@ module TalonOne
|
|
35
35
|
# Attribute type mapping.
|
36
36
|
def self.swagger_types
|
37
37
|
{
|
38
|
+
:'id' => :'Integer',
|
38
39
|
:'name' => :'String',
|
39
|
-
:'datatype' => :'Object',
|
40
40
|
:'description' => :'String'
|
41
41
|
}
|
42
42
|
end
|
@@ -49,12 +49,12 @@ module TalonOne
|
|
49
49
|
# convert string to symbol for hash key
|
50
50
|
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
51
51
|
|
52
|
-
if attributes.has_key?(:'
|
53
|
-
self.
|
52
|
+
if attributes.has_key?(:'id')
|
53
|
+
self.id = attributes[:'id']
|
54
54
|
end
|
55
55
|
|
56
|
-
if attributes.has_key?(:'
|
57
|
-
self.
|
56
|
+
if attributes.has_key?(:'name')
|
57
|
+
self.name = attributes[:'name']
|
58
58
|
end
|
59
59
|
|
60
60
|
if attributes.has_key?(:'description')
|
@@ -66,12 +66,16 @@ module TalonOne
|
|
66
66
|
# @return Array for valid properties with the reasons
|
67
67
|
def list_invalid_properties
|
68
68
|
invalid_properties = Array.new
|
69
|
+
if @id.nil?
|
70
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
71
|
+
end
|
72
|
+
|
69
73
|
if @name.nil?
|
70
74
|
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
71
75
|
end
|
72
76
|
|
73
|
-
if @
|
74
|
-
invalid_properties.push('invalid value for "
|
77
|
+
if @description.nil?
|
78
|
+
invalid_properties.push('invalid value for "description", description cannot be nil.')
|
75
79
|
end
|
76
80
|
|
77
81
|
invalid_properties
|
@@ -80,8 +84,9 @@ module TalonOne
|
|
80
84
|
# Check to see if the all the properties in the model are valid
|
81
85
|
# @return true if the model is valid
|
82
86
|
def valid?
|
87
|
+
return false if @id.nil?
|
83
88
|
return false if @name.nil?
|
84
|
-
return false if @
|
89
|
+
return false if @description.nil?
|
85
90
|
true
|
86
91
|
end
|
87
92
|
|
@@ -90,8 +95,8 @@ module TalonOne
|
|
90
95
|
def ==(o)
|
91
96
|
return true if self.equal?(o)
|
92
97
|
self.class == o.class &&
|
98
|
+
id == o.id &&
|
93
99
|
name == o.name &&
|
94
|
-
datatype == o.datatype &&
|
95
100
|
description == o.description
|
96
101
|
end
|
97
102
|
|
@@ -104,7 +109,7 @@ module TalonOne
|
|
104
109
|
# Calculates hash code according to all attributes.
|
105
110
|
# @return [Fixnum] Hash code
|
106
111
|
def hash
|
107
|
-
[
|
112
|
+
[id, name, description].hash
|
108
113
|
end
|
109
114
|
|
110
115
|
# Builds the object from hash
|
@@ -13,8 +13,7 @@ Swagger Codegen version: 2.4.7
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module TalonOne
|
16
|
-
|
17
|
-
class ApplicationStorageData
|
16
|
+
class Notifications
|
18
17
|
# Attribute mapping from ruby-style variable name to JSON key.
|
19
18
|
def self.attribute_map
|
20
19
|
{
|
@@ -0,0 +1,251 @@
|
|
1
|
+
=begin
|
2
|
+
#Talon.One API
|
3
|
+
|
4
|
+
#The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. ### Where is the API? The API is available at the same hostname as these docs. For example, if you are reading this page at `https://mycompany.talon.one/docs/api/`, the URL for the [updateCustomerProfile][] operation is `https://mycompany.talon.one/v1/customer_profiles/id` [updateCustomerProfile]: #operation--v1-customer_profiles--integrationId--put
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.7
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module TalonOne
|
16
|
+
# Holds a reference to the campaign, the referral and the reason for which that referral was rejected. Should only be present when there is a 'rejectReferral' effect.
|
17
|
+
class ReferralRejectionReason
|
18
|
+
attr_accessor :campaign_id
|
19
|
+
|
20
|
+
attr_accessor :referral_id
|
21
|
+
|
22
|
+
attr_accessor :reason
|
23
|
+
|
24
|
+
class EnumAttributeValidator
|
25
|
+
attr_reader :datatype
|
26
|
+
attr_reader :allowable_values
|
27
|
+
|
28
|
+
def initialize(datatype, allowable_values)
|
29
|
+
@allowable_values = allowable_values.map do |value|
|
30
|
+
case datatype.to_s
|
31
|
+
when /Integer/i
|
32
|
+
value.to_i
|
33
|
+
when /Float/i
|
34
|
+
value.to_f
|
35
|
+
else
|
36
|
+
value
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def valid?(value)
|
42
|
+
!value || allowable_values.include?(value)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
47
|
+
def self.attribute_map
|
48
|
+
{
|
49
|
+
:'campaign_id' => :'campaignId',
|
50
|
+
:'referral_id' => :'referralId',
|
51
|
+
:'reason' => :'reason'
|
52
|
+
}
|
53
|
+
end
|
54
|
+
|
55
|
+
# Attribute type mapping.
|
56
|
+
def self.swagger_types
|
57
|
+
{
|
58
|
+
:'campaign_id' => :'Integer',
|
59
|
+
:'referral_id' => :'Integer',
|
60
|
+
:'reason' => :'String'
|
61
|
+
}
|
62
|
+
end
|
63
|
+
|
64
|
+
# Initializes the object
|
65
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
66
|
+
def initialize(attributes = {})
|
67
|
+
return unless attributes.is_a?(Hash)
|
68
|
+
|
69
|
+
# convert string to symbol for hash key
|
70
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
71
|
+
|
72
|
+
if attributes.has_key?(:'campaignId')
|
73
|
+
self.campaign_id = attributes[:'campaignId']
|
74
|
+
end
|
75
|
+
|
76
|
+
if attributes.has_key?(:'referralId')
|
77
|
+
self.referral_id = attributes[:'referralId']
|
78
|
+
end
|
79
|
+
|
80
|
+
if attributes.has_key?(:'reason')
|
81
|
+
self.reason = attributes[:'reason']
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
86
|
+
# @return Array for valid properties with the reasons
|
87
|
+
def list_invalid_properties
|
88
|
+
invalid_properties = Array.new
|
89
|
+
if @campaign_id.nil?
|
90
|
+
invalid_properties.push('invalid value for "campaign_id", campaign_id cannot be nil.')
|
91
|
+
end
|
92
|
+
|
93
|
+
if @referral_id.nil?
|
94
|
+
invalid_properties.push('invalid value for "referral_id", referral_id cannot be nil.')
|
95
|
+
end
|
96
|
+
|
97
|
+
if @reason.nil?
|
98
|
+
invalid_properties.push('invalid value for "reason", reason cannot be nil.')
|
99
|
+
end
|
100
|
+
|
101
|
+
invalid_properties
|
102
|
+
end
|
103
|
+
|
104
|
+
# Check to see if the all the properties in the model are valid
|
105
|
+
# @return true if the model is valid
|
106
|
+
def valid?
|
107
|
+
return false if @campaign_id.nil?
|
108
|
+
return false if @referral_id.nil?
|
109
|
+
return false if @reason.nil?
|
110
|
+
reason_validator = EnumAttributeValidator.new('String', ['ReferralNotFound', 'ReferralRecipientIdSameAsAdvocate', 'ReferralPartOfNotRunningCampaign', 'ReferralValidConditionMissing', 'ReferralLimitReached', 'CampaignLimitReached', 'ProfileLimitReached', 'ReferralRecipientDoesNotMatch', 'ReferralExpired', 'ReferralStartDateInFuture', 'ReferralRejectedByCondition', 'EffectCouldNotBeApplied'])
|
111
|
+
return false unless reason_validator.valid?(@reason)
|
112
|
+
true
|
113
|
+
end
|
114
|
+
|
115
|
+
# Custom attribute writer method checking allowed values (enum).
|
116
|
+
# @param [Object] reason Object to be assigned
|
117
|
+
def reason=(reason)
|
118
|
+
validator = EnumAttributeValidator.new('String', ['ReferralNotFound', 'ReferralRecipientIdSameAsAdvocate', 'ReferralPartOfNotRunningCampaign', 'ReferralValidConditionMissing', 'ReferralLimitReached', 'CampaignLimitReached', 'ProfileLimitReached', 'ReferralRecipientDoesNotMatch', 'ReferralExpired', 'ReferralStartDateInFuture', 'ReferralRejectedByCondition', 'EffectCouldNotBeApplied'])
|
119
|
+
unless validator.valid?(reason)
|
120
|
+
fail ArgumentError, 'invalid value for "reason", must be one of #{validator.allowable_values}.'
|
121
|
+
end
|
122
|
+
@reason = reason
|
123
|
+
end
|
124
|
+
|
125
|
+
# Checks equality by comparing each attribute.
|
126
|
+
# @param [Object] Object to be compared
|
127
|
+
def ==(o)
|
128
|
+
return true if self.equal?(o)
|
129
|
+
self.class == o.class &&
|
130
|
+
campaign_id == o.campaign_id &&
|
131
|
+
referral_id == o.referral_id &&
|
132
|
+
reason == o.reason
|
133
|
+
end
|
134
|
+
|
135
|
+
# @see the `==` method
|
136
|
+
# @param [Object] Object to be compared
|
137
|
+
def eql?(o)
|
138
|
+
self == o
|
139
|
+
end
|
140
|
+
|
141
|
+
# Calculates hash code according to all attributes.
|
142
|
+
# @return [Fixnum] Hash code
|
143
|
+
def hash
|
144
|
+
[campaign_id, referral_id, reason].hash
|
145
|
+
end
|
146
|
+
|
147
|
+
# Builds the object from hash
|
148
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
149
|
+
# @return [Object] Returns the model itself
|
150
|
+
def build_from_hash(attributes)
|
151
|
+
return nil unless attributes.is_a?(Hash)
|
152
|
+
self.class.swagger_types.each_pair do |key, type|
|
153
|
+
if type =~ /\AArray<(.*)>/i
|
154
|
+
# check to ensure the input is an array given that the the attribute
|
155
|
+
# is documented as an array but the input is not
|
156
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
157
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
158
|
+
end
|
159
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
160
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
161
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
162
|
+
end
|
163
|
+
|
164
|
+
self
|
165
|
+
end
|
166
|
+
|
167
|
+
# Deserializes the data based on type
|
168
|
+
# @param string type Data type
|
169
|
+
# @param string value Value to be deserialized
|
170
|
+
# @return [Object] Deserialized data
|
171
|
+
def _deserialize(type, value)
|
172
|
+
case type.to_sym
|
173
|
+
when :DateTime
|
174
|
+
DateTime.parse(value)
|
175
|
+
when :Date
|
176
|
+
Date.parse(value)
|
177
|
+
when :String
|
178
|
+
value.to_s
|
179
|
+
when :Integer
|
180
|
+
value.to_i
|
181
|
+
when :Float
|
182
|
+
value.to_f
|
183
|
+
when :BOOLEAN
|
184
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
185
|
+
true
|
186
|
+
else
|
187
|
+
false
|
188
|
+
end
|
189
|
+
when :Object
|
190
|
+
# generic object (usually a Hash), return directly
|
191
|
+
value
|
192
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
193
|
+
inner_type = Regexp.last_match[:inner_type]
|
194
|
+
value.map { |v| _deserialize(inner_type, v) }
|
195
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
196
|
+
k_type = Regexp.last_match[:k_type]
|
197
|
+
v_type = Regexp.last_match[:v_type]
|
198
|
+
{}.tap do |hash|
|
199
|
+
value.each do |k, v|
|
200
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
201
|
+
end
|
202
|
+
end
|
203
|
+
else # model
|
204
|
+
temp_model = TalonOne.const_get(type).new
|
205
|
+
temp_model.build_from_hash(value)
|
206
|
+
end
|
207
|
+
end
|
208
|
+
|
209
|
+
# Returns the string representation of the object
|
210
|
+
# @return [String] String presentation of the object
|
211
|
+
def to_s
|
212
|
+
to_hash.to_s
|
213
|
+
end
|
214
|
+
|
215
|
+
# to_body is an alias to to_hash (backward compatibility)
|
216
|
+
# @return [Hash] Returns the object in the form of hash
|
217
|
+
def to_body
|
218
|
+
to_hash
|
219
|
+
end
|
220
|
+
|
221
|
+
# Returns the object in the form of hash
|
222
|
+
# @return [Hash] Returns the object in the form of hash
|
223
|
+
def to_hash
|
224
|
+
hash = {}
|
225
|
+
self.class.attribute_map.each_pair do |attr, param|
|
226
|
+
value = self.send(attr)
|
227
|
+
next if value.nil?
|
228
|
+
hash[param] = _to_hash(value)
|
229
|
+
end
|
230
|
+
hash
|
231
|
+
end
|
232
|
+
|
233
|
+
# Outputs non-array value in the form of hash
|
234
|
+
# For object, use to_hash. Otherwise, just return the value
|
235
|
+
# @param [Object] value Any valid value
|
236
|
+
# @return [Hash] Returns the value in the form of hash
|
237
|
+
def _to_hash(value)
|
238
|
+
if value.is_a?(Array)
|
239
|
+
value.compact.map { |v| _to_hash(v) }
|
240
|
+
elsif value.is_a?(Hash)
|
241
|
+
{}.tap do |hash|
|
242
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
243
|
+
end
|
244
|
+
elsif value.respond_to? :to_hash
|
245
|
+
value.to_hash
|
246
|
+
else
|
247
|
+
value
|
248
|
+
end
|
249
|
+
end
|
250
|
+
end
|
251
|
+
end
|
@@ -0,0 +1,387 @@
|
|
1
|
+
=begin
|
2
|
+
#Talon.One API
|
3
|
+
|
4
|
+
#The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. ### Where is the API? The API is available at the same hostname as these docs. For example, if you are reading this page at `https://mycompany.talon.one/docs/api/`, the URL for the [updateCustomerProfile][] operation is `https://mycompany.talon.one/v1/customer_profiles/id` [updateCustomerProfile]: #operation--v1-customer_profiles--integrationId--put
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.7
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module TalonOne
|
16
|
+
#
|
17
|
+
class SamlConnection
|
18
|
+
# The location where the SAML assertion is sent with a HTTP POST.
|
19
|
+
attr_accessor :assertion_consumer_service_url
|
20
|
+
|
21
|
+
# The ID of the account that owns this entity.
|
22
|
+
attr_accessor :account_id
|
23
|
+
|
24
|
+
# ID of the SAML service.
|
25
|
+
attr_accessor :name
|
26
|
+
|
27
|
+
# Determines if this SAML connection active.
|
28
|
+
attr_accessor :enabled
|
29
|
+
|
30
|
+
# Identity Provider Entity ID.
|
31
|
+
attr_accessor :issuer
|
32
|
+
|
33
|
+
# Single Sign-On URL.
|
34
|
+
attr_accessor :sign_on_url
|
35
|
+
|
36
|
+
# Single Sign-Out URL.
|
37
|
+
attr_accessor :sign_out_url
|
38
|
+
|
39
|
+
# Metadata URL.
|
40
|
+
attr_accessor :metadata_url
|
41
|
+
|
42
|
+
# The application-defined unique identifier that is the intended audience of the SAML assertion. This is most often the SP Entity ID of your application. When not specified, the ACS URL will be used.
|
43
|
+
attr_accessor :audience_uri
|
44
|
+
|
45
|
+
# Unique ID for this entity.
|
46
|
+
attr_accessor :id
|
47
|
+
|
48
|
+
# The exact moment this entity was created.
|
49
|
+
attr_accessor :created
|
50
|
+
|
51
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
52
|
+
def self.attribute_map
|
53
|
+
{
|
54
|
+
:'assertion_consumer_service_url' => :'assertionConsumerServiceURL',
|
55
|
+
:'account_id' => :'accountId',
|
56
|
+
:'name' => :'name',
|
57
|
+
:'enabled' => :'enabled',
|
58
|
+
:'issuer' => :'issuer',
|
59
|
+
:'sign_on_url' => :'signOnURL',
|
60
|
+
:'sign_out_url' => :'signOutURL',
|
61
|
+
:'metadata_url' => :'metadataURL',
|
62
|
+
:'audience_uri' => :'audienceURI',
|
63
|
+
:'id' => :'id',
|
64
|
+
:'created' => :'created'
|
65
|
+
}
|
66
|
+
end
|
67
|
+
|
68
|
+
# Attribute type mapping.
|
69
|
+
def self.swagger_types
|
70
|
+
{
|
71
|
+
:'assertion_consumer_service_url' => :'String',
|
72
|
+
:'account_id' => :'Integer',
|
73
|
+
:'name' => :'String',
|
74
|
+
:'enabled' => :'BOOLEAN',
|
75
|
+
:'issuer' => :'String',
|
76
|
+
:'sign_on_url' => :'String',
|
77
|
+
:'sign_out_url' => :'String',
|
78
|
+
:'metadata_url' => :'String',
|
79
|
+
:'audience_uri' => :'String',
|
80
|
+
:'id' => :'Integer',
|
81
|
+
:'created' => :'DateTime'
|
82
|
+
}
|
83
|
+
end
|
84
|
+
|
85
|
+
# Initializes the object
|
86
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
87
|
+
def initialize(attributes = {})
|
88
|
+
return unless attributes.is_a?(Hash)
|
89
|
+
|
90
|
+
# convert string to symbol for hash key
|
91
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
92
|
+
|
93
|
+
if attributes.has_key?(:'assertionConsumerServiceURL')
|
94
|
+
self.assertion_consumer_service_url = attributes[:'assertionConsumerServiceURL']
|
95
|
+
end
|
96
|
+
|
97
|
+
if attributes.has_key?(:'accountId')
|
98
|
+
self.account_id = attributes[:'accountId']
|
99
|
+
end
|
100
|
+
|
101
|
+
if attributes.has_key?(:'name')
|
102
|
+
self.name = attributes[:'name']
|
103
|
+
end
|
104
|
+
|
105
|
+
if attributes.has_key?(:'enabled')
|
106
|
+
self.enabled = attributes[:'enabled']
|
107
|
+
end
|
108
|
+
|
109
|
+
if attributes.has_key?(:'issuer')
|
110
|
+
self.issuer = attributes[:'issuer']
|
111
|
+
end
|
112
|
+
|
113
|
+
if attributes.has_key?(:'signOnURL')
|
114
|
+
self.sign_on_url = attributes[:'signOnURL']
|
115
|
+
end
|
116
|
+
|
117
|
+
if attributes.has_key?(:'signOutURL')
|
118
|
+
self.sign_out_url = attributes[:'signOutURL']
|
119
|
+
end
|
120
|
+
|
121
|
+
if attributes.has_key?(:'metadataURL')
|
122
|
+
self.metadata_url = attributes[:'metadataURL']
|
123
|
+
end
|
124
|
+
|
125
|
+
if attributes.has_key?(:'audienceURI')
|
126
|
+
self.audience_uri = attributes[:'audienceURI']
|
127
|
+
end
|
128
|
+
|
129
|
+
if attributes.has_key?(:'id')
|
130
|
+
self.id = attributes[:'id']
|
131
|
+
end
|
132
|
+
|
133
|
+
if attributes.has_key?(:'created')
|
134
|
+
self.created = attributes[:'created']
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
139
|
+
# @return Array for valid properties with the reasons
|
140
|
+
def list_invalid_properties
|
141
|
+
invalid_properties = Array.new
|
142
|
+
if @assertion_consumer_service_url.nil?
|
143
|
+
invalid_properties.push('invalid value for "assertion_consumer_service_url", assertion_consumer_service_url cannot be nil.')
|
144
|
+
end
|
145
|
+
|
146
|
+
if @account_id.nil?
|
147
|
+
invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
|
148
|
+
end
|
149
|
+
|
150
|
+
if @name.nil?
|
151
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
152
|
+
end
|
153
|
+
|
154
|
+
if @name.to_s.length < 1
|
155
|
+
invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
|
156
|
+
end
|
157
|
+
|
158
|
+
if @enabled.nil?
|
159
|
+
invalid_properties.push('invalid value for "enabled", enabled cannot be nil.')
|
160
|
+
end
|
161
|
+
|
162
|
+
if @issuer.nil?
|
163
|
+
invalid_properties.push('invalid value for "issuer", issuer cannot be nil.')
|
164
|
+
end
|
165
|
+
|
166
|
+
if @issuer.to_s.length < 1
|
167
|
+
invalid_properties.push('invalid value for "issuer", the character length must be great than or equal to 1.')
|
168
|
+
end
|
169
|
+
|
170
|
+
if @sign_on_url.nil?
|
171
|
+
invalid_properties.push('invalid value for "sign_on_url", sign_on_url cannot be nil.')
|
172
|
+
end
|
173
|
+
|
174
|
+
if @sign_on_url.to_s.length < 1
|
175
|
+
invalid_properties.push('invalid value for "sign_on_url", the character length must be great than or equal to 1.')
|
176
|
+
end
|
177
|
+
|
178
|
+
if @audience_uri.nil?
|
179
|
+
invalid_properties.push('invalid value for "audience_uri", audience_uri cannot be nil.')
|
180
|
+
end
|
181
|
+
|
182
|
+
if @id.nil?
|
183
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
184
|
+
end
|
185
|
+
|
186
|
+
if @created.nil?
|
187
|
+
invalid_properties.push('invalid value for "created", created cannot be nil.')
|
188
|
+
end
|
189
|
+
|
190
|
+
invalid_properties
|
191
|
+
end
|
192
|
+
|
193
|
+
# Check to see if the all the properties in the model are valid
|
194
|
+
# @return true if the model is valid
|
195
|
+
def valid?
|
196
|
+
return false if @assertion_consumer_service_url.nil?
|
197
|
+
return false if @account_id.nil?
|
198
|
+
return false if @name.nil?
|
199
|
+
return false if @name.to_s.length < 1
|
200
|
+
return false if @enabled.nil?
|
201
|
+
return false if @issuer.nil?
|
202
|
+
return false if @issuer.to_s.length < 1
|
203
|
+
return false if @sign_on_url.nil?
|
204
|
+
return false if @sign_on_url.to_s.length < 1
|
205
|
+
return false if @audience_uri.nil?
|
206
|
+
return false if @id.nil?
|
207
|
+
return false if @created.nil?
|
208
|
+
true
|
209
|
+
end
|
210
|
+
|
211
|
+
# Custom attribute writer method with validation
|
212
|
+
# @param [Object] name Value to be assigned
|
213
|
+
def name=(name)
|
214
|
+
if name.nil?
|
215
|
+
fail ArgumentError, 'name cannot be nil'
|
216
|
+
end
|
217
|
+
|
218
|
+
if name.to_s.length < 1
|
219
|
+
fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
|
220
|
+
end
|
221
|
+
|
222
|
+
@name = name
|
223
|
+
end
|
224
|
+
|
225
|
+
# Custom attribute writer method with validation
|
226
|
+
# @param [Object] issuer Value to be assigned
|
227
|
+
def issuer=(issuer)
|
228
|
+
if issuer.nil?
|
229
|
+
fail ArgumentError, 'issuer cannot be nil'
|
230
|
+
end
|
231
|
+
|
232
|
+
if issuer.to_s.length < 1
|
233
|
+
fail ArgumentError, 'invalid value for "issuer", the character length must be great than or equal to 1.'
|
234
|
+
end
|
235
|
+
|
236
|
+
@issuer = issuer
|
237
|
+
end
|
238
|
+
|
239
|
+
# Custom attribute writer method with validation
|
240
|
+
# @param [Object] sign_on_url Value to be assigned
|
241
|
+
def sign_on_url=(sign_on_url)
|
242
|
+
if sign_on_url.nil?
|
243
|
+
fail ArgumentError, 'sign_on_url cannot be nil'
|
244
|
+
end
|
245
|
+
|
246
|
+
if sign_on_url.to_s.length < 1
|
247
|
+
fail ArgumentError, 'invalid value for "sign_on_url", the character length must be great than or equal to 1.'
|
248
|
+
end
|
249
|
+
|
250
|
+
@sign_on_url = sign_on_url
|
251
|
+
end
|
252
|
+
|
253
|
+
# Checks equality by comparing each attribute.
|
254
|
+
# @param [Object] Object to be compared
|
255
|
+
def ==(o)
|
256
|
+
return true if self.equal?(o)
|
257
|
+
self.class == o.class &&
|
258
|
+
assertion_consumer_service_url == o.assertion_consumer_service_url &&
|
259
|
+
account_id == o.account_id &&
|
260
|
+
name == o.name &&
|
261
|
+
enabled == o.enabled &&
|
262
|
+
issuer == o.issuer &&
|
263
|
+
sign_on_url == o.sign_on_url &&
|
264
|
+
sign_out_url == o.sign_out_url &&
|
265
|
+
metadata_url == o.metadata_url &&
|
266
|
+
audience_uri == o.audience_uri &&
|
267
|
+
id == o.id &&
|
268
|
+
created == o.created
|
269
|
+
end
|
270
|
+
|
271
|
+
# @see the `==` method
|
272
|
+
# @param [Object] Object to be compared
|
273
|
+
def eql?(o)
|
274
|
+
self == o
|
275
|
+
end
|
276
|
+
|
277
|
+
# Calculates hash code according to all attributes.
|
278
|
+
# @return [Fixnum] Hash code
|
279
|
+
def hash
|
280
|
+
[assertion_consumer_service_url, account_id, name, enabled, issuer, sign_on_url, sign_out_url, metadata_url, audience_uri, id, created].hash
|
281
|
+
end
|
282
|
+
|
283
|
+
# Builds the object from hash
|
284
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
285
|
+
# @return [Object] Returns the model itself
|
286
|
+
def build_from_hash(attributes)
|
287
|
+
return nil unless attributes.is_a?(Hash)
|
288
|
+
self.class.swagger_types.each_pair do |key, type|
|
289
|
+
if type =~ /\AArray<(.*)>/i
|
290
|
+
# check to ensure the input is an array given that the the attribute
|
291
|
+
# is documented as an array but the input is not
|
292
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
293
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
294
|
+
end
|
295
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
296
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
297
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
298
|
+
end
|
299
|
+
|
300
|
+
self
|
301
|
+
end
|
302
|
+
|
303
|
+
# Deserializes the data based on type
|
304
|
+
# @param string type Data type
|
305
|
+
# @param string value Value to be deserialized
|
306
|
+
# @return [Object] Deserialized data
|
307
|
+
def _deserialize(type, value)
|
308
|
+
case type.to_sym
|
309
|
+
when :DateTime
|
310
|
+
DateTime.parse(value)
|
311
|
+
when :Date
|
312
|
+
Date.parse(value)
|
313
|
+
when :String
|
314
|
+
value.to_s
|
315
|
+
when :Integer
|
316
|
+
value.to_i
|
317
|
+
when :Float
|
318
|
+
value.to_f
|
319
|
+
when :BOOLEAN
|
320
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
321
|
+
true
|
322
|
+
else
|
323
|
+
false
|
324
|
+
end
|
325
|
+
when :Object
|
326
|
+
# generic object (usually a Hash), return directly
|
327
|
+
value
|
328
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
329
|
+
inner_type = Regexp.last_match[:inner_type]
|
330
|
+
value.map { |v| _deserialize(inner_type, v) }
|
331
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
332
|
+
k_type = Regexp.last_match[:k_type]
|
333
|
+
v_type = Regexp.last_match[:v_type]
|
334
|
+
{}.tap do |hash|
|
335
|
+
value.each do |k, v|
|
336
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
337
|
+
end
|
338
|
+
end
|
339
|
+
else # model
|
340
|
+
temp_model = TalonOne.const_get(type).new
|
341
|
+
temp_model.build_from_hash(value)
|
342
|
+
end
|
343
|
+
end
|
344
|
+
|
345
|
+
# Returns the string representation of the object
|
346
|
+
# @return [String] String presentation of the object
|
347
|
+
def to_s
|
348
|
+
to_hash.to_s
|
349
|
+
end
|
350
|
+
|
351
|
+
# to_body is an alias to to_hash (backward compatibility)
|
352
|
+
# @return [Hash] Returns the object in the form of hash
|
353
|
+
def to_body
|
354
|
+
to_hash
|
355
|
+
end
|
356
|
+
|
357
|
+
# Returns the object in the form of hash
|
358
|
+
# @return [Hash] Returns the object in the form of hash
|
359
|
+
def to_hash
|
360
|
+
hash = {}
|
361
|
+
self.class.attribute_map.each_pair do |attr, param|
|
362
|
+
value = self.send(attr)
|
363
|
+
next if value.nil?
|
364
|
+
hash[param] = _to_hash(value)
|
365
|
+
end
|
366
|
+
hash
|
367
|
+
end
|
368
|
+
|
369
|
+
# Outputs non-array value in the form of hash
|
370
|
+
# For object, use to_hash. Otherwise, just return the value
|
371
|
+
# @param [Object] value Any valid value
|
372
|
+
# @return [Hash] Returns the value in the form of hash
|
373
|
+
def _to_hash(value)
|
374
|
+
if value.is_a?(Array)
|
375
|
+
value.compact.map { |v| _to_hash(v) }
|
376
|
+
elsif value.is_a?(Hash)
|
377
|
+
{}.tap do |hash|
|
378
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
379
|
+
end
|
380
|
+
elsif value.respond_to? :to_hash
|
381
|
+
value.to_hash
|
382
|
+
else
|
383
|
+
value
|
384
|
+
end
|
385
|
+
end
|
386
|
+
end
|
387
|
+
end
|