swaggy_jenkins 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +69 -0
- data/README.md +249 -0
- data/Rakefile +8 -0
- data/docs/AllView.md +10 -0
- data/docs/BlueOceanApi.md +2034 -0
- data/docs/Body.md +8 -0
- data/docs/BranchImpl.md +20 -0
- data/docs/BranchImpllinks.md +12 -0
- data/docs/BranchImplpermissions.md +12 -0
- data/docs/CauseAction.md +9 -0
- data/docs/CauseUserIdCause.md +11 -0
- data/docs/ClassesByClass.md +9 -0
- data/docs/ClockDifference.md +9 -0
- data/docs/ComputerSet.md +12 -0
- data/docs/DefaultCrumbIssuer.md +10 -0
- data/docs/DiskSpaceMonitorDescriptorDiskSpace.md +11 -0
- data/docs/EmptyChangeLogSet.md +9 -0
- data/docs/ExtensionClassContainerImpl1.md +10 -0
- data/docs/ExtensionClassContainerImpl1links.md +9 -0
- data/docs/ExtensionClassContainerImpl1map.md +10 -0
- data/docs/ExtensionClassImpl.md +10 -0
- data/docs/ExtensionClassImpllinks.md +9 -0
- data/docs/FavoriteImpl.md +10 -0
- data/docs/FavoriteImpllinks.md +9 -0
- data/docs/FreeStyleBuild.md +25 -0
- data/docs/FreeStyleProject.md +34 -0
- data/docs/FreeStyleProjectactions.md +8 -0
- data/docs/FreeStyleProjecthealthReport.md +12 -0
- data/docs/GenericResource.md +13 -0
- data/docs/GithubContent.md +15 -0
- data/docs/GithubFile.md +9 -0
- data/docs/GithubOrganization.md +11 -0
- data/docs/GithubOrganizationlinks.md +10 -0
- data/docs/GithubRepositories.md +13 -0
- data/docs/GithubRepositorieslinks.md +9 -0
- data/docs/GithubRepository.md +15 -0
- data/docs/GithubRepositorylinks.md +9 -0
- data/docs/GithubRepositorypermissions.md +11 -0
- data/docs/GithubRespositoryContainer.md +10 -0
- data/docs/GithubRespositoryContainerlinks.md +9 -0
- data/docs/GithubScm.md +12 -0
- data/docs/GithubScmlinks.md +9 -0
- data/docs/Hudson.md +22 -0
- data/docs/HudsonMasterComputer.md +23 -0
- data/docs/HudsonMasterComputerexecutors.md +13 -0
- data/docs/HudsonMasterComputermonitorData.md +14 -0
- data/docs/HudsonassignedLabels.md +8 -0
- data/docs/InputStepImpl.md +14 -0
- data/docs/InputStepImpllinks.md +9 -0
- data/docs/Label1.md +8 -0
- data/docs/Link.md +9 -0
- data/docs/ListView.md +12 -0
- data/docs/MultibranchPipeline.md +21 -0
- data/docs/NullSCM.md +8 -0
- data/docs/Organisation.md +9 -0
- data/docs/Organisations.md +7 -0
- data/docs/Pipeline.md +15 -0
- data/docs/PipelineActivities.md +7 -0
- data/docs/PipelineActivity.md +22 -0
- data/docs/PipelineActivityartifacts.md +11 -0
- data/docs/PipelineBranches.md +7 -0
- data/docs/PipelineBranchesitem.md +16 -0
- data/docs/PipelineBranchesitemlatestRun.md +21 -0
- data/docs/PipelineBranchesitempullRequest.md +13 -0
- data/docs/PipelineBranchesitempullRequestlinks.md +9 -0
- data/docs/PipelineFolderImpl.md +14 -0
- data/docs/PipelineImpl.md +16 -0
- data/docs/PipelineImpllinks.md +12 -0
- data/docs/PipelineQueue.md +7 -0
- data/docs/PipelineRun.md +22 -0
- data/docs/PipelineRunImpl.md +22 -0
- data/docs/PipelineRunImpllinks.md +13 -0
- data/docs/PipelineRunNode.md +15 -0
- data/docs/PipelineRunNodeSteps.md +7 -0
- data/docs/PipelineRunNodeedges.md +9 -0
- data/docs/PipelineRunNodes.md +7 -0
- data/docs/PipelineRunSteps.md +7 -0
- data/docs/PipelineRunartifacts.md +11 -0
- data/docs/PipelineRuns.md +7 -0
- data/docs/PipelineStepImpl.md +16 -0
- data/docs/PipelineStepImpllinks.md +10 -0
- data/docs/PipelinelatestRun.md +22 -0
- data/docs/PipelinelatestRunartifacts.md +11 -0
- data/docs/Pipelines.md +7 -0
- data/docs/Queue.md +9 -0
- data/docs/QueueBlockedItem.md +19 -0
- data/docs/QueueItemImpl.md +12 -0
- data/docs/QueueLeftItem.md +20 -0
- data/docs/RemoteAccessApi.md +1151 -0
- data/docs/ResponseTimeMonitorData.md +10 -0
- data/docs/ScmOrganisations.md +7 -0
- data/docs/StringParameterDefinition.md +12 -0
- data/docs/StringParameterValue.md +10 -0
- data/docs/SwapSpaceMonitorMemoryUsage2.md +12 -0
- data/docs/UnlabeledLoadStatistics.md +8 -0
- data/docs/User.md +12 -0
- data/docs/UserFavorites.md +7 -0
- data/docs/Users.md +7 -0
- data/git_push.sh +55 -0
- data/lib/swaggy_jenkins.rb +134 -0
- data/lib/swaggy_jenkins/api/blue_ocean_api.rb +2200 -0
- data/lib/swaggy_jenkins/api/remote_access_api.rb +1166 -0
- data/lib/swaggy_jenkins/api_client.rb +389 -0
- data/lib/swaggy_jenkins/api_error.rb +38 -0
- data/lib/swaggy_jenkins/configuration.rb +209 -0
- data/lib/swaggy_jenkins/models/all_view.rb +206 -0
- data/lib/swaggy_jenkins/models/body.rb +193 -0
- data/lib/swaggy_jenkins/models/branch_impl.rb +298 -0
- data/lib/swaggy_jenkins/models/branch_impllinks.rb +224 -0
- data/lib/swaggy_jenkins/models/branch_implpermissions.rb +224 -0
- data/lib/swaggy_jenkins/models/cause_action.rb +199 -0
- data/lib/swaggy_jenkins/models/cause_user_id_cause.rb +215 -0
- data/lib/swaggy_jenkins/models/classes_by_class.rb +199 -0
- data/lib/swaggy_jenkins/models/clock_difference.rb +197 -0
- data/lib/swaggy_jenkins/models/computer_set.rb +226 -0
- data/lib/swaggy_jenkins/models/default_crumb_issuer.rb +206 -0
- data/lib/swaggy_jenkins/models/disk_space_monitor_descriptor_disk_space.rb +215 -0
- data/lib/swaggy_jenkins/models/empty_change_log_set.rb +197 -0
- data/lib/swaggy_jenkins/models/extension_class_container_impl1.rb +206 -0
- data/lib/swaggy_jenkins/models/extension_class_container_impl1links.rb +197 -0
- data/lib/swaggy_jenkins/models/extension_class_container_impl1map.rb +206 -0
- data/lib/swaggy_jenkins/models/extension_class_impl.rb +208 -0
- data/lib/swaggy_jenkins/models/extension_class_impllinks.rb +197 -0
- data/lib/swaggy_jenkins/models/favorite_impl.rb +206 -0
- data/lib/swaggy_jenkins/models/favorite_impllinks.rb +197 -0
- data/lib/swaggy_jenkins/models/free_style_build.rb +343 -0
- data/lib/swaggy_jenkins/models/free_style_project.rb +428 -0
- data/lib/swaggy_jenkins/models/free_style_projectactions.rb +188 -0
- data/lib/swaggy_jenkins/models/free_style_projecthealth_report.rb +224 -0
- data/lib/swaggy_jenkins/models/generic_resource.rb +233 -0
- data/lib/swaggy_jenkins/models/github_content.rb +251 -0
- data/lib/swaggy_jenkins/models/github_file.rb +197 -0
- data/lib/swaggy_jenkins/models/github_organization.rb +215 -0
- data/lib/swaggy_jenkins/models/github_organizationlinks.rb +206 -0
- data/lib/swaggy_jenkins/models/github_repositories.rb +235 -0
- data/lib/swaggy_jenkins/models/github_repositorieslinks.rb +197 -0
- data/lib/swaggy_jenkins/models/github_repository.rb +251 -0
- data/lib/swaggy_jenkins/models/github_repositorylinks.rb +197 -0
- data/lib/swaggy_jenkins/models/github_repositorypermissions.rb +215 -0
- data/lib/swaggy_jenkins/models/github_respository_container.rb +206 -0
- data/lib/swaggy_jenkins/models/github_respository_containerlinks.rb +197 -0
- data/lib/swaggy_jenkins/models/github_scm.rb +224 -0
- data/lib/swaggy_jenkins/models/github_scmlinks.rb +197 -0
- data/lib/swaggy_jenkins/models/hudson.rb +320 -0
- data/lib/swaggy_jenkins/models/hudson_master_computer.rb +325 -0
- data/lib/swaggy_jenkins/models/hudson_master_computerexecutors.rb +233 -0
- data/lib/swaggy_jenkins/models/hudson_master_computermonitor_data.rb +242 -0
- data/lib/swaggy_jenkins/models/hudsonassigned_labels.rb +188 -0
- data/lib/swaggy_jenkins/models/input_step_impl.rb +244 -0
- data/lib/swaggy_jenkins/models/input_step_impllinks.rb +197 -0
- data/lib/swaggy_jenkins/models/label1.rb +188 -0
- data/lib/swaggy_jenkins/models/link.rb +197 -0
- data/lib/swaggy_jenkins/models/list_view.rb +226 -0
- data/lib/swaggy_jenkins/models/multibranch_pipeline.rb +307 -0
- data/lib/swaggy_jenkins/models/null_scm.rb +188 -0
- data/lib/swaggy_jenkins/models/organisation.rb +197 -0
- data/lib/swaggy_jenkins/models/organisations.rb +179 -0
- data/lib/swaggy_jenkins/models/pipeline.rb +251 -0
- data/lib/swaggy_jenkins/models/pipeline_activities.rb +179 -0
- data/lib/swaggy_jenkins/models/pipeline_activity.rb +316 -0
- data/lib/swaggy_jenkins/models/pipeline_activityartifacts.rb +215 -0
- data/lib/swaggy_jenkins/models/pipeline_branches.rb +179 -0
- data/lib/swaggy_jenkins/models/pipeline_branchesitem.rb +260 -0
- data/lib/swaggy_jenkins/models/pipeline_branchesitemlatest_run.rb +305 -0
- data/lib/swaggy_jenkins/models/pipeline_branchesitempull_request.rb +233 -0
- data/lib/swaggy_jenkins/models/pipeline_branchesitempull_requestlinks.rb +197 -0
- data/lib/swaggy_jenkins/models/pipeline_folder_impl.rb +242 -0
- data/lib/swaggy_jenkins/models/pipeline_impl.rb +260 -0
- data/lib/swaggy_jenkins/models/pipeline_impllinks.rb +224 -0
- data/lib/swaggy_jenkins/models/pipeline_queue.rb +179 -0
- data/lib/swaggy_jenkins/models/pipeline_run.rb +316 -0
- data/lib/swaggy_jenkins/models/pipeline_run_impl.rb +314 -0
- data/lib/swaggy_jenkins/models/pipeline_run_impllinks.rb +233 -0
- data/lib/swaggy_jenkins/models/pipeline_run_node.rb +253 -0
- data/lib/swaggy_jenkins/models/pipeline_run_node_steps.rb +179 -0
- data/lib/swaggy_jenkins/models/pipeline_run_nodeedges.rb +197 -0
- data/lib/swaggy_jenkins/models/pipeline_run_nodes.rb +179 -0
- data/lib/swaggy_jenkins/models/pipeline_run_steps.rb +179 -0
- data/lib/swaggy_jenkins/models/pipeline_runartifacts.rb +215 -0
- data/lib/swaggy_jenkins/models/pipeline_runs.rb +179 -0
- data/lib/swaggy_jenkins/models/pipeline_step_impl.rb +260 -0
- data/lib/swaggy_jenkins/models/pipeline_step_impllinks.rb +206 -0
- data/lib/swaggy_jenkins/models/pipelinelatest_run.rb +316 -0
- data/lib/swaggy_jenkins/models/pipelinelatest_runartifacts.rb +215 -0
- data/lib/swaggy_jenkins/models/pipelines.rb +179 -0
- data/lib/swaggy_jenkins/models/queue.rb +199 -0
- data/lib/swaggy_jenkins/models/queue_blocked_item.rb +289 -0
- data/lib/swaggy_jenkins/models/queue_item_impl.rb +224 -0
- data/lib/swaggy_jenkins/models/queue_left_item.rb +298 -0
- data/lib/swaggy_jenkins/models/response_time_monitor_data.rb +206 -0
- data/lib/swaggy_jenkins/models/scm_organisations.rb +179 -0
- data/lib/swaggy_jenkins/models/string_parameter_definition.rb +224 -0
- data/lib/swaggy_jenkins/models/string_parameter_value.rb +206 -0
- data/lib/swaggy_jenkins/models/swap_space_monitor_memory_usage2.rb +224 -0
- data/lib/swaggy_jenkins/models/unlabeled_load_statistics.rb +188 -0
- data/lib/swaggy_jenkins/models/user.rb +224 -0
- data/lib/swaggy_jenkins/models/user_favorites.rb +179 -0
- data/lib/swaggy_jenkins/models/users.rb +179 -0
- data/lib/swaggy_jenkins/version.rb +15 -0
- data/spec/api/blue_ocean_api_spec.rb +513 -0
- data/spec/api/remote_access_api_spec.rb +304 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/all_view_spec.rb +54 -0
- data/spec/models/body_spec.rb +42 -0
- data/spec/models/branch_impl_spec.rb +114 -0
- data/spec/models/branch_impllinks_spec.rb +66 -0
- data/spec/models/branch_implpermissions_spec.rb +66 -0
- data/spec/models/cause_action_spec.rb +48 -0
- data/spec/models/cause_user_id_cause_spec.rb +60 -0
- data/spec/models/classes_by_class_spec.rb +48 -0
- data/spec/models/clock_difference_spec.rb +48 -0
- data/spec/models/computer_set_spec.rb +66 -0
- data/spec/models/default_crumb_issuer_spec.rb +54 -0
- data/spec/models/disk_space_monitor_descriptor_disk_space_spec.rb +60 -0
- data/spec/models/empty_change_log_set_spec.rb +48 -0
- data/spec/models/extension_class_container_impl1_spec.rb +54 -0
- data/spec/models/extension_class_container_impl1links_spec.rb +48 -0
- data/spec/models/extension_class_container_impl1map_spec.rb +54 -0
- data/spec/models/extension_class_impl_spec.rb +54 -0
- data/spec/models/extension_class_impllinks_spec.rb +48 -0
- data/spec/models/favorite_impl_spec.rb +54 -0
- data/spec/models/favorite_impllinks_spec.rb +48 -0
- data/spec/models/free_style_build_spec.rb +144 -0
- data/spec/models/free_style_project_spec.rb +198 -0
- data/spec/models/free_style_projectactions_spec.rb +42 -0
- data/spec/models/free_style_projecthealth_report_spec.rb +66 -0
- data/spec/models/generic_resource_spec.rb +72 -0
- data/spec/models/github_content_spec.rb +84 -0
- data/spec/models/github_file_spec.rb +48 -0
- data/spec/models/github_organization_spec.rb +60 -0
- data/spec/models/github_organizationlinks_spec.rb +54 -0
- data/spec/models/github_repositories_spec.rb +72 -0
- data/spec/models/github_repositorieslinks_spec.rb +48 -0
- data/spec/models/github_repository_spec.rb +84 -0
- data/spec/models/github_repositorylinks_spec.rb +48 -0
- data/spec/models/github_repositorypermissions_spec.rb +60 -0
- data/spec/models/github_respository_container_spec.rb +54 -0
- data/spec/models/github_respository_containerlinks_spec.rb +48 -0
- data/spec/models/github_scm_spec.rb +66 -0
- data/spec/models/github_scmlinks_spec.rb +48 -0
- data/spec/models/hudson_master_computer_spec.rb +132 -0
- data/spec/models/hudson_master_computerexecutors_spec.rb +72 -0
- data/spec/models/hudson_master_computermonitor_data_spec.rb +78 -0
- data/spec/models/hudson_spec.rb +126 -0
- data/spec/models/hudsonassigned_labels_spec.rb +42 -0
- data/spec/models/input_step_impl_spec.rb +78 -0
- data/spec/models/input_step_impllinks_spec.rb +48 -0
- data/spec/models/label1_spec.rb +42 -0
- data/spec/models/link_spec.rb +48 -0
- data/spec/models/list_view_spec.rb +66 -0
- data/spec/models/multibranch_pipeline_spec.rb +120 -0
- data/spec/models/null_scm_spec.rb +42 -0
- data/spec/models/organisation_spec.rb +48 -0
- data/spec/models/organisations_spec.rb +36 -0
- data/spec/models/pipeline_activities_spec.rb +36 -0
- data/spec/models/pipeline_activity_spec.rb +126 -0
- data/spec/models/pipeline_activityartifacts_spec.rb +60 -0
- data/spec/models/pipeline_branches_spec.rb +36 -0
- data/spec/models/pipeline_branchesitem_spec.rb +90 -0
- data/spec/models/pipeline_branchesitemlatest_run_spec.rb +120 -0
- data/spec/models/pipeline_branchesitempull_request_spec.rb +72 -0
- data/spec/models/pipeline_branchesitempull_requestlinks_spec.rb +48 -0
- data/spec/models/pipeline_folder_impl_spec.rb +78 -0
- data/spec/models/pipeline_impl_spec.rb +90 -0
- data/spec/models/pipeline_impllinks_spec.rb +66 -0
- data/spec/models/pipeline_queue_spec.rb +36 -0
- data/spec/models/pipeline_run_impl_spec.rb +126 -0
- data/spec/models/pipeline_run_impllinks_spec.rb +72 -0
- data/spec/models/pipeline_run_node_spec.rb +84 -0
- data/spec/models/pipeline_run_node_steps_spec.rb +36 -0
- data/spec/models/pipeline_run_nodeedges_spec.rb +48 -0
- data/spec/models/pipeline_run_nodes_spec.rb +36 -0
- data/spec/models/pipeline_run_spec.rb +126 -0
- data/spec/models/pipeline_run_steps_spec.rb +36 -0
- data/spec/models/pipeline_runartifacts_spec.rb +60 -0
- data/spec/models/pipeline_runs_spec.rb +36 -0
- data/spec/models/pipeline_spec.rb +84 -0
- data/spec/models/pipeline_step_impl_spec.rb +90 -0
- data/spec/models/pipeline_step_impllinks_spec.rb +54 -0
- data/spec/models/pipelinelatest_run_spec.rb +126 -0
- data/spec/models/pipelinelatest_runartifacts_spec.rb +60 -0
- data/spec/models/pipelines_spec.rb +36 -0
- data/spec/models/queue_blocked_item_spec.rb +108 -0
- data/spec/models/queue_item_impl_spec.rb +66 -0
- data/spec/models/queue_left_item_spec.rb +114 -0
- data/spec/models/queue_spec.rb +48 -0
- data/spec/models/response_time_monitor_data_spec.rb +54 -0
- data/spec/models/scm_organisations_spec.rb +36 -0
- data/spec/models/string_parameter_definition_spec.rb +66 -0
- data/spec/models/string_parameter_value_spec.rb +54 -0
- data/spec/models/swap_space_monitor_memory_usage2_spec.rb +66 -0
- data/spec/models/unlabeled_load_statistics_spec.rb +42 -0
- data/spec/models/user_favorites_spec.rb +36 -0
- data/spec/models/user_spec.rb +66 -0
- data/spec/models/users_spec.rb +36 -0
- data/spec/spec_helper.rb +111 -0
- data/swaggy_jenkins.gemspec +45 -0
- metadata +621 -0
@@ -0,0 +1,197 @@
|
|
1
|
+
=begin
|
2
|
+
#Swaggy Jenkins
|
3
|
+
|
4
|
+
#Jenkins API clients generated from Swagger / Open API specification
|
5
|
+
|
6
|
+
OpenAPI spec version: 0.1.0
|
7
|
+
Contact: blah@cliffano.com
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.3.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module SwaggyJenkinsClient
|
16
|
+
|
17
|
+
class PipelineBranchesitempullRequestlinks
|
18
|
+
attr_accessor :_self
|
19
|
+
|
20
|
+
attr_accessor :_class
|
21
|
+
|
22
|
+
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
24
|
+
def self.attribute_map
|
25
|
+
{
|
26
|
+
:'_self' => :'self',
|
27
|
+
:'_class' => :'_class'
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
# Attribute type mapping.
|
32
|
+
def self.swagger_types
|
33
|
+
{
|
34
|
+
:'_self' => :'String',
|
35
|
+
:'_class' => :'String'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# Initializes the object
|
40
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
41
|
+
def initialize(attributes = {})
|
42
|
+
return unless attributes.is_a?(Hash)
|
43
|
+
|
44
|
+
# convert string to symbol for hash key
|
45
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
46
|
+
|
47
|
+
if attributes.has_key?(:'self')
|
48
|
+
self._self = attributes[:'self']
|
49
|
+
end
|
50
|
+
|
51
|
+
if attributes.has_key?(:'_class')
|
52
|
+
self._class = attributes[:'_class']
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
56
|
+
|
57
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
58
|
+
# @return Array for valid properies with the reasons
|
59
|
+
def list_invalid_properties
|
60
|
+
invalid_properties = Array.new
|
61
|
+
return invalid_properties
|
62
|
+
end
|
63
|
+
|
64
|
+
# Check to see if the all the properties in the model are valid
|
65
|
+
# @return true if the model is valid
|
66
|
+
def valid?
|
67
|
+
return true
|
68
|
+
end
|
69
|
+
|
70
|
+
# Checks equality by comparing each attribute.
|
71
|
+
# @param [Object] Object to be compared
|
72
|
+
def ==(o)
|
73
|
+
return true if self.equal?(o)
|
74
|
+
self.class == o.class &&
|
75
|
+
_self == o._self &&
|
76
|
+
_class == o._class
|
77
|
+
end
|
78
|
+
|
79
|
+
# @see the `==` method
|
80
|
+
# @param [Object] Object to be compared
|
81
|
+
def eql?(o)
|
82
|
+
self == o
|
83
|
+
end
|
84
|
+
|
85
|
+
# Calculates hash code according to all attributes.
|
86
|
+
# @return [Fixnum] Hash code
|
87
|
+
def hash
|
88
|
+
[_self, _class].hash
|
89
|
+
end
|
90
|
+
|
91
|
+
# Builds the object from hash
|
92
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
93
|
+
# @return [Object] Returns the model itself
|
94
|
+
def build_from_hash(attributes)
|
95
|
+
return nil unless attributes.is_a?(Hash)
|
96
|
+
self.class.swagger_types.each_pair do |key, type|
|
97
|
+
if type =~ /\AArray<(.*)>/i
|
98
|
+
# check to ensure the input is an array given that the the attribute
|
99
|
+
# is documented as an array but the input is not
|
100
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
101
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
102
|
+
end
|
103
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
104
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
105
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
106
|
+
end
|
107
|
+
|
108
|
+
self
|
109
|
+
end
|
110
|
+
|
111
|
+
# Deserializes the data based on type
|
112
|
+
# @param string type Data type
|
113
|
+
# @param string value Value to be deserialized
|
114
|
+
# @return [Object] Deserialized data
|
115
|
+
def _deserialize(type, value)
|
116
|
+
case type.to_sym
|
117
|
+
when :DateTime
|
118
|
+
DateTime.parse(value)
|
119
|
+
when :Date
|
120
|
+
Date.parse(value)
|
121
|
+
when :String
|
122
|
+
value.to_s
|
123
|
+
when :Integer
|
124
|
+
value.to_i
|
125
|
+
when :Float
|
126
|
+
value.to_f
|
127
|
+
when :BOOLEAN
|
128
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
129
|
+
true
|
130
|
+
else
|
131
|
+
false
|
132
|
+
end
|
133
|
+
when :Object
|
134
|
+
# generic object (usually a Hash), return directly
|
135
|
+
value
|
136
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
137
|
+
inner_type = Regexp.last_match[:inner_type]
|
138
|
+
value.map { |v| _deserialize(inner_type, v) }
|
139
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
140
|
+
k_type = Regexp.last_match[:k_type]
|
141
|
+
v_type = Regexp.last_match[:v_type]
|
142
|
+
{}.tap do |hash|
|
143
|
+
value.each do |k, v|
|
144
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
145
|
+
end
|
146
|
+
end
|
147
|
+
else # model
|
148
|
+
temp_model = SwaggyJenkinsClient.const_get(type).new
|
149
|
+
temp_model.build_from_hash(value)
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
# Returns the string representation of the object
|
154
|
+
# @return [String] String presentation of the object
|
155
|
+
def to_s
|
156
|
+
to_hash.to_s
|
157
|
+
end
|
158
|
+
|
159
|
+
# to_body is an alias to to_hash (backward compatibility)
|
160
|
+
# @return [Hash] Returns the object in the form of hash
|
161
|
+
def to_body
|
162
|
+
to_hash
|
163
|
+
end
|
164
|
+
|
165
|
+
# Returns the object in the form of hash
|
166
|
+
# @return [Hash] Returns the object in the form of hash
|
167
|
+
def to_hash
|
168
|
+
hash = {}
|
169
|
+
self.class.attribute_map.each_pair do |attr, param|
|
170
|
+
value = self.send(attr)
|
171
|
+
next if value.nil?
|
172
|
+
hash[param] = _to_hash(value)
|
173
|
+
end
|
174
|
+
hash
|
175
|
+
end
|
176
|
+
|
177
|
+
# Outputs non-array value in the form of hash
|
178
|
+
# For object, use to_hash. Otherwise, just return the value
|
179
|
+
# @param [Object] value Any valid value
|
180
|
+
# @return [Hash] Returns the value in the form of hash
|
181
|
+
def _to_hash(value)
|
182
|
+
if value.is_a?(Array)
|
183
|
+
value.compact.map{ |v| _to_hash(v) }
|
184
|
+
elsif value.is_a?(Hash)
|
185
|
+
{}.tap do |hash|
|
186
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
187
|
+
end
|
188
|
+
elsif value.respond_to? :to_hash
|
189
|
+
value.to_hash
|
190
|
+
else
|
191
|
+
value
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
end
|
196
|
+
|
197
|
+
end
|
@@ -0,0 +1,242 @@
|
|
1
|
+
=begin
|
2
|
+
#Swaggy Jenkins
|
3
|
+
|
4
|
+
#Jenkins API clients generated from Swagger / Open API specification
|
5
|
+
|
6
|
+
OpenAPI spec version: 0.1.0
|
7
|
+
Contact: blah@cliffano.com
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.3.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module SwaggyJenkinsClient
|
16
|
+
|
17
|
+
class PipelineFolderImpl
|
18
|
+
attr_accessor :_class
|
19
|
+
|
20
|
+
attr_accessor :display_name
|
21
|
+
|
22
|
+
attr_accessor :full_name
|
23
|
+
|
24
|
+
attr_accessor :name
|
25
|
+
|
26
|
+
attr_accessor :organization
|
27
|
+
|
28
|
+
attr_accessor :number_of_folders
|
29
|
+
|
30
|
+
attr_accessor :number_of_pipelines
|
31
|
+
|
32
|
+
|
33
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
34
|
+
def self.attribute_map
|
35
|
+
{
|
36
|
+
:'_class' => :'_class',
|
37
|
+
:'display_name' => :'displayName',
|
38
|
+
:'full_name' => :'fullName',
|
39
|
+
:'name' => :'name',
|
40
|
+
:'organization' => :'organization',
|
41
|
+
:'number_of_folders' => :'numberOfFolders',
|
42
|
+
:'number_of_pipelines' => :'numberOfPipelines'
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
# Attribute type mapping.
|
47
|
+
def self.swagger_types
|
48
|
+
{
|
49
|
+
:'_class' => :'String',
|
50
|
+
:'display_name' => :'String',
|
51
|
+
:'full_name' => :'String',
|
52
|
+
:'name' => :'String',
|
53
|
+
:'organization' => :'String',
|
54
|
+
:'number_of_folders' => :'Integer',
|
55
|
+
:'number_of_pipelines' => :'Integer'
|
56
|
+
}
|
57
|
+
end
|
58
|
+
|
59
|
+
# Initializes the object
|
60
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
61
|
+
def initialize(attributes = {})
|
62
|
+
return unless attributes.is_a?(Hash)
|
63
|
+
|
64
|
+
# convert string to symbol for hash key
|
65
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
66
|
+
|
67
|
+
if attributes.has_key?(:'_class')
|
68
|
+
self._class = attributes[:'_class']
|
69
|
+
end
|
70
|
+
|
71
|
+
if attributes.has_key?(:'displayName')
|
72
|
+
self.display_name = attributes[:'displayName']
|
73
|
+
end
|
74
|
+
|
75
|
+
if attributes.has_key?(:'fullName')
|
76
|
+
self.full_name = attributes[:'fullName']
|
77
|
+
end
|
78
|
+
|
79
|
+
if attributes.has_key?(:'name')
|
80
|
+
self.name = attributes[:'name']
|
81
|
+
end
|
82
|
+
|
83
|
+
if attributes.has_key?(:'organization')
|
84
|
+
self.organization = attributes[:'organization']
|
85
|
+
end
|
86
|
+
|
87
|
+
if attributes.has_key?(:'numberOfFolders')
|
88
|
+
self.number_of_folders = attributes[:'numberOfFolders']
|
89
|
+
end
|
90
|
+
|
91
|
+
if attributes.has_key?(:'numberOfPipelines')
|
92
|
+
self.number_of_pipelines = attributes[:'numberOfPipelines']
|
93
|
+
end
|
94
|
+
|
95
|
+
end
|
96
|
+
|
97
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
98
|
+
# @return Array for valid properies with the reasons
|
99
|
+
def list_invalid_properties
|
100
|
+
invalid_properties = Array.new
|
101
|
+
return invalid_properties
|
102
|
+
end
|
103
|
+
|
104
|
+
# Check to see if the all the properties in the model are valid
|
105
|
+
# @return true if the model is valid
|
106
|
+
def valid?
|
107
|
+
return true
|
108
|
+
end
|
109
|
+
|
110
|
+
# Checks equality by comparing each attribute.
|
111
|
+
# @param [Object] Object to be compared
|
112
|
+
def ==(o)
|
113
|
+
return true if self.equal?(o)
|
114
|
+
self.class == o.class &&
|
115
|
+
_class == o._class &&
|
116
|
+
display_name == o.display_name &&
|
117
|
+
full_name == o.full_name &&
|
118
|
+
name == o.name &&
|
119
|
+
organization == o.organization &&
|
120
|
+
number_of_folders == o.number_of_folders &&
|
121
|
+
number_of_pipelines == o.number_of_pipelines
|
122
|
+
end
|
123
|
+
|
124
|
+
# @see the `==` method
|
125
|
+
# @param [Object] Object to be compared
|
126
|
+
def eql?(o)
|
127
|
+
self == o
|
128
|
+
end
|
129
|
+
|
130
|
+
# Calculates hash code according to all attributes.
|
131
|
+
# @return [Fixnum] Hash code
|
132
|
+
def hash
|
133
|
+
[_class, display_name, full_name, name, organization, number_of_folders, number_of_pipelines].hash
|
134
|
+
end
|
135
|
+
|
136
|
+
# Builds the object from hash
|
137
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
138
|
+
# @return [Object] Returns the model itself
|
139
|
+
def build_from_hash(attributes)
|
140
|
+
return nil unless attributes.is_a?(Hash)
|
141
|
+
self.class.swagger_types.each_pair do |key, type|
|
142
|
+
if type =~ /\AArray<(.*)>/i
|
143
|
+
# check to ensure the input is an array given that the the attribute
|
144
|
+
# is documented as an array but the input is not
|
145
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
146
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
147
|
+
end
|
148
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
149
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
150
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
151
|
+
end
|
152
|
+
|
153
|
+
self
|
154
|
+
end
|
155
|
+
|
156
|
+
# Deserializes the data based on type
|
157
|
+
# @param string type Data type
|
158
|
+
# @param string value Value to be deserialized
|
159
|
+
# @return [Object] Deserialized data
|
160
|
+
def _deserialize(type, value)
|
161
|
+
case type.to_sym
|
162
|
+
when :DateTime
|
163
|
+
DateTime.parse(value)
|
164
|
+
when :Date
|
165
|
+
Date.parse(value)
|
166
|
+
when :String
|
167
|
+
value.to_s
|
168
|
+
when :Integer
|
169
|
+
value.to_i
|
170
|
+
when :Float
|
171
|
+
value.to_f
|
172
|
+
when :BOOLEAN
|
173
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
174
|
+
true
|
175
|
+
else
|
176
|
+
false
|
177
|
+
end
|
178
|
+
when :Object
|
179
|
+
# generic object (usually a Hash), return directly
|
180
|
+
value
|
181
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
182
|
+
inner_type = Regexp.last_match[:inner_type]
|
183
|
+
value.map { |v| _deserialize(inner_type, v) }
|
184
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
185
|
+
k_type = Regexp.last_match[:k_type]
|
186
|
+
v_type = Regexp.last_match[:v_type]
|
187
|
+
{}.tap do |hash|
|
188
|
+
value.each do |k, v|
|
189
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
190
|
+
end
|
191
|
+
end
|
192
|
+
else # model
|
193
|
+
temp_model = SwaggyJenkinsClient.const_get(type).new
|
194
|
+
temp_model.build_from_hash(value)
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
# Returns the string representation of the object
|
199
|
+
# @return [String] String presentation of the object
|
200
|
+
def to_s
|
201
|
+
to_hash.to_s
|
202
|
+
end
|
203
|
+
|
204
|
+
# to_body is an alias to to_hash (backward compatibility)
|
205
|
+
# @return [Hash] Returns the object in the form of hash
|
206
|
+
def to_body
|
207
|
+
to_hash
|
208
|
+
end
|
209
|
+
|
210
|
+
# Returns the object in the form of hash
|
211
|
+
# @return [Hash] Returns the object in the form of hash
|
212
|
+
def to_hash
|
213
|
+
hash = {}
|
214
|
+
self.class.attribute_map.each_pair do |attr, param|
|
215
|
+
value = self.send(attr)
|
216
|
+
next if value.nil?
|
217
|
+
hash[param] = _to_hash(value)
|
218
|
+
end
|
219
|
+
hash
|
220
|
+
end
|
221
|
+
|
222
|
+
# Outputs non-array value in the form of hash
|
223
|
+
# For object, use to_hash. Otherwise, just return the value
|
224
|
+
# @param [Object] value Any valid value
|
225
|
+
# @return [Hash] Returns the value in the form of hash
|
226
|
+
def _to_hash(value)
|
227
|
+
if value.is_a?(Array)
|
228
|
+
value.compact.map{ |v| _to_hash(v) }
|
229
|
+
elsif value.is_a?(Hash)
|
230
|
+
{}.tap do |hash|
|
231
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
232
|
+
end
|
233
|
+
elsif value.respond_to? :to_hash
|
234
|
+
value.to_hash
|
235
|
+
else
|
236
|
+
value
|
237
|
+
end
|
238
|
+
end
|
239
|
+
|
240
|
+
end
|
241
|
+
|
242
|
+
end
|
@@ -0,0 +1,260 @@
|
|
1
|
+
=begin
|
2
|
+
#Swaggy Jenkins
|
3
|
+
|
4
|
+
#Jenkins API clients generated from Swagger / Open API specification
|
5
|
+
|
6
|
+
OpenAPI spec version: 0.1.0
|
7
|
+
Contact: blah@cliffano.com
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.3.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module SwaggyJenkinsClient
|
16
|
+
|
17
|
+
class PipelineImpl
|
18
|
+
attr_accessor :_class
|
19
|
+
|
20
|
+
attr_accessor :display_name
|
21
|
+
|
22
|
+
attr_accessor :estimated_duration_in_millis
|
23
|
+
|
24
|
+
attr_accessor :full_name
|
25
|
+
|
26
|
+
attr_accessor :latest_run
|
27
|
+
|
28
|
+
attr_accessor :name
|
29
|
+
|
30
|
+
attr_accessor :organization
|
31
|
+
|
32
|
+
attr_accessor :weather_score
|
33
|
+
|
34
|
+
attr_accessor :_links
|
35
|
+
|
36
|
+
|
37
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
38
|
+
def self.attribute_map
|
39
|
+
{
|
40
|
+
:'_class' => :'_class',
|
41
|
+
:'display_name' => :'displayName',
|
42
|
+
:'estimated_duration_in_millis' => :'estimatedDurationInMillis',
|
43
|
+
:'full_name' => :'fullName',
|
44
|
+
:'latest_run' => :'latestRun',
|
45
|
+
:'name' => :'name',
|
46
|
+
:'organization' => :'organization',
|
47
|
+
:'weather_score' => :'weatherScore',
|
48
|
+
:'_links' => :'_links'
|
49
|
+
}
|
50
|
+
end
|
51
|
+
|
52
|
+
# Attribute type mapping.
|
53
|
+
def self.swagger_types
|
54
|
+
{
|
55
|
+
:'_class' => :'String',
|
56
|
+
:'display_name' => :'String',
|
57
|
+
:'estimated_duration_in_millis' => :'Integer',
|
58
|
+
:'full_name' => :'String',
|
59
|
+
:'latest_run' => :'String',
|
60
|
+
:'name' => :'String',
|
61
|
+
:'organization' => :'String',
|
62
|
+
:'weather_score' => :'Integer',
|
63
|
+
:'_links' => :'PipelineImpllinks'
|
64
|
+
}
|
65
|
+
end
|
66
|
+
|
67
|
+
# Initializes the object
|
68
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
69
|
+
def initialize(attributes = {})
|
70
|
+
return unless attributes.is_a?(Hash)
|
71
|
+
|
72
|
+
# convert string to symbol for hash key
|
73
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
74
|
+
|
75
|
+
if attributes.has_key?(:'_class')
|
76
|
+
self._class = attributes[:'_class']
|
77
|
+
end
|
78
|
+
|
79
|
+
if attributes.has_key?(:'displayName')
|
80
|
+
self.display_name = attributes[:'displayName']
|
81
|
+
end
|
82
|
+
|
83
|
+
if attributes.has_key?(:'estimatedDurationInMillis')
|
84
|
+
self.estimated_duration_in_millis = attributes[:'estimatedDurationInMillis']
|
85
|
+
end
|
86
|
+
|
87
|
+
if attributes.has_key?(:'fullName')
|
88
|
+
self.full_name = attributes[:'fullName']
|
89
|
+
end
|
90
|
+
|
91
|
+
if attributes.has_key?(:'latestRun')
|
92
|
+
self.latest_run = attributes[:'latestRun']
|
93
|
+
end
|
94
|
+
|
95
|
+
if attributes.has_key?(:'name')
|
96
|
+
self.name = attributes[:'name']
|
97
|
+
end
|
98
|
+
|
99
|
+
if attributes.has_key?(:'organization')
|
100
|
+
self.organization = attributes[:'organization']
|
101
|
+
end
|
102
|
+
|
103
|
+
if attributes.has_key?(:'weatherScore')
|
104
|
+
self.weather_score = attributes[:'weatherScore']
|
105
|
+
end
|
106
|
+
|
107
|
+
if attributes.has_key?(:'_links')
|
108
|
+
self._links = attributes[:'_links']
|
109
|
+
end
|
110
|
+
|
111
|
+
end
|
112
|
+
|
113
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
114
|
+
# @return Array for valid properies with the reasons
|
115
|
+
def list_invalid_properties
|
116
|
+
invalid_properties = Array.new
|
117
|
+
return invalid_properties
|
118
|
+
end
|
119
|
+
|
120
|
+
# Check to see if the all the properties in the model are valid
|
121
|
+
# @return true if the model is valid
|
122
|
+
def valid?
|
123
|
+
return true
|
124
|
+
end
|
125
|
+
|
126
|
+
# Checks equality by comparing each attribute.
|
127
|
+
# @param [Object] Object to be compared
|
128
|
+
def ==(o)
|
129
|
+
return true if self.equal?(o)
|
130
|
+
self.class == o.class &&
|
131
|
+
_class == o._class &&
|
132
|
+
display_name == o.display_name &&
|
133
|
+
estimated_duration_in_millis == o.estimated_duration_in_millis &&
|
134
|
+
full_name == o.full_name &&
|
135
|
+
latest_run == o.latest_run &&
|
136
|
+
name == o.name &&
|
137
|
+
organization == o.organization &&
|
138
|
+
weather_score == o.weather_score &&
|
139
|
+
_links == o._links
|
140
|
+
end
|
141
|
+
|
142
|
+
# @see the `==` method
|
143
|
+
# @param [Object] Object to be compared
|
144
|
+
def eql?(o)
|
145
|
+
self == o
|
146
|
+
end
|
147
|
+
|
148
|
+
# Calculates hash code according to all attributes.
|
149
|
+
# @return [Fixnum] Hash code
|
150
|
+
def hash
|
151
|
+
[_class, display_name, estimated_duration_in_millis, full_name, latest_run, name, organization, weather_score, _links].hash
|
152
|
+
end
|
153
|
+
|
154
|
+
# Builds the object from hash
|
155
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
156
|
+
# @return [Object] Returns the model itself
|
157
|
+
def build_from_hash(attributes)
|
158
|
+
return nil unless attributes.is_a?(Hash)
|
159
|
+
self.class.swagger_types.each_pair do |key, type|
|
160
|
+
if type =~ /\AArray<(.*)>/i
|
161
|
+
# check to ensure the input is an array given that the the attribute
|
162
|
+
# is documented as an array but the input is not
|
163
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
164
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
165
|
+
end
|
166
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
167
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
168
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
169
|
+
end
|
170
|
+
|
171
|
+
self
|
172
|
+
end
|
173
|
+
|
174
|
+
# Deserializes the data based on type
|
175
|
+
# @param string type Data type
|
176
|
+
# @param string value Value to be deserialized
|
177
|
+
# @return [Object] Deserialized data
|
178
|
+
def _deserialize(type, value)
|
179
|
+
case type.to_sym
|
180
|
+
when :DateTime
|
181
|
+
DateTime.parse(value)
|
182
|
+
when :Date
|
183
|
+
Date.parse(value)
|
184
|
+
when :String
|
185
|
+
value.to_s
|
186
|
+
when :Integer
|
187
|
+
value.to_i
|
188
|
+
when :Float
|
189
|
+
value.to_f
|
190
|
+
when :BOOLEAN
|
191
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
192
|
+
true
|
193
|
+
else
|
194
|
+
false
|
195
|
+
end
|
196
|
+
when :Object
|
197
|
+
# generic object (usually a Hash), return directly
|
198
|
+
value
|
199
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
200
|
+
inner_type = Regexp.last_match[:inner_type]
|
201
|
+
value.map { |v| _deserialize(inner_type, v) }
|
202
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
203
|
+
k_type = Regexp.last_match[:k_type]
|
204
|
+
v_type = Regexp.last_match[:v_type]
|
205
|
+
{}.tap do |hash|
|
206
|
+
value.each do |k, v|
|
207
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
208
|
+
end
|
209
|
+
end
|
210
|
+
else # model
|
211
|
+
temp_model = SwaggyJenkinsClient.const_get(type).new
|
212
|
+
temp_model.build_from_hash(value)
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
# Returns the string representation of the object
|
217
|
+
# @return [String] String presentation of the object
|
218
|
+
def to_s
|
219
|
+
to_hash.to_s
|
220
|
+
end
|
221
|
+
|
222
|
+
# to_body is an alias to to_hash (backward compatibility)
|
223
|
+
# @return [Hash] Returns the object in the form of hash
|
224
|
+
def to_body
|
225
|
+
to_hash
|
226
|
+
end
|
227
|
+
|
228
|
+
# Returns the object in the form of hash
|
229
|
+
# @return [Hash] Returns the object in the form of hash
|
230
|
+
def to_hash
|
231
|
+
hash = {}
|
232
|
+
self.class.attribute_map.each_pair do |attr, param|
|
233
|
+
value = self.send(attr)
|
234
|
+
next if value.nil?
|
235
|
+
hash[param] = _to_hash(value)
|
236
|
+
end
|
237
|
+
hash
|
238
|
+
end
|
239
|
+
|
240
|
+
# Outputs non-array value in the form of hash
|
241
|
+
# For object, use to_hash. Otherwise, just return the value
|
242
|
+
# @param [Object] value Any valid value
|
243
|
+
# @return [Hash] Returns the value in the form of hash
|
244
|
+
def _to_hash(value)
|
245
|
+
if value.is_a?(Array)
|
246
|
+
value.compact.map{ |v| _to_hash(v) }
|
247
|
+
elsif value.is_a?(Hash)
|
248
|
+
{}.tap do |hash|
|
249
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
250
|
+
end
|
251
|
+
elsif value.respond_to? :to_hash
|
252
|
+
value.to_hash
|
253
|
+
else
|
254
|
+
value
|
255
|
+
end
|
256
|
+
end
|
257
|
+
|
258
|
+
end
|
259
|
+
|
260
|
+
end
|