freelancer 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. data/.gitignore +3 -0
  2. data/Gemfile +14 -0
  3. data/LICENSE +20 -0
  4. data/README.rdoc +56 -0
  5. data/Rakefile +34 -0
  6. data/VERSION +1 -0
  7. data/freelancer.gemspec +299 -0
  8. data/init.rb +2 -0
  9. data/lib/freelancer.rb +59 -0
  10. data/lib/freelancer/api.rb +20 -0
  11. data/lib/freelancer/api/common.rb +58 -0
  12. data/lib/freelancer/api/employer.rb +56 -0
  13. data/lib/freelancer/api/freelancer.rb +36 -0
  14. data/lib/freelancer/api/job.rb +46 -0
  15. data/lib/freelancer/api/message.rb +89 -0
  16. data/lib/freelancer/api/notification.rb +25 -0
  17. data/lib/freelancer/api/payment.rb +123 -0
  18. data/lib/freelancer/api/profile.rb +30 -0
  19. data/lib/freelancer/api/project.rb +133 -0
  20. data/lib/freelancer/api/user.rb +86 -0
  21. data/lib/freelancer/client.rb +152 -0
  22. data/lib/freelancer/extensions/hash.rb +11 -0
  23. data/lib/freelancer/models/address.rb +46 -0
  24. data/lib/freelancer/models/balance.rb +22 -0
  25. data/lib/freelancer/models/bid.rb +41 -0
  26. data/lib/freelancer/models/config_version.rb +21 -0
  27. data/lib/freelancer/models/eligibility.rb +23 -0
  28. data/lib/freelancer/models/job.rb +33 -0
  29. data/lib/freelancer/models/job_category.rb +18 -0
  30. data/lib/freelancer/models/message.rb +32 -0
  31. data/lib/freelancer/models/milestone.rb +57 -0
  32. data/lib/freelancer/models/news.rb +15 -0
  33. data/lib/freelancer/models/notification.rb +15 -0
  34. data/lib/freelancer/models/notification_status.rb +45 -0
  35. data/lib/freelancer/models/project.rb +116 -0
  36. data/lib/freelancer/models/project_budget.rb +21 -0
  37. data/lib/freelancer/models/project_fee.rb +18 -0
  38. data/lib/freelancer/models/project_options.rb +34 -0
  39. data/lib/freelancer/models/rating.rb +21 -0
  40. data/lib/freelancer/models/review.rb +87 -0
  41. data/lib/freelancer/models/transaction.rb +39 -0
  42. data/lib/freelancer/models/user.rb +225 -0
  43. data/lib/freelancer/models/withdrawal.rb +51 -0
  44. data/lib/freelancer/models/withdrawal_fee.rb +39 -0
  45. data/lib/freelancer/support/json_mapper.rb +95 -0
  46. data/test/fixtures/common/get_config_version.json +1 -0
  47. data/test/fixtures/common/get_config_version.xml +5 -0
  48. data/test/fixtures/common/get_pending_feedback.json +1 -0
  49. data/test/fixtures/common/get_pending_feedback.xml +20 -0
  50. data/test/fixtures/common/get_terms.json +1 -0
  51. data/test/fixtures/common/get_terms.xml +4 -0
  52. data/test/fixtures/common/post_feedback.json +1 -0
  53. data/test/fixtures/common/post_feedback.xml +4 -0
  54. data/test/fixtures/common/post_reply_for_feedback.json +1 -0
  55. data/test/fixtures/common/post_reply_for_feedback.xml +4 -0
  56. data/test/fixtures/common/request_cancel_project.json +1 -0
  57. data/test/fixtures/common/request_cancel_project.xml +4 -0
  58. data/test/fixtures/common/request_withdraw_feedback.json +1 -0
  59. data/test/fixtures/common/request_withdraw_feedback.xml +4 -0
  60. data/test/fixtures/employer/choose_winner_for_project.json +1 -0
  61. data/test/fixtures/employer/choose_winner_for_project.xml +3 -0
  62. data/test/fixtures/employer/delete_draft_project.json +1 -0
  63. data/test/fixtures/employer/delete_draft_project.xml +4 -0
  64. data/test/fixtures/employer/eligible_for_trial_project.json +1 -0
  65. data/test/fixtures/employer/eligible_for_trial_project.xml +5 -0
  66. data/test/fixtures/employer/get_posted_project_list.json +1 -0
  67. data/test/fixtures/employer/get_posted_project_list.xml +38 -0
  68. data/test/fixtures/employer/invite_user_for_project.json +1 -0
  69. data/test/fixtures/employer/invite_user_for_project.xml +4 -0
  70. data/test/fixtures/employer/post_new_draft_project.json +1 -0
  71. data/test/fixtures/employer/post_new_draft_project.xml +5 -0
  72. data/test/fixtures/employer/post_new_project.json +1 -0
  73. data/test/fixtures/employer/post_new_project.xml +5 -0
  74. data/test/fixtures/employer/post_new_trial_project.json +1 -0
  75. data/test/fixtures/employer/post_new_trial_project.xml +5 -0
  76. data/test/fixtures/employer/publish_draft_project.json +1 -0
  77. data/test/fixtures/employer/publish_draft_project.xml +4 -0
  78. data/test/fixtures/employer/update_project_details.json +1 -0
  79. data/test/fixtures/employer/update_project_details.xml +4 -0
  80. data/test/fixtures/employer/upgrade_trial_project.json +1 -0
  81. data/test/fixtures/employer/upgrade_trial_project.xml +4 -0
  82. data/test/fixtures/freelancer/accept_bid_won.json +1 -0
  83. data/test/fixtures/freelancer/accept_bid_won.xml +4 -0
  84. data/test/fixtures/freelancer/get_project_list_for_placed_bids.json +1 -0
  85. data/test/fixtures/freelancer/get_project_list_for_placed_bids.xml +16 -0
  86. data/test/fixtures/freelancer/place_bid_on_project.json +1 -0
  87. data/test/fixtures/freelancer/place_bid_on_project.xml +4 -0
  88. data/test/fixtures/freelancer/retract_bid_from_project.json +1 -0
  89. data/test/fixtures/freelancer/retract_bid_from_project.xml +4 -0
  90. data/test/fixtures/job/get_category_job_list.json +1 -0
  91. data/test/fixtures/job/get_category_job_list.xml +34 -0
  92. data/test/fixtures/job/get_job_list.json +1 -0
  93. data/test/fixtures/job/get_job_list.xml +17 -0
  94. data/test/fixtures/job/get_my_job_list.json +1 -0
  95. data/test/fixtures/job/get_my_job_list.xml +11 -0
  96. data/test/fixtures/message/get_inbox_messages.json +1 -0
  97. data/test/fixtures/message/get_inbox_messages.xml +22 -0
  98. data/test/fixtures/message/get_sent_messages.json +1 -0
  99. data/test/fixtures/message/get_sent_messages.xml +22 -0
  100. data/test/fixtures/message/get_unread_count.json +1 -0
  101. data/test/fixtures/message/get_unread_count.xml +4 -0
  102. data/test/fixtures/message/load_message_thread.json +1 -0
  103. data/test/fixtures/message/load_message_thread.xml +54 -0
  104. data/test/fixtures/message/mark_message_as_read.json +1 -0
  105. data/test/fixtures/message/mark_message_as_read.xml +4 -0
  106. data/test/fixtures/message/send_message.json +1 -0
  107. data/test/fixtures/message/send_message.xml +4 -0
  108. data/test/fixtures/notification/get_news.json +1 -0
  109. data/test/fixtures/notification/get_news.xml +14 -0
  110. data/test/fixtures/notification/get_notification.json +1 -0
  111. data/test/fixtures/notification/get_notification.xml +10 -0
  112. data/test/fixtures/payment/cancel_milestone.json +1 -0
  113. data/test/fixtures/payment/cancel_milestone.xml +4 -0
  114. data/test/fixtures/payment/create_milestone_payment.json +1 -0
  115. data/test/fixtures/payment/create_milestone_payment.xml +4 -0
  116. data/test/fixtures/payment/get_account_balance_status.json +1 -0
  117. data/test/fixtures/payment/get_account_balance_status.xml +12 -0
  118. data/test/fixtures/payment/get_account_milestone_list.json +1 -0
  119. data/test/fixtures/payment/get_account_milestone_list.xml +30 -0
  120. data/test/fixtures/payment/get_account_transaction_list.json +1 -0
  121. data/test/fixtures/payment/get_account_transaction_list.xml +57 -0
  122. data/test/fixtures/payment/get_account_withdrawal_list.json +1 -0
  123. data/test/fixtures/payment/get_account_withdrawal_list.xml +42 -0
  124. data/test/fixtures/payment/get_balance.json +1 -0
  125. data/test/fixtures/payment/get_balance.xml +4 -0
  126. data/test/fixtures/payment/get_project_list_for_transfer.json +1 -0
  127. data/test/fixtures/payment/get_project_list_for_transfer.xml +52 -0
  128. data/test/fixtures/payment/get_withdrawal_fees.json +1 -0
  129. data/test/fixtures/payment/get_withdrawal_fees.xml +41 -0
  130. data/test/fixtures/payment/prepare_transfer.json +1 -0
  131. data/test/fixtures/payment/prepare_transfer.xml +4 -0
  132. data/test/fixtures/payment/release_milestone.json +1 -0
  133. data/test/fixtures/payment/release_milestone.xml +4 -0
  134. data/test/fixtures/payment/request_cancel_withdrawal.json +1 -0
  135. data/test/fixtures/payment/request_cancel_withdrawal.xml +4 -0
  136. data/test/fixtures/payment/request_release_milestone.json +1 -0
  137. data/test/fixtures/payment/request_release_milestone.xml +4 -0
  138. data/test/fixtures/payment/request_withdrawal.json +1 -0
  139. data/test/fixtures/payment/request_withdrawal.xml +6 -0
  140. data/test/fixtures/payment/transfer_money.json +1 -0
  141. data/test/fixtures/payment/transfer_money.xml +4 -0
  142. data/test/fixtures/profile/get_account_details.json +1 -0
  143. data/test/fixtures/profile/get_account_details.xml +71 -0
  144. data/test/fixtures/profile/get_profile_info.json +1 -0
  145. data/test/fixtures/profile/get_profile_info.xml +53 -0
  146. data/test/fixtures/profile/set_profile_info.json +1 -0
  147. data/test/fixtures/profile/set_profile_info.xml +4 -0
  148. data/test/fixtures/project/get_bids_details.json +1 -0
  149. data/test/fixtures/project/get_bids_details.xml +19 -0
  150. data/test/fixtures/project/get_project_budget_config.json +1 -0
  151. data/test/fixtures/project/get_project_budget_config.xml +42 -0
  152. data/test/fixtures/project/get_project_details.json +1 -0
  153. data/test/fixtures/project/get_project_details.xml +78 -0
  154. data/test/fixtures/project/get_project_fees.json +1 -0
  155. data/test/fixtures/project/get_project_fees.xml +31 -0
  156. data/test/fixtures/project/get_public_messages.json +1 -0
  157. data/test/fixtures/project/get_public_messages.xml +27 -0
  158. data/test/fixtures/project/get_sent_messages.xml +22 -0
  159. data/test/fixtures/project/get_unread_count.xml +4 -0
  160. data/test/fixtures/project/load_message_thread.xml +54 -0
  161. data/test/fixtures/project/mark_message_as_read.xml +4 -0
  162. data/test/fixtures/project/post_public_message.json +1 -0
  163. data/test/fixtures/project/post_public_message.xml +4 -0
  164. data/test/fixtures/project/search_projects.json +1 -0
  165. data/test/fixtures/project/search_projects.xml +37 -0
  166. data/test/fixtures/project/send_message.xml +4 -0
  167. data/test/fixtures/user/get_user_details.json +1 -0
  168. data/test/fixtures/user/get_user_details.xml +32 -0
  169. data/test/fixtures/user/get_user_feedback.json +1 -0
  170. data/test/fixtures/user/get_user_feedback.xml +58 -0
  171. data/test/fixtures/user/get_users_by_search.json +1 -0
  172. data/test/fixtures/user/get_users_by_search.xml +26 -0
  173. data/test/freelancer/api/common_api_test.rb +82 -0
  174. data/test/freelancer/api/employer_api_test.rb +105 -0
  175. data/test/freelancer/api/freelancer_api_test.rb +72 -0
  176. data/test/freelancer/api/job_api_test.rb +76 -0
  177. data/test/freelancer/api/message_api_test.rb +144 -0
  178. data/test/freelancer/api/notification_api_test.rb +56 -0
  179. data/test/freelancer/api/payment_api_test.rb +225 -0
  180. data/test/freelancer/api/profile_api_test.rb +54 -0
  181. data/test/freelancer/api/project_api_test.rb +229 -0
  182. data/test/freelancer/api/user_api_test.rb +153 -0
  183. data/test/freelancer/client_test.rb +5 -0
  184. data/test/freelancer/models/balance_test.rb +24 -0
  185. data/test/freelancer/models/bid_test.rb +25 -0
  186. data/test/freelancer/models/config_version.rb +14 -0
  187. data/test/freelancer/models/eligibility_test.rb +14 -0
  188. data/test/freelancer/models/job_category_test.rb +16 -0
  189. data/test/freelancer/models/job_test.rb +19 -0
  190. data/test/freelancer/models/message_test.rb +42 -0
  191. data/test/freelancer/models/milestone_test.rb +21 -0
  192. data/test/freelancer/models/news_test.rb +15 -0
  193. data/test/freelancer/models/notification_test.rb +15 -0
  194. data/test/freelancer/models/project_budget_test.rb +18 -0
  195. data/test/freelancer/models/project_fee_test.rb +17 -0
  196. data/test/freelancer/models/project_test.rb +97 -0
  197. data/test/freelancer/models/review_test.rb +36 -0
  198. data/test/freelancer/models/transaction_test.rb +29 -0
  199. data/test/freelancer/models/user_test.rb +94 -0
  200. data/test/freelancer/models/withdrawal_fee_test.rb +19 -0
  201. data/test/freelancer/models/withdrawal_test.rb +20 -0
  202. data/test/freelancer/oauth_test.rb +112 -0
  203. data/test/freelancer_test.rb +1 -0
  204. data/test/test_helper.rb +42 -0
  205. metadata +427 -0
@@ -0,0 +1,22 @@
1
+ module Freelancer
2
+ module Models
3
+ class Balance
4
+
5
+ include JSONMapper
6
+
7
+ # The amount of money in the users account
8
+ #
9
+ # Provided from:
10
+ # - /Payment/getAccountBalanceStatus.json
11
+ # - /Payment/getBalance.json
12
+ json_attribute :amount, [ :balanceamount, :balance ], Float
13
+
14
+ # The last transaction available for the user
15
+ #
16
+ # Provided from:
17
+ # - /Payment/getAccountBalanceStatus.json
18
+ json_attribute :last_transaction, "self", Transaction
19
+
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,41 @@
1
+ module Freelancer
2
+ module Models
3
+ class Bid
4
+
5
+ include JSONMapper
6
+
7
+ # The provider that made the bid
8
+ json_attribute :provider, "self", User
9
+
10
+ # The rating of the provider
11
+ json_attribute :provider_rating, :rating, Float
12
+
13
+ # The bid amount
14
+ json_attribute :amount, :bid_amount, Integer
15
+
16
+ # The milestone payment requirements
17
+ json_attribute :milestone, String
18
+
19
+ # If the bid is highlighted
20
+ json_attribute :highlighted, Boolean
21
+
22
+ # The number of days in the bid
23
+ json_attribute :days, :period, Integer
24
+
25
+ # The bid description
26
+ json_attribute :description, :descr, String
27
+
28
+ # The time the bid was placed
29
+ json_attribute :submitted_at, :submittime, DateTime
30
+
31
+ # The number of messages between the seller and bidder on this project
32
+ json_attribute :total_messages, :total_msg_count, Integer
33
+
34
+ # The number of unread messages between the seller and bidder on this project
35
+ json_attribute :unread_messages, :unread_msg_count, Integer
36
+
37
+ def highlighted?; return self.highlighted; end
38
+
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,21 @@
1
+ module Freelancer
2
+ module Models
3
+ class ConfigVersion
4
+
5
+ include JSONMapper
6
+
7
+ # The function requested
8
+ #
9
+ # Provided from:
10
+ # - /Common/getConfigVersion.json
11
+ json_attribute :function, String
12
+
13
+ # The version of the requested function
14
+ #
15
+ # Provided from:
16
+ # - /Common/getConfigVersion.json
17
+ json_attribute :version, Integer
18
+
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,23 @@
1
+ module Freelancer
2
+ module Models
3
+ class Eligibility
4
+
5
+ include JSONMapper
6
+
7
+ # If the user is eligible for the requested action
8
+ #
9
+ # Provided from:
10
+ # - /Employer/eligibleForTrialProject.json
11
+ json_attribute :eligible, Boolean
12
+
13
+ # The number of bonus point the user has
14
+ #
15
+ # Provided from:
16
+ # - /Employer/eligibleForTrialProject.json
17
+ json_attribute :bonus_points, :bonuspoints, Integer
18
+
19
+ def eligible?; self.eligible; end
20
+
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,33 @@
1
+ module Freelancer
2
+ module Models
3
+ class Job
4
+
5
+ include JSONMapper
6
+
7
+ # The id of the job
8
+ #
9
+ # Provided from:
10
+ # - /Job/getJobList.json
11
+ json_attribute :id, Integer
12
+
13
+ # The name of the job
14
+ #
15
+ # Provided from:
16
+ # - /Job/getJobList.json
17
+ json_attribute :name, String
18
+
19
+ # The number of projects available for the job type
20
+ #
21
+ # Provided from:
22
+ # - /Job/getJobList.json
23
+ json_attribute :project_count, Integer
24
+
25
+ # The SEO URL for the job
26
+ #
27
+ # Provided from:
28
+ # - /Job/getJobList.json
29
+ json_attribute :seo_url, String
30
+
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,18 @@
1
+ module Freelancer
2
+ module Models
3
+ class JobCategory
4
+
5
+ include JSONMapper
6
+
7
+ # The id of the category
8
+ json_attribute :id, Integer
9
+
10
+ # The name of the category
11
+ json_attribute :name, String
12
+
13
+ # The list of jobs associated with the category
14
+ json_attributes :jobs, :job, Job
15
+
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,32 @@
1
+ module Freelancer
2
+ module Models
3
+ class Message
4
+
5
+ include JSONMapper
6
+
7
+ # The id of the message
8
+ json_attribute :id, Integer
9
+
10
+ # Sender or recipient of the message
11
+ json_attribute :user, "self", User
12
+
13
+ # The project id related to the message
14
+ json_attribute :project_id, :projectid, Integer
15
+
16
+ # The date the message was sent
17
+ json_attribute :sent_at, :datetime, DateTime
18
+
19
+ # The message text
20
+ json_attribute :text, String
21
+
22
+ # The url to the attachment
23
+ json_attribute :attachment_url, :attachmentlink, String
24
+
25
+ # If the message has been read
26
+ json_attribute :new, Boolean
27
+
28
+ def new?; return self.new; end
29
+
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,57 @@
1
+ module Freelancer
2
+ module Models
3
+ class Milestone
4
+
5
+ include JSONMapper
6
+
7
+ # The id of the milestone
8
+ #
9
+ # Provided from:
10
+ # - /Payment/getAccountMilestoneList.json
11
+ json_attribute :id, Integer
12
+
13
+ # The user id the milestone payment is for
14
+ #
15
+ # Provided from:
16
+ # - /Payment/getAccountMilestoneList.json
17
+ json_attribute :user_id, :userid, Integer
18
+
19
+ # The username the milestone payment is for
20
+ #
21
+ # Provided from:
22
+ # - /Payment/getAccountMilestoneList.json
23
+ json_attribute :username, String
24
+
25
+ # The id of the project the milestone payment is for
26
+ #
27
+ # Provided from:
28
+ # - /Payment/getAccountMilestoneList.json
29
+ json_attribute :project_id, :projectid, Integer
30
+
31
+ # The name of the project the milestone payment is for
32
+ #
33
+ # Provided from:
34
+ # - /Payment/getAccountMilestoneList.json
35
+ json_attribute :project_name, :projectname, String
36
+
37
+ # The amount of money in the milestone payment
38
+ #
39
+ # Provided from:
40
+ # - /Payment/getAccountMilestoneList.json
41
+ json_attribute :amount, Float
42
+
43
+ # The description of the milestone payment
44
+ #
45
+ # Provided from:
46
+ # - /Payment/getAccountMilestoneList.json
47
+ json_attribute :description, :reason, String
48
+
49
+ # The date the milestone was placed
50
+ #
51
+ # Provided from:
52
+ # - /Payment/getAccountMilestoneList.json
53
+ json_attribute :made_at, :date, DateTime
54
+
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,15 @@
1
+ module Freelancer
2
+ module Models
3
+ class News
4
+
5
+ include JSONMapper
6
+
7
+ # The id of the news entry
8
+ json_attribute :id, :newsid, Integer
9
+
10
+ # The text of the news entry
11
+ json_attribute :text, :newstext, String
12
+
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ module Freelancer
2
+ module Models
3
+ class Notification
4
+
5
+ include JSONMapper
6
+
7
+ # The description of the notification
8
+ json_attribute :description, :notificationtext, String
9
+
10
+ # The URL to the notification
11
+ json_attribute :url, String
12
+
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,45 @@
1
+ module Freelancer
2
+ module Models
3
+ class NotificationStatus
4
+
5
+ include JSONMapper
6
+
7
+ # The notification format setting
8
+ #
9
+ # Provided from:
10
+ # - /Profile/getAccountDetails.json
11
+ json_attribute :notification_format, :notificationformat, String
12
+
13
+ # If e-mail notifications have been enabled
14
+ #
15
+ # Provided from:
16
+ # - /Profile/getAccountDetails.json
17
+ json_attribute :email, :emailnotificationstatus, Boolean
18
+
19
+ # If news notifications have been enabled
20
+ #
21
+ # Provided from:
22
+ # - /Profile/getAccountDetails.json
23
+ json_attribute :news, :receivenewsstatus, Boolean
24
+
25
+ # If bid won notifications have been enabled
26
+ #
27
+ # Provided from:
28
+ # - /Profile/getAccountDetails.json
29
+ json_attribute :bid_won, :bidwonnotificationstatus, Boolean
30
+
31
+ # If bid placed notifications have been enabled
32
+ #
33
+ # Provided from:
34
+ # - /Profile/getAccountDetails.json
35
+ json_attribute :bid_placed, :bidplacednotificationstatus, Boolean
36
+
37
+ # If private message notifications have been enabled
38
+ #
39
+ # Provided from:
40
+ # - /Profile/getAccountDetails.json
41
+ json_attribute :new_private_message, :newprivatemessagestatus, Boolean
42
+
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,116 @@
1
+ module Freelancer
2
+ module Models
3
+ class Project
4
+
5
+ include JSONMapper
6
+
7
+ # The ID of the project
8
+ #
9
+ # Provided from:
10
+ # - /Profile/getAccountDetails.json
11
+ # - /Employer/postNewProject.json
12
+ json_attribute :id, [ :id, :projectid ], Integer
13
+
14
+ # The name of the project
15
+ #
16
+ # Provided from:
17
+ # - /Profile/getAccountDetails.json
18
+ # - /Employer/getPostedProjectList.json
19
+ json_attribute :name, [ :name, :projectname ], String
20
+
21
+ # The URL to the project
22
+ #
23
+ # Provided from:
24
+ # - /Profile/getAccountDetails.json
25
+ # - /Employer/postNewProject.json
26
+ json_attribute :url, [ :url, :projecturl ], String
27
+
28
+ # The short description of the project
29
+ json_attribute :short_description, [ :shortdescr, :short_descr ], String
30
+
31
+ # The detailed description of the project
32
+ json_attribute :additional_description, { :additional_descr => :descr_html }, String
33
+
34
+ # The status value of the project
35
+ #
36
+ # Provided from:
37
+ # - /Freelancer/getProjectListForPlacedBids.json
38
+ json_attribute :status, [ :status, :state ], String
39
+
40
+ # The additional status value of the project
41
+ #
42
+ # Provided from:
43
+ # - /Freelancer/getProjectListForPlacedBids.json
44
+ json_attribute :additional_status, :additionalstatus, String
45
+
46
+ # The job types associated with the project
47
+ json_attributes :jobs, :jobtypecsv, DelimitedString, :delimiter => ","
48
+
49
+ # The job types associated with this project. This is a workaround
50
+ # for the /Project/getProjectDetails.json service which returns the
51
+ # data as an array instead of a comma separated list like the rest of
52
+ # the services. There's some magic in the jobs method below to select
53
+ # the proper one.
54
+ json_attributes :jobs_array, :jobs, String
55
+
56
+ # The project options
57
+ json_attribute :options, ProjectOptions
58
+
59
+ # The minimum budget for the project
60
+ json_attribute :minimum_budget, { :budget => :min }, Integer
61
+
62
+ # The maximum budget for the project
63
+ json_attribute :maximum_budget, { :budget => :max }, Integer
64
+
65
+ # The number of bids placed on the project
66
+ #
67
+ # Provided from:
68
+ # - /Freelancer/getProjectListForPlacedBids.json
69
+ json_attribute :bids, [ :bidcount, :bids, { :bid_stats => :count } ], Integer
70
+
71
+ # The average bid for the project
72
+ #
73
+ # Provided from:
74
+ # - /Freelancer/getProjectListForPlacedBids.json
75
+ json_attribute :average_bid, [ :averagebid, { :bid_stats => :avg } ], Integer
76
+
77
+ # The date the project was posted
78
+ #
79
+ # Provided from:
80
+ # - /Employer/postNewProject.json
81
+ json_attribute :posted_at, :postdatetime, DateTime
82
+
83
+ # The date the project starts
84
+ json_attribute :starts_at, [ :startdate, :start_date ], DateTime
85
+
86
+ # The date the project ends
87
+ #
88
+ # Provided from:
89
+ # - /Freelancer/getProjectListForPlacedBids.json
90
+ json_attribute :ends_at, [ :enddate, :end_date ], DateTime
91
+
92
+ # The time left before the project ends
93
+ json_attribute :time_left, :timeleft, String
94
+
95
+ # The buyer that created the project
96
+ json_attribute :buyer, User
97
+
98
+ # The sellers that have bid on the project
99
+ json_attributes :sellers, :seller, User
100
+
101
+ # The freelancers selected for this project. This is
102
+ # only available when listing projects where a money
103
+ # transfer can take place.
104
+ json_attributes :selected_freelancers, :selectedfreelancer, User
105
+
106
+ # Returns the list of jobs associated with the project. This method
107
+ # selects the "jobs_array" if it exists and has content, otherwise
108
+ # it returns the "jobs" array
109
+ def jobs
110
+ return self.jobs_array unless self.jobs_array.nil? || self.jobs_array.empty?
111
+ return @jobs
112
+ end
113
+
114
+ end
115
+ end
116
+ end