shortcut_client_ruby 0.0.2
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 +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,518 @@
|
|
|
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
|
+
# Corresponds to a VCS Pull Request attached to a Shortcut story.
|
|
16
|
+
class PullRequest
|
|
17
|
+
# A string description of this resource.
|
|
18
|
+
attr_accessor :entity_type
|
|
19
|
+
|
|
20
|
+
# True/False boolean indicating whether the VCS pull request has been closed.
|
|
21
|
+
attr_accessor :closed
|
|
22
|
+
|
|
23
|
+
# True/False boolean indicating whether the VCS pull request has been merged.
|
|
24
|
+
attr_accessor :merged
|
|
25
|
+
|
|
26
|
+
# Number of lines added in the pull request, according to VCS.
|
|
27
|
+
attr_accessor :num_added
|
|
28
|
+
|
|
29
|
+
# The ID of the branch for the particular pull request.
|
|
30
|
+
attr_accessor :branch_id
|
|
31
|
+
|
|
32
|
+
# The pull request's unique number ID in VCS.
|
|
33
|
+
attr_accessor :number
|
|
34
|
+
|
|
35
|
+
# The name of the branch for the particular pull request.
|
|
36
|
+
attr_accessor :branch_name
|
|
37
|
+
|
|
38
|
+
# The name of the target branch for the particular pull request.
|
|
39
|
+
attr_accessor :target_branch_name
|
|
40
|
+
|
|
41
|
+
# The number of commits on the pull request.
|
|
42
|
+
attr_accessor :num_commits
|
|
43
|
+
|
|
44
|
+
# The title of the pull request.
|
|
45
|
+
attr_accessor :title
|
|
46
|
+
|
|
47
|
+
# The time/date the pull request was created.
|
|
48
|
+
attr_accessor :updated_at
|
|
49
|
+
|
|
50
|
+
# True/False boolean indicating whether the VCS pull request is in the draft state.
|
|
51
|
+
attr_accessor :draft
|
|
52
|
+
|
|
53
|
+
# The unique ID associated with the pull request in Shortcut.
|
|
54
|
+
attr_accessor :id
|
|
55
|
+
|
|
56
|
+
# An array of PullRequestLabels attached to the PullRequest.
|
|
57
|
+
attr_accessor :vcs_labels
|
|
58
|
+
|
|
59
|
+
# The URL for the pull request.
|
|
60
|
+
attr_accessor :url
|
|
61
|
+
|
|
62
|
+
# Number of lines removed in the pull request, according to VCS.
|
|
63
|
+
attr_accessor :num_removed
|
|
64
|
+
|
|
65
|
+
# The status of the review for the pull request.
|
|
66
|
+
attr_accessor :review_status
|
|
67
|
+
|
|
68
|
+
# Number of lines modified in the pull request, according to VCS.
|
|
69
|
+
attr_accessor :num_modified
|
|
70
|
+
|
|
71
|
+
# The status of the Continuous Integration workflow for the pull request.
|
|
72
|
+
attr_accessor :build_status
|
|
73
|
+
|
|
74
|
+
# The ID of the target branch for the particular pull request.
|
|
75
|
+
attr_accessor :target_branch_id
|
|
76
|
+
|
|
77
|
+
# The ID of the repository for the particular pull request.
|
|
78
|
+
attr_accessor :repository_id
|
|
79
|
+
|
|
80
|
+
# The time/date the pull request was created.
|
|
81
|
+
attr_accessor :created_at
|
|
82
|
+
|
|
83
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
84
|
+
def self.attribute_map
|
|
85
|
+
{
|
|
86
|
+
:'entity_type' => :'entity_type',
|
|
87
|
+
:'closed' => :'closed',
|
|
88
|
+
:'merged' => :'merged',
|
|
89
|
+
:'num_added' => :'num_added',
|
|
90
|
+
:'branch_id' => :'branch_id',
|
|
91
|
+
:'number' => :'number',
|
|
92
|
+
:'branch_name' => :'branch_name',
|
|
93
|
+
:'target_branch_name' => :'target_branch_name',
|
|
94
|
+
:'num_commits' => :'num_commits',
|
|
95
|
+
:'title' => :'title',
|
|
96
|
+
:'updated_at' => :'updated_at',
|
|
97
|
+
:'draft' => :'draft',
|
|
98
|
+
:'id' => :'id',
|
|
99
|
+
:'vcs_labels' => :'vcs_labels',
|
|
100
|
+
:'url' => :'url',
|
|
101
|
+
:'num_removed' => :'num_removed',
|
|
102
|
+
:'review_status' => :'review_status',
|
|
103
|
+
:'num_modified' => :'num_modified',
|
|
104
|
+
:'build_status' => :'build_status',
|
|
105
|
+
:'target_branch_id' => :'target_branch_id',
|
|
106
|
+
:'repository_id' => :'repository_id',
|
|
107
|
+
:'created_at' => :'created_at'
|
|
108
|
+
}
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Attribute type mapping.
|
|
112
|
+
def self.openapi_types
|
|
113
|
+
{
|
|
114
|
+
:'entity_type' => :'Object',
|
|
115
|
+
:'closed' => :'Object',
|
|
116
|
+
:'merged' => :'Object',
|
|
117
|
+
:'num_added' => :'Object',
|
|
118
|
+
:'branch_id' => :'Object',
|
|
119
|
+
:'number' => :'Object',
|
|
120
|
+
:'branch_name' => :'Object',
|
|
121
|
+
:'target_branch_name' => :'Object',
|
|
122
|
+
:'num_commits' => :'Object',
|
|
123
|
+
:'title' => :'Object',
|
|
124
|
+
:'updated_at' => :'Object',
|
|
125
|
+
:'draft' => :'Object',
|
|
126
|
+
:'id' => :'Object',
|
|
127
|
+
:'vcs_labels' => :'Object',
|
|
128
|
+
:'url' => :'Object',
|
|
129
|
+
:'num_removed' => :'Object',
|
|
130
|
+
:'review_status' => :'Object',
|
|
131
|
+
:'num_modified' => :'Object',
|
|
132
|
+
:'build_status' => :'Object',
|
|
133
|
+
:'target_branch_id' => :'Object',
|
|
134
|
+
:'repository_id' => :'Object',
|
|
135
|
+
:'created_at' => :'Object'
|
|
136
|
+
}
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# List of attributes with nullable: true
|
|
140
|
+
def self.openapi_nullable
|
|
141
|
+
Set.new([
|
|
142
|
+
:'num_commits',
|
|
143
|
+
:'vcs_labels',
|
|
144
|
+
:'num_modified',
|
|
145
|
+
])
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# Initializes the object
|
|
149
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
150
|
+
def initialize(attributes = {})
|
|
151
|
+
if (!attributes.is_a?(Hash))
|
|
152
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Shortcut::PullRequest` initialize method"
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
156
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
157
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
158
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Shortcut::PullRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
159
|
+
end
|
|
160
|
+
h[k.to_sym] = v
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
if attributes.key?(:'entity_type')
|
|
164
|
+
self.entity_type = attributes[:'entity_type']
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
if attributes.key?(:'closed')
|
|
168
|
+
self.closed = attributes[:'closed']
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
if attributes.key?(:'merged')
|
|
172
|
+
self.merged = attributes[:'merged']
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
if attributes.key?(:'num_added')
|
|
176
|
+
self.num_added = attributes[:'num_added']
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
if attributes.key?(:'branch_id')
|
|
180
|
+
self.branch_id = attributes[:'branch_id']
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
if attributes.key?(:'number')
|
|
184
|
+
self.number = attributes[:'number']
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
if attributes.key?(:'branch_name')
|
|
188
|
+
self.branch_name = attributes[:'branch_name']
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
if attributes.key?(:'target_branch_name')
|
|
192
|
+
self.target_branch_name = attributes[:'target_branch_name']
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
if attributes.key?(:'num_commits')
|
|
196
|
+
self.num_commits = attributes[:'num_commits']
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
if attributes.key?(:'title')
|
|
200
|
+
self.title = attributes[:'title']
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
if attributes.key?(:'updated_at')
|
|
204
|
+
self.updated_at = attributes[:'updated_at']
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
if attributes.key?(:'draft')
|
|
208
|
+
self.draft = attributes[:'draft']
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
if attributes.key?(:'id')
|
|
212
|
+
self.id = attributes[:'id']
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
if attributes.key?(:'vcs_labels')
|
|
216
|
+
if (value = attributes[:'vcs_labels']).is_a?(Array)
|
|
217
|
+
self.vcs_labels = value
|
|
218
|
+
end
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
if attributes.key?(:'url')
|
|
222
|
+
self.url = attributes[:'url']
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
if attributes.key?(:'num_removed')
|
|
226
|
+
self.num_removed = attributes[:'num_removed']
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
if attributes.key?(:'review_status')
|
|
230
|
+
self.review_status = attributes[:'review_status']
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
if attributes.key?(:'num_modified')
|
|
234
|
+
self.num_modified = attributes[:'num_modified']
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
if attributes.key?(:'build_status')
|
|
238
|
+
self.build_status = attributes[:'build_status']
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
if attributes.key?(:'target_branch_id')
|
|
242
|
+
self.target_branch_id = attributes[:'target_branch_id']
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
if attributes.key?(:'repository_id')
|
|
246
|
+
self.repository_id = attributes[:'repository_id']
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
if attributes.key?(:'created_at')
|
|
250
|
+
self.created_at = attributes[:'created_at']
|
|
251
|
+
end
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
255
|
+
# @return Array for valid properties with the reasons
|
|
256
|
+
def list_invalid_properties
|
|
257
|
+
invalid_properties = Array.new
|
|
258
|
+
if @entity_type.nil?
|
|
259
|
+
invalid_properties.push('invalid value for "entity_type", entity_type cannot be nil.')
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
if @closed.nil?
|
|
263
|
+
invalid_properties.push('invalid value for "closed", closed cannot be nil.')
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
if @merged.nil?
|
|
267
|
+
invalid_properties.push('invalid value for "merged", merged cannot be nil.')
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
if @num_added.nil?
|
|
271
|
+
invalid_properties.push('invalid value for "num_added", num_added cannot be nil.')
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
if @branch_id.nil?
|
|
275
|
+
invalid_properties.push('invalid value for "branch_id", branch_id cannot be nil.')
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
if @number.nil?
|
|
279
|
+
invalid_properties.push('invalid value for "number", number cannot be nil.')
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
if @branch_name.nil?
|
|
283
|
+
invalid_properties.push('invalid value for "branch_name", branch_name cannot be nil.')
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
if @target_branch_name.nil?
|
|
287
|
+
invalid_properties.push('invalid value for "target_branch_name", target_branch_name cannot be nil.')
|
|
288
|
+
end
|
|
289
|
+
|
|
290
|
+
if @num_commits.nil?
|
|
291
|
+
invalid_properties.push('invalid value for "num_commits", num_commits 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
|
+
if @updated_at.nil?
|
|
299
|
+
invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
|
|
300
|
+
end
|
|
301
|
+
|
|
302
|
+
if @draft.nil?
|
|
303
|
+
invalid_properties.push('invalid value for "draft", draft cannot be nil.')
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
if @id.nil?
|
|
307
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
if @url.nil?
|
|
311
|
+
invalid_properties.push('invalid value for "url", url cannot be nil.')
|
|
312
|
+
end
|
|
313
|
+
|
|
314
|
+
if @num_removed.nil?
|
|
315
|
+
invalid_properties.push('invalid value for "num_removed", num_removed cannot be nil.')
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
if @num_modified.nil?
|
|
319
|
+
invalid_properties.push('invalid value for "num_modified", num_modified cannot be nil.')
|
|
320
|
+
end
|
|
321
|
+
|
|
322
|
+
if @target_branch_id.nil?
|
|
323
|
+
invalid_properties.push('invalid value for "target_branch_id", target_branch_id cannot be nil.')
|
|
324
|
+
end
|
|
325
|
+
|
|
326
|
+
if @repository_id.nil?
|
|
327
|
+
invalid_properties.push('invalid value for "repository_id", repository_id cannot be nil.')
|
|
328
|
+
end
|
|
329
|
+
|
|
330
|
+
if @created_at.nil?
|
|
331
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
|
332
|
+
end
|
|
333
|
+
|
|
334
|
+
invalid_properties
|
|
335
|
+
end
|
|
336
|
+
|
|
337
|
+
# Check to see if the all the properties in the model are valid
|
|
338
|
+
# @return true if the model is valid
|
|
339
|
+
def valid?
|
|
340
|
+
return false if @entity_type.nil?
|
|
341
|
+
return false if @closed.nil?
|
|
342
|
+
return false if @merged.nil?
|
|
343
|
+
return false if @num_added.nil?
|
|
344
|
+
return false if @branch_id.nil?
|
|
345
|
+
return false if @number.nil?
|
|
346
|
+
return false if @branch_name.nil?
|
|
347
|
+
return false if @target_branch_name.nil?
|
|
348
|
+
return false if @num_commits.nil?
|
|
349
|
+
return false if @title.nil?
|
|
350
|
+
return false if @updated_at.nil?
|
|
351
|
+
return false if @draft.nil?
|
|
352
|
+
return false if @id.nil?
|
|
353
|
+
return false if @url.nil?
|
|
354
|
+
return false if @num_removed.nil?
|
|
355
|
+
return false if @num_modified.nil?
|
|
356
|
+
return false if @target_branch_id.nil?
|
|
357
|
+
return false if @repository_id.nil?
|
|
358
|
+
return false if @created_at.nil?
|
|
359
|
+
true
|
|
360
|
+
end
|
|
361
|
+
|
|
362
|
+
# Checks equality by comparing each attribute.
|
|
363
|
+
# @param [Object] Object to be compared
|
|
364
|
+
def ==(o)
|
|
365
|
+
return true if self.equal?(o)
|
|
366
|
+
self.class == o.class &&
|
|
367
|
+
entity_type == o.entity_type &&
|
|
368
|
+
closed == o.closed &&
|
|
369
|
+
merged == o.merged &&
|
|
370
|
+
num_added == o.num_added &&
|
|
371
|
+
branch_id == o.branch_id &&
|
|
372
|
+
number == o.number &&
|
|
373
|
+
branch_name == o.branch_name &&
|
|
374
|
+
target_branch_name == o.target_branch_name &&
|
|
375
|
+
num_commits == o.num_commits &&
|
|
376
|
+
title == o.title &&
|
|
377
|
+
updated_at == o.updated_at &&
|
|
378
|
+
draft == o.draft &&
|
|
379
|
+
id == o.id &&
|
|
380
|
+
vcs_labels == o.vcs_labels &&
|
|
381
|
+
url == o.url &&
|
|
382
|
+
num_removed == o.num_removed &&
|
|
383
|
+
review_status == o.review_status &&
|
|
384
|
+
num_modified == o.num_modified &&
|
|
385
|
+
build_status == o.build_status &&
|
|
386
|
+
target_branch_id == o.target_branch_id &&
|
|
387
|
+
repository_id == o.repository_id &&
|
|
388
|
+
created_at == o.created_at
|
|
389
|
+
end
|
|
390
|
+
|
|
391
|
+
# @see the `==` method
|
|
392
|
+
# @param [Object] Object to be compared
|
|
393
|
+
def eql?(o)
|
|
394
|
+
self == o
|
|
395
|
+
end
|
|
396
|
+
|
|
397
|
+
# Calculates hash code according to all attributes.
|
|
398
|
+
# @return [Integer] Hash code
|
|
399
|
+
def hash
|
|
400
|
+
[entity_type, closed, merged, num_added, branch_id, number, branch_name, target_branch_name, num_commits, title, updated_at, draft, id, vcs_labels, url, num_removed, review_status, num_modified, build_status, target_branch_id, repository_id, created_at].hash
|
|
401
|
+
end
|
|
402
|
+
|
|
403
|
+
# Builds the object from hash
|
|
404
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
405
|
+
# @return [Object] Returns the model itself
|
|
406
|
+
def self.build_from_hash(attributes)
|
|
407
|
+
new.build_from_hash(attributes)
|
|
408
|
+
end
|
|
409
|
+
|
|
410
|
+
# Builds the object from hash
|
|
411
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
412
|
+
# @return [Object] Returns the model itself
|
|
413
|
+
def build_from_hash(attributes)
|
|
414
|
+
return nil unless attributes.is_a?(Hash)
|
|
415
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
416
|
+
if type =~ /\AArray<(.*)>/i
|
|
417
|
+
# check to ensure the input is an array given that the attribute
|
|
418
|
+
# is documented as an array but the input is not
|
|
419
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
420
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
421
|
+
end
|
|
422
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
423
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
424
|
+
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
425
|
+
self.send("#{key}=", nil)
|
|
426
|
+
end
|
|
427
|
+
end
|
|
428
|
+
|
|
429
|
+
self
|
|
430
|
+
end
|
|
431
|
+
|
|
432
|
+
# Deserializes the data based on type
|
|
433
|
+
# @param string type Data type
|
|
434
|
+
# @param string value Value to be deserialized
|
|
435
|
+
# @return [Object] Deserialized data
|
|
436
|
+
def _deserialize(type, value)
|
|
437
|
+
case type.to_sym
|
|
438
|
+
when :DateTime
|
|
439
|
+
DateTime.parse(value)
|
|
440
|
+
when :Date
|
|
441
|
+
Date.parse(value)
|
|
442
|
+
when :String
|
|
443
|
+
value.to_s
|
|
444
|
+
when :Integer
|
|
445
|
+
value.to_i
|
|
446
|
+
when :Float
|
|
447
|
+
value.to_f
|
|
448
|
+
when :Boolean
|
|
449
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
450
|
+
true
|
|
451
|
+
else
|
|
452
|
+
false
|
|
453
|
+
end
|
|
454
|
+
when :Object
|
|
455
|
+
# generic object (usually a Hash), return directly
|
|
456
|
+
value
|
|
457
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
458
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
459
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
460
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
461
|
+
k_type = Regexp.last_match[:k_type]
|
|
462
|
+
v_type = Regexp.last_match[:v_type]
|
|
463
|
+
{}.tap do |hash|
|
|
464
|
+
value.each do |k, v|
|
|
465
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
466
|
+
end
|
|
467
|
+
end
|
|
468
|
+
else # model
|
|
469
|
+
Shortcut.const_get(type).build_from_hash(value)
|
|
470
|
+
end
|
|
471
|
+
end
|
|
472
|
+
|
|
473
|
+
# Returns the string representation of the object
|
|
474
|
+
# @return [String] String presentation of the object
|
|
475
|
+
def to_s
|
|
476
|
+
to_hash.to_s
|
|
477
|
+
end
|
|
478
|
+
|
|
479
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
480
|
+
# @return [Hash] Returns the object in the form of hash
|
|
481
|
+
def to_body
|
|
482
|
+
to_hash
|
|
483
|
+
end
|
|
484
|
+
|
|
485
|
+
# Returns the object in the form of hash
|
|
486
|
+
# @return [Hash] Returns the object in the form of hash
|
|
487
|
+
def to_hash
|
|
488
|
+
hash = {}
|
|
489
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
490
|
+
value = self.send(attr)
|
|
491
|
+
if value.nil?
|
|
492
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
493
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
494
|
+
end
|
|
495
|
+
|
|
496
|
+
hash[param] = _to_hash(value)
|
|
497
|
+
end
|
|
498
|
+
hash
|
|
499
|
+
end
|
|
500
|
+
|
|
501
|
+
# Outputs non-array value in the form of hash
|
|
502
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
503
|
+
# @param [Object] value Any valid value
|
|
504
|
+
# @return [Hash] Returns the value in the form of hash
|
|
505
|
+
def _to_hash(value)
|
|
506
|
+
if value.is_a?(Array)
|
|
507
|
+
value.compact.map { |v| _to_hash(v) }
|
|
508
|
+
elsif value.is_a?(Hash)
|
|
509
|
+
{}.tap do |hash|
|
|
510
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
511
|
+
end
|
|
512
|
+
elsif value.respond_to? :to_hash
|
|
513
|
+
value.to_hash
|
|
514
|
+
else
|
|
515
|
+
value
|
|
516
|
+
end
|
|
517
|
+
end end
|
|
518
|
+
end
|