artikcloud 2.1.1 → 2.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +44 -3
  3. data/artikcloud.gemspec +3 -4
  4. data/docs/ActionOut.md +6 -0
  5. data/docs/CertificateData.md +9 -0
  6. data/docs/CertificateEnvelope.md +8 -0
  7. data/docs/CertificateFields.md +13 -0
  8. data/docs/CertificateId.md +8 -0
  9. data/docs/ContactInfo.md +9 -0
  10. data/docs/DevicePricingTier.md +16 -0
  11. data/docs/DevicePricingTierEnvelope.md +8 -0
  12. data/docs/DevicePricingTierRequest.md +8 -0
  13. data/docs/DevicePricingTiers.md +8 -0
  14. data/docs/DevicePricingTiersEnvelope.md +8 -0
  15. data/docs/DeviceShareInfo.md +1 -1
  16. data/docs/DeviceTypePricingList.md +8 -0
  17. data/docs/DeviceTypePricingTier.md +17 -0
  18. data/docs/DeviceTypePricingTiersEnvelope.md +8 -0
  19. data/docs/DeviceTypeUpdateInput.md +8 -0
  20. data/docs/DevicesSharesApi.md +235 -0
  21. data/docs/DevicesStatusApi.md +183 -0
  22. data/docs/MessageOut.md +6 -0
  23. data/docs/MonetizationApi.md +289 -0
  24. data/docs/OutputRule.md +1 -0
  25. data/docs/RejectedCSVRow.md +8 -0
  26. data/docs/RejectedCSVRowsEnvelope.md +11 -0
  27. data/docs/Tier.md +17 -0
  28. data/docs/UpgradePath.md +8 -0
  29. data/docs/UpgradePathEnvelope.md +8 -0
  30. data/docs/UpgradePathUserToken.md +10 -0
  31. data/docs/UpgradePathUserTokenEnvelope.md +8 -0
  32. data/docs/UploadIdEnvelope.md +8 -0
  33. data/docs/UploadStatusEnvelope.md +8 -0
  34. data/docs/UsersApi.md +6 -2
  35. data/docs/ValidityPeriod.md +9 -0
  36. data/docs/Whitelist.md +10 -0
  37. data/docs/WhitelistEnvelope.md +8 -0
  38. data/docs/WhitelistResultEnvelope.md +12 -0
  39. data/docs/WhitelistingApi.md +515 -0
  40. data/lib/artikcloud/api/monetization_api.rb +296 -0
  41. data/lib/artikcloud/api/users_api.rb +3 -0
  42. data/lib/artikcloud/api/whitelisting_api.rb +519 -0
  43. data/lib/artikcloud/models/action_out.rb +62 -1
  44. data/lib/artikcloud/models/certificate_data.rb +197 -0
  45. data/lib/artikcloud/models/certificate_envelope.rb +188 -0
  46. data/lib/artikcloud/models/certificate_fields.rb +237 -0
  47. data/lib/artikcloud/models/certificate_id.rb +188 -0
  48. data/lib/artikcloud/models/contact_info.rb +198 -0
  49. data/lib/artikcloud/models/device_pricing_tier.rb +268 -0
  50. data/lib/artikcloud/models/device_pricing_tier_envelope.rb +188 -0
  51. data/lib/artikcloud/models/device_pricing_tier_request.rb +188 -0
  52. data/lib/artikcloud/models/device_pricing_tiers.rb +190 -0
  53. data/lib/artikcloud/models/device_pricing_tiers_envelope.rb +188 -0
  54. data/lib/artikcloud/models/device_share_info.rb +7 -7
  55. data/lib/artikcloud/models/device_type_pricing_list.rb +190 -0
  56. data/lib/artikcloud/models/device_type_pricing_tier.rb +280 -0
  57. data/lib/artikcloud/models/device_type_pricing_tiers_envelope.rb +188 -0
  58. data/lib/artikcloud/models/device_type_update_input.rb +188 -0
  59. data/lib/artikcloud/models/message_out.rb +65 -1
  60. data/lib/artikcloud/models/output_rule.rb +46 -4
  61. data/lib/artikcloud/models/rejected_csv_row.rb +188 -0
  62. data/lib/artikcloud/models/rejected_csv_rows_envelope.rb +220 -0
  63. data/lib/artikcloud/models/tier.rb +278 -0
  64. data/lib/artikcloud/models/upgrade_path.rb +188 -0
  65. data/lib/artikcloud/models/upgrade_path_envelope.rb +188 -0
  66. data/lib/artikcloud/models/upgrade_path_user_token.rb +208 -0
  67. data/lib/artikcloud/models/upgrade_path_user_token_envelope.rb +187 -0
  68. data/lib/artikcloud/models/upload_id_envelope.rb +188 -0
  69. data/lib/artikcloud/models/upload_status_envelope.rb +188 -0
  70. data/lib/artikcloud/models/validity_period.rb +198 -0
  71. data/lib/artikcloud/models/whitelist.rb +208 -0
  72. data/lib/artikcloud/models/whitelist_envelope.rb +190 -0
  73. data/lib/artikcloud/models/whitelist_result_envelope.rb +230 -0
  74. data/lib/artikcloud/version.rb +1 -2
  75. data/lib/artikcloud.rb +33 -3
  76. data/pom.xml +1 -1
  77. data/spec/api/device_types_api_spec.rb +3 -15
  78. data/spec/api/devices_api_spec.rb +6 -22
  79. data/spec/api/devices_management_api_spec.rb +1 -13
  80. data/spec/api/export_api_spec.rb +2 -14
  81. data/spec/api/messages_api_spec.rb +115 -74
  82. data/spec/api/monetization_api_spec.rb +99 -0
  83. data/spec/api/registrations_api_spec.rb +1 -13
  84. data/spec/api/rules_api_spec.rb +3 -15
  85. data/spec/api/tags_api_spec.rb +0 -12
  86. data/spec/api/tokens_api_spec.rb +24 -14
  87. data/spec/api/users_api_spec.rb +119 -57
  88. data/spec/api/whitelisting_api_spec.rb +152 -0
  89. data/spec/factories/users.rb +12 -12
  90. data/spec/models/action_out_spec.rb +36 -0
  91. data/spec/models/certificate_data_spec.rb +47 -0
  92. data/spec/models/certificate_envelope_spec.rb +41 -0
  93. data/spec/models/certificate_fields_spec.rb +71 -0
  94. data/spec/models/certificate_id_spec.rb +41 -0
  95. data/spec/models/contact_info_spec.rb +47 -0
  96. data/spec/models/device_pricing_tier_envelope_spec.rb +41 -0
  97. data/spec/models/device_pricing_tier_request_spec.rb +41 -0
  98. data/spec/models/device_pricing_tier_spec.rb +89 -0
  99. data/spec/models/device_pricing_tiers_envelope_spec.rb +41 -0
  100. data/spec/models/device_pricing_tiers_spec.rb +41 -0
  101. data/spec/models/device_share_info_spec.rb +1 -1
  102. data/spec/models/device_type_pricing_list_spec.rb +41 -0
  103. data/spec/models/device_type_pricing_tier_spec.rb +95 -0
  104. data/spec/models/device_type_pricing_tiers_envelope_spec.rb +41 -0
  105. data/spec/models/device_type_update_input_spec.rb +41 -0
  106. data/spec/models/message_out_spec.rb +36 -0
  107. data/spec/models/output_rule_spec.rb +10 -0
  108. data/spec/models/rejected_csv_row_spec.rb +41 -0
  109. data/spec/models/rejected_csv_rows_envelope_spec.rb +59 -0
  110. data/spec/models/tier_spec.rb +95 -0
  111. data/spec/models/upgrade_path_envelope_spec.rb +41 -0
  112. data/spec/models/upgrade_path_spec.rb +41 -0
  113. data/spec/models/upgrade_path_user_token_envelope_spec.rb +41 -0
  114. data/spec/models/upgrade_path_user_token_spec.rb +53 -0
  115. data/spec/models/upload_id_envelope_spec.rb +41 -0
  116. data/spec/models/upload_status_envelope_spec.rb +41 -0
  117. data/spec/models/validity_period_spec.rb +47 -0
  118. data/spec/models/whitelist_envelope_spec.rb +41 -0
  119. data/spec/models/whitelist_result_envelope_spec.rb +65 -0
  120. data/spec/models/whitelist_spec.rb +53 -0
  121. metadata +121 -11
  122. data/docs/.DS_Store +0 -0
  123. data/lib/.DS_Store +0 -0
  124. data/lib/artikcloud/.DS_Store +0 -0
  125. data/lib/artikcloud/api/.DS_Store +0 -0
  126. data/lib/artikcloud/models/.DS_Store +0 -0
  127. data/spec/.DS_Store +0 -0
  128. data/spec/api/.DS_Store +0 -0
@@ -0,0 +1,188 @@
1
+ =begin
2
+ #ARTIK Cloud API
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 2.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ =end
11
+
12
+ require 'date'
13
+
14
+ module ArtikCloud
15
+ #
16
+ class DevicePricingTiersEnvelope
17
+ # Data envelope
18
+ attr_accessor :data
19
+
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'data' => :'data'
25
+ }
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.swagger_types
30
+ {
31
+ :'data' => :'DevicePricingTiers'
32
+ }
33
+ end
34
+
35
+ # Initializes the object
36
+ # @param [Hash] attributes Model attributes in the form of hash
37
+ def initialize(attributes = {})
38
+ return unless attributes.is_a?(Hash)
39
+
40
+ # convert string to symbol for hash key
41
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
42
+
43
+ if attributes.has_key?(:'data')
44
+ self.data = attributes[:'data']
45
+ end
46
+
47
+ end
48
+
49
+ # Show invalid properties with the reasons. Usually used together with valid?
50
+ # @return Array for valid properies with the reasons
51
+ def list_invalid_properties
52
+ invalid_properties = Array.new
53
+ return invalid_properties
54
+ end
55
+
56
+ # Check to see if the all the properties in the model are valid
57
+ # @return true if the model is valid
58
+ def valid?
59
+ return true
60
+ end
61
+
62
+ # Checks equality by comparing each attribute.
63
+ # @param [Object] Object to be compared
64
+ def ==(o)
65
+ return true if self.equal?(o)
66
+ self.class == o.class &&
67
+ data == o.data
68
+ end
69
+
70
+ # @see the `==` method
71
+ # @param [Object] Object to be compared
72
+ def eql?(o)
73
+ self == o
74
+ end
75
+
76
+ # Calculates hash code according to all attributes.
77
+ # @return [Fixnum] Hash code
78
+ def hash
79
+ [data].hash
80
+ end
81
+
82
+ # Builds the object from hash
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ # @return [Object] Returns the model itself
85
+ def build_from_hash(attributes)
86
+ return nil unless attributes.is_a?(Hash)
87
+ self.class.swagger_types.each_pair do |key, type|
88
+ if type =~ /\AArray<(.*)>/i
89
+ # check to ensure the input is an array given that the the attribute
90
+ # is documented as an array but the input is not
91
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
92
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
93
+ end
94
+ elsif !attributes[self.class.attribute_map[key]].nil?
95
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
96
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
97
+ end
98
+
99
+ self
100
+ end
101
+
102
+ # Deserializes the data based on type
103
+ # @param string type Data type
104
+ # @param string value Value to be deserialized
105
+ # @return [Object] Deserialized data
106
+ def _deserialize(type, value)
107
+ case type.to_sym
108
+ when :DateTime
109
+ DateTime.parse(value)
110
+ when :Date
111
+ Date.parse(value)
112
+ when :String
113
+ value.to_s
114
+ when :Integer
115
+ value.to_i
116
+ when :Float
117
+ value.to_f
118
+ when :BOOLEAN
119
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
120
+ true
121
+ else
122
+ false
123
+ end
124
+ when :Object
125
+ # generic object (usually a Hash), return directly
126
+ value
127
+ when /\AArray<(?<inner_type>.+)>\z/
128
+ inner_type = Regexp.last_match[:inner_type]
129
+ value.map { |v| _deserialize(inner_type, v) }
130
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
131
+ k_type = Regexp.last_match[:k_type]
132
+ v_type = Regexp.last_match[:v_type]
133
+ {}.tap do |hash|
134
+ value.each do |k, v|
135
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
136
+ end
137
+ end
138
+ else # model
139
+ temp_model = ArtikCloud.const_get(type).new
140
+ temp_model.build_from_hash(value)
141
+ end
142
+ end
143
+
144
+ # Returns the string representation of the object
145
+ # @return [String] String presentation of the object
146
+ def to_s
147
+ to_hash.to_s
148
+ end
149
+
150
+ # to_body is an alias to to_hash (backward compatibility)
151
+ # @return [Hash] Returns the object in the form of hash
152
+ def to_body
153
+ to_hash
154
+ end
155
+
156
+ # Returns the object in the form of hash
157
+ # @return [Hash] Returns the object in the form of hash
158
+ def to_hash
159
+ hash = {}
160
+ self.class.attribute_map.each_pair do |attr, param|
161
+ value = self.send(attr)
162
+ next if value.nil?
163
+ hash[param] = _to_hash(value)
164
+ end
165
+ hash
166
+ end
167
+
168
+ # Outputs non-array value in the form of hash
169
+ # For object, use to_hash. Otherwise, just return the value
170
+ # @param [Object] value Any valid value
171
+ # @return [Hash] Returns the value in the form of hash
172
+ def _to_hash(value)
173
+ if value.is_a?(Array)
174
+ value.compact.map{ |v| _to_hash(v) }
175
+ elsif value.is_a?(Hash)
176
+ {}.tap do |hash|
177
+ value.each { |k, v| hash[k] = _to_hash(v) }
178
+ end
179
+ elsif value.respond_to? :to_hash
180
+ value.to_hash
181
+ else
182
+ value
183
+ end
184
+ end
185
+
186
+ end
187
+
188
+ end
@@ -15,20 +15,20 @@ module ArtikCloud
15
15
  #
16
16
  class DeviceShareInfo
17
17
  # User email
18
- attr_accessor :email
18
+ attr_accessor :uid
19
19
 
20
20
 
21
21
  # Attribute mapping from ruby-style variable name to JSON key.
22
22
  def self.attribute_map
23
23
  {
24
- :'email' => :'email'
24
+ :'uid' => :'uid'
25
25
  }
26
26
  end
27
27
 
28
28
  # Attribute type mapping.
29
29
  def self.swagger_types
30
30
  {
31
- :'email' => :'String'
31
+ :'uid' => :'String'
32
32
  }
33
33
  end
34
34
 
@@ -40,8 +40,8 @@ module ArtikCloud
40
40
  # convert string to symbol for hash key
41
41
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
42
42
 
43
- if attributes.has_key?(:'email')
44
- self.email = attributes[:'email']
43
+ if attributes.has_key?(:'uid')
44
+ self.uid = attributes[:'uid']
45
45
  end
46
46
 
47
47
  end
@@ -64,7 +64,7 @@ module ArtikCloud
64
64
  def ==(o)
65
65
  return true if self.equal?(o)
66
66
  self.class == o.class &&
67
- email == o.email
67
+ uid == o.uid
68
68
  end
69
69
 
70
70
  # @see the `==` method
@@ -76,7 +76,7 @@ module ArtikCloud
76
76
  # Calculates hash code according to all attributes.
77
77
  # @return [Fixnum] Hash code
78
78
  def hash
79
- [email].hash
79
+ [uid].hash
80
80
  end
81
81
 
82
82
  # Builds the object from hash
@@ -0,0 +1,190 @@
1
+ =begin
2
+ #ARTIK Cloud API
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 2.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ =end
11
+
12
+ require 'date'
13
+
14
+ module ArtikCloud
15
+ #
16
+ class DeviceTypePricingList
17
+ # Pricing Tiers List
18
+ attr_accessor :pricing_tiers
19
+
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'pricing_tiers' => :'pricingTiers'
25
+ }
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.swagger_types
30
+ {
31
+ :'pricing_tiers' => :'Array<DeviceTypePricingTier>'
32
+ }
33
+ end
34
+
35
+ # Initializes the object
36
+ # @param [Hash] attributes Model attributes in the form of hash
37
+ def initialize(attributes = {})
38
+ return unless attributes.is_a?(Hash)
39
+
40
+ # convert string to symbol for hash key
41
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
42
+
43
+ if attributes.has_key?(:'pricingTiers')
44
+ if (value = attributes[:'pricingTiers']).is_a?(Array)
45
+ self.pricing_tiers = value
46
+ end
47
+ end
48
+
49
+ end
50
+
51
+ # Show invalid properties with the reasons. Usually used together with valid?
52
+ # @return Array for valid properies with the reasons
53
+ def list_invalid_properties
54
+ invalid_properties = Array.new
55
+ return invalid_properties
56
+ end
57
+
58
+ # Check to see if the all the properties in the model are valid
59
+ # @return true if the model is valid
60
+ def valid?
61
+ return true
62
+ end
63
+
64
+ # Checks equality by comparing each attribute.
65
+ # @param [Object] Object to be compared
66
+ def ==(o)
67
+ return true if self.equal?(o)
68
+ self.class == o.class &&
69
+ pricing_tiers == o.pricing_tiers
70
+ end
71
+
72
+ # @see the `==` method
73
+ # @param [Object] Object to be compared
74
+ def eql?(o)
75
+ self == o
76
+ end
77
+
78
+ # Calculates hash code according to all attributes.
79
+ # @return [Fixnum] Hash code
80
+ def hash
81
+ [pricing_tiers].hash
82
+ end
83
+
84
+ # Builds the object from hash
85
+ # @param [Hash] attributes Model attributes in the form of hash
86
+ # @return [Object] Returns the model itself
87
+ def build_from_hash(attributes)
88
+ return nil unless attributes.is_a?(Hash)
89
+ self.class.swagger_types.each_pair do |key, type|
90
+ if type =~ /\AArray<(.*)>/i
91
+ # check to ensure the input is an array given that the the attribute
92
+ # is documented as an array but the input is not
93
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
94
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
95
+ end
96
+ elsif !attributes[self.class.attribute_map[key]].nil?
97
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
98
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
99
+ end
100
+
101
+ self
102
+ end
103
+
104
+ # Deserializes the data based on type
105
+ # @param string type Data type
106
+ # @param string value Value to be deserialized
107
+ # @return [Object] Deserialized data
108
+ def _deserialize(type, value)
109
+ case type.to_sym
110
+ when :DateTime
111
+ DateTime.parse(value)
112
+ when :Date
113
+ Date.parse(value)
114
+ when :String
115
+ value.to_s
116
+ when :Integer
117
+ value.to_i
118
+ when :Float
119
+ value.to_f
120
+ when :BOOLEAN
121
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
122
+ true
123
+ else
124
+ false
125
+ end
126
+ when :Object
127
+ # generic object (usually a Hash), return directly
128
+ value
129
+ when /\AArray<(?<inner_type>.+)>\z/
130
+ inner_type = Regexp.last_match[:inner_type]
131
+ value.map { |v| _deserialize(inner_type, v) }
132
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
133
+ k_type = Regexp.last_match[:k_type]
134
+ v_type = Regexp.last_match[:v_type]
135
+ {}.tap do |hash|
136
+ value.each do |k, v|
137
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
138
+ end
139
+ end
140
+ else # model
141
+ temp_model = ArtikCloud.const_get(type).new
142
+ temp_model.build_from_hash(value)
143
+ end
144
+ end
145
+
146
+ # Returns the string representation of the object
147
+ # @return [String] String presentation of the object
148
+ def to_s
149
+ to_hash.to_s
150
+ end
151
+
152
+ # to_body is an alias to to_hash (backward compatibility)
153
+ # @return [Hash] Returns the object in the form of hash
154
+ def to_body
155
+ to_hash
156
+ end
157
+
158
+ # Returns the object in the form of hash
159
+ # @return [Hash] Returns the object in the form of hash
160
+ def to_hash
161
+ hash = {}
162
+ self.class.attribute_map.each_pair do |attr, param|
163
+ value = self.send(attr)
164
+ next if value.nil?
165
+ hash[param] = _to_hash(value)
166
+ end
167
+ hash
168
+ end
169
+
170
+ # Outputs non-array value in the form of hash
171
+ # For object, use to_hash. Otherwise, just return the value
172
+ # @param [Object] value Any valid value
173
+ # @return [Hash] Returns the value in the form of hash
174
+ def _to_hash(value)
175
+ if value.is_a?(Array)
176
+ value.compact.map{ |v| _to_hash(v) }
177
+ elsif value.is_a?(Hash)
178
+ {}.tap do |hash|
179
+ value.each { |k, v| hash[k] = _to_hash(v) }
180
+ end
181
+ elsif value.respond_to? :to_hash
182
+ value.to_hash
183
+ else
184
+ value
185
+ end
186
+ end
187
+
188
+ end
189
+
190
+ end
@@ -0,0 +1,280 @@
1
+ =begin
2
+ #ARTIK Cloud API
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 2.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ =end
11
+
12
+ require 'date'
13
+
14
+ module ArtikCloud
15
+ #
16
+ class DeviceTypePricingTier
17
+ # revenue share percentage
18
+ attr_accessor :revenue_share_percent
19
+
20
+ # tiers
21
+ attr_accessor :tiers
22
+
23
+ # modified on
24
+ attr_accessor :modified_on
25
+
26
+ # comments
27
+ attr_accessor :comments
28
+
29
+ # dtid
30
+ attr_accessor :dtid
31
+
32
+ # contact information
33
+ attr_accessor :contact_info
34
+
35
+ # type
36
+ attr_accessor :pt_type
37
+
38
+ # version
39
+ attr_accessor :version
40
+
41
+ # created on
42
+ attr_accessor :created_on
43
+
44
+ # status
45
+ attr_accessor :status
46
+
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'revenue_share_percent' => :'revenueSharePercent',
52
+ :'tiers' => :'tiers',
53
+ :'modified_on' => :'modifiedOn',
54
+ :'comments' => :'comments',
55
+ :'dtid' => :'dtid',
56
+ :'contact_info' => :'contactInfo',
57
+ :'pt_type' => :'ptType',
58
+ :'version' => :'version',
59
+ :'created_on' => :'createdOn',
60
+ :'status' => :'status'
61
+ }
62
+ end
63
+
64
+ # Attribute type mapping.
65
+ def self.swagger_types
66
+ {
67
+ :'revenue_share_percent' => :'Object',
68
+ :'tiers' => :'Array<Tier>',
69
+ :'modified_on' => :'Integer',
70
+ :'comments' => :'String',
71
+ :'dtid' => :'String',
72
+ :'contact_info' => :'ContactInfo',
73
+ :'pt_type' => :'String',
74
+ :'version' => :'Integer',
75
+ :'created_on' => :'Integer',
76
+ :'status' => :'String'
77
+ }
78
+ end
79
+
80
+ # Initializes the object
81
+ # @param [Hash] attributes Model attributes in the form of hash
82
+ def initialize(attributes = {})
83
+ return unless attributes.is_a?(Hash)
84
+
85
+ # convert string to symbol for hash key
86
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
87
+
88
+ if attributes.has_key?(:'revenueSharePercent')
89
+ self.revenue_share_percent = attributes[:'revenueSharePercent']
90
+ end
91
+
92
+ if attributes.has_key?(:'tiers')
93
+ if (value = attributes[:'tiers']).is_a?(Array)
94
+ self.tiers = value
95
+ end
96
+ end
97
+
98
+ if attributes.has_key?(:'modifiedOn')
99
+ self.modified_on = attributes[:'modifiedOn']
100
+ end
101
+
102
+ if attributes.has_key?(:'comments')
103
+ self.comments = attributes[:'comments']
104
+ end
105
+
106
+ if attributes.has_key?(:'dtid')
107
+ self.dtid = attributes[:'dtid']
108
+ end
109
+
110
+ if attributes.has_key?(:'contactInfo')
111
+ self.contact_info = attributes[:'contactInfo']
112
+ end
113
+
114
+ if attributes.has_key?(:'ptType')
115
+ self.pt_type = attributes[:'ptType']
116
+ end
117
+
118
+ if attributes.has_key?(:'version')
119
+ self.version = attributes[:'version']
120
+ end
121
+
122
+ if attributes.has_key?(:'createdOn')
123
+ self.created_on = attributes[:'createdOn']
124
+ end
125
+
126
+ if attributes.has_key?(:'status')
127
+ self.status = attributes[:'status']
128
+ end
129
+
130
+ end
131
+
132
+ # Show invalid properties with the reasons. Usually used together with valid?
133
+ # @return Array for valid properies with the reasons
134
+ def list_invalid_properties
135
+ invalid_properties = Array.new
136
+ return invalid_properties
137
+ end
138
+
139
+ # Check to see if the all the properties in the model are valid
140
+ # @return true if the model is valid
141
+ def valid?
142
+ return true
143
+ end
144
+
145
+ # Checks equality by comparing each attribute.
146
+ # @param [Object] Object to be compared
147
+ def ==(o)
148
+ return true if self.equal?(o)
149
+ self.class == o.class &&
150
+ revenue_share_percent == o.revenue_share_percent &&
151
+ tiers == o.tiers &&
152
+ modified_on == o.modified_on &&
153
+ comments == o.comments &&
154
+ dtid == o.dtid &&
155
+ contact_info == o.contact_info &&
156
+ pt_type == o.pt_type &&
157
+ version == o.version &&
158
+ created_on == o.created_on &&
159
+ status == o.status
160
+ end
161
+
162
+ # @see the `==` method
163
+ # @param [Object] Object to be compared
164
+ def eql?(o)
165
+ self == o
166
+ end
167
+
168
+ # Calculates hash code according to all attributes.
169
+ # @return [Fixnum] Hash code
170
+ def hash
171
+ [revenue_share_percent, tiers, modified_on, comments, dtid, contact_info, pt_type, version, created_on, status].hash
172
+ end
173
+
174
+ # Builds the object from hash
175
+ # @param [Hash] attributes Model attributes in the form of hash
176
+ # @return [Object] Returns the model itself
177
+ def build_from_hash(attributes)
178
+ return nil unless attributes.is_a?(Hash)
179
+ self.class.swagger_types.each_pair do |key, type|
180
+ if type =~ /\AArray<(.*)>/i
181
+ # check to ensure the input is an array given that the the attribute
182
+ # is documented as an array but the input is not
183
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
184
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
185
+ end
186
+ elsif !attributes[self.class.attribute_map[key]].nil?
187
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
188
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
189
+ end
190
+
191
+ self
192
+ end
193
+
194
+ # Deserializes the data based on type
195
+ # @param string type Data type
196
+ # @param string value Value to be deserialized
197
+ # @return [Object] Deserialized data
198
+ def _deserialize(type, value)
199
+ case type.to_sym
200
+ when :DateTime
201
+ DateTime.parse(value)
202
+ when :Date
203
+ Date.parse(value)
204
+ when :String
205
+ value.to_s
206
+ when :Integer
207
+ value.to_i
208
+ when :Float
209
+ value.to_f
210
+ when :BOOLEAN
211
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
212
+ true
213
+ else
214
+ false
215
+ end
216
+ when :Object
217
+ # generic object (usually a Hash), return directly
218
+ value
219
+ when /\AArray<(?<inner_type>.+)>\z/
220
+ inner_type = Regexp.last_match[:inner_type]
221
+ value.map { |v| _deserialize(inner_type, v) }
222
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
223
+ k_type = Regexp.last_match[:k_type]
224
+ v_type = Regexp.last_match[:v_type]
225
+ {}.tap do |hash|
226
+ value.each do |k, v|
227
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
228
+ end
229
+ end
230
+ else # model
231
+ temp_model = ArtikCloud.const_get(type).new
232
+ temp_model.build_from_hash(value)
233
+ end
234
+ end
235
+
236
+ # Returns the string representation of the object
237
+ # @return [String] String presentation of the object
238
+ def to_s
239
+ to_hash.to_s
240
+ end
241
+
242
+ # to_body is an alias to to_hash (backward compatibility)
243
+ # @return [Hash] Returns the object in the form of hash
244
+ def to_body
245
+ to_hash
246
+ end
247
+
248
+ # Returns the object in the form of hash
249
+ # @return [Hash] Returns the object in the form of hash
250
+ def to_hash
251
+ hash = {}
252
+ self.class.attribute_map.each_pair do |attr, param|
253
+ value = self.send(attr)
254
+ next if value.nil?
255
+ hash[param] = _to_hash(value)
256
+ end
257
+ hash
258
+ end
259
+
260
+ # Outputs non-array value in the form of hash
261
+ # For object, use to_hash. Otherwise, just return the value
262
+ # @param [Object] value Any valid value
263
+ # @return [Hash] Returns the value in the form of hash
264
+ def _to_hash(value)
265
+ if value.is_a?(Array)
266
+ value.compact.map{ |v| _to_hash(v) }
267
+ elsif value.is_a?(Hash)
268
+ {}.tap do |hash|
269
+ value.each { |k, v| hash[k] = _to_hash(v) }
270
+ end
271
+ elsif value.respond_to? :to_hash
272
+ value.to_hash
273
+ else
274
+ value
275
+ end
276
+ end
277
+
278
+ end
279
+
280
+ end