shortcut_client_ruby 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/LICENSE +21 -0
- data/README.md +2303 -0
- data/Rakefile +8 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/bin/update.rb +34 -0
- data/config.json +7 -0
- data/docs/BasicWorkspaceInfo.md +8 -0
- data/docs/Branch.md +17 -0
- data/docs/Category.md +15 -0
- data/docs/Commit.md +19 -0
- data/docs/CreateCategory.md +10 -0
- data/docs/CreateCategoryParams.md +9 -0
- data/docs/CreateCommentComment.md +11 -0
- data/docs/CreateEntityTemplate.md +9 -0
- data/docs/CreateEpic.md +23 -0
- data/docs/CreateEpicComment.md +11 -0
- data/docs/CreateGroup.md +14 -0
- data/docs/CreateIteration.md +13 -0
- data/docs/CreateLabelParams.md +10 -0
- data/docs/CreateLinkedFile.md +15 -0
- data/docs/CreateMilestone.md +12 -0
- data/docs/CreateOrDeleteStoryReaction.md +7 -0
- data/docs/CreateProject.md +17 -0
- data/docs/CreateStories.md +7 -0
- data/docs/CreateStoryComment.md +11 -0
- data/docs/CreateStoryCommentParams.md +11 -0
- data/docs/CreateStoryContents.md +27 -0
- data/docs/CreateStoryLink.md +9 -0
- data/docs/CreateStoryLinkParams.md +9 -0
- data/docs/CreateStoryParams.md +33 -0
- data/docs/CreateTask.md +12 -0
- data/docs/CreateTaskParams.md +12 -0
- data/docs/DefaultApi.md +5632 -0
- data/docs/DeleteStories.md +7 -0
- data/docs/EntityTemplate.md +14 -0
- data/docs/EntityTemplateTask.md +10 -0
- data/docs/Epic.md +44 -0
- data/docs/EpicSearchResults.md +10 -0
- data/docs/EpicSlim.md +43 -0
- data/docs/EpicState.md +15 -0
- data/docs/EpicStats.md +19 -0
- data/docs/EpicWorkflow.md +12 -0
- data/docs/GetEpicStories.md +7 -0
- data/docs/GetExternalLinkStoriesParams.md +7 -0
- data/docs/GetIterationStories.md +7 -0
- data/docs/GetLabelStories.md +7 -0
- data/docs/GetMember.md +7 -0
- data/docs/GetProjectStories.md +7 -0
- data/docs/Group.md +22 -0
- data/docs/History.md +15 -0
- data/docs/HistoryActionBranchCreate.md +11 -0
- data/docs/HistoryActionBranchMerge.md +11 -0
- data/docs/HistoryActionBranchPush.md +11 -0
- data/docs/HistoryActionLabelCreate.md +11 -0
- data/docs/HistoryActionLabelDelete.md +10 -0
- data/docs/HistoryActionLabelUpdate.md +9 -0
- data/docs/HistoryActionProjectUpdate.md +11 -0
- data/docs/HistoryActionPullRequest.md +12 -0
- data/docs/HistoryActionStoryCommentCreate.md +12 -0
- data/docs/HistoryActionStoryCreate.md +30 -0
- data/docs/HistoryActionStoryDelete.md +11 -0
- data/docs/HistoryActionStoryLinkCreate.md +12 -0
- data/docs/HistoryActionStoryLinkDelete.md +12 -0
- data/docs/HistoryActionStoryLinkUpdate.md +13 -0
- data/docs/HistoryActionStoryUpdate.md +13 -0
- data/docs/HistoryActionTaskCreate.md +15 -0
- data/docs/HistoryActionTaskDelete.md +10 -0
- data/docs/HistoryActionTaskUpdate.md +13 -0
- data/docs/HistoryChangesStory.md +30 -0
- data/docs/HistoryChangesStoryLink.md +9 -0
- data/docs/HistoryChangesTask.md +10 -0
- data/docs/HistoryReferenceBranch.md +10 -0
- data/docs/HistoryReferenceCommit.md +10 -0
- data/docs/HistoryReferenceEpic.md +10 -0
- data/docs/HistoryReferenceGeneral.md +9 -0
- data/docs/HistoryReferenceGroup.md +9 -0
- data/docs/HistoryReferenceIteration.md +10 -0
- data/docs/HistoryReferenceLabel.md +10 -0
- data/docs/HistoryReferenceProject.md +10 -0
- data/docs/HistoryReferenceStory.md +11 -0
- data/docs/HistoryReferenceStoryTask.md +9 -0
- data/docs/HistoryReferenceWorkflowState.md +10 -0
- data/docs/Icon.md +11 -0
- data/docs/Identity.md +9 -0
- data/docs/Iteration.md +24 -0
- data/docs/IterationSlim.md +23 -0
- data/docs/IterationStats.md +17 -0
- data/docs/Label.md +17 -0
- data/docs/LabelSlim.md +16 -0
- data/docs/LabelStats.md +21 -0
- data/docs/LinkedFile.md +22 -0
- data/docs/ListEpics.md +7 -0
- data/docs/ListGroupStories.md +8 -0
- data/docs/ListLabels.md +7 -0
- data/docs/ListMembers.md +7 -0
- data/docs/MaxSearchResultsExceededError.md +9 -0
- data/docs/Member.md +17 -0
- data/docs/MemberInfo.md +10 -0
- data/docs/Milestone.md +23 -0
- data/docs/MilestoneStats.md +9 -0
- data/docs/Profile.md +15 -0
- data/docs/Project.md +25 -0
- data/docs/ProjectStats.md +9 -0
- data/docs/PullRequest.md +28 -0
- data/docs/PullRequestLabel.md +11 -0
- data/docs/Repository.md +15 -0
- data/docs/Search.md +10 -0
- data/docs/SearchResults.md +8 -0
- data/docs/SearchStories.md +34 -0
- data/docs/Story.md +56 -0
- data/docs/StoryComment.md +20 -0
- data/docs/StoryContents.md +25 -0
- data/docs/StoryContentsTask.md +11 -0
- data/docs/StoryHistoryChangeAddsRemovesInt.md +8 -0
- data/docs/StoryHistoryChangeAddsRemovesUuid.md +8 -0
- data/docs/StoryHistoryChangeOldNewBool.md +8 -0
- data/docs/StoryHistoryChangeOldNewInt.md +8 -0
- data/docs/StoryHistoryChangeOldNewStr.md +8 -0
- data/docs/StoryHistoryChangeOldNewUuid.md +8 -0
- data/docs/StoryLink.md +14 -0
- data/docs/StoryReaction.md +8 -0
- data/docs/StorySearchResults.md +10 -0
- data/docs/StorySlim.md +54 -0
- data/docs/StoryStats.md +7 -0
- data/docs/Task.md +20 -0
- data/docs/ThreadedComment.md +19 -0
- data/docs/TypedStoryLink.md +15 -0
- data/docs/UnusableEntitlementError.md +9 -0
- data/docs/UpdateCategory.md +9 -0
- data/docs/UpdateComment.md +7 -0
- data/docs/UpdateEntityTemplate.md +8 -0
- data/docs/UpdateEpic.md +23 -0
- data/docs/UpdateFile.md +12 -0
- data/docs/UpdateGroup.md +15 -0
- data/docs/UpdateIteration.md +13 -0
- data/docs/UpdateLabel.md +10 -0
- data/docs/UpdateLinkedFile.md +14 -0
- data/docs/UpdateMilestone.md +14 -0
- data/docs/UpdateProject.md +15 -0
- data/docs/UpdateStories.md +27 -0
- data/docs/UpdateStory.md +32 -0
- data/docs/UpdateStoryComment.md +7 -0
- data/docs/UpdateStoryContents.md +27 -0
- data/docs/UpdateStoryLink.md +9 -0
- data/docs/UpdateTask.md +11 -0
- data/docs/UploadedFile.md +23 -0
- data/docs/V3FilesBody.md +11 -0
- data/docs/Workflow.md +17 -0
- data/docs/WorkflowState.md +18 -0
- data/git_push.sh +55 -0
- data/lib/shortcut/client/ruby/version.rb +9 -0
- data/lib/shortcut/client/ruby.rb +12 -0
- data/lib/shortcut_client_ruby/api/default_api.rb +6091 -0
- data/lib/shortcut_client_ruby/api_client.rb +388 -0
- data/lib/shortcut_client_ruby/api_error.rb +57 -0
- data/lib/shortcut_client_ruby/configuration.rb +205 -0
- data/lib/shortcut_client_ruby/models/basic_workspace_info.rb +227 -0
- data/lib/shortcut_client_ruby/models/branch.rb +371 -0
- data/lib/shortcut_client_ruby/models/category.rb +335 -0
- data/lib/shortcut_client_ruby/models/commit.rb +398 -0
- data/lib/shortcut_client_ruby/models/create_category.rb +281 -0
- data/lib/shortcut_client_ruby/models/create_category_params.rb +233 -0
- data/lib/shortcut_client_ruby/models/create_comment_comment.rb +252 -0
- data/lib/shortcut_client_ruby/models/create_entity_template.rb +237 -0
- data/lib/shortcut_client_ruby/models/create_epic.rb +416 -0
- data/lib/shortcut_client_ruby/models/create_epic_comment.rb +252 -0
- data/lib/shortcut_client_ruby/models/create_group.rb +325 -0
- data/lib/shortcut_client_ruby/models/create_iteration.rb +288 -0
- data/lib/shortcut_client_ruby/models/create_label_params.rb +243 -0
- data/lib/shortcut_client_ruby/models/create_linked_file.rb +336 -0
- data/lib/shortcut_client_ruby/models/create_milestone.rb +298 -0
- data/lib/shortcut_client_ruby/models/create_or_delete_story_reaction.rb +212 -0
- data/lib/shortcut_client_ruby/models/create_project.rb +319 -0
- data/lib/shortcut_client_ruby/models/create_stories.rb +214 -0
- data/lib/shortcut_client_ruby/models/create_story_comment.rb +252 -0
- data/lib/shortcut_client_ruby/models/create_story_comment_params.rb +253 -0
- data/lib/shortcut_client_ruby/models/create_story_contents.rb +433 -0
- data/lib/shortcut_client_ruby/models/create_story_link.rb +276 -0
- data/lib/shortcut_client_ruby/models/create_story_link_params.rb +267 -0
- data/lib/shortcut_client_ruby/models/create_story_params.rb +532 -0
- data/lib/shortcut_client_ruby/models/create_task.rb +264 -0
- data/lib/shortcut_client_ruby/models/create_task_params.rb +265 -0
- data/lib/shortcut_client_ruby/models/delete_stories.rb +214 -0
- data/lib/shortcut_client_ruby/models/entity_template.rb +317 -0
- data/lib/shortcut_client_ruby/models/entity_template_task.rb +245 -0
- data/lib/shortcut_client_ruby/models/epic.rb +799 -0
- data/lib/shortcut_client_ruby/models/epic_search_results.rb +257 -0
- data/lib/shortcut_client_ruby/models/epic_slim.rb +777 -0
- data/lib/shortcut_client_ruby/models/epic_state.rb +328 -0
- data/lib/shortcut_client_ruby/models/epic_stats.rb +384 -0
- data/lib/shortcut_client_ruby/models/epic_workflow.rb +290 -0
- data/lib/shortcut_client_ruby/models/get_epic_stories.rb +207 -0
- data/lib/shortcut_client_ruby/models/get_external_link_stories_params.rb +212 -0
- data/lib/shortcut_client_ruby/models/get_iteration_stories.rb +207 -0
- data/lib/shortcut_client_ruby/models/get_label_stories.rb +207 -0
- data/lib/shortcut_client_ruby/models/get_member.rb +207 -0
- data/lib/shortcut_client_ruby/models/get_project_stories.rb +207 -0
- data/lib/shortcut_client_ruby/models/group.rb +479 -0
- data/lib/shortcut_client_ruby/models/history.rb +347 -0
- data/lib/shortcut_client_ruby/models/history_action_branch_create.rb +307 -0
- data/lib/shortcut_client_ruby/models/history_action_branch_merge.rb +307 -0
- data/lib/shortcut_client_ruby/models/history_action_branch_push.rb +307 -0
- data/lib/shortcut_client_ruby/models/history_action_label_create.rb +307 -0
- data/lib/shortcut_client_ruby/models/history_action_label_delete.rb +292 -0
- data/lib/shortcut_client_ruby/models/history_action_label_update.rb +277 -0
- data/lib/shortcut_client_ruby/models/history_action_project_update.rb +307 -0
- data/lib/shortcut_client_ruby/models/history_action_pull_request.rb +322 -0
- data/lib/shortcut_client_ruby/models/history_action_story_comment_create.rb +322 -0
- data/lib/shortcut_client_ruby/models/history_action_story_create.rb +527 -0
- data/lib/shortcut_client_ruby/models/history_action_story_delete.rb +319 -0
- data/lib/shortcut_client_ruby/models/history_action_story_link_create.rb +334 -0
- data/lib/shortcut_client_ruby/models/history_action_story_link_delete.rb +336 -0
- data/lib/shortcut_client_ruby/models/history_action_story_link_update.rb +348 -0
- data/lib/shortcut_client_ruby/models/history_action_story_update.rb +343 -0
- data/lib/shortcut_client_ruby/models/history_action_task_create.rb +353 -0
- data/lib/shortcut_client_ruby/models/history_action_task_delete.rb +292 -0
- data/lib/shortcut_client_ruby/models/history_action_task_update.rb +331 -0
- data/lib/shortcut_client_ruby/models/history_changes_story.rb +414 -0
- data/lib/shortcut_client_ruby/models/history_changes_story_link.rb +225 -0
- data/lib/shortcut_client_ruby/models/history_changes_task.rb +234 -0
- data/lib/shortcut_client_ruby/models/history_reference_branch.rb +258 -0
- data/lib/shortcut_client_ruby/models/history_reference_commit.rb +258 -0
- data/lib/shortcut_client_ruby/models/history_reference_epic.rb +258 -0
- data/lib/shortcut_client_ruby/models/history_reference_general.rb +243 -0
- data/lib/shortcut_client_ruby/models/history_reference_group.rb +243 -0
- data/lib/shortcut_client_ruby/models/history_reference_iteration.rb +258 -0
- data/lib/shortcut_client_ruby/models/history_reference_label.rb +258 -0
- data/lib/shortcut_client_ruby/models/history_reference_project.rb +258 -0
- data/lib/shortcut_client_ruby/models/history_reference_story.rb +307 -0
- data/lib/shortcut_client_ruby/models/history_reference_story_task.rb +243 -0
- data/lib/shortcut_client_ruby/models/history_reference_workflow_state.rb +292 -0
- data/lib/shortcut_client_ruby/models/icon.rb +273 -0
- data/lib/shortcut_client_ruby/models/identity.rb +245 -0
- data/lib/shortcut_client_ruby/models/iteration.rb +481 -0
- data/lib/shortcut_client_ruby/models/iteration_slim.rb +466 -0
- data/lib/shortcut_client_ruby/models/iteration_stats.rb +353 -0
- data/lib/shortcut_client_ruby/models/label.rb +362 -0
- data/lib/shortcut_client_ruby/models/label_slim.rb +353 -0
- data/lib/shortcut_client_ruby/models/label_stats.rb +423 -0
- data/lib/shortcut_client_ruby/models/linked_file.rb +450 -0
- data/lib/shortcut_client_ruby/models/list_epics.rb +207 -0
- data/lib/shortcut_client_ruby/models/list_group_stories.rb +217 -0
- data/lib/shortcut_client_ruby/models/list_labels.rb +207 -0
- data/lib/shortcut_client_ruby/models/list_members.rb +207 -0
- data/lib/shortcut_client_ruby/models/max_search_results_exceeded_error.rb +289 -0
- data/lib/shortcut_client_ruby/models/member.rb +395 -0
- data/lib/shortcut_client_ruby/models/member_info.rb +253 -0
- data/lib/shortcut_client_ruby/models/milestone.rb +453 -0
- data/lib/shortcut_client_ruby/models/milestone_stats.rb +233 -0
- data/lib/shortcut_client_ruby/models/profile.rb +330 -0
- data/lib/shortcut_client_ruby/models/project.rb +490 -0
- data/lib/shortcut_client_ruby/models/project_stats.rb +243 -0
- data/lib/shortcut_client_ruby/models/pull_request.rb +518 -0
- data/lib/shortcut_client_ruby/models/pull_request_label.rb +269 -0
- data/lib/shortcut_client_ruby/models/repository.rb +340 -0
- data/lib/shortcut_client_ruby/models/search.rb +275 -0
- data/lib/shortcut_client_ruby/models/search_results.rb +226 -0
- data/lib/shortcut_client_ruby/models/search_stories.rb +529 -0
- data/lib/shortcut_client_ruby/models/story.rb +985 -0
- data/lib/shortcut_client_ruby/models/story_comment.rb +419 -0
- data/lib/shortcut_client_ruby/models/story_contents.rb +404 -0
- data/lib/shortcut_client_ruby/models/story_contents_task.rb +255 -0
- data/lib/shortcut_client_ruby/models/story_history_change_adds_removes_int.rb +222 -0
- data/lib/shortcut_client_ruby/models/story_history_change_adds_removes_uuid.rb +222 -0
- data/lib/shortcut_client_ruby/models/story_history_change_old_new_bool.rb +218 -0
- data/lib/shortcut_client_ruby/models/story_history_change_old_new_int.rb +218 -0
- data/lib/shortcut_client_ruby/models/story_history_change_old_new_str.rb +218 -0
- data/lib/shortcut_client_ruby/models/story_history_change_old_new_uuid.rb +218 -0
- data/lib/shortcut_client_ruby/models/story_link.rb +318 -0
- data/lib/shortcut_client_ruby/models/story_reaction.rb +230 -0
- data/lib/shortcut_client_ruby/models/story_search_results.rb +257 -0
- data/lib/shortcut_client_ruby/models/story_slim.rb +944 -0
- data/lib/shortcut_client_ruby/models/story_stats.rb +213 -0
- data/lib/shortcut_client_ruby/models/task.rb +418 -0
- data/lib/shortcut_client_ruby/models/threaded_comment.rb +402 -0
- data/lib/shortcut_client_ruby/models/typed_story_link.rb +333 -0
- data/lib/shortcut_client_ruby/models/unusable_entitlement_error.rb +276 -0
- data/lib/shortcut_client_ruby/models/update_category.rb +228 -0
- data/lib/shortcut_client_ruby/models/update_comment.rb +212 -0
- data/lib/shortcut_client_ruby/models/update_entity_template.rb +217 -0
- data/lib/shortcut_client_ruby/models/update_epic.rb +413 -0
- data/lib/shortcut_client_ruby/models/update_file.rb +257 -0
- data/lib/shortcut_client_ruby/models/update_group.rb +328 -0
- data/lib/shortcut_client_ruby/models/update_iteration.rb +273 -0
- data/lib/shortcut_client_ruby/models/update_label.rb +238 -0
- data/lib/shortcut_client_ruby/models/update_linked_file.rb +311 -0
- data/lib/shortcut_client_ruby/models/update_milestone.rb +315 -0
- data/lib/shortcut_client_ruby/models/update_project.rb +289 -0
- data/lib/shortcut_client_ruby/models/update_stories.rb +480 -0
- data/lib/shortcut_client_ruby/models/update_story.rb +529 -0
- data/lib/shortcut_client_ruby/models/update_story_comment.rb +212 -0
- data/lib/shortcut_client_ruby/models/update_story_contents.rb +434 -0
- data/lib/shortcut_client_ruby/models/update_story_link.rb +261 -0
- data/lib/shortcut_client_ruby/models/update_task.rb +249 -0
- data/lib/shortcut_client_ruby/models/uploaded_file.rb +466 -0
- data/lib/shortcut_client_ruby/models/v3_files_body.rb +252 -0
- data/lib/shortcut_client_ruby/models/workflow.rb +367 -0
- data/lib/shortcut_client_ruby/models/workflow_state.rb +374 -0
- data/lib/shortcut_client_ruby/version.rb +14 -0
- data/lib/shortcut_client_ruby.rb +181 -0
- data/shortcut-client-ruby.gemspec +36 -0
- data/shortcut_client_ruby.gemspec +38 -0
- data/spec/api/default_api_spec.rb +1310 -0
- data/spec/api_client_spec.rb +225 -0
- data/spec/base_object_spec.rb +109 -0
- data/spec/configuration_spec.rb +41 -0
- data/spec/models/basic_workspace_info_spec.rb +46 -0
- data/spec/models/branch_spec.rb +100 -0
- data/spec/models/category_spec.rb +88 -0
- data/spec/models/commit_spec.rb +112 -0
- data/spec/models/create_category_params_spec.rb +52 -0
- data/spec/models/create_category_spec.rb +62 -0
- data/spec/models/create_comment_comment_spec.rb +64 -0
- data/spec/models/create_entity_template_spec.rb +52 -0
- data/spec/models/create_epic_comment_spec.rb +64 -0
- data/spec/models/create_epic_spec.rb +140 -0
- data/spec/models/create_group_spec.rb +86 -0
- data/spec/models/create_iteration_spec.rb +76 -0
- data/spec/models/create_label_params_spec.rb +58 -0
- data/spec/models/create_linked_file_spec.rb +92 -0
- data/spec/models/create_milestone_spec.rb +74 -0
- data/spec/models/create_or_delete_story_reaction_spec.rb +40 -0
- data/spec/models/create_project_spec.rb +100 -0
- data/spec/models/create_stories_spec.rb +40 -0
- data/spec/models/create_story_comment_params_spec.rb +64 -0
- data/spec/models/create_story_comment_spec.rb +64 -0
- data/spec/models/create_story_contents_spec.rb +160 -0
- data/spec/models/create_story_link_params_spec.rb +56 -0
- data/spec/models/create_story_link_spec.rb +56 -0
- data/spec/models/create_story_params_spec.rb +200 -0
- data/spec/models/create_task_params_spec.rb +70 -0
- data/spec/models/create_task_spec.rb +70 -0
- data/spec/models/delete_stories_spec.rb +40 -0
- data/spec/models/entity_template_spec.rb +82 -0
- data/spec/models/entity_template_task_spec.rb +58 -0
- data/spec/models/epic_search_results_spec.rb +58 -0
- data/spec/models/epic_slim_spec.rb +256 -0
- data/spec/models/epic_spec.rb +262 -0
- data/spec/models/epic_state_spec.rb +88 -0
- data/spec/models/epic_stats_spec.rb +112 -0
- data/spec/models/epic_workflow_spec.rb +70 -0
- data/spec/models/get_epic_stories_spec.rb +40 -0
- data/spec/models/get_external_link_stories_params_spec.rb +40 -0
- data/spec/models/get_iteration_stories_spec.rb +40 -0
- data/spec/models/get_label_stories_spec.rb +40 -0
- data/spec/models/get_member_spec.rb +40 -0
- data/spec/models/get_project_stories_spec.rb +40 -0
- data/spec/models/group_spec.rb +134 -0
- data/spec/models/history_action_branch_create_spec.rb +68 -0
- data/spec/models/history_action_branch_merge_spec.rb +68 -0
- data/spec/models/history_action_branch_push_spec.rb +68 -0
- data/spec/models/history_action_label_create_spec.rb +68 -0
- data/spec/models/history_action_label_delete_spec.rb +62 -0
- data/spec/models/history_action_label_update_spec.rb +56 -0
- data/spec/models/history_action_project_update_spec.rb +68 -0
- data/spec/models/history_action_pull_request_spec.rb +74 -0
- data/spec/models/history_action_story_comment_create_spec.rb +74 -0
- data/spec/models/history_action_story_create_spec.rb +186 -0
- data/spec/models/history_action_story_delete_spec.rb +72 -0
- data/spec/models/history_action_story_link_create_spec.rb +78 -0
- data/spec/models/history_action_story_link_delete_spec.rb +78 -0
- data/spec/models/history_action_story_link_update_spec.rb +84 -0
- data/spec/models/history_action_story_update_spec.rb +84 -0
- data/spec/models/history_action_task_create_spec.rb +92 -0
- data/spec/models/history_action_task_delete_spec.rb +62 -0
- data/spec/models/history_action_task_update_spec.rb +80 -0
- data/spec/models/history_changes_story_link_spec.rb +52 -0
- data/spec/models/history_changes_story_spec.rb +178 -0
- data/spec/models/history_changes_task_spec.rb +58 -0
- data/spec/models/history_reference_branch_spec.rb +58 -0
- data/spec/models/history_reference_commit_spec.rb +58 -0
- data/spec/models/history_reference_epic_spec.rb +58 -0
- data/spec/models/history_reference_general_spec.rb +52 -0
- data/spec/models/history_reference_group_spec.rb +52 -0
- data/spec/models/history_reference_iteration_spec.rb +58 -0
- data/spec/models/history_reference_label_spec.rb +58 -0
- data/spec/models/history_reference_project_spec.rb +58 -0
- data/spec/models/history_reference_story_spec.rb +68 -0
- data/spec/models/history_reference_story_task_spec.rb +52 -0
- data/spec/models/history_reference_workflow_state_spec.rb +62 -0
- data/spec/models/history_spec.rb +92 -0
- data/spec/models/icon_spec.rb +64 -0
- data/spec/models/identity_spec.rb +52 -0
- data/spec/models/iteration_slim_spec.rb +136 -0
- data/spec/models/iteration_spec.rb +142 -0
- data/spec/models/iteration_stats_spec.rb +100 -0
- data/spec/models/label_slim_spec.rb +94 -0
- data/spec/models/label_spec.rb +100 -0
- data/spec/models/label_stats_spec.rb +124 -0
- data/spec/models/linked_file_spec.rb +130 -0
- data/spec/models/list_epics_spec.rb +40 -0
- data/spec/models/list_group_stories_spec.rb +46 -0
- data/spec/models/list_labels_spec.rb +40 -0
- data/spec/models/list_members_spec.rb +40 -0
- data/spec/models/max_search_results_exceeded_error_spec.rb +60 -0
- data/spec/models/member_info_spec.rb +58 -0
- data/spec/models/member_spec.rb +104 -0
- data/spec/models/milestone_spec.rb +136 -0
- data/spec/models/milestone_stats_spec.rb +52 -0
- data/spec/models/profile_spec.rb +88 -0
- data/spec/models/project_spec.rb +148 -0
- data/spec/models/project_stats_spec.rb +52 -0
- data/spec/models/pull_request_label_spec.rb +64 -0
- data/spec/models/pull_request_spec.rb +166 -0
- data/spec/models/repository_spec.rb +88 -0
- data/spec/models/search_results_spec.rb +46 -0
- data/spec/models/search_spec.rb +62 -0
- data/spec/models/search_stories_spec.rb +210 -0
- data/spec/models/story_comment_spec.rb +118 -0
- data/spec/models/story_contents_spec.rb +148 -0
- data/spec/models/story_contents_task_spec.rb +64 -0
- data/spec/models/story_history_change_adds_removes_int_spec.rb +46 -0
- data/spec/models/story_history_change_adds_removes_uuid_spec.rb +46 -0
- data/spec/models/story_history_change_old_new_bool_spec.rb +46 -0
- data/spec/models/story_history_change_old_new_int_spec.rb +46 -0
- data/spec/models/story_history_change_old_new_str_spec.rb +46 -0
- data/spec/models/story_history_change_old_new_uuid_spec.rb +46 -0
- data/spec/models/story_link_spec.rb +82 -0
- data/spec/models/story_reaction_spec.rb +46 -0
- data/spec/models/story_search_results_spec.rb +58 -0
- data/spec/models/story_slim_spec.rb +322 -0
- data/spec/models/story_spec.rb +334 -0
- data/spec/models/story_stats_spec.rb +40 -0
- data/spec/models/task_spec.rb +118 -0
- data/spec/models/threaded_comment_spec.rb +112 -0
- data/spec/models/typed_story_link_spec.rb +88 -0
- data/spec/models/unusable_entitlement_error_spec.rb +56 -0
- data/spec/models/update_category_spec.rb +52 -0
- data/spec/models/update_comment_spec.rb +40 -0
- data/spec/models/update_entity_template_spec.rb +46 -0
- data/spec/models/update_epic_spec.rb +140 -0
- data/spec/models/update_file_spec.rb +70 -0
- data/spec/models/update_group_spec.rb +92 -0
- data/spec/models/update_iteration_spec.rb +76 -0
- data/spec/models/update_label_spec.rb +58 -0
- data/spec/models/update_linked_file_spec.rb +86 -0
- data/spec/models/update_milestone_spec.rb +86 -0
- data/spec/models/update_project_spec.rb +88 -0
- data/spec/models/update_stories_spec.rb +168 -0
- data/spec/models/update_story_comment_spec.rb +40 -0
- data/spec/models/update_story_contents_spec.rb +160 -0
- data/spec/models/update_story_link_spec.rb +56 -0
- data/spec/models/update_story_spec.rb +198 -0
- data/spec/models/update_task_spec.rb +64 -0
- data/spec/models/uploaded_file_spec.rb +136 -0
- data/spec/models/v3_files_body_spec.rb +64 -0
- data/spec/models/workflow_spec.rb +100 -0
- data/spec/models/workflow_state_spec.rb +106 -0
- data/spec/spec_helper.rb +110 -0
- metadata +701 -0
@@ -0,0 +1,529 @@
|
|
1
|
+
=begin
|
2
|
+
#Shortcut API
|
3
|
+
|
4
|
+
#Shortcut API
|
5
|
+
|
6
|
+
OpenAPI spec version: 3.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 3.0.35
|
10
|
+
=end
|
11
|
+
|
12
|
+
require 'date'
|
13
|
+
|
14
|
+
module Shortcut
|
15
|
+
class SearchStories
|
16
|
+
# A true/false boolean indicating whether the Story is in archived state.
|
17
|
+
attr_accessor :archived
|
18
|
+
|
19
|
+
# An array of UUIDs for any Users who may be Owners of the Stories.
|
20
|
+
attr_accessor :owner_id
|
21
|
+
|
22
|
+
# The type of Stories that you want returned.
|
23
|
+
attr_accessor :story_type
|
24
|
+
|
25
|
+
# The Epic IDs that may be associated with the Stories.
|
26
|
+
attr_accessor :epic_ids
|
27
|
+
|
28
|
+
# The IDs for the Projects the Stories may be assigned to.
|
29
|
+
attr_accessor :project_ids
|
30
|
+
|
31
|
+
# Stories should have been updated before this date.
|
32
|
+
attr_accessor :updated_at_end
|
33
|
+
|
34
|
+
# Stories should have been completed before this date.
|
35
|
+
attr_accessor :completed_at_end
|
36
|
+
|
37
|
+
# The type of Workflow State the Stories may be in.
|
38
|
+
attr_accessor :workflow_state_types
|
39
|
+
|
40
|
+
# Stories should have a deadline before this date.
|
41
|
+
attr_accessor :deadline_end
|
42
|
+
|
43
|
+
# Stories should have been created after this date.
|
44
|
+
attr_accessor :created_at_start
|
45
|
+
|
46
|
+
# The Epic IDs that may be associated with the Stories.
|
47
|
+
attr_accessor :epic_id
|
48
|
+
|
49
|
+
# The name of any associated Labels.
|
50
|
+
attr_accessor :label_name
|
51
|
+
|
52
|
+
# The UUID of any Users who may have requested the Stories.
|
53
|
+
attr_accessor :requested_by_id
|
54
|
+
|
55
|
+
# The Iteration ID that may be associated with the Stories.
|
56
|
+
attr_accessor :iteration_id
|
57
|
+
|
58
|
+
# The Label IDs that may be associated with the Stories.
|
59
|
+
attr_accessor :label_ids
|
60
|
+
|
61
|
+
# The Group ID that is associated with the Stories
|
62
|
+
attr_accessor :group_id
|
63
|
+
|
64
|
+
# The unique IDs of the specific Workflow States that the Stories should be in.
|
65
|
+
attr_accessor :workflow_state_id
|
66
|
+
|
67
|
+
# The Iteration IDs that may be associated with the Stories.
|
68
|
+
attr_accessor :iteration_ids
|
69
|
+
|
70
|
+
# Stories should have been created before this date.
|
71
|
+
attr_accessor :created_at_end
|
72
|
+
|
73
|
+
# Stories should have a deadline after this date.
|
74
|
+
attr_accessor :deadline_start
|
75
|
+
|
76
|
+
# The Group IDs that are associated with the Stories
|
77
|
+
attr_accessor :group_ids
|
78
|
+
|
79
|
+
# An array of UUIDs for any Users who may be Owners of the Stories.
|
80
|
+
attr_accessor :owner_ids
|
81
|
+
|
82
|
+
# An ID or URL that references an external resource. Useful during imports.
|
83
|
+
attr_accessor :external_id
|
84
|
+
|
85
|
+
# Whether to include the story description in the response.
|
86
|
+
attr_accessor :includes_description
|
87
|
+
|
88
|
+
# The number of estimate points associate with the Stories.
|
89
|
+
attr_accessor :estimate
|
90
|
+
|
91
|
+
# The IDs for the Projects the Stories may be assigned to.
|
92
|
+
attr_accessor :project_id
|
93
|
+
|
94
|
+
# Stories should have been competed after this date.
|
95
|
+
attr_accessor :completed_at_start
|
96
|
+
|
97
|
+
# Stories should have been updated after this date.
|
98
|
+
attr_accessor :updated_at_start
|
99
|
+
|
100
|
+
class EnumAttributeValidator
|
101
|
+
attr_reader :datatype
|
102
|
+
attr_reader :allowable_values
|
103
|
+
|
104
|
+
def initialize(datatype, allowable_values)
|
105
|
+
@allowable_values = allowable_values.map do |value|
|
106
|
+
case datatype.to_s
|
107
|
+
when /Integer/i
|
108
|
+
value.to_i
|
109
|
+
when /Float/i
|
110
|
+
value.to_f
|
111
|
+
else
|
112
|
+
value
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
def valid?(value)
|
118
|
+
!value || allowable_values.include?(value)
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
123
|
+
def self.attribute_map
|
124
|
+
{
|
125
|
+
:'archived' => :'archived',
|
126
|
+
:'owner_id' => :'owner_id',
|
127
|
+
:'story_type' => :'story_type',
|
128
|
+
:'epic_ids' => :'epic_ids',
|
129
|
+
:'project_ids' => :'project_ids',
|
130
|
+
:'updated_at_end' => :'updated_at_end',
|
131
|
+
:'completed_at_end' => :'completed_at_end',
|
132
|
+
:'workflow_state_types' => :'workflow_state_types',
|
133
|
+
:'deadline_end' => :'deadline_end',
|
134
|
+
:'created_at_start' => :'created_at_start',
|
135
|
+
:'epic_id' => :'epic_id',
|
136
|
+
:'label_name' => :'label_name',
|
137
|
+
:'requested_by_id' => :'requested_by_id',
|
138
|
+
:'iteration_id' => :'iteration_id',
|
139
|
+
:'label_ids' => :'label_ids',
|
140
|
+
:'group_id' => :'group_id',
|
141
|
+
:'workflow_state_id' => :'workflow_state_id',
|
142
|
+
:'iteration_ids' => :'iteration_ids',
|
143
|
+
:'created_at_end' => :'created_at_end',
|
144
|
+
:'deadline_start' => :'deadline_start',
|
145
|
+
:'group_ids' => :'group_ids',
|
146
|
+
:'owner_ids' => :'owner_ids',
|
147
|
+
:'external_id' => :'external_id',
|
148
|
+
:'includes_description' => :'includes_description',
|
149
|
+
:'estimate' => :'estimate',
|
150
|
+
:'project_id' => :'project_id',
|
151
|
+
:'completed_at_start' => :'completed_at_start',
|
152
|
+
:'updated_at_start' => :'updated_at_start'
|
153
|
+
}
|
154
|
+
end
|
155
|
+
|
156
|
+
# Attribute type mapping.
|
157
|
+
def self.openapi_types
|
158
|
+
{
|
159
|
+
:'archived' => :'Object',
|
160
|
+
:'owner_id' => :'Object',
|
161
|
+
:'story_type' => :'Object',
|
162
|
+
:'epic_ids' => :'Object',
|
163
|
+
:'project_ids' => :'Object',
|
164
|
+
:'updated_at_end' => :'Object',
|
165
|
+
:'completed_at_end' => :'Object',
|
166
|
+
:'workflow_state_types' => :'Object',
|
167
|
+
:'deadline_end' => :'Object',
|
168
|
+
:'created_at_start' => :'Object',
|
169
|
+
:'epic_id' => :'Object',
|
170
|
+
:'label_name' => :'Object',
|
171
|
+
:'requested_by_id' => :'Object',
|
172
|
+
:'iteration_id' => :'Object',
|
173
|
+
:'label_ids' => :'Object',
|
174
|
+
:'group_id' => :'Object',
|
175
|
+
:'workflow_state_id' => :'Object',
|
176
|
+
:'iteration_ids' => :'Object',
|
177
|
+
:'created_at_end' => :'Object',
|
178
|
+
:'deadline_start' => :'Object',
|
179
|
+
:'group_ids' => :'Object',
|
180
|
+
:'owner_ids' => :'Object',
|
181
|
+
:'external_id' => :'Object',
|
182
|
+
:'includes_description' => :'Object',
|
183
|
+
:'estimate' => :'Object',
|
184
|
+
:'project_id' => :'Object',
|
185
|
+
:'completed_at_start' => :'Object',
|
186
|
+
:'updated_at_start' => :'Object'
|
187
|
+
}
|
188
|
+
end
|
189
|
+
|
190
|
+
# List of attributes with nullable: true
|
191
|
+
def self.openapi_nullable
|
192
|
+
Set.new([
|
193
|
+
:'owner_id',
|
194
|
+
:'epic_id',
|
195
|
+
:'iteration_id',
|
196
|
+
:'group_id',
|
197
|
+
])
|
198
|
+
end
|
199
|
+
|
200
|
+
# Initializes the object
|
201
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
202
|
+
def initialize(attributes = {})
|
203
|
+
if (!attributes.is_a?(Hash))
|
204
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Shortcut::SearchStories` initialize method"
|
205
|
+
end
|
206
|
+
|
207
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
208
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
209
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
210
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Shortcut::SearchStories`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
211
|
+
end
|
212
|
+
h[k.to_sym] = v
|
213
|
+
}
|
214
|
+
|
215
|
+
if attributes.key?(:'archived')
|
216
|
+
self.archived = attributes[:'archived']
|
217
|
+
end
|
218
|
+
|
219
|
+
if attributes.key?(:'owner_id')
|
220
|
+
self.owner_id = attributes[:'owner_id']
|
221
|
+
end
|
222
|
+
|
223
|
+
if attributes.key?(:'story_type')
|
224
|
+
self.story_type = attributes[:'story_type']
|
225
|
+
end
|
226
|
+
|
227
|
+
if attributes.key?(:'epic_ids')
|
228
|
+
if (value = attributes[:'epic_ids']).is_a?(Array)
|
229
|
+
self.epic_ids = value
|
230
|
+
end
|
231
|
+
end
|
232
|
+
|
233
|
+
if attributes.key?(:'project_ids')
|
234
|
+
if (value = attributes[:'project_ids']).is_a?(Array)
|
235
|
+
self.project_ids = value
|
236
|
+
end
|
237
|
+
end
|
238
|
+
|
239
|
+
if attributes.key?(:'updated_at_end')
|
240
|
+
self.updated_at_end = attributes[:'updated_at_end']
|
241
|
+
end
|
242
|
+
|
243
|
+
if attributes.key?(:'completed_at_end')
|
244
|
+
self.completed_at_end = attributes[:'completed_at_end']
|
245
|
+
end
|
246
|
+
|
247
|
+
if attributes.key?(:'workflow_state_types')
|
248
|
+
if (value = attributes[:'workflow_state_types']).is_a?(Array)
|
249
|
+
self.workflow_state_types = value
|
250
|
+
end
|
251
|
+
end
|
252
|
+
|
253
|
+
if attributes.key?(:'deadline_end')
|
254
|
+
self.deadline_end = attributes[:'deadline_end']
|
255
|
+
end
|
256
|
+
|
257
|
+
if attributes.key?(:'created_at_start')
|
258
|
+
self.created_at_start = attributes[:'created_at_start']
|
259
|
+
end
|
260
|
+
|
261
|
+
if attributes.key?(:'epic_id')
|
262
|
+
self.epic_id = attributes[:'epic_id']
|
263
|
+
end
|
264
|
+
|
265
|
+
if attributes.key?(:'label_name')
|
266
|
+
self.label_name = attributes[:'label_name']
|
267
|
+
end
|
268
|
+
|
269
|
+
if attributes.key?(:'requested_by_id')
|
270
|
+
self.requested_by_id = attributes[:'requested_by_id']
|
271
|
+
end
|
272
|
+
|
273
|
+
if attributes.key?(:'iteration_id')
|
274
|
+
self.iteration_id = attributes[:'iteration_id']
|
275
|
+
end
|
276
|
+
|
277
|
+
if attributes.key?(:'label_ids')
|
278
|
+
if (value = attributes[:'label_ids']).is_a?(Array)
|
279
|
+
self.label_ids = value
|
280
|
+
end
|
281
|
+
end
|
282
|
+
|
283
|
+
if attributes.key?(:'group_id')
|
284
|
+
self.group_id = attributes[:'group_id']
|
285
|
+
end
|
286
|
+
|
287
|
+
if attributes.key?(:'workflow_state_id')
|
288
|
+
self.workflow_state_id = attributes[:'workflow_state_id']
|
289
|
+
end
|
290
|
+
|
291
|
+
if attributes.key?(:'iteration_ids')
|
292
|
+
if (value = attributes[:'iteration_ids']).is_a?(Array)
|
293
|
+
self.iteration_ids = value
|
294
|
+
end
|
295
|
+
end
|
296
|
+
|
297
|
+
if attributes.key?(:'created_at_end')
|
298
|
+
self.created_at_end = attributes[:'created_at_end']
|
299
|
+
end
|
300
|
+
|
301
|
+
if attributes.key?(:'deadline_start')
|
302
|
+
self.deadline_start = attributes[:'deadline_start']
|
303
|
+
end
|
304
|
+
|
305
|
+
if attributes.key?(:'group_ids')
|
306
|
+
if (value = attributes[:'group_ids']).is_a?(Array)
|
307
|
+
self.group_ids = value
|
308
|
+
end
|
309
|
+
end
|
310
|
+
|
311
|
+
if attributes.key?(:'owner_ids')
|
312
|
+
if (value = attributes[:'owner_ids']).is_a?(Array)
|
313
|
+
self.owner_ids = value
|
314
|
+
end
|
315
|
+
end
|
316
|
+
|
317
|
+
if attributes.key?(:'external_id')
|
318
|
+
self.external_id = attributes[:'external_id']
|
319
|
+
end
|
320
|
+
|
321
|
+
if attributes.key?(:'includes_description')
|
322
|
+
self.includes_description = attributes[:'includes_description']
|
323
|
+
end
|
324
|
+
|
325
|
+
if attributes.key?(:'estimate')
|
326
|
+
self.estimate = attributes[:'estimate']
|
327
|
+
end
|
328
|
+
|
329
|
+
if attributes.key?(:'project_id')
|
330
|
+
self.project_id = attributes[:'project_id']
|
331
|
+
end
|
332
|
+
|
333
|
+
if attributes.key?(:'completed_at_start')
|
334
|
+
self.completed_at_start = attributes[:'completed_at_start']
|
335
|
+
end
|
336
|
+
|
337
|
+
if attributes.key?(:'updated_at_start')
|
338
|
+
self.updated_at_start = attributes[:'updated_at_start']
|
339
|
+
end
|
340
|
+
end
|
341
|
+
|
342
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
343
|
+
# @return Array for valid properties with the reasons
|
344
|
+
def list_invalid_properties
|
345
|
+
invalid_properties = Array.new
|
346
|
+
invalid_properties
|
347
|
+
end
|
348
|
+
|
349
|
+
# Check to see if the all the properties in the model are valid
|
350
|
+
# @return true if the model is valid
|
351
|
+
def valid?
|
352
|
+
story_type_validator = EnumAttributeValidator.new('Object', ['feature', 'chore', 'bug'])
|
353
|
+
return false unless story_type_validator.valid?(@story_type)
|
354
|
+
true
|
355
|
+
end
|
356
|
+
|
357
|
+
# Custom attribute writer method checking allowed values (enum).
|
358
|
+
# @param [Object] story_type Object to be assigned
|
359
|
+
def story_type=(story_type)
|
360
|
+
validator = EnumAttributeValidator.new('Object', ['feature', 'chore', 'bug'])
|
361
|
+
unless validator.valid?(story_type)
|
362
|
+
fail ArgumentError, "invalid value for \"story_type\", must be one of #{validator.allowable_values}."
|
363
|
+
end
|
364
|
+
@story_type = story_type
|
365
|
+
end
|
366
|
+
|
367
|
+
# Checks equality by comparing each attribute.
|
368
|
+
# @param [Object] Object to be compared
|
369
|
+
def ==(o)
|
370
|
+
return true if self.equal?(o)
|
371
|
+
self.class == o.class &&
|
372
|
+
archived == o.archived &&
|
373
|
+
owner_id == o.owner_id &&
|
374
|
+
story_type == o.story_type &&
|
375
|
+
epic_ids == o.epic_ids &&
|
376
|
+
project_ids == o.project_ids &&
|
377
|
+
updated_at_end == o.updated_at_end &&
|
378
|
+
completed_at_end == o.completed_at_end &&
|
379
|
+
workflow_state_types == o.workflow_state_types &&
|
380
|
+
deadline_end == o.deadline_end &&
|
381
|
+
created_at_start == o.created_at_start &&
|
382
|
+
epic_id == o.epic_id &&
|
383
|
+
label_name == o.label_name &&
|
384
|
+
requested_by_id == o.requested_by_id &&
|
385
|
+
iteration_id == o.iteration_id &&
|
386
|
+
label_ids == o.label_ids &&
|
387
|
+
group_id == o.group_id &&
|
388
|
+
workflow_state_id == o.workflow_state_id &&
|
389
|
+
iteration_ids == o.iteration_ids &&
|
390
|
+
created_at_end == o.created_at_end &&
|
391
|
+
deadline_start == o.deadline_start &&
|
392
|
+
group_ids == o.group_ids &&
|
393
|
+
owner_ids == o.owner_ids &&
|
394
|
+
external_id == o.external_id &&
|
395
|
+
includes_description == o.includes_description &&
|
396
|
+
estimate == o.estimate &&
|
397
|
+
project_id == o.project_id &&
|
398
|
+
completed_at_start == o.completed_at_start &&
|
399
|
+
updated_at_start == o.updated_at_start
|
400
|
+
end
|
401
|
+
|
402
|
+
# @see the `==` method
|
403
|
+
# @param [Object] Object to be compared
|
404
|
+
def eql?(o)
|
405
|
+
self == o
|
406
|
+
end
|
407
|
+
|
408
|
+
# Calculates hash code according to all attributes.
|
409
|
+
# @return [Integer] Hash code
|
410
|
+
def hash
|
411
|
+
[archived, owner_id, story_type, epic_ids, project_ids, updated_at_end, completed_at_end, workflow_state_types, deadline_end, created_at_start, epic_id, label_name, requested_by_id, iteration_id, label_ids, group_id, workflow_state_id, iteration_ids, created_at_end, deadline_start, group_ids, owner_ids, external_id, includes_description, estimate, project_id, completed_at_start, updated_at_start].hash
|
412
|
+
end
|
413
|
+
|
414
|
+
# Builds the object from hash
|
415
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
416
|
+
# @return [Object] Returns the model itself
|
417
|
+
def self.build_from_hash(attributes)
|
418
|
+
new.build_from_hash(attributes)
|
419
|
+
end
|
420
|
+
|
421
|
+
# Builds the object from hash
|
422
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
423
|
+
# @return [Object] Returns the model itself
|
424
|
+
def build_from_hash(attributes)
|
425
|
+
return nil unless attributes.is_a?(Hash)
|
426
|
+
self.class.openapi_types.each_pair do |key, type|
|
427
|
+
if type =~ /\AArray<(.*)>/i
|
428
|
+
# check to ensure the input is an array given that the attribute
|
429
|
+
# is documented as an array but the input is not
|
430
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
431
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
432
|
+
end
|
433
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
434
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
435
|
+
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
436
|
+
self.send("#{key}=", nil)
|
437
|
+
end
|
438
|
+
end
|
439
|
+
|
440
|
+
self
|
441
|
+
end
|
442
|
+
|
443
|
+
# Deserializes the data based on type
|
444
|
+
# @param string type Data type
|
445
|
+
# @param string value Value to be deserialized
|
446
|
+
# @return [Object] Deserialized data
|
447
|
+
def _deserialize(type, value)
|
448
|
+
case type.to_sym
|
449
|
+
when :DateTime
|
450
|
+
DateTime.parse(value)
|
451
|
+
when :Date
|
452
|
+
Date.parse(value)
|
453
|
+
when :String
|
454
|
+
value.to_s
|
455
|
+
when :Integer
|
456
|
+
value.to_i
|
457
|
+
when :Float
|
458
|
+
value.to_f
|
459
|
+
when :Boolean
|
460
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
461
|
+
true
|
462
|
+
else
|
463
|
+
false
|
464
|
+
end
|
465
|
+
when :Object
|
466
|
+
# generic object (usually a Hash), return directly
|
467
|
+
value
|
468
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
469
|
+
inner_type = Regexp.last_match[:inner_type]
|
470
|
+
value.map { |v| _deserialize(inner_type, v) }
|
471
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
472
|
+
k_type = Regexp.last_match[:k_type]
|
473
|
+
v_type = Regexp.last_match[:v_type]
|
474
|
+
{}.tap do |hash|
|
475
|
+
value.each do |k, v|
|
476
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
477
|
+
end
|
478
|
+
end
|
479
|
+
else # model
|
480
|
+
Shortcut.const_get(type).build_from_hash(value)
|
481
|
+
end
|
482
|
+
end
|
483
|
+
|
484
|
+
# Returns the string representation of the object
|
485
|
+
# @return [String] String presentation of the object
|
486
|
+
def to_s
|
487
|
+
to_hash.to_s
|
488
|
+
end
|
489
|
+
|
490
|
+
# to_body is an alias to to_hash (backward compatibility)
|
491
|
+
# @return [Hash] Returns the object in the form of hash
|
492
|
+
def to_body
|
493
|
+
to_hash
|
494
|
+
end
|
495
|
+
|
496
|
+
# Returns the object in the form of hash
|
497
|
+
# @return [Hash] Returns the object in the form of hash
|
498
|
+
def to_hash
|
499
|
+
hash = {}
|
500
|
+
self.class.attribute_map.each_pair do |attr, param|
|
501
|
+
value = self.send(attr)
|
502
|
+
if value.nil?
|
503
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
504
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
505
|
+
end
|
506
|
+
|
507
|
+
hash[param] = _to_hash(value)
|
508
|
+
end
|
509
|
+
hash
|
510
|
+
end
|
511
|
+
|
512
|
+
# Outputs non-array value in the form of hash
|
513
|
+
# For object, use to_hash. Otherwise, just return the value
|
514
|
+
# @param [Object] value Any valid value
|
515
|
+
# @return [Hash] Returns the value in the form of hash
|
516
|
+
def _to_hash(value)
|
517
|
+
if value.is_a?(Array)
|
518
|
+
value.compact.map { |v| _to_hash(v) }
|
519
|
+
elsif value.is_a?(Hash)
|
520
|
+
{}.tap do |hash|
|
521
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
522
|
+
end
|
523
|
+
elsif value.respond_to? :to_hash
|
524
|
+
value.to_hash
|
525
|
+
else
|
526
|
+
value
|
527
|
+
end
|
528
|
+
end end
|
529
|
+
end
|