phrase 2.17.0 → 2.19.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/README.md +14 -29
- data/docs/Account.md +2 -2
- data/docs/AccountDetails.md +2 -2
- data/docs/Authorization.md +3 -3
- data/docs/AuthorizationCreateParameters.md +1 -1
- data/docs/AuthorizationUpdateParameters.md +1 -1
- data/docs/AuthorizationWithToken.md +3 -3
- data/docs/BitbucketSync.md +2 -2
- data/docs/BlacklistedKey.md +2 -2
- data/docs/Branch.md +3 -3
- data/docs/Comment.md +2 -2
- data/docs/CommentReaction.md +2 -2
- data/docs/CommentRepliesApi.md +3 -1
- data/docs/CommentsApi.md +5 -3
- data/docs/CommentsListParameters.md +3 -1
- data/docs/CurrentUser.md +2 -2
- data/docs/Distribution.md +2 -2
- data/docs/DistributionCreateParameters.md +1 -1
- data/docs/DistributionPreview.md +2 -2
- data/docs/Document.md +2 -2
- data/docs/FigmaAttachment.md +2 -2
- data/docs/GitlabSync.md +2 -2
- data/docs/GitlabSyncHistory.md +3 -3
- data/docs/{GitlabSyncHistoryErrors.md → GitlabSyncHistoryErrorsInner.md} +2 -2
- data/docs/Glossary.md +2 -2
- data/docs/GlossaryTerm.md +2 -2
- data/docs/GlossaryTermTranslation.md +2 -2
- data/docs/Invitation.md +5 -5
- data/docs/{InlineResponse422.md → InvitationCreate422Response.md} +3 -3
- data/docs/{InlineResponse422Errors.md → InvitationCreate422ResponseErrorsInner.md} +2 -2
- data/docs/Job.md +3 -3
- data/docs/JobComment.md +2 -2
- data/docs/JobCommentsApi.md +3 -1
- data/docs/JobCreateParameters.md +1 -1
- data/docs/JobDetails.md +3 -3
- data/docs/JobLocale.md +2 -2
- data/docs/JobLocalesApi.md +1 -1
- data/docs/JobTemplate.md +2 -2
- data/docs/JobTemplateDetails.md +2 -2
- data/docs/JobTemplateLocalesApi.md +1 -1
- data/docs/JobTemplatesApi.md +2 -2
- data/docs/JobUpdateParameters.md +1 -1
- data/docs/JobsApi.md +1 -1
- data/docs/KeyCreateParameters.md +1 -1
- data/docs/KeyUpdateParameters.md +1 -1
- data/docs/Locale.md +2 -2
- data/docs/LocaleDetails.md +2 -2
- data/docs/LocalesApi.md +1 -1
- data/docs/Member.md +4 -4
- data/docs/MemberProjectDetail.md +3 -3
- data/docs/{MemberProjectDetailProjectRoles.md → MemberProjectDetailProjectRolesInner.md} +2 -2
- data/docs/{MemberSpaces.md → MemberSpacesInner.md} +4 -4
- data/docs/Notification.md +6 -6
- data/docs/NotificationGroup.md +2 -2
- data/docs/NotificationGroupDetail.md +2 -2
- data/docs/OrganizationJobTemplate.md +2 -2
- data/docs/OrganizationJobTemplateDetails.md +2 -2
- data/docs/OrganizationJobTemplateLocalesApi.md +1 -1
- data/docs/OrganizationJobTemplatesApi.md +2 -2
- data/docs/Project.md +2 -2
- data/docs/ProjectCreateParameters.md +1 -1
- data/docs/ProjectDetails.md +2 -2
- data/docs/ProjectLocales.md +2 -2
- data/docs/ProjectShort.md +2 -2
- data/docs/ProjectUpdateParameters.md +1 -1
- data/docs/ProjectsApi.md +1 -1
- data/docs/Release.md +2 -2
- data/docs/ReleasePreview.md +2 -2
- data/docs/RepliesListParameters.md +3 -1
- data/docs/Screenshot.md +2 -2
- data/docs/ScreenshotMarker.md +2 -2
- data/docs/ScreenshotUpdateParameters.md +1 -1
- data/docs/ScreenshotsApi.md +1 -1
- data/docs/Space.md +2 -2
- data/docs/Space1.md +2 -2
- data/docs/Styleguide.md +2 -2
- data/docs/StyleguideCreateParameters.md +1 -1
- data/docs/StyleguideDetails.md +2 -2
- data/docs/StyleguideUpdateParameters.md +1 -1
- data/docs/Tag.md +2 -2
- data/docs/TagWithStats.md +2 -2
- data/docs/Team.md +2 -2
- data/docs/TeamDetail.md +2 -2
- data/docs/TeamShort.md +2 -2
- data/docs/Translation.md +2 -2
- data/docs/TranslationDetails.md +2 -2
- data/docs/TranslationKey.md +2 -2
- data/docs/TranslationKeyDetails.md +2 -2
- data/docs/TranslationOrder.md +2 -2
- data/docs/TranslationVersion.md +3 -3
- data/docs/TranslationVersionWithUser.md +3 -3
- data/docs/Upload.md +2 -2
- data/docs/UploadsApi.md +4 -4
- data/docs/User.md +2 -2
- data/docs/Variable.md +2 -2
- data/docs/Webhook.md +2 -2
- data/docs/WebhookDelivery.md +3 -3
- data/lib/phrase/api/comment_replies_api.rb +3 -0
- data/lib/phrase/api/comments_api.rb +3 -0
- data/lib/phrase/api/job_comments_api.rb +3 -0
- data/lib/phrase/configuration.rb +6 -6
- data/lib/phrase/models/account.rb +3 -1
- data/lib/phrase/models/account_details.rb +4 -3
- data/lib/phrase/models/account_search_result.rb +3 -1
- data/lib/phrase/models/affected_count.rb +3 -1
- data/lib/phrase/models/affected_resources.rb +3 -1
- data/lib/phrase/models/authorization.rb +3 -1
- data/lib/phrase/models/authorization_create_parameters.rb +3 -1
- data/lib/phrase/models/authorization_update_parameters.rb +3 -1
- data/lib/phrase/models/authorization_with_token.rb +4 -3
- data/lib/phrase/models/bitbucket_sync.rb +3 -1
- data/lib/phrase/models/bitbucket_sync_export_parameters.rb +3 -1
- data/lib/phrase/models/bitbucket_sync_export_response.rb +3 -1
- data/lib/phrase/models/bitbucket_sync_import_parameters.rb +3 -1
- data/lib/phrase/models/blacklisted_key.rb +3 -1
- data/lib/phrase/models/blacklisted_key_create_parameters.rb +3 -1
- data/lib/phrase/models/blacklisted_key_update_parameters.rb +3 -1
- data/lib/phrase/models/branch.rb +3 -1
- data/lib/phrase/models/branch_create_parameters.rb +3 -1
- data/lib/phrase/models/branch_merge_parameters.rb +3 -1
- data/lib/phrase/models/branch_name.rb +3 -1
- data/lib/phrase/models/branch_update_parameters.rb +3 -1
- data/lib/phrase/models/comment.rb +3 -1
- data/lib/phrase/models/comment_create_parameters.rb +3 -1
- data/lib/phrase/models/comment_mark_read_parameters.rb +3 -1
- data/lib/phrase/models/comment_reaction.rb +3 -1
- data/lib/phrase/models/comment_update_parameters.rb +3 -1
- data/lib/phrase/models/comments_list_parameters.rb +17 -5
- data/lib/phrase/models/current_user.rb +3 -1
- data/lib/phrase/models/distribution.rb +3 -1
- data/lib/phrase/models/distribution_create_parameters.rb +4 -2
- data/lib/phrase/models/distribution_preview.rb +3 -1
- data/lib/phrase/models/distribution_update_parameters.rb +3 -1
- data/lib/phrase/models/document.rb +3 -1
- data/lib/phrase/models/figma_attachment.rb +3 -1
- data/lib/phrase/models/figma_attachment_create_parameters.rb +3 -1
- data/lib/phrase/models/figma_attachment_update_parameters.rb +3 -1
- data/lib/phrase/models/format.rb +3 -1
- data/lib/phrase/models/github_sync_export_parameters.rb +3 -1
- data/lib/phrase/models/github_sync_import_parameters.rb +3 -1
- data/lib/phrase/models/gitlab_sync.rb +3 -1
- data/lib/phrase/models/gitlab_sync_export.rb +3 -1
- data/lib/phrase/models/gitlab_sync_export_parameters.rb +3 -1
- data/lib/phrase/models/gitlab_sync_history.rb +4 -2
- data/lib/phrase/models/{gitlab_sync_history_errors.rb → gitlab_sync_history_errors_inner.rb} +6 -4
- data/lib/phrase/models/gitlab_sync_import_parameters.rb +3 -1
- data/lib/phrase/models/glossary.rb +3 -1
- data/lib/phrase/models/glossary_create_parameters.rb +3 -1
- data/lib/phrase/models/glossary_term.rb +3 -1
- data/lib/phrase/models/glossary_term_create_parameters.rb +3 -1
- data/lib/phrase/models/glossary_term_translation.rb +3 -1
- data/lib/phrase/models/glossary_term_translation_create_parameters.rb +3 -1
- data/lib/phrase/models/glossary_term_translation_update_parameters.rb +3 -1
- data/lib/phrase/models/glossary_term_update_parameters.rb +3 -1
- data/lib/phrase/models/glossary_update_parameters.rb +3 -1
- data/lib/phrase/models/icu.rb +3 -1
- data/lib/phrase/models/icu_skeleton_parameters.rb +3 -1
- data/lib/phrase/models/invitation.rb +4 -2
- data/lib/phrase/models/{inline_response422.rb → invitation_create422_response.rb} +7 -5
- data/lib/phrase/models/{inline_response422_errors.rb → invitation_create422_response_errors_inner.rb} +6 -4
- data/lib/phrase/models/invitation_create_parameters.rb +3 -1
- data/lib/phrase/models/invitation_update_parameters.rb +3 -1
- data/lib/phrase/models/invitation_update_settings_parameters.rb +3 -1
- data/lib/phrase/models/job.rb +3 -1
- data/lib/phrase/models/job_comment.rb +3 -1
- data/lib/phrase/models/job_comment_create_parameters.rb +3 -1
- data/lib/phrase/models/job_comment_update_parameters.rb +3 -1
- data/lib/phrase/models/job_complete_parameters.rb +3 -1
- data/lib/phrase/models/job_create_parameters.rb +3 -1
- data/lib/phrase/models/job_details.rb +4 -3
- data/lib/phrase/models/job_keys_create_parameters.rb +3 -1
- data/lib/phrase/models/job_locale.rb +3 -1
- data/lib/phrase/models/job_locale_complete_parameters.rb +3 -1
- data/lib/phrase/models/job_locale_complete_review_parameters.rb +3 -1
- data/lib/phrase/models/job_locale_reopen_parameters.rb +3 -1
- data/lib/phrase/models/job_locale_update_parameters.rb +3 -1
- data/lib/phrase/models/job_locales_create_parameters.rb +3 -1
- data/lib/phrase/models/job_preview.rb +3 -1
- data/lib/phrase/models/job_reopen_parameters.rb +3 -1
- data/lib/phrase/models/job_start_parameters.rb +3 -1
- data/lib/phrase/models/job_template.rb +3 -1
- data/lib/phrase/models/job_template_create_parameters.rb +3 -1
- data/lib/phrase/models/job_template_details.rb +4 -3
- data/lib/phrase/models/job_template_locale_update_parameters.rb +3 -1
- data/lib/phrase/models/job_template_locales.rb +3 -1
- data/lib/phrase/models/job_template_locales_create_parameters.rb +3 -1
- data/lib/phrase/models/job_template_preview.rb +3 -1
- data/lib/phrase/models/job_template_update_parameters.rb +3 -1
- data/lib/phrase/models/job_update_parameters.rb +3 -1
- data/lib/phrase/models/key_create_parameters.rb +3 -1
- data/lib/phrase/models/key_preview.rb +3 -1
- data/lib/phrase/models/key_update_parameters.rb +3 -1
- data/lib/phrase/models/keys_exclude_parameters.rb +3 -1
- data/lib/phrase/models/keys_include_parameters.rb +3 -1
- data/lib/phrase/models/keys_search_parameters.rb +3 -1
- data/lib/phrase/models/keys_tag_parameters.rb +3 -1
- data/lib/phrase/models/keys_untag_parameters.rb +3 -1
- data/lib/phrase/models/locale.rb +3 -1
- data/lib/phrase/models/locale_create_parameters.rb +3 -1
- data/lib/phrase/models/locale_details.rb +4 -3
- data/lib/phrase/models/locale_preview.rb +3 -1
- data/lib/phrase/models/locale_preview1.rb +3 -1
- data/lib/phrase/models/locale_statistics.rb +3 -1
- data/lib/phrase/models/locale_team_preview.rb +3 -1
- data/lib/phrase/models/locale_update_parameters.rb +3 -1
- data/lib/phrase/models/locale_user_preview.rb +3 -1
- data/lib/phrase/models/member.rb +4 -2
- data/lib/phrase/models/member_project_detail.rb +5 -3
- data/lib/phrase/models/{member_project_detail_project_roles.rb → member_project_detail_project_roles_inner.rb} +6 -4
- data/lib/phrase/models/{member_spaces.rb → member_spaces_inner.rb} +6 -4
- data/lib/phrase/models/member_update_parameters.rb +3 -1
- data/lib/phrase/models/member_update_settings_parameters.rb +3 -1
- data/lib/phrase/models/notification.rb +3 -1
- data/lib/phrase/models/notification_group.rb +3 -1
- data/lib/phrase/models/notification_group_detail.rb +3 -1
- data/lib/phrase/models/order_confirm_parameters.rb +3 -1
- data/lib/phrase/models/order_create_parameters.rb +3 -1
- data/lib/phrase/models/organization_job_template.rb +3 -1
- data/lib/phrase/models/organization_job_template_create_parameters.rb +3 -1
- data/lib/phrase/models/organization_job_template_details.rb +3 -2
- data/lib/phrase/models/organization_job_template_locale_update_parameters.rb +3 -1
- data/lib/phrase/models/organization_job_template_locales_create_parameters.rb +3 -1
- data/lib/phrase/models/organization_job_template_update_parameters.rb +3 -1
- data/lib/phrase/models/project.rb +3 -1
- data/lib/phrase/models/project_create_parameters.rb +3 -1
- data/lib/phrase/models/project_details.rb +4 -3
- data/lib/phrase/models/project_locales.rb +3 -9
- data/lib/phrase/models/project_short.rb +3 -1
- data/lib/phrase/models/project_update_parameters.rb +3 -1
- data/lib/phrase/models/release.rb +3 -1
- data/lib/phrase/models/release_create_parameters.rb +3 -1
- data/lib/phrase/models/release_preview.rb +3 -1
- data/lib/phrase/models/release_update_parameters.rb +3 -1
- data/lib/phrase/models/replies_list_parameters.rb +17 -5
- data/lib/phrase/models/screenshot.rb +3 -1
- data/lib/phrase/models/screenshot_marker.rb +3 -1
- data/lib/phrase/models/screenshot_marker_create_parameters.rb +3 -1
- data/lib/phrase/models/screenshot_marker_update_parameters.rb +3 -1
- data/lib/phrase/models/screenshot_update_parameters.rb +3 -1
- data/lib/phrase/models/search_in_account_parameters.rb +3 -1
- data/lib/phrase/models/space.rb +3 -1
- data/lib/phrase/models/space1.rb +3 -1
- data/lib/phrase/models/space_create_parameters.rb +3 -1
- data/lib/phrase/models/space_update_parameters.rb +3 -1
- data/lib/phrase/models/spaces_projects_create_parameters.rb +3 -1
- data/lib/phrase/models/styleguide.rb +3 -1
- data/lib/phrase/models/styleguide_create_parameters.rb +3 -1
- data/lib/phrase/models/styleguide_details.rb +4 -3
- data/lib/phrase/models/styleguide_preview.rb +3 -1
- data/lib/phrase/models/styleguide_update_parameters.rb +3 -1
- data/lib/phrase/models/subscription.rb +3 -1
- data/lib/phrase/models/tag.rb +3 -1
- data/lib/phrase/models/tag_create_parameters.rb +3 -1
- data/lib/phrase/models/tag_with_stats.rb +4 -3
- data/lib/phrase/models/tag_with_stats1_statistics.rb +3 -1
- data/lib/phrase/models/tag_with_stats1_statistics1.rb +3 -1
- data/lib/phrase/models/team.rb +3 -1
- data/lib/phrase/models/team_create_parameters.rb +3 -1
- data/lib/phrase/models/team_detail.rb +3 -1
- data/lib/phrase/models/team_short.rb +3 -1
- data/lib/phrase/models/team_update_parameters.rb +3 -1
- data/lib/phrase/models/teams_projects_create_parameters.rb +3 -1
- data/lib/phrase/models/teams_spaces_create_parameters.rb +3 -1
- data/lib/phrase/models/teams_users_create_parameters.rb +3 -1
- data/lib/phrase/models/translation.rb +3 -1
- data/lib/phrase/models/translation_create_parameters.rb +3 -1
- data/lib/phrase/models/translation_details.rb +4 -3
- data/lib/phrase/models/translation_exclude_parameters.rb +3 -1
- data/lib/phrase/models/translation_include_parameters.rb +3 -1
- data/lib/phrase/models/translation_key.rb +3 -1
- data/lib/phrase/models/translation_key_details.rb +4 -3
- data/lib/phrase/models/translation_order.rb +3 -1
- data/lib/phrase/models/translation_review_parameters.rb +3 -1
- data/lib/phrase/models/translation_unverify_parameters.rb +3 -1
- data/lib/phrase/models/translation_update_parameters.rb +3 -1
- data/lib/phrase/models/translation_verify_parameters.rb +3 -1
- data/lib/phrase/models/translation_version.rb +3 -1
- data/lib/phrase/models/translation_version_with_user.rb +4 -3
- data/lib/phrase/models/translations_exclude_parameters.rb +3 -1
- data/lib/phrase/models/translations_include_parameters.rb +3 -1
- data/lib/phrase/models/translations_review_parameters.rb +3 -1
- data/lib/phrase/models/translations_search_parameters.rb +3 -1
- data/lib/phrase/models/translations_unverify_parameters.rb +3 -1
- data/lib/phrase/models/translations_verify_parameters.rb +3 -1
- data/lib/phrase/models/upload.rb +3 -1
- data/lib/phrase/models/upload_summary.rb +3 -1
- data/lib/phrase/models/user.rb +3 -1
- data/lib/phrase/models/user_preview.rb +3 -1
- data/lib/phrase/models/variable.rb +3 -1
- data/lib/phrase/models/variable_create_parameters.rb +3 -1
- data/lib/phrase/models/variable_update_parameters.rb +3 -1
- data/lib/phrase/models/webhook.rb +3 -1
- data/lib/phrase/models/webhook_create_parameters.rb +3 -1
- data/lib/phrase/models/webhook_delivery.rb +3 -1
- data/lib/phrase/models/webhook_update_parameters.rb +3 -1
- data/lib/phrase/version.rb +1 -1
- data/lib/phrase.rb +5 -20
- data/spec/api/comment_replies_api_spec.rb +1 -0
- data/spec/api/comments_api_spec.rb +1 -0
- data/spec/api/job_comments_api_spec.rb +1 -0
- data/spec/models/comments_list_parameters_spec.rb +6 -0
- data/spec/models/{gitlab_sync_history_errors_spec.rb → gitlab_sync_history_errors_inner_spec.rb} +6 -6
- data/spec/models/{inline_response422_errors_spec.rb → invitation_create422_response_errors_inner_spec.rb} +6 -6
- data/spec/models/{inline_response422_spec.rb → invitation_create422_response_spec.rb} +6 -6
- data/spec/models/{member_project_detail_project_roles_spec.rb → member_project_detail_project_roles_inner_spec.rb} +6 -6
- data/spec/models/{member_spaces_spec.rb → member_spaces_inner_spec.rb} +6 -6
- data/spec/models/replies_list_parameters_spec.rb +6 -0
- metadata +226 -286
- data/docs/AccountDetails1.md +0 -19
- data/docs/AuthorizationWithToken1.md +0 -17
- data/docs/JobDetails1.md +0 -25
- data/docs/JobTemplateDetails1.md +0 -21
- data/docs/LocaleDetails1.md +0 -17
- data/docs/ProjectDetails1.md +0 -19
- data/docs/ProjectLocales1.md +0 -17
- data/docs/ProjectMemberSpecific.md +0 -27
- data/docs/ScreenshotCreateParameters.md +0 -23
- data/docs/StyleguideDetails1.md +0 -41
- data/docs/TagWithStats1.md +0 -17
- data/docs/TranslationDetails1.md +0 -19
- data/docs/TranslationKeyDetails1.md +0 -33
- data/docs/TranslationVersionWithUser1.md +0 -17
- data/docs/UploadCreateParameters.md +0 -47
- data/lib/phrase/models/account_details1.rb +0 -203
- data/lib/phrase/models/authorization_with_token1.rb +0 -194
- data/lib/phrase/models/job_details1.rb +0 -234
- data/lib/phrase/models/job_template_details1.rb +0 -214
- data/lib/phrase/models/locale_details1.rb +0 -194
- data/lib/phrase/models/project_details1.rb +0 -203
- data/lib/phrase/models/project_locales1.rb +0 -196
- data/lib/phrase/models/project_member_specific.rb +0 -239
- data/lib/phrase/models/screenshot_create_parameters.rb +0 -225
- data/lib/phrase/models/styleguide_details1.rb +0 -302
- data/lib/phrase/models/tag_with_stats1.rb +0 -196
- data/lib/phrase/models/translation_details1.rb +0 -203
- data/lib/phrase/models/translation_key_details1.rb +0 -266
- data/lib/phrase/models/translation_version_with_user1.rb +0 -194
- data/lib/phrase/models/upload_create_parameters.rb +0 -347
- data/spec/models/account_details1_spec.rb +0 -35
- data/spec/models/authorization_with_token1_spec.rb +0 -29
- data/spec/models/job_details1_spec.rb +0 -53
- data/spec/models/job_template_details1_spec.rb +0 -41
- data/spec/models/locale_details1_spec.rb +0 -29
- data/spec/models/project_details1_spec.rb +0 -35
- data/spec/models/project_locales1_spec.rb +0 -29
- data/spec/models/project_member_specific_spec.rb +0 -59
- data/spec/models/screenshot_create_parameters_spec.rb +0 -47
- data/spec/models/styleguide_details1_spec.rb +0 -101
- data/spec/models/tag_with_stats1_spec.rb +0 -29
- data/spec/models/translation_details1_spec.rb +0 -35
- data/spec/models/translation_key_details1_spec.rb +0 -77
- data/spec/models/translation_version_with_user1_spec.rb +0 -29
- data/spec/models/upload_create_parameters_spec.rb +0 -119
@@ -1,302 +0,0 @@
|
|
1
|
-
require 'date'
|
2
|
-
|
3
|
-
module Phrase
|
4
|
-
class StyleguideDetails1
|
5
|
-
attr_accessor :public_url
|
6
|
-
|
7
|
-
attr_accessor :audience
|
8
|
-
|
9
|
-
attr_accessor :target_audience
|
10
|
-
|
11
|
-
attr_accessor :grammatical_person
|
12
|
-
|
13
|
-
attr_accessor :vocabulary_type
|
14
|
-
|
15
|
-
attr_accessor :business
|
16
|
-
|
17
|
-
attr_accessor :company_branding
|
18
|
-
|
19
|
-
attr_accessor :formatting
|
20
|
-
|
21
|
-
attr_accessor :glossary_terms
|
22
|
-
|
23
|
-
attr_accessor :grammar_consistency
|
24
|
-
|
25
|
-
attr_accessor :literal_translation
|
26
|
-
|
27
|
-
attr_accessor :overall_tone
|
28
|
-
|
29
|
-
attr_accessor :samples
|
30
|
-
|
31
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
32
|
-
def self.attribute_map
|
33
|
-
{
|
34
|
-
:'public_url' => :'public_url',
|
35
|
-
:'audience' => :'audience',
|
36
|
-
:'target_audience' => :'target_audience',
|
37
|
-
:'grammatical_person' => :'grammatical_person',
|
38
|
-
:'vocabulary_type' => :'vocabulary_type',
|
39
|
-
:'business' => :'business',
|
40
|
-
:'company_branding' => :'company_branding',
|
41
|
-
:'formatting' => :'formatting',
|
42
|
-
:'glossary_terms' => :'glossary_terms',
|
43
|
-
:'grammar_consistency' => :'grammar_consistency',
|
44
|
-
:'literal_translation' => :'literal_translation',
|
45
|
-
:'overall_tone' => :'overall_tone',
|
46
|
-
:'samples' => :'samples'
|
47
|
-
}
|
48
|
-
end
|
49
|
-
|
50
|
-
# Attribute type mapping.
|
51
|
-
def self.openapi_types
|
52
|
-
{
|
53
|
-
:'public_url' => :'String',
|
54
|
-
:'audience' => :'String',
|
55
|
-
:'target_audience' => :'String',
|
56
|
-
:'grammatical_person' => :'String',
|
57
|
-
:'vocabulary_type' => :'String',
|
58
|
-
:'business' => :'String',
|
59
|
-
:'company_branding' => :'String',
|
60
|
-
:'formatting' => :'String',
|
61
|
-
:'glossary_terms' => :'String',
|
62
|
-
:'grammar_consistency' => :'String',
|
63
|
-
:'literal_translation' => :'String',
|
64
|
-
:'overall_tone' => :'String',
|
65
|
-
:'samples' => :'String'
|
66
|
-
}
|
67
|
-
end
|
68
|
-
|
69
|
-
# List of attributes with nullable: true
|
70
|
-
def self.openapi_nullable
|
71
|
-
Set.new([
|
72
|
-
])
|
73
|
-
end
|
74
|
-
|
75
|
-
# Initializes the object
|
76
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
77
|
-
def initialize(attributes = {})
|
78
|
-
if (!attributes.is_a?(Hash))
|
79
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::StyleguideDetails1` initialize method"
|
80
|
-
end
|
81
|
-
|
82
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
83
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
84
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
85
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::StyleguideDetails1`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
86
|
-
end
|
87
|
-
h[k.to_sym] = v
|
88
|
-
}
|
89
|
-
|
90
|
-
if attributes.key?(:'public_url')
|
91
|
-
self.public_url = attributes[:'public_url']
|
92
|
-
end
|
93
|
-
|
94
|
-
if attributes.key?(:'audience')
|
95
|
-
self.audience = attributes[:'audience']
|
96
|
-
end
|
97
|
-
|
98
|
-
if attributes.key?(:'target_audience')
|
99
|
-
self.target_audience = attributes[:'target_audience']
|
100
|
-
end
|
101
|
-
|
102
|
-
if attributes.key?(:'grammatical_person')
|
103
|
-
self.grammatical_person = attributes[:'grammatical_person']
|
104
|
-
end
|
105
|
-
|
106
|
-
if attributes.key?(:'vocabulary_type')
|
107
|
-
self.vocabulary_type = attributes[:'vocabulary_type']
|
108
|
-
end
|
109
|
-
|
110
|
-
if attributes.key?(:'business')
|
111
|
-
self.business = attributes[:'business']
|
112
|
-
end
|
113
|
-
|
114
|
-
if attributes.key?(:'company_branding')
|
115
|
-
self.company_branding = attributes[:'company_branding']
|
116
|
-
end
|
117
|
-
|
118
|
-
if attributes.key?(:'formatting')
|
119
|
-
self.formatting = attributes[:'formatting']
|
120
|
-
end
|
121
|
-
|
122
|
-
if attributes.key?(:'glossary_terms')
|
123
|
-
self.glossary_terms = attributes[:'glossary_terms']
|
124
|
-
end
|
125
|
-
|
126
|
-
if attributes.key?(:'grammar_consistency')
|
127
|
-
self.grammar_consistency = attributes[:'grammar_consistency']
|
128
|
-
end
|
129
|
-
|
130
|
-
if attributes.key?(:'literal_translation')
|
131
|
-
self.literal_translation = attributes[:'literal_translation']
|
132
|
-
end
|
133
|
-
|
134
|
-
if attributes.key?(:'overall_tone')
|
135
|
-
self.overall_tone = attributes[:'overall_tone']
|
136
|
-
end
|
137
|
-
|
138
|
-
if attributes.key?(:'samples')
|
139
|
-
self.samples = attributes[:'samples']
|
140
|
-
end
|
141
|
-
end
|
142
|
-
|
143
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
144
|
-
# @return Array for valid properties with the reasons
|
145
|
-
def list_invalid_properties
|
146
|
-
invalid_properties = Array.new
|
147
|
-
invalid_properties
|
148
|
-
end
|
149
|
-
|
150
|
-
# Check to see if the all the properties in the model are valid
|
151
|
-
# @return true if the model is valid
|
152
|
-
def valid?
|
153
|
-
true
|
154
|
-
end
|
155
|
-
|
156
|
-
# Checks equality by comparing each attribute.
|
157
|
-
# @param [Object] Object to be compared
|
158
|
-
def ==(o)
|
159
|
-
return true if self.equal?(o)
|
160
|
-
self.class == o.class &&
|
161
|
-
public_url == o.public_url &&
|
162
|
-
audience == o.audience &&
|
163
|
-
target_audience == o.target_audience &&
|
164
|
-
grammatical_person == o.grammatical_person &&
|
165
|
-
vocabulary_type == o.vocabulary_type &&
|
166
|
-
business == o.business &&
|
167
|
-
company_branding == o.company_branding &&
|
168
|
-
formatting == o.formatting &&
|
169
|
-
glossary_terms == o.glossary_terms &&
|
170
|
-
grammar_consistency == o.grammar_consistency &&
|
171
|
-
literal_translation == o.literal_translation &&
|
172
|
-
overall_tone == o.overall_tone &&
|
173
|
-
samples == o.samples
|
174
|
-
end
|
175
|
-
|
176
|
-
# @see the `==` method
|
177
|
-
# @param [Object] Object to be compared
|
178
|
-
def eql?(o)
|
179
|
-
self == o
|
180
|
-
end
|
181
|
-
|
182
|
-
# Calculates hash code according to all attributes.
|
183
|
-
# @return [Integer] Hash code
|
184
|
-
def hash
|
185
|
-
[public_url, audience, target_audience, grammatical_person, vocabulary_type, business, company_branding, formatting, glossary_terms, grammar_consistency, literal_translation, overall_tone, samples].hash
|
186
|
-
end
|
187
|
-
|
188
|
-
# Builds the object from hash
|
189
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
190
|
-
# @return [Object] Returns the model itself
|
191
|
-
def self.build_from_hash(attributes)
|
192
|
-
new.build_from_hash(attributes)
|
193
|
-
end
|
194
|
-
|
195
|
-
# Builds the object from hash
|
196
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
197
|
-
# @return [Object] Returns the model itself
|
198
|
-
def build_from_hash(attributes)
|
199
|
-
return nil unless attributes.is_a?(Hash)
|
200
|
-
self.class.openapi_types.each_pair do |key, type|
|
201
|
-
if type =~ /\AArray<(.*)>/i
|
202
|
-
# check to ensure the input is an array given that the attribute
|
203
|
-
# is documented as an array but the input is not
|
204
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
205
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
206
|
-
end
|
207
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
208
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
209
|
-
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
210
|
-
end
|
211
|
-
|
212
|
-
self
|
213
|
-
end
|
214
|
-
|
215
|
-
# Deserializes the data based on type
|
216
|
-
# @param string type Data type
|
217
|
-
# @param string value Value to be deserialized
|
218
|
-
# @return [Object] Deserialized data
|
219
|
-
def _deserialize(type, value)
|
220
|
-
case type.to_sym
|
221
|
-
when :DateTime
|
222
|
-
DateTime.parse(value)
|
223
|
-
when :Date
|
224
|
-
Date.parse(value)
|
225
|
-
when :String
|
226
|
-
value.to_s
|
227
|
-
when :Integer
|
228
|
-
value.to_i
|
229
|
-
when :Float
|
230
|
-
value.to_f
|
231
|
-
when :Boolean
|
232
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
233
|
-
true
|
234
|
-
else
|
235
|
-
false
|
236
|
-
end
|
237
|
-
when :Object
|
238
|
-
# generic object (usually a Hash), return directly
|
239
|
-
value
|
240
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
241
|
-
inner_type = Regexp.last_match[:inner_type]
|
242
|
-
value.map { |v| _deserialize(inner_type, v) }
|
243
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
244
|
-
k_type = Regexp.last_match[:k_type]
|
245
|
-
v_type = Regexp.last_match[:v_type]
|
246
|
-
{}.tap do |hash|
|
247
|
-
value.each do |k, v|
|
248
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
249
|
-
end
|
250
|
-
end
|
251
|
-
else # model
|
252
|
-
Phrase.const_get(type).build_from_hash(value)
|
253
|
-
end
|
254
|
-
end
|
255
|
-
|
256
|
-
# Returns the string representation of the object
|
257
|
-
# @return [String] String presentation of the object
|
258
|
-
def to_s
|
259
|
-
to_hash.to_s
|
260
|
-
end
|
261
|
-
|
262
|
-
# to_body is an alias to to_hash (backward compatibility)
|
263
|
-
# @return [Hash] Returns the object in the form of hash
|
264
|
-
def to_body
|
265
|
-
to_hash
|
266
|
-
end
|
267
|
-
|
268
|
-
# Returns the object in the form of hash
|
269
|
-
# @return [Hash] Returns the object in the form of hash
|
270
|
-
def to_hash
|
271
|
-
hash = {}
|
272
|
-
self.class.attribute_map.each_pair do |attr, param|
|
273
|
-
value = self.send(attr)
|
274
|
-
if value.nil?
|
275
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
276
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
277
|
-
end
|
278
|
-
|
279
|
-
hash[param] = _to_hash(value)
|
280
|
-
end
|
281
|
-
hash
|
282
|
-
end
|
283
|
-
|
284
|
-
# Outputs non-array value in the form of hash
|
285
|
-
# For object, use to_hash. Otherwise, just return the value
|
286
|
-
# @param [Object] value Any valid value
|
287
|
-
# @return [Hash] Returns the value in the form of hash
|
288
|
-
def _to_hash(value)
|
289
|
-
if value.is_a?(Array)
|
290
|
-
value.compact.map { |v| _to_hash(v) }
|
291
|
-
elsif value.is_a?(Hash)
|
292
|
-
{}.tap do |hash|
|
293
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
294
|
-
end
|
295
|
-
elsif value.respond_to? :to_hash
|
296
|
-
value.to_hash
|
297
|
-
else
|
298
|
-
value
|
299
|
-
end
|
300
|
-
end
|
301
|
-
end
|
302
|
-
end
|
@@ -1,196 +0,0 @@
|
|
1
|
-
require 'date'
|
2
|
-
|
3
|
-
module Phrase
|
4
|
-
class TagWithStats1
|
5
|
-
attr_accessor :statistics
|
6
|
-
|
7
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
8
|
-
def self.attribute_map
|
9
|
-
{
|
10
|
-
:'statistics' => :'statistics'
|
11
|
-
}
|
12
|
-
end
|
13
|
-
|
14
|
-
# Attribute type mapping.
|
15
|
-
def self.openapi_types
|
16
|
-
{
|
17
|
-
:'statistics' => :'Array<TagWithStats1Statistics1>'
|
18
|
-
}
|
19
|
-
end
|
20
|
-
|
21
|
-
# List of attributes with nullable: true
|
22
|
-
def self.openapi_nullable
|
23
|
-
Set.new([
|
24
|
-
])
|
25
|
-
end
|
26
|
-
|
27
|
-
# Initializes the object
|
28
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
29
|
-
def initialize(attributes = {})
|
30
|
-
if (!attributes.is_a?(Hash))
|
31
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::TagWithStats1` initialize method"
|
32
|
-
end
|
33
|
-
|
34
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
35
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
36
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
37
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::TagWithStats1`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
38
|
-
end
|
39
|
-
h[k.to_sym] = v
|
40
|
-
}
|
41
|
-
|
42
|
-
if attributes.key?(:'statistics')
|
43
|
-
if (value = attributes[:'statistics']).is_a?(Array)
|
44
|
-
self.statistics = value
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
50
|
-
# @return Array for valid properties with the reasons
|
51
|
-
def list_invalid_properties
|
52
|
-
invalid_properties = Array.new
|
53
|
-
invalid_properties
|
54
|
-
end
|
55
|
-
|
56
|
-
# Check to see if the all the properties in the model are valid
|
57
|
-
# @return true if the model is valid
|
58
|
-
def valid?
|
59
|
-
true
|
60
|
-
end
|
61
|
-
|
62
|
-
# Checks equality by comparing each attribute.
|
63
|
-
# @param [Object] Object to be compared
|
64
|
-
def ==(o)
|
65
|
-
return true if self.equal?(o)
|
66
|
-
self.class == o.class &&
|
67
|
-
statistics == o.statistics
|
68
|
-
end
|
69
|
-
|
70
|
-
# @see the `==` method
|
71
|
-
# @param [Object] Object to be compared
|
72
|
-
def eql?(o)
|
73
|
-
self == o
|
74
|
-
end
|
75
|
-
|
76
|
-
# Calculates hash code according to all attributes.
|
77
|
-
# @return [Integer] Hash code
|
78
|
-
def hash
|
79
|
-
[statistics].hash
|
80
|
-
end
|
81
|
-
|
82
|
-
# Builds the object from hash
|
83
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
84
|
-
# @return [Object] Returns the model itself
|
85
|
-
def self.build_from_hash(attributes)
|
86
|
-
new.build_from_hash(attributes)
|
87
|
-
end
|
88
|
-
|
89
|
-
# Builds the object from hash
|
90
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
91
|
-
# @return [Object] Returns the model itself
|
92
|
-
def build_from_hash(attributes)
|
93
|
-
return nil unless attributes.is_a?(Hash)
|
94
|
-
self.class.openapi_types.each_pair do |key, type|
|
95
|
-
if type =~ /\AArray<(.*)>/i
|
96
|
-
# check to ensure the input is an array given that the attribute
|
97
|
-
# is documented as an array but the input is not
|
98
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
99
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
100
|
-
end
|
101
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
102
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
103
|
-
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
104
|
-
end
|
105
|
-
|
106
|
-
self
|
107
|
-
end
|
108
|
-
|
109
|
-
# Deserializes the data based on type
|
110
|
-
# @param string type Data type
|
111
|
-
# @param string value Value to be deserialized
|
112
|
-
# @return [Object] Deserialized data
|
113
|
-
def _deserialize(type, value)
|
114
|
-
case type.to_sym
|
115
|
-
when :DateTime
|
116
|
-
DateTime.parse(value)
|
117
|
-
when :Date
|
118
|
-
Date.parse(value)
|
119
|
-
when :String
|
120
|
-
value.to_s
|
121
|
-
when :Integer
|
122
|
-
value.to_i
|
123
|
-
when :Float
|
124
|
-
value.to_f
|
125
|
-
when :Boolean
|
126
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
127
|
-
true
|
128
|
-
else
|
129
|
-
false
|
130
|
-
end
|
131
|
-
when :Object
|
132
|
-
# generic object (usually a Hash), return directly
|
133
|
-
value
|
134
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
135
|
-
inner_type = Regexp.last_match[:inner_type]
|
136
|
-
value.map { |v| _deserialize(inner_type, v) }
|
137
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
138
|
-
k_type = Regexp.last_match[:k_type]
|
139
|
-
v_type = Regexp.last_match[:v_type]
|
140
|
-
{}.tap do |hash|
|
141
|
-
value.each do |k, v|
|
142
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
143
|
-
end
|
144
|
-
end
|
145
|
-
else # model
|
146
|
-
Phrase.const_get(type).build_from_hash(value)
|
147
|
-
end
|
148
|
-
end
|
149
|
-
|
150
|
-
# Returns the string representation of the object
|
151
|
-
# @return [String] String presentation of the object
|
152
|
-
def to_s
|
153
|
-
to_hash.to_s
|
154
|
-
end
|
155
|
-
|
156
|
-
# to_body is an alias to to_hash (backward compatibility)
|
157
|
-
# @return [Hash] Returns the object in the form of hash
|
158
|
-
def to_body
|
159
|
-
to_hash
|
160
|
-
end
|
161
|
-
|
162
|
-
# Returns the object in the form of hash
|
163
|
-
# @return [Hash] Returns the object in the form of hash
|
164
|
-
def to_hash
|
165
|
-
hash = {}
|
166
|
-
self.class.attribute_map.each_pair do |attr, param|
|
167
|
-
value = self.send(attr)
|
168
|
-
if value.nil?
|
169
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
170
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
171
|
-
end
|
172
|
-
|
173
|
-
hash[param] = _to_hash(value)
|
174
|
-
end
|
175
|
-
hash
|
176
|
-
end
|
177
|
-
|
178
|
-
# Outputs non-array value in the form of hash
|
179
|
-
# For object, use to_hash. Otherwise, just return the value
|
180
|
-
# @param [Object] value Any valid value
|
181
|
-
# @return [Hash] Returns the value in the form of hash
|
182
|
-
def _to_hash(value)
|
183
|
-
if value.is_a?(Array)
|
184
|
-
value.compact.map { |v| _to_hash(v) }
|
185
|
-
elsif value.is_a?(Hash)
|
186
|
-
{}.tap do |hash|
|
187
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
188
|
-
end
|
189
|
-
elsif value.respond_to? :to_hash
|
190
|
-
value.to_hash
|
191
|
-
else
|
192
|
-
value
|
193
|
-
end
|
194
|
-
end
|
195
|
-
end
|
196
|
-
end
|
@@ -1,203 +0,0 @@
|
|
1
|
-
require 'date'
|
2
|
-
|
3
|
-
module Phrase
|
4
|
-
class TranslationDetails1
|
5
|
-
attr_accessor :user
|
6
|
-
|
7
|
-
attr_accessor :word_count
|
8
|
-
|
9
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
10
|
-
def self.attribute_map
|
11
|
-
{
|
12
|
-
:'user' => :'user',
|
13
|
-
:'word_count' => :'word_count'
|
14
|
-
}
|
15
|
-
end
|
16
|
-
|
17
|
-
# Attribute type mapping.
|
18
|
-
def self.openapi_types
|
19
|
-
{
|
20
|
-
:'user' => :'UserPreview',
|
21
|
-
:'word_count' => :'Integer'
|
22
|
-
}
|
23
|
-
end
|
24
|
-
|
25
|
-
# List of attributes with nullable: true
|
26
|
-
def self.openapi_nullable
|
27
|
-
Set.new([
|
28
|
-
])
|
29
|
-
end
|
30
|
-
|
31
|
-
# Initializes the object
|
32
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
33
|
-
def initialize(attributes = {})
|
34
|
-
if (!attributes.is_a?(Hash))
|
35
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::TranslationDetails1` initialize method"
|
36
|
-
end
|
37
|
-
|
38
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
39
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
40
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
41
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::TranslationDetails1`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
42
|
-
end
|
43
|
-
h[k.to_sym] = v
|
44
|
-
}
|
45
|
-
|
46
|
-
if attributes.key?(:'user')
|
47
|
-
self.user = attributes[:'user']
|
48
|
-
end
|
49
|
-
|
50
|
-
if attributes.key?(:'word_count')
|
51
|
-
self.word_count = attributes[:'word_count']
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
56
|
-
# @return Array for valid properties with the reasons
|
57
|
-
def list_invalid_properties
|
58
|
-
invalid_properties = Array.new
|
59
|
-
invalid_properties
|
60
|
-
end
|
61
|
-
|
62
|
-
# Check to see if the all the properties in the model are valid
|
63
|
-
# @return true if the model is valid
|
64
|
-
def valid?
|
65
|
-
true
|
66
|
-
end
|
67
|
-
|
68
|
-
# Checks equality by comparing each attribute.
|
69
|
-
# @param [Object] Object to be compared
|
70
|
-
def ==(o)
|
71
|
-
return true if self.equal?(o)
|
72
|
-
self.class == o.class &&
|
73
|
-
user == o.user &&
|
74
|
-
word_count == o.word_count
|
75
|
-
end
|
76
|
-
|
77
|
-
# @see the `==` method
|
78
|
-
# @param [Object] Object to be compared
|
79
|
-
def eql?(o)
|
80
|
-
self == o
|
81
|
-
end
|
82
|
-
|
83
|
-
# Calculates hash code according to all attributes.
|
84
|
-
# @return [Integer] Hash code
|
85
|
-
def hash
|
86
|
-
[user, word_count].hash
|
87
|
-
end
|
88
|
-
|
89
|
-
# Builds the object from hash
|
90
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
91
|
-
# @return [Object] Returns the model itself
|
92
|
-
def self.build_from_hash(attributes)
|
93
|
-
new.build_from_hash(attributes)
|
94
|
-
end
|
95
|
-
|
96
|
-
# Builds the object from hash
|
97
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
98
|
-
# @return [Object] Returns the model itself
|
99
|
-
def build_from_hash(attributes)
|
100
|
-
return nil unless attributes.is_a?(Hash)
|
101
|
-
self.class.openapi_types.each_pair do |key, type|
|
102
|
-
if type =~ /\AArray<(.*)>/i
|
103
|
-
# check to ensure the input is an array given that the attribute
|
104
|
-
# is documented as an array but the input is not
|
105
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
106
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
107
|
-
end
|
108
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
109
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
110
|
-
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
111
|
-
end
|
112
|
-
|
113
|
-
self
|
114
|
-
end
|
115
|
-
|
116
|
-
# Deserializes the data based on type
|
117
|
-
# @param string type Data type
|
118
|
-
# @param string value Value to be deserialized
|
119
|
-
# @return [Object] Deserialized data
|
120
|
-
def _deserialize(type, value)
|
121
|
-
case type.to_sym
|
122
|
-
when :DateTime
|
123
|
-
DateTime.parse(value)
|
124
|
-
when :Date
|
125
|
-
Date.parse(value)
|
126
|
-
when :String
|
127
|
-
value.to_s
|
128
|
-
when :Integer
|
129
|
-
value.to_i
|
130
|
-
when :Float
|
131
|
-
value.to_f
|
132
|
-
when :Boolean
|
133
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
134
|
-
true
|
135
|
-
else
|
136
|
-
false
|
137
|
-
end
|
138
|
-
when :Object
|
139
|
-
# generic object (usually a Hash), return directly
|
140
|
-
value
|
141
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
142
|
-
inner_type = Regexp.last_match[:inner_type]
|
143
|
-
value.map { |v| _deserialize(inner_type, v) }
|
144
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
145
|
-
k_type = Regexp.last_match[:k_type]
|
146
|
-
v_type = Regexp.last_match[:v_type]
|
147
|
-
{}.tap do |hash|
|
148
|
-
value.each do |k, v|
|
149
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
150
|
-
end
|
151
|
-
end
|
152
|
-
else # model
|
153
|
-
Phrase.const_get(type).build_from_hash(value)
|
154
|
-
end
|
155
|
-
end
|
156
|
-
|
157
|
-
# Returns the string representation of the object
|
158
|
-
# @return [String] String presentation of the object
|
159
|
-
def to_s
|
160
|
-
to_hash.to_s
|
161
|
-
end
|
162
|
-
|
163
|
-
# to_body is an alias to to_hash (backward compatibility)
|
164
|
-
# @return [Hash] Returns the object in the form of hash
|
165
|
-
def to_body
|
166
|
-
to_hash
|
167
|
-
end
|
168
|
-
|
169
|
-
# Returns the object in the form of hash
|
170
|
-
# @return [Hash] Returns the object in the form of hash
|
171
|
-
def to_hash
|
172
|
-
hash = {}
|
173
|
-
self.class.attribute_map.each_pair do |attr, param|
|
174
|
-
value = self.send(attr)
|
175
|
-
if value.nil?
|
176
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
177
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
178
|
-
end
|
179
|
-
|
180
|
-
hash[param] = _to_hash(value)
|
181
|
-
end
|
182
|
-
hash
|
183
|
-
end
|
184
|
-
|
185
|
-
# Outputs non-array value in the form of hash
|
186
|
-
# For object, use to_hash. Otherwise, just return the value
|
187
|
-
# @param [Object] value Any valid value
|
188
|
-
# @return [Hash] Returns the value in the form of hash
|
189
|
-
def _to_hash(value)
|
190
|
-
if value.is_a?(Array)
|
191
|
-
value.compact.map { |v| _to_hash(v) }
|
192
|
-
elsif value.is_a?(Hash)
|
193
|
-
{}.tap do |hash|
|
194
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
195
|
-
end
|
196
|
-
elsif value.respond_to? :to_hash
|
197
|
-
value.to_hash
|
198
|
-
else
|
199
|
-
value
|
200
|
-
end
|
201
|
-
end
|
202
|
-
end
|
203
|
-
end
|