aimastering 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +18 -5
- data/aimastering.gemspec +4 -4
- data/docs/AccessTokenApi.md +1 -1
- data/docs/AmazonSubscription.md +12 -0
- data/docs/AmazonSubscriptionApi.md +55 -0
- data/docs/Audio.md +4 -0
- data/docs/AudioApi.md +4 -2
- data/docs/Config.md +1 -0
- data/docs/ConfigApi.md +1 -1
- data/docs/{DateTime.md → ConfigVersion.md} +2 -1
- data/docs/ExternalSearchApi.md +1 -1
- data/docs/GroupBuyStatistics.md +8 -0
- data/docs/LibraryAudio.md +4 -0
- data/docs/LibraryAudioApi.md +1 -1
- data/docs/Mastering.md +9 -0
- data/docs/MasteringApi.md +151 -29
- data/docs/PaymentApi.md +3 -3
- data/docs/PaymentCustomerApi.md +1 -1
- data/docs/PlanApi.md +1 -1
- data/docs/SpSubscription.md +12 -0
- data/docs/SpSubscriptionApi.md +112 -0
- data/docs/StatisticsApi.md +48 -1
- data/docs/Subscription.md +1 -0
- data/docs/SubscriptionApi.md +4 -2
- data/docs/User.md +3 -0
- data/docs/UserApi.md +110 -1
- data/docs/UserStatistics.md +13 -0
- data/docs/VideoApi.md +1 -1
- data/lib/aimastering.rb +8 -1
- data/lib/aimastering/api/access_token_api.rb +1 -1
- data/lib/aimastering/api/amazon_subscription_api.rb +70 -0
- data/lib/aimastering/api/audio_api.rb +4 -1
- data/lib/aimastering/api/config_api.rb +1 -1
- data/lib/aimastering/api/external_search_api.rb +1 -1
- data/lib/aimastering/api/library_audio_api.rb +1 -1
- data/lib/aimastering/api/mastering_api.rb +162 -16
- data/lib/aimastering/api/payment_api.rb +1 -1
- data/lib/aimastering/api/payment_customer_api.rb +1 -1
- data/lib/aimastering/api/plan_api.rb +1 -1
- data/lib/aimastering/api/sp_subscription_api.rb +133 -0
- data/lib/aimastering/api/statistics_api.rb +48 -1
- data/lib/aimastering/api/subscription_api.rb +4 -1
- data/lib/aimastering/api/user_api.rb +112 -1
- data/lib/aimastering/api/video_api.rb +1 -1
- data/lib/aimastering/api_client.rb +1 -1
- data/lib/aimastering/api_error.rb +1 -1
- data/lib/aimastering/configuration.rb +3 -3
- data/lib/aimastering/models/access_token.rb +1 -1
- data/lib/aimastering/models/amazon_subscription.rb +257 -0
- data/lib/aimastering/models/anonymized_mastering.rb +5 -5
- data/lib/aimastering/models/audio.rb +38 -2
- data/lib/aimastering/models/audio_analysis.rb +1 -1
- data/lib/aimastering/models/audio_download_token.rb +1 -1
- data/lib/aimastering/models/config.rb +14 -5
- data/lib/aimastering/models/config_auth0.rb +1 -1
- data/lib/aimastering/models/config_paypal.rb +1 -1
- data/lib/aimastering/models/config_stripe.rb +1 -1
- data/lib/aimastering/models/{date_time.rb → config_version.rb} +14 -5
- data/lib/aimastering/models/external_search_result.rb +1 -1
- data/lib/aimastering/models/external_search_result_itunes.rb +1 -1
- data/lib/aimastering/models/external_search_result_youtube.rb +1 -1
- data/lib/aimastering/models/group_buy_statistics.rb +188 -0
- data/lib/aimastering/models/jwt.rb +1 -1
- data/lib/aimastering/models/kpi.rb +1 -1
- data/lib/aimastering/models/library_audio.rb +38 -2
- data/lib/aimastering/models/library_audio_analysis.rb +1 -1
- data/lib/aimastering/models/library_audio_like.rb +1 -1
- data/lib/aimastering/models/mastering.rb +123 -6
- data/lib/aimastering/models/payment.rb +1 -1
- data/lib/aimastering/models/payment_customer.rb +1 -1
- data/lib/aimastering/models/plan.rb +1 -1
- data/lib/aimastering/models/sp_subscription.rb +257 -0
- data/lib/aimastering/models/subscription.rb +11 -2
- data/lib/aimastering/models/user.rb +29 -2
- data/lib/aimastering/models/user_statistics.rb +233 -0
- data/lib/aimastering/models/video.rb +1 -1
- data/lib/aimastering/models/video_download_token.rb +1 -1
- data/lib/aimastering/version.rb +2 -2
- data/spec/api/access_token_api_spec.rb +1 -1
- data/spec/api/amazon_subscription_api_spec.rb +46 -0
- data/spec/api/audio_api_spec.rb +2 -1
- data/spec/api/config_api_spec.rb +1 -1
- data/spec/api/external_search_api_spec.rb +1 -1
- data/spec/api/library_audio_api_spec.rb +1 -1
- data/spec/api/mastering_api_spec.rb +35 -4
- data/spec/api/payment_api_spec.rb +1 -1
- data/spec/api/payment_customer_api_spec.rb +1 -1
- data/spec/api/plan_api_spec.rb +1 -1
- data/spec/api/sp_subscription_api_spec.rb +59 -0
- data/spec/api/statistics_api_spec.rb +12 -1
- data/spec/api/subscription_api_spec.rb +2 -1
- data/spec/api/user_api_spec.rb +26 -1
- data/spec/api/video_api_spec.rb +1 -1
- data/spec/api_client_spec.rb +1 -1
- data/spec/configuration_spec.rb +4 -4
- data/spec/models/access_token_spec.rb +1 -1
- data/spec/models/amazon_subscription_spec.rb +70 -0
- data/spec/models/anonymized_mastering_spec.rb +3 -3
- data/spec/models/audio_analysis_spec.rb +1 -1
- data/spec/models/audio_download_token_spec.rb +1 -1
- data/spec/models/audio_spec.rb +25 -1
- data/spec/models/config_auth0_spec.rb +1 -1
- data/spec/models/config_paypal_spec.rb +1 -1
- data/spec/models/config_spec.rb +7 -1
- data/spec/models/config_stripe_spec.rb +1 -1
- data/spec/models/config_version_spec.rb +42 -0
- data/spec/models/external_search_result_itunes_spec.rb +1 -1
- data/spec/models/external_search_result_spec.rb +1 -1
- data/spec/models/external_search_result_youtube_spec.rb +1 -1
- data/spec/models/group_buy_statistics_spec.rb +42 -0
- data/spec/models/jwt_spec.rb +1 -1
- data/spec/models/kpi_spec.rb +1 -1
- data/spec/models/library_audio_analysis_spec.rb +1 -1
- data/spec/models/library_audio_like_spec.rb +1 -1
- data/spec/models/library_audio_spec.rb +25 -1
- data/spec/models/mastering_spec.rb +69 -3
- data/spec/models/payment_customer_spec.rb +1 -1
- data/spec/models/payment_spec.rb +1 -1
- data/spec/models/plan_spec.rb +1 -1
- data/spec/models/sp_subscription_spec.rb +70 -0
- data/spec/models/subscription_spec.rb +7 -1
- data/spec/models/user_spec.rb +19 -1
- data/spec/models/user_statistics_spec.rb +72 -0
- data/spec/models/video_download_token_spec.rb +1 -1
- data/spec/models/video_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +46 -23
- data/spec/models/date_time_spec.rb +0 -36
@@ -4,7 +4,7 @@
|
|
4
4
|
#This is a AI Mastering API document. You can use the mastering feature of [AI Mastering](https://aimastering.com) through this API.
|
5
5
|
|
6
6
|
OpenAPI spec version: 1.0.0
|
7
|
-
Contact:
|
7
|
+
Contact: info@bakuage.com
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
9
|
Swagger Codegen version: 2.3.1
|
10
10
|
|
@@ -20,6 +20,53 @@ module Aimastering
|
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
22
|
|
23
|
+
# Get group buy statistics.
|
24
|
+
#
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [GroupBuyStatistics]
|
27
|
+
def get_group_buy_statistics(opts = {})
|
28
|
+
data, _status_code, _headers = get_group_buy_statistics_with_http_info(opts)
|
29
|
+
return data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Get group buy statistics.
|
33
|
+
#
|
34
|
+
# @param [Hash] opts the optional parameters
|
35
|
+
# @return [Array<(GroupBuyStatistics, Fixnum, Hash)>] GroupBuyStatistics data, response status code and response headers
|
36
|
+
def get_group_buy_statistics_with_http_info(opts = {})
|
37
|
+
if @api_client.config.debugging
|
38
|
+
@api_client.config.logger.debug "Calling API: StatisticsApi.get_group_buy_statistics ..."
|
39
|
+
end
|
40
|
+
# resource path
|
41
|
+
local_var_path = "/statistics/group_buy"
|
42
|
+
|
43
|
+
# query parameters
|
44
|
+
query_params = {}
|
45
|
+
|
46
|
+
# header parameters
|
47
|
+
header_params = {}
|
48
|
+
# HTTP header 'Accept' (if needed)
|
49
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
50
|
+
|
51
|
+
# form parameters
|
52
|
+
form_params = {}
|
53
|
+
|
54
|
+
# http body (model)
|
55
|
+
post_body = nil
|
56
|
+
auth_names = ['bearer']
|
57
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
58
|
+
:header_params => header_params,
|
59
|
+
:query_params => query_params,
|
60
|
+
:form_params => form_params,
|
61
|
+
:body => post_body,
|
62
|
+
:auth_names => auth_names,
|
63
|
+
:return_type => 'GroupBuyStatistics')
|
64
|
+
if @api_client.config.debugging
|
65
|
+
@api_client.config.logger.debug "API called: StatisticsApi#get_group_buy_statistics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
66
|
+
end
|
67
|
+
return data, status_code, headers
|
68
|
+
end
|
69
|
+
|
23
70
|
# Get anonymized masterings.
|
24
71
|
#
|
25
72
|
# @param [Hash] opts the optional parameters
|
@@ -4,7 +4,7 @@
|
|
4
4
|
#This is a AI Mastering API document. You can use the mastering feature of [AI Mastering](https://aimastering.com) through this API.
|
5
5
|
|
6
6
|
OpenAPI spec version: 1.0.0
|
7
|
-
Contact:
|
7
|
+
Contact: info@bakuage.com
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
9
|
Swagger Codegen version: 2.3.1
|
10
10
|
|
@@ -144,6 +144,7 @@ module Aimastering
|
|
144
144
|
# @param [Hash] opts the optional parameters
|
145
145
|
# @option opts [String] :stripe_plan_id The Stripe plan id. This parameter is effective only when the service is \"stripe\".
|
146
146
|
# @option opts [String] :token This parameter represents the card token. This parameter is effective only when the service is \"stripe\".
|
147
|
+
# @option opts [String] :affiliate_id Affiliate id of inviter user.
|
147
148
|
# @return [Subscription]
|
148
149
|
def create_subscription(service, opts = {})
|
149
150
|
data, _status_code, _headers = create_subscription_with_http_info(service, opts)
|
@@ -156,6 +157,7 @@ module Aimastering
|
|
156
157
|
# @param [Hash] opts the optional parameters
|
157
158
|
# @option opts [String] :stripe_plan_id The Stripe plan id. This parameter is effective only when the service is \"stripe\".
|
158
159
|
# @option opts [String] :token This parameter represents the card token. This parameter is effective only when the service is \"stripe\".
|
160
|
+
# @option opts [String] :affiliate_id Affiliate id of inviter user.
|
159
161
|
# @return [Array<(Subscription, Fixnum, Hash)>] Subscription data, response status code and response headers
|
160
162
|
def create_subscription_with_http_info(service, opts = {})
|
161
163
|
if @api_client.config.debugging
|
@@ -187,6 +189,7 @@ module Aimastering
|
|
187
189
|
form_params["service"] = service
|
188
190
|
form_params["stripe_plan_id"] = opts[:'stripe_plan_id'] if !opts[:'stripe_plan_id'].nil?
|
189
191
|
form_params["token"] = opts[:'token'] if !opts[:'token'].nil?
|
192
|
+
form_params["affiliate_id"] = opts[:'affiliate_id'] if !opts[:'affiliate_id'].nil?
|
190
193
|
|
191
194
|
# http body (model)
|
192
195
|
post_body = nil
|
@@ -4,7 +4,7 @@
|
|
4
4
|
#This is a AI Mastering API document. You can use the mastering feature of [AI Mastering](https://aimastering.com) through this API.
|
5
5
|
|
6
6
|
OpenAPI spec version: 1.0.0
|
7
|
-
Contact:
|
7
|
+
Contact: info@bakuage.com
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
9
|
Swagger Codegen version: 2.3.1
|
10
10
|
|
@@ -67,6 +67,117 @@ module Aimastering
|
|
67
67
|
return data, status_code, headers
|
68
68
|
end
|
69
69
|
|
70
|
+
# Notify user is registered.
|
71
|
+
#
|
72
|
+
# @param [Hash] opts the optional parameters
|
73
|
+
# @option opts [String] :affiliate_id The affiliate id of inviter.
|
74
|
+
# @option opts [String] :referrer_url The referrer URL.
|
75
|
+
# @return [User]
|
76
|
+
def notify_registration(opts = {})
|
77
|
+
data, _status_code, _headers = notify_registration_with_http_info(opts)
|
78
|
+
return data
|
79
|
+
end
|
80
|
+
|
81
|
+
# Notify user is registered.
|
82
|
+
#
|
83
|
+
# @param [Hash] opts the optional parameters
|
84
|
+
# @option opts [String] :affiliate_id The affiliate id of inviter.
|
85
|
+
# @option opts [String] :referrer_url The referrer URL.
|
86
|
+
# @return [Array<(User, Fixnum, Hash)>] User data, response status code and response headers
|
87
|
+
def notify_registration_with_http_info(opts = {})
|
88
|
+
if @api_client.config.debugging
|
89
|
+
@api_client.config.logger.debug "Calling API: UserApi.notify_registration ..."
|
90
|
+
end
|
91
|
+
# resource path
|
92
|
+
local_var_path = "/users/self/notify_registration"
|
93
|
+
|
94
|
+
# query parameters
|
95
|
+
query_params = {}
|
96
|
+
|
97
|
+
# header parameters
|
98
|
+
header_params = {}
|
99
|
+
# HTTP header 'Accept' (if needed)
|
100
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
101
|
+
# HTTP header 'Content-Type'
|
102
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
103
|
+
|
104
|
+
# form parameters
|
105
|
+
form_params = {}
|
106
|
+
form_params["affiliate_id"] = opts[:'affiliate_id'] if !opts[:'affiliate_id'].nil?
|
107
|
+
form_params["referrer_url"] = opts[:'referrer_url'] if !opts[:'referrer_url'].nil?
|
108
|
+
|
109
|
+
# http body (model)
|
110
|
+
post_body = nil
|
111
|
+
auth_names = ['bearer']
|
112
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
113
|
+
:header_params => header_params,
|
114
|
+
:query_params => query_params,
|
115
|
+
:form_params => form_params,
|
116
|
+
:body => post_body,
|
117
|
+
:auth_names => auth_names,
|
118
|
+
:return_type => 'User')
|
119
|
+
if @api_client.config.debugging
|
120
|
+
@api_client.config.logger.debug "API called: UserApi#notify_registration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
121
|
+
end
|
122
|
+
return data, status_code, headers
|
123
|
+
end
|
124
|
+
|
125
|
+
# Send invitation.
|
126
|
+
#
|
127
|
+
# @param invitee_email The email of invitee.
|
128
|
+
# @param [Hash] opts the optional parameters
|
129
|
+
# @return [User]
|
130
|
+
def send_invitation(invitee_email, opts = {})
|
131
|
+
data, _status_code, _headers = send_invitation_with_http_info(invitee_email, opts)
|
132
|
+
return data
|
133
|
+
end
|
134
|
+
|
135
|
+
# Send invitation.
|
136
|
+
#
|
137
|
+
# @param invitee_email The email of invitee.
|
138
|
+
# @param [Hash] opts the optional parameters
|
139
|
+
# @return [Array<(User, Fixnum, Hash)>] User data, response status code and response headers
|
140
|
+
def send_invitation_with_http_info(invitee_email, opts = {})
|
141
|
+
if @api_client.config.debugging
|
142
|
+
@api_client.config.logger.debug "Calling API: UserApi.send_invitation ..."
|
143
|
+
end
|
144
|
+
# verify the required parameter 'invitee_email' is set
|
145
|
+
if @api_client.config.client_side_validation && invitee_email.nil?
|
146
|
+
fail ArgumentError, "Missing the required parameter 'invitee_email' when calling UserApi.send_invitation"
|
147
|
+
end
|
148
|
+
# resource path
|
149
|
+
local_var_path = "/users/self/send_invitation"
|
150
|
+
|
151
|
+
# query parameters
|
152
|
+
query_params = {}
|
153
|
+
|
154
|
+
# header parameters
|
155
|
+
header_params = {}
|
156
|
+
# HTTP header 'Accept' (if needed)
|
157
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
158
|
+
# HTTP header 'Content-Type'
|
159
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
160
|
+
|
161
|
+
# form parameters
|
162
|
+
form_params = {}
|
163
|
+
form_params["invitee_email"] = invitee_email
|
164
|
+
|
165
|
+
# http body (model)
|
166
|
+
post_body = nil
|
167
|
+
auth_names = ['bearer']
|
168
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
169
|
+
:header_params => header_params,
|
170
|
+
:query_params => query_params,
|
171
|
+
:form_params => form_params,
|
172
|
+
:body => post_body,
|
173
|
+
:auth_names => auth_names,
|
174
|
+
:return_type => 'User')
|
175
|
+
if @api_client.config.debugging
|
176
|
+
@api_client.config.logger.debug "API called: UserApi#send_invitation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
177
|
+
end
|
178
|
+
return data, status_code, headers
|
179
|
+
end
|
180
|
+
|
70
181
|
# Update self user.
|
71
182
|
#
|
72
183
|
# @param [Hash] opts the optional parameters
|
@@ -4,7 +4,7 @@
|
|
4
4
|
#This is a AI Mastering API document. You can use the mastering feature of [AI Mastering](https://aimastering.com) through this API.
|
5
5
|
|
6
6
|
OpenAPI spec version: 1.0.0
|
7
|
-
Contact:
|
7
|
+
Contact: info@bakuage.com
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
9
|
Swagger Codegen version: 2.3.1
|
10
10
|
|
@@ -4,7 +4,7 @@
|
|
4
4
|
#This is a AI Mastering API document. You can use the mastering feature of [AI Mastering](https://aimastering.com) through this API.
|
5
5
|
|
6
6
|
OpenAPI spec version: 1.0.0
|
7
|
-
Contact:
|
7
|
+
Contact: info@bakuage.com
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
9
|
Swagger Codegen version: 2.3.1
|
10
10
|
|
@@ -4,7 +4,7 @@
|
|
4
4
|
#This is a AI Mastering API document. You can use the mastering feature of [AI Mastering](https://aimastering.com) through this API.
|
5
5
|
|
6
6
|
OpenAPI spec version: 1.0.0
|
7
|
-
Contact:
|
7
|
+
Contact: info@bakuage.com
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
9
|
Swagger Codegen version: 2.3.1
|
10
10
|
|
@@ -4,7 +4,7 @@
|
|
4
4
|
#This is a AI Mastering API document. You can use the mastering feature of [AI Mastering](https://aimastering.com) through this API.
|
5
5
|
|
6
6
|
OpenAPI spec version: 1.0.0
|
7
|
-
Contact:
|
7
|
+
Contact: info@bakuage.com
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
9
|
Swagger Codegen version: 2.3.1
|
10
10
|
|
@@ -129,8 +129,8 @@ module Aimastering
|
|
129
129
|
|
130
130
|
def initialize
|
131
131
|
@scheme = 'https'
|
132
|
-
@host = '
|
133
|
-
@base_path = '
|
132
|
+
@host = 'api.bakuage.com:443'
|
133
|
+
@base_path = ''
|
134
134
|
@api_key = {}
|
135
135
|
@api_key_prefix = {}
|
136
136
|
@timeout = 0
|
@@ -4,7 +4,7 @@
|
|
4
4
|
#This is a AI Mastering API document. You can use the mastering feature of [AI Mastering](https://aimastering.com) through this API.
|
5
5
|
|
6
6
|
OpenAPI spec version: 1.0.0
|
7
|
-
Contact:
|
7
|
+
Contact: info@bakuage.com
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
9
|
Swagger Codegen version: 2.3.1
|
10
10
|
|
@@ -0,0 +1,257 @@
|
|
1
|
+
=begin
|
2
|
+
#AI Mastering API
|
3
|
+
|
4
|
+
#This is a AI Mastering API document. You can use the mastering feature of [AI Mastering](https://aimastering.com) through this API.
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.0
|
7
|
+
Contact: info@bakuage.com
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module Aimastering
|
16
|
+
|
17
|
+
class AmazonSubscription
|
18
|
+
attr_accessor :id
|
19
|
+
|
20
|
+
attr_accessor :user_id
|
21
|
+
|
22
|
+
attr_accessor :status
|
23
|
+
|
24
|
+
attr_accessor :created_at
|
25
|
+
|
26
|
+
attr_accessor :updated_at
|
27
|
+
|
28
|
+
class EnumAttributeValidator
|
29
|
+
attr_reader :datatype
|
30
|
+
attr_reader :allowable_values
|
31
|
+
|
32
|
+
def initialize(datatype, allowable_values)
|
33
|
+
@allowable_values = allowable_values.map do |value|
|
34
|
+
case datatype.to_s
|
35
|
+
when /Integer/i
|
36
|
+
value.to_i
|
37
|
+
when /Float/i
|
38
|
+
value.to_f
|
39
|
+
else
|
40
|
+
value
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def valid?(value)
|
46
|
+
!value || allowable_values.include?(value)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
51
|
+
def self.attribute_map
|
52
|
+
{
|
53
|
+
:'id' => :'id',
|
54
|
+
:'user_id' => :'user_id',
|
55
|
+
:'status' => :'status',
|
56
|
+
:'created_at' => :'created_at',
|
57
|
+
:'updated_at' => :'updated_at'
|
58
|
+
}
|
59
|
+
end
|
60
|
+
|
61
|
+
# Attribute type mapping.
|
62
|
+
def self.swagger_types
|
63
|
+
{
|
64
|
+
:'id' => :'Integer',
|
65
|
+
:'user_id' => :'Integer',
|
66
|
+
:'status' => :'String',
|
67
|
+
:'created_at' => :'DateTime',
|
68
|
+
:'updated_at' => :'DateTime'
|
69
|
+
}
|
70
|
+
end
|
71
|
+
|
72
|
+
# Initializes the object
|
73
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
74
|
+
def initialize(attributes = {})
|
75
|
+
return unless attributes.is_a?(Hash)
|
76
|
+
|
77
|
+
# convert string to symbol for hash key
|
78
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
79
|
+
|
80
|
+
if attributes.has_key?(:'id')
|
81
|
+
self.id = attributes[:'id']
|
82
|
+
end
|
83
|
+
|
84
|
+
if attributes.has_key?(:'user_id')
|
85
|
+
self.user_id = attributes[:'user_id']
|
86
|
+
end
|
87
|
+
|
88
|
+
if attributes.has_key?(:'status')
|
89
|
+
self.status = attributes[:'status']
|
90
|
+
end
|
91
|
+
|
92
|
+
if attributes.has_key?(:'created_at')
|
93
|
+
self.created_at = attributes[:'created_at']
|
94
|
+
end
|
95
|
+
|
96
|
+
if attributes.has_key?(:'updated_at')
|
97
|
+
self.updated_at = attributes[:'updated_at']
|
98
|
+
end
|
99
|
+
|
100
|
+
end
|
101
|
+
|
102
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
103
|
+
# @return Array for valid properties with the reasons
|
104
|
+
def list_invalid_properties
|
105
|
+
invalid_properties = Array.new
|
106
|
+
return invalid_properties
|
107
|
+
end
|
108
|
+
|
109
|
+
# Check to see if the all the properties in the model are valid
|
110
|
+
# @return true if the model is valid
|
111
|
+
def valid?
|
112
|
+
status_validator = EnumAttributeValidator.new('String', ["active", "deactivated"])
|
113
|
+
return false unless status_validator.valid?(@status)
|
114
|
+
return true
|
115
|
+
end
|
116
|
+
|
117
|
+
# Custom attribute writer method checking allowed values (enum).
|
118
|
+
# @param [Object] status Object to be assigned
|
119
|
+
def status=(status)
|
120
|
+
validator = EnumAttributeValidator.new('String', ["active", "deactivated"])
|
121
|
+
unless validator.valid?(status)
|
122
|
+
fail ArgumentError, "invalid value for 'status', must be one of #{validator.allowable_values}."
|
123
|
+
end
|
124
|
+
@status = status
|
125
|
+
end
|
126
|
+
|
127
|
+
# Checks equality by comparing each attribute.
|
128
|
+
# @param [Object] Object to be compared
|
129
|
+
def ==(o)
|
130
|
+
return true if self.equal?(o)
|
131
|
+
self.class == o.class &&
|
132
|
+
id == o.id &&
|
133
|
+
user_id == o.user_id &&
|
134
|
+
status == o.status &&
|
135
|
+
created_at == o.created_at &&
|
136
|
+
updated_at == o.updated_at
|
137
|
+
end
|
138
|
+
|
139
|
+
# @see the `==` method
|
140
|
+
# @param [Object] Object to be compared
|
141
|
+
def eql?(o)
|
142
|
+
self == o
|
143
|
+
end
|
144
|
+
|
145
|
+
# Calculates hash code according to all attributes.
|
146
|
+
# @return [Fixnum] Hash code
|
147
|
+
def hash
|
148
|
+
[id, user_id, status, created_at, updated_at].hash
|
149
|
+
end
|
150
|
+
|
151
|
+
# Builds the object from hash
|
152
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
153
|
+
# @return [Object] Returns the model itself
|
154
|
+
def build_from_hash(attributes)
|
155
|
+
return nil unless attributes.is_a?(Hash)
|
156
|
+
self.class.swagger_types.each_pair do |key, type|
|
157
|
+
if type =~ /\AArray<(.*)>/i
|
158
|
+
# check to ensure the input is an array given that the the attribute
|
159
|
+
# is documented as an array but the input is not
|
160
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
161
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
162
|
+
end
|
163
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
164
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
165
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
166
|
+
end
|
167
|
+
|
168
|
+
self
|
169
|
+
end
|
170
|
+
|
171
|
+
# Deserializes the data based on type
|
172
|
+
# @param string type Data type
|
173
|
+
# @param string value Value to be deserialized
|
174
|
+
# @return [Object] Deserialized data
|
175
|
+
def _deserialize(type, value)
|
176
|
+
case type.to_sym
|
177
|
+
when :DateTime
|
178
|
+
DateTime.parse(value)
|
179
|
+
when :Date
|
180
|
+
Date.parse(value)
|
181
|
+
when :String
|
182
|
+
value.to_s
|
183
|
+
when :Integer
|
184
|
+
value.to_i
|
185
|
+
when :Float
|
186
|
+
value.to_f
|
187
|
+
when :BOOLEAN
|
188
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
189
|
+
true
|
190
|
+
else
|
191
|
+
false
|
192
|
+
end
|
193
|
+
when :Object
|
194
|
+
# generic object (usually a Hash), return directly
|
195
|
+
value
|
196
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
197
|
+
inner_type = Regexp.last_match[:inner_type]
|
198
|
+
value.map { |v| _deserialize(inner_type, v) }
|
199
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
200
|
+
k_type = Regexp.last_match[:k_type]
|
201
|
+
v_type = Regexp.last_match[:v_type]
|
202
|
+
{}.tap do |hash|
|
203
|
+
value.each do |k, v|
|
204
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
205
|
+
end
|
206
|
+
end
|
207
|
+
else # model
|
208
|
+
temp_model = Aimastering.const_get(type).new
|
209
|
+
temp_model.build_from_hash(value)
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
213
|
+
# Returns the string representation of the object
|
214
|
+
# @return [String] String presentation of the object
|
215
|
+
def to_s
|
216
|
+
to_hash.to_s
|
217
|
+
end
|
218
|
+
|
219
|
+
# to_body is an alias to to_hash (backward compatibility)
|
220
|
+
# @return [Hash] Returns the object in the form of hash
|
221
|
+
def to_body
|
222
|
+
to_hash
|
223
|
+
end
|
224
|
+
|
225
|
+
# Returns the object in the form of hash
|
226
|
+
# @return [Hash] Returns the object in the form of hash
|
227
|
+
def to_hash
|
228
|
+
hash = {}
|
229
|
+
self.class.attribute_map.each_pair do |attr, param|
|
230
|
+
value = self.send(attr)
|
231
|
+
next if value.nil?
|
232
|
+
hash[param] = _to_hash(value)
|
233
|
+
end
|
234
|
+
hash
|
235
|
+
end
|
236
|
+
|
237
|
+
# Outputs non-array value in the form of hash
|
238
|
+
# For object, use to_hash. Otherwise, just return the value
|
239
|
+
# @param [Object] value Any valid value
|
240
|
+
# @return [Hash] Returns the value in the form of hash
|
241
|
+
def _to_hash(value)
|
242
|
+
if value.is_a?(Array)
|
243
|
+
value.compact.map{ |v| _to_hash(v) }
|
244
|
+
elsif value.is_a?(Hash)
|
245
|
+
{}.tap do |hash|
|
246
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
247
|
+
end
|
248
|
+
elsif value.respond_to? :to_hash
|
249
|
+
value.to_hash
|
250
|
+
else
|
251
|
+
value
|
252
|
+
end
|
253
|
+
end
|
254
|
+
|
255
|
+
end
|
256
|
+
|
257
|
+
end
|