talon_one 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 372b274ea65bd20f35d6987041e92a5ab0880886
4
- data.tar.gz: 5329015e322dc04b11f8948ff10cf3605cfd14f9
3
+ metadata.gz: 15fffb96da51fa185c0e2a56d384a9c78373bbf8
4
+ data.tar.gz: 151a716d442978d6a94d0b1d987bd195c77091b0
5
5
  SHA512:
6
- metadata.gz: 47f48bf1f3f7ac4d7e0e6e7f6647d5ef4b8dd03c44f61b3b61f78ac07ba11d1544f94800ffabca815b4e69b95eb57470cc95c5609c97bdb8873a94132f276fad
7
- data.tar.gz: de467540b105b2447f6bd10486431ed15fe3c85b2ed22953483950d59a2291093355cd461a4e211f17ee6e6b3a084879496a86e18c36ce85079e9cd347dcd7c0
6
+ metadata.gz: 8e4370ebf69b3d129f28bb0214168d0494e283af934e4c379a3ce3af34fba79ae2958ae26bd55eaa0d4a707565c420f997088281ac7a0de698e6e46a920e03fa
7
+ data.tar.gz: 9faef93333b717d5bba8544a0073b479a39f75e3a472ea9884fbd68632f5a33dfe29a9c9452633a32878961605b58c728c7570fb81e1d3be8ba6bdfc5eaa9e64
data/README.md CHANGED
@@ -7,7 +7,7 @@ The Talon.One API is used to manage applications and campaigns, as well as to in
7
7
  This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
8
8
 
9
9
  - API version: 1.0.0
10
- - Package version: 1.1.0
10
+ - Package version: 1.1.1
11
11
  - Build package: io.swagger.codegen.languages.RubyClientCodegen
12
12
 
13
13
  ## Installation
@@ -23,15 +23,15 @@ gem build talon_one.gemspec
23
23
  Then either install the gem locally:
24
24
 
25
25
  ```shell
26
- gem install ./talon_one-1.1.0.gem
26
+ gem install ./talon_one-1.1.1.gem
27
27
  ```
28
- (for development, run `gem install --dev ./talon_one-1.1.0.gem` to install the development dependencies)
28
+ (for development, run `gem install --dev ./talon_one-1.1.1.gem` to install the development dependencies)
29
29
 
30
30
  or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
31
31
 
32
32
  Finally add this to the Gemfile:
33
33
 
34
- gem 'talon_one', '~> 1.1.0'
34
+ gem 'talon_one', '~> 1.1.1'
35
35
 
36
36
  ### Install from Git
37
37
 
@@ -243,9 +243,6 @@ Class | Method | HTTP request | Description
243
243
  - [TalonOne::ApplicationEvent](docs/ApplicationEvent.md)
244
244
  - [TalonOne::ApplicationSession](docs/ApplicationSession.md)
245
245
  - [TalonOne::ApplicationSessionEntity](docs/ApplicationSessionEntity.md)
246
- - [TalonOne::ApplicationStorage](docs/ApplicationStorage.md)
247
- - [TalonOne::ApplicationStorageData](docs/ApplicationStorageData.md)
248
- - [TalonOne::ApplicationStorageTuple](docs/ApplicationStorageTuple.md)
249
246
  - [TalonOne::Attribute](docs/Attribute.md)
250
247
  - [TalonOne::AttributeQuery](docs/AttributeQuery.md)
251
248
  - [TalonOne::Binding](docs/Binding.md)
@@ -343,9 +340,6 @@ Class | Method | HTTP request | Description
343
340
  - [TalonOne::NewAccountSignUp](docs/NewAccountSignUp.md)
344
341
  - [TalonOne::NewApplication](docs/NewApplication.md)
345
342
  - [TalonOne::NewApplicationAPIKey](docs/NewApplicationAPIKey.md)
346
- - [TalonOne::NewApplicationStorage](docs/NewApplicationStorage.md)
347
- - [TalonOne::NewApplicationStorageData](docs/NewApplicationStorageData.md)
348
- - [TalonOne::NewApplicationStorageTuple](docs/NewApplicationStorageTuple.md)
349
343
  - [TalonOne::NewAttribute](docs/NewAttribute.md)
350
344
  - [TalonOne::NewCampaign](docs/NewCampaign.md)
351
345
  - [TalonOne::NewCampaignSet](docs/NewCampaignSet.md)
@@ -10,7 +10,7 @@ Name | Type | Description | Notes
10
10
  **account_id** | **Integer** | The ID of the Talon.One account that owns this profile. The ID of the Talon.One account that owns this profile. |
11
11
  **closed_sessions** | **Integer** | The total amount of closed sessions by a customer. A closed session is a successful purchase. |
12
12
  **total_sales** | **Float** | Sum of all purchases made by this customer |
13
- **loyalty_memberships** | [**Array<LoyaltyMembership>**](LoyaltyMembership.md) | A list of loyalty programs joined by the customer |
13
+ **loyalty_memberships** | [**Array<LoyaltyMembership>**](LoyaltyMembership.md) | A list of loyalty programs joined by the customer | [optional]
14
14
  **last_activity** | **DateTime** | Timestamp of the most recent event received from this customer |
15
15
 
16
16
 
@@ -9,7 +9,7 @@ Name | Type | Description | Notes
9
9
  **account_id** | **Integer** | The ID of the Talon.One account that owns this profile. |
10
10
  **closed_sessions** | **Integer** | The total amount of closed sessions by a customer. A closed session is a successful purchase. |
11
11
  **total_sales** | **Float** | Sum of all purchases made by this customer |
12
- **loyalty_memberships** | [**Array<LoyaltyMembership>**](LoyaltyMembership.md) | A list of loyalty programs joined by the customer |
12
+ **loyalty_memberships** | [**Array<LoyaltyMembership>**](LoyaltyMembership.md) | A list of loyalty programs joined by the customer | [optional]
13
13
  **last_activity** | **DateTime** | Timestamp of the most recent event received from this customer |
14
14
 
15
15
 
@@ -2055,7 +2055,7 @@ end
2055
2055
 
2056
2056
  api_instance = TalonOne::ManagementApi.new
2057
2057
 
2058
- application_id = 56 # Integer | The identifier for the application
2058
+ application_id = 56 # Integer |
2059
2059
 
2060
2060
  campaign_id = 56 # Integer |
2061
2061
 
@@ -2080,7 +2080,7 @@ end
2080
2080
 
2081
2081
  Name | Type | Description | Notes
2082
2082
  ------------- | ------------- | ------------- | -------------
2083
- **application_id** | **Integer**| The identifier for the application |
2083
+ **application_id** | **Integer**| |
2084
2084
  **campaign_id** | **Integer**| |
2085
2085
  **range_start** | **DateTime**| Only return results from after this timestamp, must be an RFC3339 timestamp string |
2086
2086
  **range_end** | **DateTime**| Only return results from before this timestamp, must be an RFC3339 timestamp string |
@@ -4712,7 +4712,7 @@ Name | Type | Description | Notes
4712
4712
 
4713
4713
  Set account limits
4714
4714
 
4715
- sets account limits
4715
+ sets account limits
4716
4716
 
4717
4717
  ### Example
4718
4718
  ```ruby
@@ -33,9 +33,6 @@ require 'talon_one/models/application_entity'
33
33
  require 'talon_one/models/application_event'
34
34
  require 'talon_one/models/application_session'
35
35
  require 'talon_one/models/application_session_entity'
36
- require 'talon_one/models/application_storage'
37
- require 'talon_one/models/application_storage_data'
38
- require 'talon_one/models/application_storage_tuple'
39
36
  require 'talon_one/models/attribute'
40
37
  require 'talon_one/models/attribute_query'
41
38
  require 'talon_one/models/binding'
@@ -133,9 +130,6 @@ require 'talon_one/models/new_account'
133
130
  require 'talon_one/models/new_account_sign_up'
134
131
  require 'talon_one/models/new_application'
135
132
  require 'talon_one/models/new_application_api_key'
136
- require 'talon_one/models/new_application_storage'
137
- require 'talon_one/models/new_application_storage_data'
138
- require 'talon_one/models/new_application_storage_tuple'
139
133
  require 'talon_one/models/new_attribute'
140
134
  require 'talon_one/models/new_campaign'
141
135
  require 'talon_one/models/new_campaign_set'
@@ -2144,7 +2144,7 @@ module TalonOne
2144
2144
  end
2145
2145
  # Get analytics of campaigns
2146
2146
  #
2147
- # @param application_id The identifier for the application
2147
+ # @param application_id
2148
2148
  # @param campaign_id
2149
2149
  # @param range_start Only return results from after this timestamp, must be an RFC3339 timestamp string
2150
2150
  # @param range_end Only return results from before this timestamp, must be an RFC3339 timestamp string
@@ -2158,7 +2158,7 @@ module TalonOne
2158
2158
 
2159
2159
  # Get analytics of campaigns
2160
2160
  #
2161
- # @param application_id The identifier for the application
2161
+ # @param application_id
2162
2162
  # @param campaign_id
2163
2163
  # @param range_start Only return results from after this timestamp, must be an RFC3339 timestamp string
2164
2164
  # @param range_end Only return results from before this timestamp, must be an RFC3339 timestamp string
@@ -5123,7 +5123,7 @@ module TalonOne
5123
5123
  return data, status_code, headers
5124
5124
  end
5125
5125
  # Set account limits
5126
- # sets account limits
5126
+ # sets account limits
5127
5127
  # @param account_id
5128
5128
  # @param body
5129
5129
  # @param [Hash] opts the optional parameters
@@ -5134,7 +5134,7 @@ module TalonOne
5134
5134
  end
5135
5135
 
5136
5136
  # Set account limits
5137
- # sets account limits
5137
+ # sets account limits
5138
5138
  # @param account_id
5139
5139
  # @param body
5140
5140
  # @param [Hash] opts the optional parameters
@@ -151,10 +151,6 @@ module TalonOne
151
151
  invalid_properties.push('invalid value for "total_sales", total_sales cannot be nil.')
152
152
  end
153
153
 
154
- if @loyalty_memberships.nil?
155
- invalid_properties.push('invalid value for "loyalty_memberships", loyalty_memberships cannot be nil.')
156
- end
157
-
158
154
  if @last_activity.nil?
159
155
  invalid_properties.push('invalid value for "last_activity", last_activity cannot be nil.')
160
156
  end
@@ -172,7 +168,6 @@ module TalonOne
172
168
  return false if @account_id.nil?
173
169
  return false if @closed_sessions.nil?
174
170
  return false if @total_sales.nil?
175
- return false if @loyalty_memberships.nil?
176
171
  return false if @last_activity.nil?
177
172
  true
178
173
  end
@@ -138,10 +138,6 @@ module TalonOne
138
138
  invalid_properties.push('invalid value for "total_sales", total_sales cannot be nil.')
139
139
  end
140
140
 
141
- if @loyalty_memberships.nil?
142
- invalid_properties.push('invalid value for "loyalty_memberships", loyalty_memberships cannot be nil.')
143
- end
144
-
145
141
  if @last_activity.nil?
146
142
  invalid_properties.push('invalid value for "last_activity", last_activity cannot be nil.')
147
143
  end
@@ -158,7 +154,6 @@ module TalonOne
158
154
  return false if @account_id.nil?
159
155
  return false if @closed_sessions.nil?
160
156
  return false if @total_sales.nil?
161
- return false if @loyalty_memberships.nil?
162
157
  return false if @last_activity.nil?
163
158
  true
164
159
  end
@@ -11,5 +11,5 @@ Swagger Codegen version: 2.4.7
11
11
  =end
12
12
 
13
13
  module TalonOne
14
- VERSION = '1.1.0'
14
+ VERSION = '1.1.1'
15
15
  end
@@ -513,7 +513,7 @@ describe 'ManagementApi' do
513
513
  # unit tests for get_campaign_analytics
514
514
  # Get analytics of campaigns
515
515
  #
516
- # @param application_id The identifier for the application
516
+ # @param application_id
517
517
  # @param campaign_id
518
518
  # @param range_start Only return results from after this timestamp, must be an RFC3339 timestamp string
519
519
  # @param range_end Only return results from before this timestamp, must be an RFC3339 timestamp string
@@ -1214,7 +1214,7 @@ describe 'ManagementApi' do
1214
1214
 
1215
1215
  # unit tests for set_account_limits
1216
1216
  # Set account limits
1217
- # sets account limits
1217
+ # sets account limits
1218
1218
  # @param account_id
1219
1219
  # @param body
1220
1220
  # @param [Hash] opts the optional parameters
Binary file
Binary file
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.version = TalonOne::VERSION
21
21
  s.platform = Gem::Platform::RUBY
22
22
  s.authors = ["Talon.One GmbH"]
23
- s.email = ["support@talon.one"]
23
+ s.email = ["devs@talon.one"]
24
24
  s.homepage = "https://github.com/talon-one/talon_one.rb/"
25
25
  s.summary = "Talon.One API Ruby Gem"
26
26
  s.description = "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."
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: talon_one
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Talon.One GmbH
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-29 00:00:00.000000000 Z
11
+ date: 2019-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -195,7 +195,7 @@ description: The Talon.One API is used to manage applications and campaigns, as
195
195
  are used to integrate with our platform, while the other operations are used to
196
196
  manage applications and campaigns.
197
197
  email:
198
- - support@talon.one
198
+ - devs@talon.one
199
199
  executables: []
200
200
  extensions: []
201
201
  extra_rdoc_files: []
@@ -368,7 +368,6 @@ files:
368
368
  - docs/Webhook.md
369
369
  - docs/WebhookActivationLogEntry.md
370
370
  - docs/WebhookLogEntry.md
371
- - fck.rb
372
371
  - git_push.sh
373
372
  - lib/talon_one.rb
374
373
  - lib/talon_one/api/integration_api.rb
@@ -392,9 +391,6 @@ files:
392
391
  - lib/talon_one/models/application_event.rb
393
392
  - lib/talon_one/models/application_session.rb
394
393
  - lib/talon_one/models/application_session_entity.rb
395
- - lib/talon_one/models/application_storage.rb
396
- - lib/talon_one/models/application_storage_data.rb
397
- - lib/talon_one/models/application_storage_tuple.rb
398
394
  - lib/talon_one/models/attribute.rb
399
395
  - lib/talon_one/models/attribute_query.rb
400
396
  - lib/talon_one/models/binding.rb
@@ -492,9 +488,6 @@ files:
492
488
  - lib/talon_one/models/new_account_sign_up.rb
493
489
  - lib/talon_one/models/new_application.rb
494
490
  - lib/talon_one/models/new_application_api_key.rb
495
- - lib/talon_one/models/new_application_storage.rb
496
- - lib/talon_one/models/new_application_storage_data.rb
497
- - lib/talon_one/models/new_application_storage_tuple.rb
498
491
  - lib/talon_one/models/new_attribute.rb
499
492
  - lib/talon_one/models/new_campaign.rb
500
493
  - lib/talon_one/models/new_campaign_set.rb
@@ -559,9 +552,6 @@ files:
559
552
  - spec/models/application_session_entity_spec.rb
560
553
  - spec/models/application_session_spec.rb
561
554
  - spec/models/application_spec.rb
562
- - spec/models/application_storage_data_spec.rb
563
- - spec/models/application_storage_spec.rb
564
- - spec/models/application_storage_tuple_spec.rb
565
555
  - spec/models/attribute_query_spec.rb
566
556
  - spec/models/attribute_spec.rb
567
557
  - spec/models/binding_spec.rb
@@ -659,9 +649,6 @@ files:
659
649
  - spec/models/new_account_spec.rb
660
650
  - spec/models/new_application_api_key_spec.rb
661
651
  - spec/models/new_application_spec.rb
662
- - spec/models/new_application_storage_data_spec.rb
663
- - spec/models/new_application_storage_spec.rb
664
- - spec/models/new_application_storage_tuple_spec.rb
665
652
  - spec/models/new_attribute_spec.rb
666
653
  - spec/models/new_campaign_set_spec.rb
667
654
  - spec/models/new_campaign_spec.rb
@@ -706,6 +693,8 @@ files:
706
693
  - spec/models/webhook_log_entry_spec.rb
707
694
  - spec/models/webhook_spec.rb
708
695
  - spec/spec_helper.rb
696
+ - talon_one-1.0.0.gem
697
+ - talon_one-1.1.0.gem
709
698
  - talon_one.gemspec
710
699
  homepage: https://github.com/talon-one/talon_one.rb/
711
700
  licenses:
@@ -760,7 +749,6 @@ test_files:
760
749
  - spec/models/coupon_rejection_reason_spec.rb
761
750
  - spec/models/application_session_entity_spec.rb
762
751
  - spec/models/loyalty_membership_spec.rb
763
- - spec/models/application_storage_tuple_spec.rb
764
752
  - spec/models/features_feed_spec.rb
765
753
  - spec/models/error_response_spec.rb
766
754
  - spec/models/account_limits_spec.rb
@@ -804,7 +792,6 @@ test_files:
804
792
  - spec/models/new_event_type_spec.rb
805
793
  - spec/models/update_campaign_spec.rb
806
794
  - spec/models/inline_response_200_25_spec.rb
807
- - spec/models/application_storage_spec.rb
808
795
  - spec/models/campaign_set_leaf_node_spec.rb
809
796
  - spec/models/export_spec.rb
810
797
  - spec/models/manager_config_spec.rb
@@ -821,7 +808,6 @@ test_files:
821
808
  - spec/models/inline_response_200_9_spec.rb
822
809
  - spec/models/application_event_spec.rb
823
810
  - spec/models/feature_flag_spec.rb
824
- - spec/models/application_storage_data_spec.rb
825
811
  - spec/models/loyalty_program_ledgers_spec.rb
826
812
  - spec/models/campaign_entity_spec.rb
827
813
  - spec/models/cart_item_adjustment_spec.rb
@@ -874,7 +860,6 @@ test_files:
874
860
  - spec/models/inline_response_200_15_spec.rb
875
861
  - spec/models/error_source_spec.rb
876
862
  - spec/models/role_membership_spec.rb
877
- - spec/models/new_application_storage_spec.rb
878
863
  - spec/models/loyalty_program_balance_spec.rb
879
864
  - spec/models/user_spec.rb
880
865
  - spec/models/new_webhook_spec.rb
@@ -886,14 +871,12 @@ test_files:
886
871
  - spec/models/loyalty_points_spec.rb
887
872
  - spec/models/integration_state_spec.rb
888
873
  - spec/models/loyalty_program_spec.rb
889
- - spec/models/new_application_storage_data_spec.rb
890
874
  - spec/models/new_application_api_key_spec.rb
891
875
  - spec/models/new_account_spec.rb
892
876
  - spec/models/multi_application_entity_spec.rb
893
877
  - spec/models/update_account_spec.rb
894
878
  - spec/models/template_def_spec.rb
895
879
  - spec/models/inline_response_200_7_spec.rb
896
- - spec/models/new_application_storage_tuple_spec.rb
897
880
  - spec/models/new_role_spec.rb
898
881
  - spec/models/inline_response_200_22_spec.rb
899
882
  - spec/models/account_analytics_spec.rb
data/fck.rb DELETED
@@ -1,64 +0,0 @@
1
- # Load the gem
2
- require 'talon_one'
3
-
4
- # Setup authorization
5
- TalonOne.configure do |config|
6
- # Configure the API host destination
7
- config.host = 'localhost:9000'
8
- config.scheme = 'http'
9
-
10
- # Configure API key authorization: api_key_v1
11
- config.api_key['Authorization'] = 'e18149e88f42247f09281c9d3d0e7b7179302722577ad60cebc86c4333b6fb70'
12
- config.api_key_prefix['Authorization'] = 'ApiKey-v1'
13
- end
14
-
15
- # # Management API example to load application with id 7
16
- # management_api = TalonOne::ManagementApi.new
17
-
18
- # begin
19
- # # Acquire session token
20
- # login_params = TalonOne::LoginParams.new({
21
- # 'email': 'demo@talon.one',
22
- # 'password': 'Demo1234'
23
- # })
24
-
25
- # login_result = management_api.create_session(login_params)
26
- # token = login_result.token
27
-
28
- # # Save token in the configuration for future management API calls
29
- # TalonOne.configure do |config|
30
- # # Configure API key authorization: manager_auth
31
- # config.api_key['Authorization'] = token
32
- # config.api_key_prefix['Authorization'] = 'Bearer'
33
- # end
34
-
35
- # # Calling get_application function with the desired id (7)
36
- # result = management_api.get_application(1)
37
- # # Print result to the console
38
- # puts result
39
-
40
- # rescue TalonOne::ApiError => e
41
- # puts "Exception when calling ManagementApi: #{e}"
42
- # end
43
-
44
- # Integration API example to send a session update
45
- integration_api = TalonOne::IntegrationApi.new
46
-
47
- session_integration_id = 'f985583f-fa7d-4098-91dd-99c898ed3cd3' # String | The integration identifier of the session
48
-
49
- # NewCustomerSession Object
50
- customer_session = TalonOne::NewCustomerSession.new({
51
- 'coupon': 'Kewl',
52
- 'total': 100,
53
- 'state': 'open'
54
- })
55
-
56
- begin
57
- # Create/update a customer session using `update_customer_session` function
58
- result = integration_api.update_customer_session(session_integration_id, customer_session)
59
-
60
- # Prints response to the console
61
- puts result
62
- rescue TalonOne::ApiError => e
63
- puts "Exception when calling IntegrationApi->update_customer_session: #{e}"
64
- end
@@ -1,292 +0,0 @@
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 ApplicationStorage
18
- # Unique ID for this entity.
19
- attr_accessor :id
20
-
21
- # The exact moment this entity was created.
22
- attr_accessor :created
23
-
24
- # The exact moment this entity was last modified.
25
- attr_accessor :modified
26
-
27
- # The ID of the application that owns this entity.
28
- attr_accessor :application_id
29
-
30
- # Identifier for the information to be saved, e.g. \"Loyalty points for SKU\".
31
- attr_accessor :name
32
-
33
- # A JSON Schema describing the information to be saved in the storage
34
- attr_accessor :datatype
35
-
36
- # Description of the application store
37
- attr_accessor :description
38
-
39
- # array of rulesets where the application storage is used
40
- attr_accessor :used_at
41
-
42
- # Attribute mapping from ruby-style variable name to JSON key.
43
- def self.attribute_map
44
- {
45
- :'id' => :'id',
46
- :'created' => :'created',
47
- :'modified' => :'modified',
48
- :'application_id' => :'applicationId',
49
- :'name' => :'name',
50
- :'datatype' => :'datatype',
51
- :'description' => :'description',
52
- :'used_at' => :'usedAt'
53
- }
54
- end
55
-
56
- # Attribute type mapping.
57
- def self.swagger_types
58
- {
59
- :'id' => :'Integer',
60
- :'created' => :'DateTime',
61
- :'modified' => :'DateTime',
62
- :'application_id' => :'Integer',
63
- :'name' => :'String',
64
- :'datatype' => :'Object',
65
- :'description' => :'String',
66
- :'used_at' => :'Array<String>'
67
- }
68
- end
69
-
70
- # Initializes the object
71
- # @param [Hash] attributes Model attributes in the form of hash
72
- def initialize(attributes = {})
73
- return unless attributes.is_a?(Hash)
74
-
75
- # convert string to symbol for hash key
76
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
77
-
78
- if attributes.has_key?(:'id')
79
- self.id = attributes[:'id']
80
- end
81
-
82
- if attributes.has_key?(:'created')
83
- self.created = attributes[:'created']
84
- end
85
-
86
- if attributes.has_key?(:'modified')
87
- self.modified = attributes[:'modified']
88
- end
89
-
90
- if attributes.has_key?(:'applicationId')
91
- self.application_id = attributes[:'applicationId']
92
- end
93
-
94
- if attributes.has_key?(:'name')
95
- self.name = attributes[:'name']
96
- end
97
-
98
- if attributes.has_key?(:'datatype')
99
- self.datatype = attributes[:'datatype']
100
- end
101
-
102
- if attributes.has_key?(:'description')
103
- self.description = attributes[:'description']
104
- end
105
-
106
- if attributes.has_key?(:'usedAt')
107
- if (value = attributes[:'usedAt']).is_a?(Array)
108
- self.used_at = value
109
- end
110
- end
111
- end
112
-
113
- # Show invalid properties with the reasons. Usually used together with valid?
114
- # @return Array for valid properties with the reasons
115
- def list_invalid_properties
116
- invalid_properties = Array.new
117
- if @id.nil?
118
- invalid_properties.push('invalid value for "id", id cannot be nil.')
119
- end
120
-
121
- if @created.nil?
122
- invalid_properties.push('invalid value for "created", created cannot be nil.')
123
- end
124
-
125
- if @modified.nil?
126
- invalid_properties.push('invalid value for "modified", modified cannot be nil.')
127
- end
128
-
129
- if @application_id.nil?
130
- invalid_properties.push('invalid value for "application_id", application_id cannot be nil.')
131
- end
132
-
133
- if @name.nil?
134
- invalid_properties.push('invalid value for "name", name cannot be nil.')
135
- end
136
-
137
- if @datatype.nil?
138
- invalid_properties.push('invalid value for "datatype", datatype cannot be nil.')
139
- end
140
-
141
- if @used_at.nil?
142
- invalid_properties.push('invalid value for "used_at", used_at cannot be nil.')
143
- end
144
-
145
- invalid_properties
146
- end
147
-
148
- # Check to see if the all the properties in the model are valid
149
- # @return true if the model is valid
150
- def valid?
151
- return false if @id.nil?
152
- return false if @created.nil?
153
- return false if @modified.nil?
154
- return false if @application_id.nil?
155
- return false if @name.nil?
156
- return false if @datatype.nil?
157
- return false if @used_at.nil?
158
- true
159
- end
160
-
161
- # Checks equality by comparing each attribute.
162
- # @param [Object] Object to be compared
163
- def ==(o)
164
- return true if self.equal?(o)
165
- self.class == o.class &&
166
- id == o.id &&
167
- created == o.created &&
168
- modified == o.modified &&
169
- application_id == o.application_id &&
170
- name == o.name &&
171
- datatype == o.datatype &&
172
- description == o.description &&
173
- used_at == o.used_at
174
- end
175
-
176
- # @see the `==` method
177
- # @param [Object] Object to be compared
178
- def eql?(o)
179
- self == o
180
- end
181
-
182
- # Calculates hash code according to all attributes.
183
- # @return [Fixnum] Hash code
184
- def hash
185
- [id, created, modified, application_id, name, datatype, description, used_at].hash
186
- end
187
-
188
- # Builds the object from hash
189
- # @param [Hash] attributes Model attributes in the form of hash
190
- # @return [Object] Returns the model itself
191
- def build_from_hash(attributes)
192
- return nil unless attributes.is_a?(Hash)
193
- self.class.swagger_types.each_pair do |key, type|
194
- if type =~ /\AArray<(.*)>/i
195
- # check to ensure the input is an array given that the the attribute
196
- # is documented as an array but the input is not
197
- if attributes[self.class.attribute_map[key]].is_a?(Array)
198
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
199
- end
200
- elsif !attributes[self.class.attribute_map[key]].nil?
201
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
202
- end # or else data not found in attributes(hash), not an issue as the data can be optional
203
- end
204
-
205
- self
206
- end
207
-
208
- # Deserializes the data based on type
209
- # @param string type Data type
210
- # @param string value Value to be deserialized
211
- # @return [Object] Deserialized data
212
- def _deserialize(type, value)
213
- case type.to_sym
214
- when :DateTime
215
- DateTime.parse(value)
216
- when :Date
217
- Date.parse(value)
218
- when :String
219
- value.to_s
220
- when :Integer
221
- value.to_i
222
- when :Float
223
- value.to_f
224
- when :BOOLEAN
225
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
226
- true
227
- else
228
- false
229
- end
230
- when :Object
231
- # generic object (usually a Hash), return directly
232
- value
233
- when /\AArray<(?<inner_type>.+)>\z/
234
- inner_type = Regexp.last_match[:inner_type]
235
- value.map { |v| _deserialize(inner_type, v) }
236
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
237
- k_type = Regexp.last_match[:k_type]
238
- v_type = Regexp.last_match[:v_type]
239
- {}.tap do |hash|
240
- value.each do |k, v|
241
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
242
- end
243
- end
244
- else # model
245
- temp_model = TalonOne.const_get(type).new
246
- temp_model.build_from_hash(value)
247
- end
248
- end
249
-
250
- # Returns the string representation of the object
251
- # @return [String] String presentation of the object
252
- def to_s
253
- to_hash.to_s
254
- end
255
-
256
- # to_body is an alias to to_hash (backward compatibility)
257
- # @return [Hash] Returns the object in the form of hash
258
- def to_body
259
- to_hash
260
- end
261
-
262
- # Returns the object in the form of hash
263
- # @return [Hash] Returns the object in the form of hash
264
- def to_hash
265
- hash = {}
266
- self.class.attribute_map.each_pair do |attr, param|
267
- value = self.send(attr)
268
- next if value.nil?
269
- hash[param] = _to_hash(value)
270
- end
271
- hash
272
- end
273
-
274
- # Outputs non-array value in the form of hash
275
- # For object, use to_hash. Otherwise, just return the value
276
- # @param [Object] value Any valid value
277
- # @return [Hash] Returns the value in the form of hash
278
- def _to_hash(value)
279
- if value.is_a?(Array)
280
- value.compact.map { |v| _to_hash(v) }
281
- elsif value.is_a?(Hash)
282
- {}.tap do |hash|
283
- value.each { |k, v| hash[k] = _to_hash(v) }
284
- end
285
- elsif value.respond_to? :to_hash
286
- value.to_hash
287
- else
288
- value
289
- end
290
- end
291
- end
292
- end