flat_api 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +5 -4
- data/docs/ScoreRights.md +1 -0
- data/flat_api.gemspec +1 -1
- data/git_push.sh +1 -1
- data/lib/flat_api.rb +1 -1
- data/lib/flat_api/api/account_api.rb +1 -1
- data/lib/flat_api/api/class_api.rb +1 -1
- data/lib/flat_api/api/group_api.rb +1 -1
- data/lib/flat_api/api/organization_api.rb +1 -1
- data/lib/flat_api/api/score_api.rb +1 -1
- data/lib/flat_api/api/user_api.rb +1 -1
- data/lib/flat_api/api_client.rb +2 -2
- data/lib/flat_api/api_error.rb +1 -1
- data/lib/flat_api/configuration.rb +1 -1
- data/lib/flat_api/models/assignment.rb +2 -2
- data/lib/flat_api/models/assignment_copy.rb +2 -2
- data/lib/flat_api/models/assignment_creation.rb +2 -2
- data/lib/flat_api/models/assignment_submission.rb +2 -2
- data/lib/flat_api/models/assignment_submission_update.rb +2 -2
- data/lib/flat_api/models/class_attachment_creation.rb +2 -2
- data/lib/flat_api/models/class_creation.rb +2 -2
- data/lib/flat_api/models/class_details.rb +2 -2
- data/lib/flat_api/models/class_details_canvas.rb +2 -2
- data/lib/flat_api/models/class_details_clever.rb +2 -2
- data/lib/flat_api/models/class_details_google_classroom.rb +2 -2
- data/lib/flat_api/models/class_details_google_drive.rb +2 -2
- data/lib/flat_api/models/class_details_lti.rb +2 -2
- data/lib/flat_api/models/class_roles.rb +10 -1
- data/lib/flat_api/models/class_state.rb +10 -1
- data/lib/flat_api/models/class_update.rb +2 -2
- data/lib/flat_api/models/flat_error_response.rb +2 -2
- data/lib/flat_api/models/flat_locales.rb +10 -1
- data/lib/flat_api/models/google_classroom_coursework.rb +2 -2
- data/lib/flat_api/models/google_classroom_submission.rb +2 -2
- data/lib/flat_api/models/group.rb +2 -2
- data/lib/flat_api/models/group_details.rb +2 -2
- data/lib/flat_api/models/group_type.rb +10 -1
- data/lib/flat_api/models/license_mode.rb +10 -1
- data/lib/flat_api/models/license_sources.rb +10 -1
- data/lib/flat_api/models/lms_name.rb +10 -1
- data/lib/flat_api/models/lti_credentials.rb +2 -2
- data/lib/flat_api/models/lti_credentials_creation.rb +2 -2
- data/lib/flat_api/models/media_attachment.rb +2 -2
- data/lib/flat_api/models/media_score_sharing_mode.rb +10 -1
- data/lib/flat_api/models/organization_invitation.rb +2 -2
- data/lib/flat_api/models/organization_invitation_creation.rb +2 -2
- data/lib/flat_api/models/organization_roles.rb +10 -1
- data/lib/flat_api/models/score_collaborator.rb +2 -2
- data/lib/flat_api/models/score_collaborator_creation.rb +2 -2
- data/lib/flat_api/models/score_comment.rb +2 -2
- data/lib/flat_api/models/score_comment_context.rb +2 -2
- data/lib/flat_api/models/score_comment_creation.rb +2 -2
- data/lib/flat_api/models/score_comment_update.rb +2 -2
- data/lib/flat_api/models/score_comments_counts.rb +2 -2
- data/lib/flat_api/models/score_creation.rb +2 -2
- data/lib/flat_api/models/score_creation_type.rb +10 -1
- data/lib/flat_api/models/score_data.rb +2 -2
- data/lib/flat_api/models/score_data_encoding.rb +10 -1
- data/lib/flat_api/models/score_details.rb +2 -2
- data/lib/flat_api/models/score_fork.rb +2 -2
- data/lib/flat_api/models/score_license.rb +10 -1
- data/lib/flat_api/models/score_likes_counts.rb +2 -2
- data/lib/flat_api/models/score_modification.rb +2 -2
- data/lib/flat_api/models/score_privacy.rb +10 -1
- data/lib/flat_api/models/score_revision.rb +2 -2
- data/lib/flat_api/models/score_revision_creation.rb +2 -2
- data/lib/flat_api/models/score_revision_statistics.rb +2 -2
- data/lib/flat_api/models/score_rights.rb +13 -3
- data/lib/flat_api/models/score_source.rb +2 -2
- data/lib/flat_api/models/score_summary.rb +2 -2
- data/lib/flat_api/models/score_track.rb +2 -2
- data/lib/flat_api/models/score_track_creation.rb +2 -2
- data/lib/flat_api/models/score_track_point.rb +2 -2
- data/lib/flat_api/models/score_track_state.rb +10 -1
- data/lib/flat_api/models/score_track_type.rb +10 -1
- data/lib/flat_api/models/score_track_update.rb +2 -2
- data/lib/flat_api/models/score_views_counts.rb +2 -2
- data/lib/flat_api/models/user_admin_update.rb +2 -2
- data/lib/flat_api/models/user_basics.rb +2 -2
- data/lib/flat_api/models/user_creation.rb +7 -7
- data/lib/flat_api/models/user_details.rb +2 -2
- data/lib/flat_api/models/user_details_admin.rb +2 -2
- data/lib/flat_api/models/user_details_admin_license.rb +2 -2
- data/lib/flat_api/models/user_instruments.rb +2 -2
- data/lib/flat_api/models/user_public.rb +2 -2
- data/lib/flat_api/models/user_public_summary.rb +2 -2
- data/lib/flat_api/version.rb +2 -2
- metadata +2 -85
- data/lib/swagger_client.rb +0 -117
- data/lib/swagger_client/api/account_api.rb +0 -72
- data/lib/swagger_client/api/class_api.rb +0 -1148
- data/lib/swagger_client/api/group_api.rb +0 -191
- data/lib/swagger_client/api/organization_api.rb +0 -599
- data/lib/swagger_client/api/score_api.rb +0 -1737
- data/lib/swagger_client/api/user_api.rb +0 -194
- data/lib/swagger_client/api_client.rb +0 -389
- data/lib/swagger_client/api_error.rb +0 -38
- data/lib/swagger_client/configuration.rb +0 -209
- data/lib/swagger_client/models/assignment.rb +0 -323
- data/lib/swagger_client/models/assignment_copy.rb +0 -194
- data/lib/swagger_client/models/assignment_creation.rb +0 -230
- data/lib/swagger_client/models/assignment_submission.rb +0 -299
- data/lib/swagger_client/models/assignment_submission_update.rb +0 -220
- data/lib/swagger_client/models/class_attachment_creation.rb +0 -242
- data/lib/swagger_client/models/class_creation.rb +0 -239
- data/lib/swagger_client/models/class_details.rb +0 -351
- data/lib/swagger_client/models/class_details_canvas.rb +0 -199
- data/lib/swagger_client/models/class_details_clever.rb +0 -282
- data/lib/swagger_client/models/class_details_google_classroom.rb +0 -219
- data/lib/swagger_client/models/class_details_google_drive.rb +0 -199
- data/lib/swagger_client/models/class_details_lti.rb +0 -209
- data/lib/swagger_client/models/class_roles.rb +0 -22
- data/lib/swagger_client/models/class_state.rb +0 -23
- data/lib/swagger_client/models/class_update.rb +0 -231
- data/lib/swagger_client/models/flat_error_response.rb +0 -219
- data/lib/swagger_client/models/flat_locales.rb +0 -27
- data/lib/swagger_client/models/google_classroom_coursework.rb +0 -209
- data/lib/swagger_client/models/google_classroom_submission.rb +0 -209
- data/lib/swagger_client/models/group.rb +0 -282
- data/lib/swagger_client/models/group_details.rb +0 -248
- data/lib/swagger_client/models/group_type.rb +0 -23
- data/lib/swagger_client/models/license_mode.rb +0 -22
- data/lib/swagger_client/models/license_sources.rb +0 -25
- data/lib/swagger_client/models/lms_name.rb +0 -27
- data/lib/swagger_client/models/lti_credentials.rb +0 -268
- data/lib/swagger_client/models/lti_credentials_creation.rb +0 -227
- data/lib/swagger_client/models/media_attachment.rb +0 -371
- data/lib/swagger_client/models/media_score_sharing_mode.rb +0 -23
- data/lib/swagger_client/models/organization_invitation.rb +0 -248
- data/lib/swagger_client/models/organization_invitation_creation.rb +0 -198
- data/lib/swagger_client/models/organization_roles.rb +0 -24
- data/lib/swagger_client/models/score_collaborator.rb +0 -263
- data/lib/swagger_client/models/score_collaborator_creation.rb +0 -245
- data/lib/swagger_client/models/score_comment.rb +0 -363
- data/lib/swagger_client/models/score_comment_context.rb +0 -282
- data/lib/swagger_client/models/score_comment_creation.rb +0 -245
- data/lib/swagger_client/models/score_comment_update.rb +0 -268
- data/lib/swagger_client/models/score_comments_counts.rb +0 -219
- data/lib/swagger_client/models/score_creation.rb +0 -240
- data/lib/swagger_client/models/score_creation_type.rb +0 -23
- data/lib/swagger_client/models/score_data.rb +0 -179
- data/lib/swagger_client/models/score_data_encoding.rb +0 -21
- data/lib/swagger_client/models/score_details.rb +0 -467
- data/lib/swagger_client/models/score_fork.rb +0 -179
- data/lib/swagger_client/models/score_license.rb +0 -28
- data/lib/swagger_client/models/score_likes_counts.rb +0 -209
- data/lib/swagger_client/models/score_modification.rb +0 -270
- data/lib/swagger_client/models/score_privacy.rb +0 -24
- data/lib/swagger_client/models/score_revision.rb +0 -249
- data/lib/swagger_client/models/score_revision_creation.rb +0 -222
- data/lib/swagger_client/models/score_revision_statistics.rb +0 -199
- data/lib/swagger_client/models/score_rights.rb +0 -203
- data/lib/swagger_client/models/score_source.rb +0 -189
- data/lib/swagger_client/models/score_summary.rb +0 -237
- data/lib/swagger_client/models/score_track.rb +0 -298
- data/lib/swagger_client/models/score_track_creation.rb +0 -229
- data/lib/swagger_client/models/score_track_point.rb +0 -252
- data/lib/swagger_client/models/score_track_state.rb +0 -23
- data/lib/swagger_client/models/score_track_type.rb +0 -24
- data/lib/swagger_client/models/score_track_update.rb +0 -219
- data/lib/swagger_client/models/score_views_counts.rb +0 -209
- data/lib/swagger_client/models/user_admin_update.rb +0 -214
- data/lib/swagger_client/models/user_basics.rb +0 -239
- data/lib/swagger_client/models/user_creation.rb +0 -266
- data/lib/swagger_client/models/user_details.rb +0 -418
- data/lib/swagger_client/models/user_details_admin.rb +0 -306
- data/lib/swagger_client/models/user_details_admin_license.rb +0 -227
- data/lib/swagger_client/models/user_instruments.rb +0 -179
- data/lib/swagger_client/models/user_public.rb +0 -356
- data/lib/swagger_client/models/user_public_summary.rb +0 -277
- data/lib/swagger_client/version.rb +0 -15
@@ -1,214 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#Flat API
|
3
|
-
|
4
|
-
#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML or MIDI files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and interoduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html)
|
5
|
-
|
6
|
-
OpenAPI spec version: 2.5.0
|
7
|
-
Contact: developers@flat.io
|
8
|
-
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.2.3-SNAPSHOT
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'date'
|
14
|
-
|
15
|
-
module SwaggerClient
|
16
|
-
# User update as an organization admin
|
17
|
-
class UserAdminUpdate
|
18
|
-
# Password of the new account
|
19
|
-
attr_accessor :password
|
20
|
-
|
21
|
-
attr_accessor :organization_role
|
22
|
-
|
23
|
-
|
24
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
25
|
-
def self.attribute_map
|
26
|
-
{
|
27
|
-
:'password' => :'password',
|
28
|
-
:'organization_role' => :'organizationRole'
|
29
|
-
}
|
30
|
-
end
|
31
|
-
|
32
|
-
# Attribute type mapping.
|
33
|
-
def self.swagger_types
|
34
|
-
{
|
35
|
-
:'password' => :'String',
|
36
|
-
:'organization_role' => :'OrganizationRoles'
|
37
|
-
}
|
38
|
-
end
|
39
|
-
|
40
|
-
# Initializes the object
|
41
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
42
|
-
def initialize(attributes = {})
|
43
|
-
return unless attributes.is_a?(Hash)
|
44
|
-
|
45
|
-
# convert string to symbol for hash key
|
46
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
47
|
-
|
48
|
-
if attributes.has_key?(:'password')
|
49
|
-
self.password = attributes[:'password']
|
50
|
-
end
|
51
|
-
|
52
|
-
if attributes.has_key?(:'organizationRole')
|
53
|
-
self.organization_role = attributes[:'organizationRole']
|
54
|
-
end
|
55
|
-
|
56
|
-
end
|
57
|
-
|
58
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
59
|
-
# @return Array for valid properies with the reasons
|
60
|
-
def list_invalid_properties
|
61
|
-
invalid_properties = Array.new
|
62
|
-
if !@password.nil? && @password.to_s.length < 6
|
63
|
-
invalid_properties.push("invalid value for 'password', the character length must be great than or equal to 6.")
|
64
|
-
end
|
65
|
-
|
66
|
-
return invalid_properties
|
67
|
-
end
|
68
|
-
|
69
|
-
# Check to see if the all the properties in the model are valid
|
70
|
-
# @return true if the model is valid
|
71
|
-
def valid?
|
72
|
-
return false if !@password.nil? && @password.to_s.length < 6
|
73
|
-
return true
|
74
|
-
end
|
75
|
-
|
76
|
-
# Custom attribute writer method with validation
|
77
|
-
# @param [Object] password Value to be assigned
|
78
|
-
def password=(password)
|
79
|
-
|
80
|
-
if !password.nil? && password.to_s.length < 6
|
81
|
-
fail ArgumentError, "invalid value for 'password', the character length must be great than or equal to 6."
|
82
|
-
end
|
83
|
-
|
84
|
-
@password = password
|
85
|
-
end
|
86
|
-
|
87
|
-
# Checks equality by comparing each attribute.
|
88
|
-
# @param [Object] Object to be compared
|
89
|
-
def ==(o)
|
90
|
-
return true if self.equal?(o)
|
91
|
-
self.class == o.class &&
|
92
|
-
password == o.password &&
|
93
|
-
organization_role == o.organization_role
|
94
|
-
end
|
95
|
-
|
96
|
-
# @see the `==` method
|
97
|
-
# @param [Object] Object to be compared
|
98
|
-
def eql?(o)
|
99
|
-
self == o
|
100
|
-
end
|
101
|
-
|
102
|
-
# Calculates hash code according to all attributes.
|
103
|
-
# @return [Fixnum] Hash code
|
104
|
-
def hash
|
105
|
-
[password, organization_role].hash
|
106
|
-
end
|
107
|
-
|
108
|
-
# Builds the object from hash
|
109
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
110
|
-
# @return [Object] Returns the model itself
|
111
|
-
def build_from_hash(attributes)
|
112
|
-
return nil unless attributes.is_a?(Hash)
|
113
|
-
self.class.swagger_types.each_pair do |key, type|
|
114
|
-
if type =~ /\AArray<(.*)>/i
|
115
|
-
# check to ensure the input is an array given that the the attribute
|
116
|
-
# is documented as an array but the input is not
|
117
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
118
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
119
|
-
end
|
120
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
121
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
122
|
-
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
123
|
-
end
|
124
|
-
|
125
|
-
self
|
126
|
-
end
|
127
|
-
|
128
|
-
# Deserializes the data based on type
|
129
|
-
# @param string type Data type
|
130
|
-
# @param string value Value to be deserialized
|
131
|
-
# @return [Object] Deserialized data
|
132
|
-
def _deserialize(type, value)
|
133
|
-
case type.to_sym
|
134
|
-
when :DateTime
|
135
|
-
DateTime.parse(value)
|
136
|
-
when :Date
|
137
|
-
Date.parse(value)
|
138
|
-
when :String
|
139
|
-
value.to_s
|
140
|
-
when :Integer
|
141
|
-
value.to_i
|
142
|
-
when :Float
|
143
|
-
value.to_f
|
144
|
-
when :BOOLEAN
|
145
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
146
|
-
true
|
147
|
-
else
|
148
|
-
false
|
149
|
-
end
|
150
|
-
when :Object
|
151
|
-
# generic object (usually a Hash), return directly
|
152
|
-
value
|
153
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
154
|
-
inner_type = Regexp.last_match[:inner_type]
|
155
|
-
value.map { |v| _deserialize(inner_type, v) }
|
156
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
157
|
-
k_type = Regexp.last_match[:k_type]
|
158
|
-
v_type = Regexp.last_match[:v_type]
|
159
|
-
{}.tap do |hash|
|
160
|
-
value.each do |k, v|
|
161
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
162
|
-
end
|
163
|
-
end
|
164
|
-
else # model
|
165
|
-
temp_model = SwaggerClient.const_get(type).new
|
166
|
-
temp_model.build_from_hash(value)
|
167
|
-
end
|
168
|
-
end
|
169
|
-
|
170
|
-
# Returns the string representation of the object
|
171
|
-
# @return [String] String presentation of the object
|
172
|
-
def to_s
|
173
|
-
to_hash.to_s
|
174
|
-
end
|
175
|
-
|
176
|
-
# to_body is an alias to to_hash (backward compatibility)
|
177
|
-
# @return [Hash] Returns the object in the form of hash
|
178
|
-
def to_body
|
179
|
-
to_hash
|
180
|
-
end
|
181
|
-
|
182
|
-
# Returns the object in the form of hash
|
183
|
-
# @return [Hash] Returns the object in the form of hash
|
184
|
-
def to_hash
|
185
|
-
hash = {}
|
186
|
-
self.class.attribute_map.each_pair do |attr, param|
|
187
|
-
value = self.send(attr)
|
188
|
-
next if value.nil?
|
189
|
-
hash[param] = _to_hash(value)
|
190
|
-
end
|
191
|
-
hash
|
192
|
-
end
|
193
|
-
|
194
|
-
# Outputs non-array value in the form of hash
|
195
|
-
# For object, use to_hash. Otherwise, just return the value
|
196
|
-
# @param [Object] value Any valid value
|
197
|
-
# @return [Hash] Returns the value in the form of hash
|
198
|
-
def _to_hash(value)
|
199
|
-
if value.is_a?(Array)
|
200
|
-
value.compact.map{ |v| _to_hash(v) }
|
201
|
-
elsif value.is_a?(Hash)
|
202
|
-
{}.tap do |hash|
|
203
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
204
|
-
end
|
205
|
-
elsif value.respond_to? :to_hash
|
206
|
-
value.to_hash
|
207
|
-
else
|
208
|
-
value
|
209
|
-
end
|
210
|
-
end
|
211
|
-
|
212
|
-
end
|
213
|
-
|
214
|
-
end
|
@@ -1,239 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#Flat API
|
3
|
-
|
4
|
-
#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML or MIDI files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and interoduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html)
|
5
|
-
|
6
|
-
OpenAPI spec version: 2.5.0
|
7
|
-
Contact: developers@flat.io
|
8
|
-
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.2.3-SNAPSHOT
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'date'
|
14
|
-
|
15
|
-
module SwaggerClient
|
16
|
-
|
17
|
-
class UserBasics
|
18
|
-
# The user unique identifier
|
19
|
-
attr_accessor :id
|
20
|
-
|
21
|
-
# The user name (unique for the organization)
|
22
|
-
attr_accessor :username
|
23
|
-
|
24
|
-
# A displayable name for the user
|
25
|
-
attr_accessor :name
|
26
|
-
|
27
|
-
# The name that can be directly printed (name or username)
|
28
|
-
attr_accessor :printable_name
|
29
|
-
|
30
|
-
# User pictue
|
31
|
-
attr_accessor :picture
|
32
|
-
|
33
|
-
# User license status. 'True' if user is an individual Power user
|
34
|
-
attr_accessor :is_power_user
|
35
|
-
|
36
|
-
|
37
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
38
|
-
def self.attribute_map
|
39
|
-
{
|
40
|
-
:'id' => :'id',
|
41
|
-
:'username' => :'username',
|
42
|
-
:'name' => :'name',
|
43
|
-
:'printable_name' => :'printableName',
|
44
|
-
:'picture' => :'picture',
|
45
|
-
:'is_power_user' => :'isPowerUser'
|
46
|
-
}
|
47
|
-
end
|
48
|
-
|
49
|
-
# Attribute type mapping.
|
50
|
-
def self.swagger_types
|
51
|
-
{
|
52
|
-
:'id' => :'String',
|
53
|
-
:'username' => :'String',
|
54
|
-
:'name' => :'String',
|
55
|
-
:'printable_name' => :'String',
|
56
|
-
:'picture' => :'String',
|
57
|
-
:'is_power_user' => :'BOOLEAN'
|
58
|
-
}
|
59
|
-
end
|
60
|
-
|
61
|
-
# Initializes the object
|
62
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
63
|
-
def initialize(attributes = {})
|
64
|
-
return unless attributes.is_a?(Hash)
|
65
|
-
|
66
|
-
# convert string to symbol for hash key
|
67
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
68
|
-
|
69
|
-
if attributes.has_key?(:'id')
|
70
|
-
self.id = attributes[:'id']
|
71
|
-
end
|
72
|
-
|
73
|
-
if attributes.has_key?(:'username')
|
74
|
-
self.username = attributes[:'username']
|
75
|
-
end
|
76
|
-
|
77
|
-
if attributes.has_key?(:'name')
|
78
|
-
self.name = attributes[:'name']
|
79
|
-
end
|
80
|
-
|
81
|
-
if attributes.has_key?(:'printableName')
|
82
|
-
self.printable_name = attributes[:'printableName']
|
83
|
-
end
|
84
|
-
|
85
|
-
if attributes.has_key?(:'picture')
|
86
|
-
self.picture = attributes[:'picture']
|
87
|
-
end
|
88
|
-
|
89
|
-
if attributes.has_key?(:'isPowerUser')
|
90
|
-
self.is_power_user = attributes[:'isPowerUser']
|
91
|
-
end
|
92
|
-
|
93
|
-
end
|
94
|
-
|
95
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
96
|
-
# @return Array for valid properies with the reasons
|
97
|
-
def list_invalid_properties
|
98
|
-
invalid_properties = Array.new
|
99
|
-
return invalid_properties
|
100
|
-
end
|
101
|
-
|
102
|
-
# Check to see if the all the properties in the model are valid
|
103
|
-
# @return true if the model is valid
|
104
|
-
def valid?
|
105
|
-
return true
|
106
|
-
end
|
107
|
-
|
108
|
-
# Checks equality by comparing each attribute.
|
109
|
-
# @param [Object] Object to be compared
|
110
|
-
def ==(o)
|
111
|
-
return true if self.equal?(o)
|
112
|
-
self.class == o.class &&
|
113
|
-
id == o.id &&
|
114
|
-
username == o.username &&
|
115
|
-
name == o.name &&
|
116
|
-
printable_name == o.printable_name &&
|
117
|
-
picture == o.picture &&
|
118
|
-
is_power_user == o.is_power_user
|
119
|
-
end
|
120
|
-
|
121
|
-
# @see the `==` method
|
122
|
-
# @param [Object] Object to be compared
|
123
|
-
def eql?(o)
|
124
|
-
self == o
|
125
|
-
end
|
126
|
-
|
127
|
-
# Calculates hash code according to all attributes.
|
128
|
-
# @return [Fixnum] Hash code
|
129
|
-
def hash
|
130
|
-
[id, username, name, printable_name, picture, is_power_user].hash
|
131
|
-
end
|
132
|
-
|
133
|
-
# Builds the object from hash
|
134
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
135
|
-
# @return [Object] Returns the model itself
|
136
|
-
def build_from_hash(attributes)
|
137
|
-
return nil unless attributes.is_a?(Hash)
|
138
|
-
self.class.swagger_types.each_pair do |key, type|
|
139
|
-
if type =~ /\AArray<(.*)>/i
|
140
|
-
# check to ensure the input is an array given that the the attribute
|
141
|
-
# is documented as an array but the input is not
|
142
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
143
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
144
|
-
end
|
145
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
146
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
147
|
-
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
148
|
-
end
|
149
|
-
|
150
|
-
self
|
151
|
-
end
|
152
|
-
|
153
|
-
# Deserializes the data based on type
|
154
|
-
# @param string type Data type
|
155
|
-
# @param string value Value to be deserialized
|
156
|
-
# @return [Object] Deserialized data
|
157
|
-
def _deserialize(type, value)
|
158
|
-
case type.to_sym
|
159
|
-
when :DateTime
|
160
|
-
DateTime.parse(value)
|
161
|
-
when :Date
|
162
|
-
Date.parse(value)
|
163
|
-
when :String
|
164
|
-
value.to_s
|
165
|
-
when :Integer
|
166
|
-
value.to_i
|
167
|
-
when :Float
|
168
|
-
value.to_f
|
169
|
-
when :BOOLEAN
|
170
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
171
|
-
true
|
172
|
-
else
|
173
|
-
false
|
174
|
-
end
|
175
|
-
when :Object
|
176
|
-
# generic object (usually a Hash), return directly
|
177
|
-
value
|
178
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
179
|
-
inner_type = Regexp.last_match[:inner_type]
|
180
|
-
value.map { |v| _deserialize(inner_type, v) }
|
181
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
182
|
-
k_type = Regexp.last_match[:k_type]
|
183
|
-
v_type = Regexp.last_match[:v_type]
|
184
|
-
{}.tap do |hash|
|
185
|
-
value.each do |k, v|
|
186
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
187
|
-
end
|
188
|
-
end
|
189
|
-
else # model
|
190
|
-
temp_model = SwaggerClient.const_get(type).new
|
191
|
-
temp_model.build_from_hash(value)
|
192
|
-
end
|
193
|
-
end
|
194
|
-
|
195
|
-
# Returns the string representation of the object
|
196
|
-
# @return [String] String presentation of the object
|
197
|
-
def to_s
|
198
|
-
to_hash.to_s
|
199
|
-
end
|
200
|
-
|
201
|
-
# to_body is an alias to to_hash (backward compatibility)
|
202
|
-
# @return [Hash] Returns the object in the form of hash
|
203
|
-
def to_body
|
204
|
-
to_hash
|
205
|
-
end
|
206
|
-
|
207
|
-
# Returns the object in the form of hash
|
208
|
-
# @return [Hash] Returns the object in the form of hash
|
209
|
-
def to_hash
|
210
|
-
hash = {}
|
211
|
-
self.class.attribute_map.each_pair do |attr, param|
|
212
|
-
value = self.send(attr)
|
213
|
-
next if value.nil?
|
214
|
-
hash[param] = _to_hash(value)
|
215
|
-
end
|
216
|
-
hash
|
217
|
-
end
|
218
|
-
|
219
|
-
# Outputs non-array value in the form of hash
|
220
|
-
# For object, use to_hash. Otherwise, just return the value
|
221
|
-
# @param [Object] value Any valid value
|
222
|
-
# @return [Hash] Returns the value in the form of hash
|
223
|
-
def _to_hash(value)
|
224
|
-
if value.is_a?(Array)
|
225
|
-
value.compact.map{ |v| _to_hash(v) }
|
226
|
-
elsif value.is_a?(Hash)
|
227
|
-
{}.tap do |hash|
|
228
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
229
|
-
end
|
230
|
-
elsif value.respond_to? :to_hash
|
231
|
-
value.to_hash
|
232
|
-
else
|
233
|
-
value
|
234
|
-
end
|
235
|
-
end
|
236
|
-
|
237
|
-
end
|
238
|
-
|
239
|
-
end
|