samplify_api_client 1.0.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.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +69 -0
- data/README.md +221 -0
- data/Rakefile +8 -0
- data/docs/AppError.md +10 -0
- data/docs/ApplicationItemData.md +11 -0
- data/docs/AttributeData.md +16 -0
- data/docs/AttributeOption.md +10 -0
- data/docs/Attributes.md +10 -0
- data/docs/AttributesApi.md +78 -0
- data/docs/AuthApi.md +191 -0
- data/docs/AuthError.md +9 -0
- data/docs/Author.md +10 -0
- data/docs/BuyProject.md +10 -0
- data/docs/BuyProjectItem.md +12 -0
- data/docs/BuyProjectResponse.md +9 -0
- data/docs/BuyProjectsPayload.md +7 -0
- data/docs/Categories.md +10 -0
- data/docs/CategoriesApi.md +72 -0
- data/docs/CategoryData.md +9 -0
- data/docs/CodePayload.md +11 -0
- data/docs/Countries.md +10 -0
- data/docs/CountriesApi.md +72 -0
- data/docs/CountryData.md +11 -0
- data/docs/CreateLineItem.md +10 -0
- data/docs/DefaultApi.md +88 -0
- data/docs/EndLinks.md +13 -0
- data/docs/ErrorType.md +9 -0
- data/docs/Event.md +10 -0
- data/docs/EventData.md +15 -0
- data/docs/EventListData.md +15 -0
- data/docs/Events.md +10 -0
- data/docs/EventsApi.md +287 -0
- data/docs/ExclusionData.md +9 -0
- data/docs/Feasibility.md +10 -0
- data/docs/FeasibilityApi.md +61 -0
- data/docs/FeasibilityData.md +14 -0
- data/docs/FeasibilityResponseData.md +9 -0
- data/docs/LineItemActionResponse.md +14 -0
- data/docs/LineItemData.md +22 -0
- data/docs/LineItemItemData.md +17 -0
- data/docs/LineItemReportData.md +25 -0
- data/docs/LineItemResponseData.md +27 -0
- data/docs/LineItems.md +10 -0
- data/docs/LineItemsApi.md +420 -0
- data/docs/Links.md +12 -0
- data/docs/LogoutPayload.md +10 -0
- data/docs/Meta.md +10 -0
- data/docs/Project.md +14 -0
- data/docs/ProjectAction.md +10 -0
- data/docs/ProjectActionResponse.md +13 -0
- data/docs/ProjectCategoryData.md +8 -0
- data/docs/ProjectItemData.md +14 -0
- data/docs/ProjectReport.md +10 -0
- data/docs/ProjectReportData.md +21 -0
- data/docs/ProjectReports.md +10 -0
- data/docs/ProjectResponse.md +10 -0
- data/docs/ProjectResponseData.md +19 -0
- data/docs/ProjectSurveyEndLinks.md +10 -0
- data/docs/ProjectSurveyEndLinksData.md +12 -0
- data/docs/Projects.md +10 -0
- data/docs/ProjectsApi.md +620 -0
- data/docs/QuotaCell.md +10 -0
- data/docs/QuotaCellFeasibility.md +9 -0
- data/docs/QuotaGroupData.md +9 -0
- data/docs/QuotaGroupFeasibility.md +8 -0
- data/docs/QuotaPlanData.md +9 -0
- data/docs/Reconcile.md +10 -0
- data/docs/ReconcileData.md +7 -0
- data/docs/RefreshTokenPayload.md +10 -0
- data/docs/Reprice.md +10 -0
- data/docs/RepriceData.md +22 -0
- data/docs/RepricePayload.md +20 -0
- data/docs/RespondentApi.md +86 -0
- data/docs/Status.md +9 -0
- data/docs/SupportedLanguage.md +10 -0
- data/docs/SurveyEndLinks.md +10 -0
- data/docs/SurveyTestId.md +10 -0
- data/docs/SurveyTestLink.md +9 -0
- data/docs/Target.md +11 -0
- data/docs/TargetingAttribute.md +10 -0
- data/docs/TokenMedia.md +11 -0
- data/docs/TokenPayload.md +11 -0
- data/docs/URLParam.md +9 -0
- data/docs/UpdateLineItem.md +21 -0
- data/docs/UpdateProjectData.md +13 -0
- data/docs/UpdateProjectLineItem.md +22 -0
- data/docs/UserInfo.md +10 -0
- data/docs/UserInfoResponseData.md +10 -0
- data/docs/UsersApi.md +68 -0
- data/examples/auth.rb +18 -0
- data/git_push.sh +55 -0
- data/lib/samplify_api_client/api/attributes_api.rb +111 -0
- data/lib/samplify_api_client/api/auth_api.rb +230 -0
- data/lib/samplify_api_client/api/categories_api.rb +99 -0
- data/lib/samplify_api_client/api/countries_api.rb +99 -0
- data/lib/samplify_api_client/api/default_api.rb +115 -0
- data/lib/samplify_api_client/api/events_api.rb +317 -0
- data/lib/samplify_api_client/api/feasibility_api.rb +75 -0
- data/lib/samplify_api_client/api/line_items_api.rb +468 -0
- data/lib/samplify_api_client/api/projects_api.rb +660 -0
- data/lib/samplify_api_client/api/respondent_api.rb +113 -0
- data/lib/samplify_api_client/api/users_api.rb +81 -0
- data/lib/samplify_api_client/api_client.rb +389 -0
- data/lib/samplify_api_client/api_error.rb +38 -0
- data/lib/samplify_api_client/configuration.rb +209 -0
- data/lib/samplify_api_client/models/app_error.rb +218 -0
- data/lib/samplify_api_client/models/application_item_data.rb +234 -0
- data/lib/samplify_api_client/models/attribute_data.rb +334 -0
- data/lib/samplify_api_client/models/attribute_option.rb +219 -0
- data/lib/samplify_api_client/models/attributes.rb +219 -0
- data/lib/samplify_api_client/models/auth_error.rb +205 -0
- data/lib/samplify_api_client/models/author.rb +253 -0
- data/lib/samplify_api_client/models/buy_project.rb +219 -0
- data/lib/samplify_api_client/models/buy_project_item.rb +243 -0
- data/lib/samplify_api_client/models/buy_project_response.rb +194 -0
- data/lib/samplify_api_client/models/buy_projects_payload.rb +174 -0
- data/lib/samplify_api_client/models/categories.rb +219 -0
- data/lib/samplify_api_client/models/category_data.rb +204 -0
- data/lib/samplify_api_client/models/code_payload.rb +229 -0
- data/lib/samplify_api_client/models/countries.rb +219 -0
- data/lib/samplify_api_client/models/country_data.rb +230 -0
- data/lib/samplify_api_client/models/create_line_item.rb +217 -0
- data/lib/samplify_api_client/models/end_links.rb +288 -0
- data/lib/samplify_api_client/models/error_type.rb +204 -0
- data/lib/samplify_api_client/models/event.rb +217 -0
- data/lib/samplify_api_client/models/event_data.rb +289 -0
- data/lib/samplify_api_client/models/event_list_data.rb +289 -0
- data/lib/samplify_api_client/models/events.rb +219 -0
- data/lib/samplify_api_client/models/exclusion_data.rb +206 -0
- data/lib/samplify_api_client/models/feasibility.rb +219 -0
- data/lib/samplify_api_client/models/feasibility_data.rb +255 -0
- data/lib/samplify_api_client/models/feasibility_response_data.rb +193 -0
- data/lib/samplify_api_client/models/line_item_action_response.rb +244 -0
- data/lib/samplify_api_client/models/line_item_data.rb +398 -0
- data/lib/samplify_api_client/models/line_item_item_data.rb +358 -0
- data/lib/samplify_api_client/models/line_item_report_data.rb +478 -0
- data/lib/samplify_api_client/models/line_item_response_data.rb +408 -0
- data/lib/samplify_api_client/models/line_items.rb +219 -0
- data/lib/samplify_api_client/models/links.rb +219 -0
- data/lib/samplify_api_client/models/logout_payload.rb +219 -0
- data/lib/samplify_api_client/models/meta.rb +203 -0
- data/lib/samplify_api_client/models/project.rb +273 -0
- data/lib/samplify_api_client/models/project_action.rb +217 -0
- data/lib/samplify_api_client/models/project_action_response.rb +236 -0
- data/lib/samplify_api_client/models/project_category_data.rb +191 -0
- data/lib/samplify_api_client/models/project_item_data.rb +307 -0
- data/lib/samplify_api_client/models/project_report.rb +217 -0
- data/lib/samplify_api_client/models/project_report_data.rb +414 -0
- data/lib/samplify_api_client/models/project_reports.rb +219 -0
- data/lib/samplify_api_client/models/project_response.rb +217 -0
- data/lib/samplify_api_client/models/project_response_data.rb +347 -0
- data/lib/samplify_api_client/models/project_survey_end_links.rb +217 -0
- data/lib/samplify_api_client/models/project_survey_end_links_data.rb +272 -0
- data/lib/samplify_api_client/models/projects.rb +219 -0
- data/lib/samplify_api_client/models/quota_cell.rb +206 -0
- data/lib/samplify_api_client/models/quota_cell_feasibility.rb +204 -0
- data/lib/samplify_api_client/models/quota_group_data.rb +201 -0
- data/lib/samplify_api_client/models/quota_group_feasibility.rb +185 -0
- data/lib/samplify_api_client/models/quota_plan_data.rb +198 -0
- data/lib/samplify_api_client/models/reconcile.rb +217 -0
- data/lib/samplify_api_client/models/reconcile_data.rb +174 -0
- data/lib/samplify_api_client/models/refresh_token_payload.rb +214 -0
- data/lib/samplify_api_client/models/reprice.rb +217 -0
- data/lib/samplify_api_client/models/reprice_data.rb +399 -0
- data/lib/samplify_api_client/models/reprice_payload.rb +369 -0
- data/lib/samplify_api_client/models/status.rb +206 -0
- data/lib/samplify_api_client/models/supported_language.rb +219 -0
- data/lib/samplify_api_client/models/survey_end_links.rb +216 -0
- data/lib/samplify_api_client/models/survey_test_id.rb +219 -0
- data/lib/samplify_api_client/models/survey_test_link.rb +206 -0
- data/lib/samplify_api_client/models/target.rb +258 -0
- data/lib/samplify_api_client/models/targeting_attribute.rb +216 -0
- data/lib/samplify_api_client/models/token_media.rb +235 -0
- data/lib/samplify_api_client/models/token_payload.rb +229 -0
- data/lib/samplify_api_client/models/update_line_item.rb +353 -0
- data/lib/samplify_api_client/models/update_project_data.rb +238 -0
- data/lib/samplify_api_client/models/update_project_line_item.rb +368 -0
- data/lib/samplify_api_client/models/url_param.rb +204 -0
- data/lib/samplify_api_client/models/user_info.rb +217 -0
- data/lib/samplify_api_client/models/user_info_response_data.rb +221 -0
- data/lib/samplify_api_client/version.rb +15 -0
- data/lib/samplify_api_client.rb +125 -0
- data/samplify_api_client.gemspec +45 -0
- data/spec/api/attributes_api_spec.rb +53 -0
- data/spec/api/auth_api_spec.rb +79 -0
- data/spec/api/categories_api_spec.rb +51 -0
- data/spec/api/countries_api_spec.rb +51 -0
- data/spec/api/default_api_spec.rb +55 -0
- data/spec/api/events_api_spec.rb +100 -0
- data/spec/api/feasibility_api_spec.rb +46 -0
- data/spec/api/line_items_api_spec.rb +128 -0
- data/spec/api/projects_api_spec.rb +168 -0
- data/spec/api/respondent_api_spec.rb +55 -0
- data/spec/api/users_api_spec.rb +49 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/app_error_spec.rb +53 -0
- data/spec/models/application_item_data_spec.rb +59 -0
- data/spec/models/attribute_data_spec.rb +93 -0
- data/spec/models/attribute_option_spec.rb +53 -0
- data/spec/models/attributes_spec.rb +53 -0
- data/spec/models/auth_error_spec.rb +47 -0
- data/spec/models/author_spec.rb +57 -0
- data/spec/models/buy_project_item_spec.rb +65 -0
- data/spec/models/buy_project_response_spec.rb +47 -0
- data/spec/models/buy_project_spec.rb +53 -0
- data/spec/models/buy_projects_payload_spec.rb +35 -0
- data/spec/models/categories_spec.rb +53 -0
- data/spec/models/category_data_spec.rb +47 -0
- data/spec/models/code_payload_spec.rb +59 -0
- data/spec/models/countries_spec.rb +53 -0
- data/spec/models/country_data_spec.rb +59 -0
- data/spec/models/create_line_item_spec.rb +53 -0
- data/spec/models/end_links_spec.rb +75 -0
- data/spec/models/error_type_spec.rb +47 -0
- data/spec/models/event_data_spec.rb +83 -0
- data/spec/models/event_list_data_spec.rb +83 -0
- data/spec/models/event_spec.rb +53 -0
- data/spec/models/events_spec.rb +53 -0
- data/spec/models/exclusion_data_spec.rb +47 -0
- data/spec/models/feasibility_data_spec.rb +77 -0
- data/spec/models/feasibility_response_data_spec.rb +47 -0
- data/spec/models/feasibility_spec.rb +53 -0
- data/spec/models/line_item_action_response_spec.rb +77 -0
- data/spec/models/line_item_data_spec.rb +129 -0
- data/spec/models/line_item_item_data_spec.rb +99 -0
- data/spec/models/line_item_report_data_spec.rb +147 -0
- data/spec/models/line_item_response_data_spec.rb +159 -0
- data/spec/models/line_items_spec.rb +53 -0
- data/spec/models/links_spec.rb +65 -0
- data/spec/models/logout_payload_spec.rb +53 -0
- data/spec/models/meta_spec.rb +53 -0
- data/spec/models/project_action_response_spec.rb +71 -0
- data/spec/models/project_action_spec.rb +53 -0
- data/spec/models/project_category_data_spec.rb +41 -0
- data/spec/models/project_item_data_spec.rb +81 -0
- data/spec/models/project_report_data_spec.rb +123 -0
- data/spec/models/project_report_spec.rb +53 -0
- data/spec/models/project_reports_spec.rb +53 -0
- data/spec/models/project_response_data_spec.rb +107 -0
- data/spec/models/project_response_spec.rb +53 -0
- data/spec/models/project_spec.rb +77 -0
- data/spec/models/project_survey_end_links_data_spec.rb +69 -0
- data/spec/models/project_survey_end_links_spec.rb +53 -0
- data/spec/models/projects_spec.rb +53 -0
- data/spec/models/quota_cell_feasibility_spec.rb +47 -0
- data/spec/models/quota_cell_spec.rb +53 -0
- data/spec/models/quota_group_data_spec.rb +47 -0
- data/spec/models/quota_group_feasibility_spec.rb +41 -0
- data/spec/models/quota_plan_data_spec.rb +47 -0
- data/spec/models/reconcile_data_spec.rb +35 -0
- data/spec/models/reconcile_spec.rb +53 -0
- data/spec/models/refresh_token_payload_spec.rb +53 -0
- data/spec/models/reprice_data_spec.rb +125 -0
- data/spec/models/reprice_payload_spec.rb +113 -0
- data/spec/models/reprice_spec.rb +53 -0
- data/spec/models/status_spec.rb +47 -0
- data/spec/models/supported_language_spec.rb +53 -0
- data/spec/models/survey_end_links_spec.rb +53 -0
- data/spec/models/survey_test_id_spec.rb +53 -0
- data/spec/models/survey_test_link_spec.rb +47 -0
- data/spec/models/target_spec.rb +63 -0
- data/spec/models/targeting_attribute_spec.rb +53 -0
- data/spec/models/token_media_spec.rb +59 -0
- data/spec/models/token_payload_spec.rb +59 -0
- data/spec/models/update_line_item_spec.rb +123 -0
- data/spec/models/update_project_data_spec.rb +71 -0
- data/spec/models/update_project_line_item_spec.rb +129 -0
- data/spec/models/url_param_spec.rb +47 -0
- data/spec/models/user_info_response_data_spec.rb +53 -0
- data/spec/models/user_info_spec.rb +53 -0
- data/spec/spec_helper.rb +111 -0
- metadata +585 -0
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Samplify API
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 1.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: 2.4.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
|
|
15
|
+
module SamplifyAPIClient
|
|
16
|
+
class LineItemItemData
|
|
17
|
+
# 2 letter ISO Country Code
|
|
18
|
+
attr_accessor :country_iso_code
|
|
19
|
+
|
|
20
|
+
# Timestamp of when the line item was created
|
|
21
|
+
attr_accessor :created_at
|
|
22
|
+
|
|
23
|
+
# A unique identifier for your Line Item
|
|
24
|
+
attr_accessor :ext_line_item_id
|
|
25
|
+
|
|
26
|
+
# 2 letter ISO Language Code
|
|
27
|
+
attr_accessor :language_iso_code
|
|
28
|
+
|
|
29
|
+
# Timestamp of when the line item launched on RN SSI panelists
|
|
30
|
+
attr_accessor :launched_at
|
|
31
|
+
|
|
32
|
+
# The current state of the line item: PROVISIONED, AWAITING_APPROVAL, LAUNCHED, PAUSED, CLOSED, INVOICED
|
|
33
|
+
attr_accessor :state
|
|
34
|
+
|
|
35
|
+
# Timestamp of when the line item last changed its state
|
|
36
|
+
attr_accessor :state_last_updated_at
|
|
37
|
+
|
|
38
|
+
# Reason for the current state of the line item
|
|
39
|
+
attr_accessor :state_reason
|
|
40
|
+
|
|
41
|
+
# A Line Item title
|
|
42
|
+
attr_accessor :title
|
|
43
|
+
|
|
44
|
+
# Timestamp of when the line item was updated
|
|
45
|
+
attr_accessor :updated_at
|
|
46
|
+
|
|
47
|
+
class EnumAttributeValidator
|
|
48
|
+
attr_reader :datatype
|
|
49
|
+
attr_reader :allowable_values
|
|
50
|
+
|
|
51
|
+
def initialize(datatype, allowable_values)
|
|
52
|
+
@allowable_values = allowable_values.map do |value|
|
|
53
|
+
case datatype.to_s
|
|
54
|
+
when /Integer/i
|
|
55
|
+
value.to_i
|
|
56
|
+
when /Float/i
|
|
57
|
+
value.to_f
|
|
58
|
+
else
|
|
59
|
+
value
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def valid?(value)
|
|
65
|
+
!value || allowable_values.include?(value)
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
70
|
+
def self.attribute_map
|
|
71
|
+
{
|
|
72
|
+
:'country_iso_code' => :'countryISOCode',
|
|
73
|
+
:'created_at' => :'createdAt',
|
|
74
|
+
:'ext_line_item_id' => :'extLineItemId',
|
|
75
|
+
:'language_iso_code' => :'languageISOCode',
|
|
76
|
+
:'launched_at' => :'launchedAt',
|
|
77
|
+
:'state' => :'state',
|
|
78
|
+
:'state_last_updated_at' => :'stateLastUpdatedAt',
|
|
79
|
+
:'state_reason' => :'stateReason',
|
|
80
|
+
:'title' => :'title',
|
|
81
|
+
:'updated_at' => :'updatedAt'
|
|
82
|
+
}
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Attribute type mapping.
|
|
86
|
+
def self.swagger_types
|
|
87
|
+
{
|
|
88
|
+
:'country_iso_code' => :'String',
|
|
89
|
+
:'created_at' => :'String',
|
|
90
|
+
:'ext_line_item_id' => :'String',
|
|
91
|
+
:'language_iso_code' => :'String',
|
|
92
|
+
:'launched_at' => :'',
|
|
93
|
+
:'state' => :'String',
|
|
94
|
+
:'state_last_updated_at' => :'String',
|
|
95
|
+
:'state_reason' => :'String',
|
|
96
|
+
:'title' => :'String',
|
|
97
|
+
:'updated_at' => :'String'
|
|
98
|
+
}
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Initializes the object
|
|
102
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
103
|
+
def initialize(attributes = {})
|
|
104
|
+
return unless attributes.is_a?(Hash)
|
|
105
|
+
|
|
106
|
+
# convert string to symbol for hash key
|
|
107
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
108
|
+
|
|
109
|
+
if attributes.has_key?(:'countryISOCode')
|
|
110
|
+
self.country_iso_code = attributes[:'countryISOCode']
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
if attributes.has_key?(:'createdAt')
|
|
114
|
+
self.created_at = attributes[:'createdAt']
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
if attributes.has_key?(:'extLineItemId')
|
|
118
|
+
self.ext_line_item_id = attributes[:'extLineItemId']
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
if attributes.has_key?(:'languageISOCode')
|
|
122
|
+
self.language_iso_code = attributes[:'languageISOCode']
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
if attributes.has_key?(:'launchedAt')
|
|
126
|
+
self.launched_at = attributes[:'launchedAt']
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
if attributes.has_key?(:'state')
|
|
130
|
+
self.state = attributes[:'state']
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
if attributes.has_key?(:'stateLastUpdatedAt')
|
|
134
|
+
self.state_last_updated_at = attributes[:'stateLastUpdatedAt']
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
if attributes.has_key?(:'stateReason')
|
|
138
|
+
self.state_reason = attributes[:'stateReason']
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
if attributes.has_key?(:'title')
|
|
142
|
+
self.title = attributes[:'title']
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
if attributes.has_key?(:'updatedAt')
|
|
146
|
+
self.updated_at = attributes[:'updatedAt']
|
|
147
|
+
end
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
151
|
+
# @return Array for valid properties with the reasons
|
|
152
|
+
def list_invalid_properties
|
|
153
|
+
invalid_properties = Array.new
|
|
154
|
+
if @country_iso_code.nil?
|
|
155
|
+
invalid_properties.push('invalid value for "country_iso_code", country_iso_code cannot be nil.')
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
if @created_at.nil?
|
|
159
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
if @ext_line_item_id.nil?
|
|
163
|
+
invalid_properties.push('invalid value for "ext_line_item_id", ext_line_item_id cannot be nil.')
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
if @language_iso_code.nil?
|
|
167
|
+
invalid_properties.push('invalid value for "language_iso_code", language_iso_code cannot be nil.')
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
if @launched_at.nil?
|
|
171
|
+
invalid_properties.push('invalid value for "launched_at", launched_at cannot be nil.')
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
if @state.nil?
|
|
175
|
+
invalid_properties.push('invalid value for "state", state cannot be nil.')
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
if @state_last_updated_at.nil?
|
|
179
|
+
invalid_properties.push('invalid value for "state_last_updated_at", state_last_updated_at cannot be nil.')
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
if @state_reason.nil?
|
|
183
|
+
invalid_properties.push('invalid value for "state_reason", state_reason cannot be nil.')
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
if @title.nil?
|
|
187
|
+
invalid_properties.push('invalid value for "title", title cannot be nil.')
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
if @updated_at.nil?
|
|
191
|
+
invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
invalid_properties
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# Check to see if the all the properties in the model are valid
|
|
198
|
+
# @return true if the model is valid
|
|
199
|
+
def valid?
|
|
200
|
+
return false if @country_iso_code.nil?
|
|
201
|
+
return false if @created_at.nil?
|
|
202
|
+
return false if @ext_line_item_id.nil?
|
|
203
|
+
return false if @language_iso_code.nil?
|
|
204
|
+
return false if @launched_at.nil?
|
|
205
|
+
return false if @state.nil?
|
|
206
|
+
state_validator = EnumAttributeValidator.new('String', ['PROVISIONED', 'AWAITING_APPROVAL', 'LAUNCHED', 'PAUSED', 'CLOSED', 'INVOICED'])
|
|
207
|
+
return false unless state_validator.valid?(@state)
|
|
208
|
+
return false if @state_last_updated_at.nil?
|
|
209
|
+
return false if @state_reason.nil?
|
|
210
|
+
return false if @title.nil?
|
|
211
|
+
return false if @updated_at.nil?
|
|
212
|
+
true
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
216
|
+
# @param [Object] state Object to be assigned
|
|
217
|
+
def state=(state)
|
|
218
|
+
validator = EnumAttributeValidator.new('String', ['PROVISIONED', 'AWAITING_APPROVAL', 'LAUNCHED', 'PAUSED', 'CLOSED', 'INVOICED'])
|
|
219
|
+
unless validator.valid?(state)
|
|
220
|
+
fail ArgumentError, 'invalid value for "state", must be one of #{validator.allowable_values}.'
|
|
221
|
+
end
|
|
222
|
+
@state = state
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
# Checks equality by comparing each attribute.
|
|
226
|
+
# @param [Object] Object to be compared
|
|
227
|
+
def ==(o)
|
|
228
|
+
return true if self.equal?(o)
|
|
229
|
+
self.class == o.class &&
|
|
230
|
+
country_iso_code == o.country_iso_code &&
|
|
231
|
+
created_at == o.created_at &&
|
|
232
|
+
ext_line_item_id == o.ext_line_item_id &&
|
|
233
|
+
language_iso_code == o.language_iso_code &&
|
|
234
|
+
launched_at == o.launched_at &&
|
|
235
|
+
state == o.state &&
|
|
236
|
+
state_last_updated_at == o.state_last_updated_at &&
|
|
237
|
+
state_reason == o.state_reason &&
|
|
238
|
+
title == o.title &&
|
|
239
|
+
updated_at == o.updated_at
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
# @see the `==` method
|
|
243
|
+
# @param [Object] Object to be compared
|
|
244
|
+
def eql?(o)
|
|
245
|
+
self == o
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
# Calculates hash code according to all attributes.
|
|
249
|
+
# @return [Fixnum] Hash code
|
|
250
|
+
def hash
|
|
251
|
+
[country_iso_code, created_at, ext_line_item_id, language_iso_code, launched_at, state, state_last_updated_at, state_reason, title, updated_at].hash
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
# Builds the object from hash
|
|
255
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
256
|
+
# @return [Object] Returns the model itself
|
|
257
|
+
def build_from_hash(attributes)
|
|
258
|
+
return nil unless attributes.is_a?(Hash)
|
|
259
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
260
|
+
if type =~ /\AArray<(.*)>/i
|
|
261
|
+
# check to ensure the input is an array given that the the attribute
|
|
262
|
+
# is documented as an array but the input is not
|
|
263
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
264
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
265
|
+
end
|
|
266
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
267
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
268
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
self
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
# Deserializes the data based on type
|
|
275
|
+
# @param string type Data type
|
|
276
|
+
# @param string value Value to be deserialized
|
|
277
|
+
# @return [Object] Deserialized data
|
|
278
|
+
def _deserialize(type, value)
|
|
279
|
+
case type.to_sym
|
|
280
|
+
when :DateTime
|
|
281
|
+
DateTime.parse(value)
|
|
282
|
+
when :Date
|
|
283
|
+
Date.parse(value)
|
|
284
|
+
when :String
|
|
285
|
+
value.to_s
|
|
286
|
+
when :Integer
|
|
287
|
+
value.to_i
|
|
288
|
+
when :Float
|
|
289
|
+
value.to_f
|
|
290
|
+
when :BOOLEAN
|
|
291
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
292
|
+
true
|
|
293
|
+
else
|
|
294
|
+
false
|
|
295
|
+
end
|
|
296
|
+
when :Object
|
|
297
|
+
# generic object (usually a Hash), return directly
|
|
298
|
+
value
|
|
299
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
300
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
301
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
302
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
303
|
+
k_type = Regexp.last_match[:k_type]
|
|
304
|
+
v_type = Regexp.last_match[:v_type]
|
|
305
|
+
{}.tap do |hash|
|
|
306
|
+
value.each do |k, v|
|
|
307
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
308
|
+
end
|
|
309
|
+
end
|
|
310
|
+
else # model
|
|
311
|
+
temp_model = SamplifyAPIClient.const_get(type).new
|
|
312
|
+
temp_model.build_from_hash(value)
|
|
313
|
+
end
|
|
314
|
+
end
|
|
315
|
+
|
|
316
|
+
# Returns the string representation of the object
|
|
317
|
+
# @return [String] String presentation of the object
|
|
318
|
+
def to_s
|
|
319
|
+
to_hash.to_s
|
|
320
|
+
end
|
|
321
|
+
|
|
322
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
323
|
+
# @return [Hash] Returns the object in the form of hash
|
|
324
|
+
def to_body
|
|
325
|
+
to_hash
|
|
326
|
+
end
|
|
327
|
+
|
|
328
|
+
# Returns the object in the form of hash
|
|
329
|
+
# @return [Hash] Returns the object in the form of hash
|
|
330
|
+
def to_hash
|
|
331
|
+
hash = {}
|
|
332
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
333
|
+
value = self.send(attr)
|
|
334
|
+
next if value.nil?
|
|
335
|
+
hash[param] = _to_hash(value)
|
|
336
|
+
end
|
|
337
|
+
hash
|
|
338
|
+
end
|
|
339
|
+
|
|
340
|
+
# Outputs non-array value in the form of hash
|
|
341
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
342
|
+
# @param [Object] value Any valid value
|
|
343
|
+
# @return [Hash] Returns the value in the form of hash
|
|
344
|
+
def _to_hash(value)
|
|
345
|
+
if value.is_a?(Array)
|
|
346
|
+
value.compact.map { |v| _to_hash(v) }
|
|
347
|
+
elsif value.is_a?(Hash)
|
|
348
|
+
{}.tap do |hash|
|
|
349
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
350
|
+
end
|
|
351
|
+
elsif value.respond_to? :to_hash
|
|
352
|
+
value.to_hash
|
|
353
|
+
else
|
|
354
|
+
value
|
|
355
|
+
end
|
|
356
|
+
end
|
|
357
|
+
end
|
|
358
|
+
end
|
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Samplify API
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 1.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: 2.4.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
|
|
15
|
+
module SamplifyAPIClient
|
|
16
|
+
class LineItemReportData
|
|
17
|
+
# Calculated median length of interview from actual panelists
|
|
18
|
+
attr_accessor :actual_median_loi
|
|
19
|
+
|
|
20
|
+
# Total number of panelists that entered the project
|
|
21
|
+
attr_accessor :attempts
|
|
22
|
+
|
|
23
|
+
# Total number of panelists that completed the project
|
|
24
|
+
attr_accessor :completes
|
|
25
|
+
|
|
26
|
+
# Ratio of completes over attempts. (ranges from 0-1)
|
|
27
|
+
attr_accessor :conversion
|
|
28
|
+
|
|
29
|
+
# ISO country code
|
|
30
|
+
attr_accessor :country_iso_code
|
|
31
|
+
|
|
32
|
+
# Currency ISO code
|
|
33
|
+
attr_accessor :currency
|
|
34
|
+
|
|
35
|
+
# Total estimated cost
|
|
36
|
+
attr_accessor :estimated_cost
|
|
37
|
+
|
|
38
|
+
# A unique identifier for your Line Item
|
|
39
|
+
attr_accessor :ext_line_item_id
|
|
40
|
+
|
|
41
|
+
# Total incurred cost
|
|
42
|
+
attr_accessor :incurred_cost
|
|
43
|
+
|
|
44
|
+
# ISO language code
|
|
45
|
+
attr_accessor :language_iso_code
|
|
46
|
+
|
|
47
|
+
# Last accepted incidence rate
|
|
48
|
+
attr_accessor :last_accepted_incidence_rate
|
|
49
|
+
|
|
50
|
+
# Last accepted length of interview
|
|
51
|
+
attr_accessor :last_accepted_loi
|
|
52
|
+
|
|
53
|
+
# Total number of panelists that triggered an overquota for the project
|
|
54
|
+
attr_accessor :overquotas
|
|
55
|
+
|
|
56
|
+
# Total remaining completes for the project
|
|
57
|
+
attr_accessor :remaining_completes
|
|
58
|
+
|
|
59
|
+
# Total number of panelists that got screened out of the project
|
|
60
|
+
attr_accessor :screenouts
|
|
61
|
+
|
|
62
|
+
# The current state of the project: PROVISIONED, LAUNCHED, PAUSED, CLOSED
|
|
63
|
+
attr_accessor :state
|
|
64
|
+
|
|
65
|
+
# The current state reason of the project
|
|
66
|
+
attr_accessor :state_reason
|
|
67
|
+
|
|
68
|
+
# LineItem title
|
|
69
|
+
attr_accessor :title
|
|
70
|
+
|
|
71
|
+
class EnumAttributeValidator
|
|
72
|
+
attr_reader :datatype
|
|
73
|
+
attr_reader :allowable_values
|
|
74
|
+
|
|
75
|
+
def initialize(datatype, allowable_values)
|
|
76
|
+
@allowable_values = allowable_values.map do |value|
|
|
77
|
+
case datatype.to_s
|
|
78
|
+
when /Integer/i
|
|
79
|
+
value.to_i
|
|
80
|
+
when /Float/i
|
|
81
|
+
value.to_f
|
|
82
|
+
else
|
|
83
|
+
value
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
def valid?(value)
|
|
89
|
+
!value || allowable_values.include?(value)
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
94
|
+
def self.attribute_map
|
|
95
|
+
{
|
|
96
|
+
:'actual_median_loi' => :'actualMedianLOI',
|
|
97
|
+
:'attempts' => :'attempts',
|
|
98
|
+
:'completes' => :'completes',
|
|
99
|
+
:'conversion' => :'conversion',
|
|
100
|
+
:'country_iso_code' => :'countryISOCode',
|
|
101
|
+
:'currency' => :'currency',
|
|
102
|
+
:'estimated_cost' => :'estimatedCost',
|
|
103
|
+
:'ext_line_item_id' => :'extLineItemId',
|
|
104
|
+
:'incurred_cost' => :'incurredCost',
|
|
105
|
+
:'language_iso_code' => :'languageISOCode',
|
|
106
|
+
:'last_accepted_incidence_rate' => :'lastAcceptedIncidenceRate',
|
|
107
|
+
:'last_accepted_loi' => :'lastAcceptedLOI',
|
|
108
|
+
:'overquotas' => :'overquotas',
|
|
109
|
+
:'remaining_completes' => :'remainingCompletes',
|
|
110
|
+
:'screenouts' => :'screenouts',
|
|
111
|
+
:'state' => :'state',
|
|
112
|
+
:'state_reason' => :'stateReason',
|
|
113
|
+
:'title' => :'title'
|
|
114
|
+
}
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Attribute type mapping.
|
|
118
|
+
def self.swagger_types
|
|
119
|
+
{
|
|
120
|
+
:'actual_median_loi' => :'Integer',
|
|
121
|
+
:'attempts' => :'Integer',
|
|
122
|
+
:'completes' => :'Integer',
|
|
123
|
+
:'conversion' => :'Float',
|
|
124
|
+
:'country_iso_code' => :'String',
|
|
125
|
+
:'currency' => :'String',
|
|
126
|
+
:'estimated_cost' => :'Float',
|
|
127
|
+
:'ext_line_item_id' => :'String',
|
|
128
|
+
:'incurred_cost' => :'Float',
|
|
129
|
+
:'language_iso_code' => :'String',
|
|
130
|
+
:'last_accepted_incidence_rate' => :'Float',
|
|
131
|
+
:'last_accepted_loi' => :'Integer',
|
|
132
|
+
:'overquotas' => :'Integer',
|
|
133
|
+
:'remaining_completes' => :'Integer',
|
|
134
|
+
:'screenouts' => :'Integer',
|
|
135
|
+
:'state' => :'String',
|
|
136
|
+
:'state_reason' => :'String',
|
|
137
|
+
:'title' => :'String'
|
|
138
|
+
}
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Initializes the object
|
|
142
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
143
|
+
def initialize(attributes = {})
|
|
144
|
+
return unless attributes.is_a?(Hash)
|
|
145
|
+
|
|
146
|
+
# convert string to symbol for hash key
|
|
147
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
148
|
+
|
|
149
|
+
if attributes.has_key?(:'actualMedianLOI')
|
|
150
|
+
self.actual_median_loi = attributes[:'actualMedianLOI']
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
if attributes.has_key?(:'attempts')
|
|
154
|
+
self.attempts = attributes[:'attempts']
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
if attributes.has_key?(:'completes')
|
|
158
|
+
self.completes = attributes[:'completes']
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
if attributes.has_key?(:'conversion')
|
|
162
|
+
self.conversion = attributes[:'conversion']
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
if attributes.has_key?(:'countryISOCode')
|
|
166
|
+
self.country_iso_code = attributes[:'countryISOCode']
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
if attributes.has_key?(:'currency')
|
|
170
|
+
self.currency = attributes[:'currency']
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
if attributes.has_key?(:'estimatedCost')
|
|
174
|
+
self.estimated_cost = attributes[:'estimatedCost']
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
if attributes.has_key?(:'extLineItemId')
|
|
178
|
+
self.ext_line_item_id = attributes[:'extLineItemId']
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
if attributes.has_key?(:'incurredCost')
|
|
182
|
+
self.incurred_cost = attributes[:'incurredCost']
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
if attributes.has_key?(:'languageISOCode')
|
|
186
|
+
self.language_iso_code = attributes[:'languageISOCode']
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
if attributes.has_key?(:'lastAcceptedIncidenceRate')
|
|
190
|
+
self.last_accepted_incidence_rate = attributes[:'lastAcceptedIncidenceRate']
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
if attributes.has_key?(:'lastAcceptedLOI')
|
|
194
|
+
self.last_accepted_loi = attributes[:'lastAcceptedLOI']
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
if attributes.has_key?(:'overquotas')
|
|
198
|
+
self.overquotas = attributes[:'overquotas']
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
if attributes.has_key?(:'remainingCompletes')
|
|
202
|
+
self.remaining_completes = attributes[:'remainingCompletes']
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
if attributes.has_key?(:'screenouts')
|
|
206
|
+
self.screenouts = attributes[:'screenouts']
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
if attributes.has_key?(:'state')
|
|
210
|
+
self.state = attributes[:'state']
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
if attributes.has_key?(:'stateReason')
|
|
214
|
+
self.state_reason = attributes[:'stateReason']
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
if attributes.has_key?(:'title')
|
|
218
|
+
self.title = attributes[:'title']
|
|
219
|
+
end
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
223
|
+
# @return Array for valid properties with the reasons
|
|
224
|
+
def list_invalid_properties
|
|
225
|
+
invalid_properties = Array.new
|
|
226
|
+
if @actual_median_loi.nil?
|
|
227
|
+
invalid_properties.push('invalid value for "actual_median_loi", actual_median_loi cannot be nil.')
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
if @attempts.nil?
|
|
231
|
+
invalid_properties.push('invalid value for "attempts", attempts cannot be nil.')
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
if @completes.nil?
|
|
235
|
+
invalid_properties.push('invalid value for "completes", completes cannot be nil.')
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
if @conversion.nil?
|
|
239
|
+
invalid_properties.push('invalid value for "conversion", conversion cannot be nil.')
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
if @country_iso_code.nil?
|
|
243
|
+
invalid_properties.push('invalid value for "country_iso_code", country_iso_code cannot be nil.')
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
if @currency.nil?
|
|
247
|
+
invalid_properties.push('invalid value for "currency", currency cannot be nil.')
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
if @estimated_cost.nil?
|
|
251
|
+
invalid_properties.push('invalid value for "estimated_cost", estimated_cost cannot be nil.')
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
if @ext_line_item_id.nil?
|
|
255
|
+
invalid_properties.push('invalid value for "ext_line_item_id", ext_line_item_id cannot be nil.')
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
if @incurred_cost.nil?
|
|
259
|
+
invalid_properties.push('invalid value for "incurred_cost", incurred_cost cannot be nil.')
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
if @language_iso_code.nil?
|
|
263
|
+
invalid_properties.push('invalid value for "language_iso_code", language_iso_code cannot be nil.')
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
if @last_accepted_incidence_rate.nil?
|
|
267
|
+
invalid_properties.push('invalid value for "last_accepted_incidence_rate", last_accepted_incidence_rate cannot be nil.')
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
if @last_accepted_loi.nil?
|
|
271
|
+
invalid_properties.push('invalid value for "last_accepted_loi", last_accepted_loi cannot be nil.')
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
if @overquotas.nil?
|
|
275
|
+
invalid_properties.push('invalid value for "overquotas", overquotas cannot be nil.')
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
if @remaining_completes.nil?
|
|
279
|
+
invalid_properties.push('invalid value for "remaining_completes", remaining_completes cannot be nil.')
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
if @screenouts.nil?
|
|
283
|
+
invalid_properties.push('invalid value for "screenouts", screenouts cannot be nil.')
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
if @state.nil?
|
|
287
|
+
invalid_properties.push('invalid value for "state", state cannot be nil.')
|
|
288
|
+
end
|
|
289
|
+
|
|
290
|
+
if @state_reason.nil?
|
|
291
|
+
invalid_properties.push('invalid value for "state_reason", state_reason cannot be nil.')
|
|
292
|
+
end
|
|
293
|
+
|
|
294
|
+
if @title.nil?
|
|
295
|
+
invalid_properties.push('invalid value for "title", title cannot be nil.')
|
|
296
|
+
end
|
|
297
|
+
|
|
298
|
+
invalid_properties
|
|
299
|
+
end
|
|
300
|
+
|
|
301
|
+
# Check to see if the all the properties in the model are valid
|
|
302
|
+
# @return true if the model is valid
|
|
303
|
+
def valid?
|
|
304
|
+
return false if @actual_median_loi.nil?
|
|
305
|
+
return false if @attempts.nil?
|
|
306
|
+
return false if @completes.nil?
|
|
307
|
+
return false if @conversion.nil?
|
|
308
|
+
return false if @country_iso_code.nil?
|
|
309
|
+
return false if @currency.nil?
|
|
310
|
+
return false if @estimated_cost.nil?
|
|
311
|
+
return false if @ext_line_item_id.nil?
|
|
312
|
+
return false if @incurred_cost.nil?
|
|
313
|
+
return false if @language_iso_code.nil?
|
|
314
|
+
return false if @last_accepted_incidence_rate.nil?
|
|
315
|
+
return false if @last_accepted_loi.nil?
|
|
316
|
+
return false if @overquotas.nil?
|
|
317
|
+
return false if @remaining_completes.nil?
|
|
318
|
+
return false if @screenouts.nil?
|
|
319
|
+
return false if @state.nil?
|
|
320
|
+
state_validator = EnumAttributeValidator.new('String', ['PROVISIONED', 'LAUNCHED', 'PAUSED', 'CLOSED'])
|
|
321
|
+
return false unless state_validator.valid?(@state)
|
|
322
|
+
return false if @state_reason.nil?
|
|
323
|
+
return false if @title.nil?
|
|
324
|
+
true
|
|
325
|
+
end
|
|
326
|
+
|
|
327
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
328
|
+
# @param [Object] state Object to be assigned
|
|
329
|
+
def state=(state)
|
|
330
|
+
validator = EnumAttributeValidator.new('String', ['PROVISIONED', 'LAUNCHED', 'PAUSED', 'CLOSED'])
|
|
331
|
+
unless validator.valid?(state)
|
|
332
|
+
fail ArgumentError, 'invalid value for "state", must be one of #{validator.allowable_values}.'
|
|
333
|
+
end
|
|
334
|
+
@state = state
|
|
335
|
+
end
|
|
336
|
+
|
|
337
|
+
# Checks equality by comparing each attribute.
|
|
338
|
+
# @param [Object] Object to be compared
|
|
339
|
+
def ==(o)
|
|
340
|
+
return true if self.equal?(o)
|
|
341
|
+
self.class == o.class &&
|
|
342
|
+
actual_median_loi == o.actual_median_loi &&
|
|
343
|
+
attempts == o.attempts &&
|
|
344
|
+
completes == o.completes &&
|
|
345
|
+
conversion == o.conversion &&
|
|
346
|
+
country_iso_code == o.country_iso_code &&
|
|
347
|
+
currency == o.currency &&
|
|
348
|
+
estimated_cost == o.estimated_cost &&
|
|
349
|
+
ext_line_item_id == o.ext_line_item_id &&
|
|
350
|
+
incurred_cost == o.incurred_cost &&
|
|
351
|
+
language_iso_code == o.language_iso_code &&
|
|
352
|
+
last_accepted_incidence_rate == o.last_accepted_incidence_rate &&
|
|
353
|
+
last_accepted_loi == o.last_accepted_loi &&
|
|
354
|
+
overquotas == o.overquotas &&
|
|
355
|
+
remaining_completes == o.remaining_completes &&
|
|
356
|
+
screenouts == o.screenouts &&
|
|
357
|
+
state == o.state &&
|
|
358
|
+
state_reason == o.state_reason &&
|
|
359
|
+
title == o.title
|
|
360
|
+
end
|
|
361
|
+
|
|
362
|
+
# @see the `==` method
|
|
363
|
+
# @param [Object] Object to be compared
|
|
364
|
+
def eql?(o)
|
|
365
|
+
self == o
|
|
366
|
+
end
|
|
367
|
+
|
|
368
|
+
# Calculates hash code according to all attributes.
|
|
369
|
+
# @return [Fixnum] Hash code
|
|
370
|
+
def hash
|
|
371
|
+
[actual_median_loi, attempts, completes, conversion, country_iso_code, currency, estimated_cost, ext_line_item_id, incurred_cost, language_iso_code, last_accepted_incidence_rate, last_accepted_loi, overquotas, remaining_completes, screenouts, state, state_reason, title].hash
|
|
372
|
+
end
|
|
373
|
+
|
|
374
|
+
# Builds the object from hash
|
|
375
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
376
|
+
# @return [Object] Returns the model itself
|
|
377
|
+
def build_from_hash(attributes)
|
|
378
|
+
return nil unless attributes.is_a?(Hash)
|
|
379
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
380
|
+
if type =~ /\AArray<(.*)>/i
|
|
381
|
+
# check to ensure the input is an array given that the the attribute
|
|
382
|
+
# is documented as an array but the input is not
|
|
383
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
384
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
385
|
+
end
|
|
386
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
387
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
388
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
389
|
+
end
|
|
390
|
+
|
|
391
|
+
self
|
|
392
|
+
end
|
|
393
|
+
|
|
394
|
+
# Deserializes the data based on type
|
|
395
|
+
# @param string type Data type
|
|
396
|
+
# @param string value Value to be deserialized
|
|
397
|
+
# @return [Object] Deserialized data
|
|
398
|
+
def _deserialize(type, value)
|
|
399
|
+
case type.to_sym
|
|
400
|
+
when :DateTime
|
|
401
|
+
DateTime.parse(value)
|
|
402
|
+
when :Date
|
|
403
|
+
Date.parse(value)
|
|
404
|
+
when :String
|
|
405
|
+
value.to_s
|
|
406
|
+
when :Integer
|
|
407
|
+
value.to_i
|
|
408
|
+
when :Float
|
|
409
|
+
value.to_f
|
|
410
|
+
when :BOOLEAN
|
|
411
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
412
|
+
true
|
|
413
|
+
else
|
|
414
|
+
false
|
|
415
|
+
end
|
|
416
|
+
when :Object
|
|
417
|
+
# generic object (usually a Hash), return directly
|
|
418
|
+
value
|
|
419
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
420
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
421
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
422
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
423
|
+
k_type = Regexp.last_match[:k_type]
|
|
424
|
+
v_type = Regexp.last_match[:v_type]
|
|
425
|
+
{}.tap do |hash|
|
|
426
|
+
value.each do |k, v|
|
|
427
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
428
|
+
end
|
|
429
|
+
end
|
|
430
|
+
else # model
|
|
431
|
+
temp_model = SamplifyAPIClient.const_get(type).new
|
|
432
|
+
temp_model.build_from_hash(value)
|
|
433
|
+
end
|
|
434
|
+
end
|
|
435
|
+
|
|
436
|
+
# Returns the string representation of the object
|
|
437
|
+
# @return [String] String presentation of the object
|
|
438
|
+
def to_s
|
|
439
|
+
to_hash.to_s
|
|
440
|
+
end
|
|
441
|
+
|
|
442
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
443
|
+
# @return [Hash] Returns the object in the form of hash
|
|
444
|
+
def to_body
|
|
445
|
+
to_hash
|
|
446
|
+
end
|
|
447
|
+
|
|
448
|
+
# Returns the object in the form of hash
|
|
449
|
+
# @return [Hash] Returns the object in the form of hash
|
|
450
|
+
def to_hash
|
|
451
|
+
hash = {}
|
|
452
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
453
|
+
value = self.send(attr)
|
|
454
|
+
next if value.nil?
|
|
455
|
+
hash[param] = _to_hash(value)
|
|
456
|
+
end
|
|
457
|
+
hash
|
|
458
|
+
end
|
|
459
|
+
|
|
460
|
+
# Outputs non-array value in the form of hash
|
|
461
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
462
|
+
# @param [Object] value Any valid value
|
|
463
|
+
# @return [Hash] Returns the value in the form of hash
|
|
464
|
+
def _to_hash(value)
|
|
465
|
+
if value.is_a?(Array)
|
|
466
|
+
value.compact.map { |v| _to_hash(v) }
|
|
467
|
+
elsif value.is_a?(Hash)
|
|
468
|
+
{}.tap do |hash|
|
|
469
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
470
|
+
end
|
|
471
|
+
elsif value.respond_to? :to_hash
|
|
472
|
+
value.to_hash
|
|
473
|
+
else
|
|
474
|
+
value
|
|
475
|
+
end
|
|
476
|
+
end
|
|
477
|
+
end
|
|
478
|
+
end
|