swaggy_jenkins 2.0.1.pre.pre.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +35 -31
- data/README.md +8 -6
- data/bin/bundle +6 -11
- data/bin/byebug +2 -2
- data/bin/coderay +2 -2
- data/bin/htmldiff +2 -2
- data/bin/ldiff +2 -2
- data/bin/pry +2 -2
- data/bin/racc +27 -0
- data/bin/rake +2 -2
- data/bin/rspec +2 -2
- data/bin/rubocop +2 -2
- data/bin/ruby-parse +2 -2
- data/bin/ruby-rewrite +2 -2
- data/lib/swaggy_jenkins/api/base_api.rb +4 -4
- data/lib/swaggy_jenkins/api/blue_ocean_api.rb +39 -39
- data/lib/swaggy_jenkins/api/remote_access_api.rb +16 -16
- data/lib/swaggy_jenkins/api_client.rb +25 -24
- data/lib/swaggy_jenkins/api_error.rb +4 -3
- data/lib/swaggy_jenkins/configuration.rb +40 -11
- data/lib/swaggy_jenkins/models/all_view.rb +25 -24
- data/lib/swaggy_jenkins/models/branch_impl.rb +25 -24
- data/lib/swaggy_jenkins/models/branch_impllinks.rb +25 -24
- data/lib/swaggy_jenkins/models/branch_implpermissions.rb +25 -24
- data/lib/swaggy_jenkins/models/cause_action.rb +25 -24
- data/lib/swaggy_jenkins/models/cause_user_id_cause.rb +25 -24
- data/lib/swaggy_jenkins/models/classes_by_class.rb +25 -24
- data/lib/swaggy_jenkins/models/clock_difference.rb +25 -24
- data/lib/swaggy_jenkins/models/computer_set.rb +25 -24
- data/lib/swaggy_jenkins/models/default_crumb_issuer.rb +25 -24
- data/lib/swaggy_jenkins/models/disk_space_monitor_descriptor_disk_space.rb +25 -24
- data/lib/swaggy_jenkins/models/empty_change_log_set.rb +25 -24
- data/lib/swaggy_jenkins/models/extension_class_container_impl1.rb +25 -24
- data/lib/swaggy_jenkins/models/extension_class_container_impl1links.rb +25 -24
- data/lib/swaggy_jenkins/models/extension_class_container_impl1map.rb +25 -24
- data/lib/swaggy_jenkins/models/extension_class_impl.rb +25 -24
- data/lib/swaggy_jenkins/models/extension_class_impllinks.rb +25 -24
- data/lib/swaggy_jenkins/models/favorite_impl.rb +25 -24
- data/lib/swaggy_jenkins/models/favorite_impllinks.rb +25 -24
- data/lib/swaggy_jenkins/models/free_style_build.rb +25 -24
- data/lib/swaggy_jenkins/models/free_style_project.rb +25 -24
- data/lib/swaggy_jenkins/models/free_style_projectactions.rb +25 -24
- data/lib/swaggy_jenkins/models/free_style_projecthealth_report.rb +25 -24
- data/lib/swaggy_jenkins/models/generic_resource.rb +25 -24
- data/lib/swaggy_jenkins/models/github_content.rb +25 -24
- data/lib/swaggy_jenkins/models/github_file.rb +25 -24
- data/lib/swaggy_jenkins/models/github_organization.rb +25 -24
- data/lib/swaggy_jenkins/models/github_organizationlinks.rb +25 -24
- data/lib/swaggy_jenkins/models/github_repositories.rb +25 -24
- data/lib/swaggy_jenkins/models/github_repositorieslinks.rb +25 -24
- data/lib/swaggy_jenkins/models/github_repository.rb +25 -24
- data/lib/swaggy_jenkins/models/github_repositorylinks.rb +25 -24
- data/lib/swaggy_jenkins/models/github_repositorypermissions.rb +25 -24
- data/lib/swaggy_jenkins/models/github_respository_container.rb +25 -24
- data/lib/swaggy_jenkins/models/github_respository_containerlinks.rb +25 -24
- data/lib/swaggy_jenkins/models/github_scm.rb +25 -24
- data/lib/swaggy_jenkins/models/github_scmlinks.rb +25 -24
- data/lib/swaggy_jenkins/models/hudson.rb +25 -24
- data/lib/swaggy_jenkins/models/hudson_master_computer.rb +25 -24
- data/lib/swaggy_jenkins/models/hudson_master_computerexecutors.rb +25 -24
- data/lib/swaggy_jenkins/models/hudson_master_computermonitor_data.rb +25 -24
- data/lib/swaggy_jenkins/models/hudsonassigned_labels.rb +25 -24
- data/lib/swaggy_jenkins/models/input_step_impl.rb +25 -24
- data/lib/swaggy_jenkins/models/input_step_impllinks.rb +25 -24
- data/lib/swaggy_jenkins/models/label1.rb +25 -24
- data/lib/swaggy_jenkins/models/link.rb +25 -24
- data/lib/swaggy_jenkins/models/list_view.rb +25 -24
- data/lib/swaggy_jenkins/models/multibranch_pipeline.rb +25 -24
- data/lib/swaggy_jenkins/models/null_scm.rb +25 -24
- data/lib/swaggy_jenkins/models/organisation.rb +25 -24
- data/lib/swaggy_jenkins/models/pipeline.rb +25 -24
- data/lib/swaggy_jenkins/models/pipeline_activity.rb +25 -24
- data/lib/swaggy_jenkins/models/pipeline_activityartifacts.rb +25 -24
- data/lib/swaggy_jenkins/models/pipeline_branchesitem.rb +25 -24
- data/lib/swaggy_jenkins/models/pipeline_branchesitemlatest_run.rb +25 -24
- data/lib/swaggy_jenkins/models/pipeline_branchesitempull_request.rb +25 -24
- data/lib/swaggy_jenkins/models/pipeline_branchesitempull_requestlinks.rb +25 -24
- data/lib/swaggy_jenkins/models/pipeline_folder_impl.rb +25 -24
- data/lib/swaggy_jenkins/models/pipeline_impl.rb +25 -24
- data/lib/swaggy_jenkins/models/pipeline_impllinks.rb +25 -24
- data/lib/swaggy_jenkins/models/pipeline_run.rb +25 -24
- data/lib/swaggy_jenkins/models/pipeline_run_impl.rb +25 -24
- data/lib/swaggy_jenkins/models/pipeline_run_impllinks.rb +25 -24
- data/lib/swaggy_jenkins/models/pipeline_run_node.rb +25 -24
- data/lib/swaggy_jenkins/models/pipeline_run_nodeedges.rb +25 -24
- data/lib/swaggy_jenkins/models/pipeline_runartifacts.rb +25 -24
- data/lib/swaggy_jenkins/models/pipeline_step_impl.rb +25 -24
- data/lib/swaggy_jenkins/models/pipeline_step_impllinks.rb +25 -24
- data/lib/swaggy_jenkins/models/pipelinelatest_run.rb +25 -24
- data/lib/swaggy_jenkins/models/pipelinelatest_runartifacts.rb +25 -24
- data/lib/swaggy_jenkins/models/queue.rb +25 -24
- data/lib/swaggy_jenkins/models/queue_blocked_item.rb +25 -24
- data/lib/swaggy_jenkins/models/queue_item_impl.rb +25 -24
- data/lib/swaggy_jenkins/models/queue_left_item.rb +25 -24
- data/lib/swaggy_jenkins/models/response_time_monitor_data.rb +25 -24
- data/lib/swaggy_jenkins/models/string_parameter_definition.rb +25 -24
- data/lib/swaggy_jenkins/models/string_parameter_value.rb +25 -24
- data/lib/swaggy_jenkins/models/swap_space_monitor_memory_usage2.rb +25 -24
- data/lib/swaggy_jenkins/models/unlabeled_load_statistics.rb +25 -24
- data/lib/swaggy_jenkins/models/user.rb +25 -24
- data/lib/swaggy_jenkins/version.rb +4 -4
- data/lib/swaggy_jenkins.rb +3 -3
- data/spec/api/base_api_spec.rb +4 -4
- data/spec/api/blue_ocean_api_spec.rb +40 -40
- data/spec/api/remote_access_api_spec.rb +23 -23
- data/spec/models/all_view_spec.rb +9 -7
- data/spec/models/branch_impl_spec.rb +19 -17
- data/spec/models/branch_impllinks_spec.rb +11 -9
- data/spec/models/branch_implpermissions_spec.rb +11 -9
- data/spec/models/cause_action_spec.rb +8 -6
- data/spec/models/cause_user_id_cause_spec.rb +10 -8
- data/spec/models/classes_by_class_spec.rb +8 -6
- data/spec/models/clock_difference_spec.rb +8 -6
- data/spec/models/computer_set_spec.rb +11 -9
- data/spec/models/default_crumb_issuer_spec.rb +9 -7
- data/spec/models/disk_space_monitor_descriptor_disk_space_spec.rb +10 -8
- data/spec/models/empty_change_log_set_spec.rb +8 -6
- data/spec/models/extension_class_container_impl1_spec.rb +9 -7
- data/spec/models/extension_class_container_impl1links_spec.rb +8 -6
- data/spec/models/extension_class_container_impl1map_spec.rb +9 -7
- data/spec/models/extension_class_impl_spec.rb +9 -7
- data/spec/models/extension_class_impllinks_spec.rb +8 -6
- data/spec/models/favorite_impl_spec.rb +9 -7
- data/spec/models/favorite_impllinks_spec.rb +8 -6
- data/spec/models/free_style_build_spec.rb +24 -22
- data/spec/models/free_style_project_spec.rb +33 -31
- data/spec/models/free_style_projectactions_spec.rb +7 -5
- data/spec/models/free_style_projecthealth_report_spec.rb +11 -9
- data/spec/models/generic_resource_spec.rb +12 -10
- data/spec/models/github_content_spec.rb +14 -12
- data/spec/models/github_file_spec.rb +8 -6
- data/spec/models/github_organization_spec.rb +10 -8
- data/spec/models/github_organizationlinks_spec.rb +9 -7
- data/spec/models/github_repositories_spec.rb +12 -10
- data/spec/models/github_repositorieslinks_spec.rb +8 -6
- data/spec/models/github_repository_spec.rb +14 -12
- data/spec/models/github_repositorylinks_spec.rb +8 -6
- data/spec/models/github_repositorypermissions_spec.rb +10 -8
- data/spec/models/github_respository_container_spec.rb +9 -7
- data/spec/models/github_respository_containerlinks_spec.rb +8 -6
- data/spec/models/github_scm_spec.rb +11 -9
- data/spec/models/github_scmlinks_spec.rb +8 -6
- data/spec/models/hudson_master_computer_spec.rb +22 -20
- data/spec/models/hudson_master_computerexecutors_spec.rb +12 -10
- data/spec/models/hudson_master_computermonitor_data_spec.rb +13 -11
- data/spec/models/hudson_spec.rb +21 -19
- data/spec/models/hudsonassigned_labels_spec.rb +7 -5
- data/spec/models/input_step_impl_spec.rb +13 -11
- data/spec/models/input_step_impllinks_spec.rb +8 -6
- data/spec/models/label1_spec.rb +7 -5
- data/spec/models/link_spec.rb +8 -6
- data/spec/models/list_view_spec.rb +11 -9
- data/spec/models/multibranch_pipeline_spec.rb +20 -18
- data/spec/models/null_scm_spec.rb +7 -5
- data/spec/models/organisation_spec.rb +8 -6
- data/spec/models/pipeline_activity_spec.rb +21 -19
- data/spec/models/pipeline_activityartifacts_spec.rb +10 -8
- data/spec/models/pipeline_branchesitem_spec.rb +15 -13
- data/spec/models/pipeline_branchesitemlatest_run_spec.rb +20 -18
- data/spec/models/pipeline_branchesitempull_request_spec.rb +12 -10
- data/spec/models/pipeline_branchesitempull_requestlinks_spec.rb +8 -6
- data/spec/models/pipeline_folder_impl_spec.rb +13 -11
- data/spec/models/pipeline_impl_spec.rb +15 -13
- data/spec/models/pipeline_impllinks_spec.rb +11 -9
- data/spec/models/pipeline_run_impl_spec.rb +21 -19
- data/spec/models/pipeline_run_impllinks_spec.rb +12 -10
- data/spec/models/pipeline_run_node_spec.rb +14 -12
- data/spec/models/pipeline_run_nodeedges_spec.rb +8 -6
- data/spec/models/pipeline_run_spec.rb +21 -19
- data/spec/models/pipeline_runartifacts_spec.rb +10 -8
- data/spec/models/pipeline_spec.rb +14 -12
- data/spec/models/pipeline_step_impl_spec.rb +15 -13
- data/spec/models/pipeline_step_impllinks_spec.rb +9 -7
- data/spec/models/pipelinelatest_run_spec.rb +21 -19
- data/spec/models/pipelinelatest_runartifacts_spec.rb +10 -8
- data/spec/models/queue_blocked_item_spec.rb +18 -16
- data/spec/models/queue_item_impl_spec.rb +11 -9
- data/spec/models/queue_left_item_spec.rb +19 -17
- data/spec/models/queue_spec.rb +8 -6
- data/spec/models/response_time_monitor_data_spec.rb +9 -7
- data/spec/models/string_parameter_definition_spec.rb +11 -9
- data/spec/models/string_parameter_value_spec.rb +9 -7
- data/spec/models/swap_space_monitor_memory_usage2_spec.rb +11 -9
- data/spec/models/unlabeled_load_statistics_spec.rb +7 -5
- data/spec/models/user_spec.rb +11 -9
- data/spec/spec_helper.rb +3 -3
- data/swaggy_jenkins.gemspec +7 -6
- metadata +77 -80
- data/spec/api_client_spec.rb +0 -226
- data/spec/configuration_spec.rb +0 -42
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
4
|
#Jenkins API clients generated from Swagger / Open API specification
|
5
5
|
|
6
|
-
The version of the OpenAPI document:
|
7
|
-
Contact: blah@cliffano.com
|
6
|
+
The version of the OpenAPI document: 3.1.0
|
7
|
+
Contact: blah+oapicf@cliffano.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.12.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -30,9 +30,14 @@ module SwaggyJenkinsClient
|
|
30
30
|
}
|
31
31
|
end
|
32
32
|
|
33
|
+
# Returns attribute mapping this model knows about
|
34
|
+
def self.acceptable_attribute_map
|
35
|
+
attribute_map
|
36
|
+
end
|
37
|
+
|
33
38
|
# Returns all the JSON keys this model knows about
|
34
39
|
def self.acceptable_attributes
|
35
|
-
|
40
|
+
acceptable_attribute_map.values
|
36
41
|
end
|
37
42
|
|
38
43
|
# Attribute type mapping.
|
@@ -58,9 +63,10 @@ module SwaggyJenkinsClient
|
|
58
63
|
end
|
59
64
|
|
60
65
|
# check to see if the attribute exists and convert string to symbol for hash key
|
66
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
61
67
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
62
|
-
if (!
|
63
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `SwaggyJenkinsClient::ResponseTimeMonitorData`. Please check the name to make sure it's valid. List of attributes: " +
|
68
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
69
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SwaggyJenkinsClient::ResponseTimeMonitorData`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
64
70
|
end
|
65
71
|
h[k.to_sym] = v
|
66
72
|
}
|
@@ -81,6 +87,7 @@ module SwaggyJenkinsClient
|
|
81
87
|
# Show invalid properties with the reasons. Usually used together with valid?
|
82
88
|
# @return Array for valid properties with the reasons
|
83
89
|
def list_invalid_properties
|
90
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
84
91
|
invalid_properties = Array.new
|
85
92
|
invalid_properties
|
86
93
|
end
|
@@ -88,6 +95,7 @@ module SwaggyJenkinsClient
|
|
88
95
|
# Check to see if the all the properties in the model are valid
|
89
96
|
# @return true if the model is valid
|
90
97
|
def valid?
|
98
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
91
99
|
true
|
92
100
|
end
|
93
101
|
|
@@ -117,37 +125,30 @@ module SwaggyJenkinsClient
|
|
117
125
|
# @param [Hash] attributes Model attributes in the form of hash
|
118
126
|
# @return [Object] Returns the model itself
|
119
127
|
def self.build_from_hash(attributes)
|
120
|
-
new.build_from_hash(attributes)
|
121
|
-
end
|
122
|
-
|
123
|
-
# Builds the object from hash
|
124
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
125
|
-
# @return [Object] Returns the model itself
|
126
|
-
def build_from_hash(attributes)
|
127
128
|
return nil unless attributes.is_a?(Hash)
|
128
129
|
attributes = attributes.transform_keys(&:to_sym)
|
129
|
-
|
130
|
-
|
131
|
-
|
130
|
+
transformed_hash = {}
|
131
|
+
openapi_types.each_pair do |key, type|
|
132
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
133
|
+
transformed_hash["#{key}"] = nil
|
132
134
|
elsif type =~ /\AArray<(.*)>/i
|
133
135
|
# check to ensure the input is an array given that the attribute
|
134
136
|
# is documented as an array but the input is not
|
135
|
-
if attributes[
|
136
|
-
|
137
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
138
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
137
139
|
end
|
138
|
-
elsif !attributes[
|
139
|
-
|
140
|
+
elsif !attributes[attribute_map[key]].nil?
|
141
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
140
142
|
end
|
141
143
|
end
|
142
|
-
|
143
|
-
self
|
144
|
+
new(transformed_hash)
|
144
145
|
end
|
145
146
|
|
146
147
|
# Deserializes the data based on type
|
147
148
|
# @param string type Data type
|
148
149
|
# @param string value Value to be deserialized
|
149
150
|
# @return [Object] Deserialized data
|
150
|
-
def _deserialize(type, value)
|
151
|
+
def self._deserialize(type, value)
|
151
152
|
case type.to_sym
|
152
153
|
when :Time
|
153
154
|
Time.parse(value)
|
@@ -182,7 +183,7 @@ module SwaggyJenkinsClient
|
|
182
183
|
else # model
|
183
184
|
# models (e.g. Pet) or oneOf
|
184
185
|
klass = SwaggyJenkinsClient.const_get(type)
|
185
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
186
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
186
187
|
end
|
187
188
|
end
|
188
189
|
|
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
4
|
#Jenkins API clients generated from Swagger / Open API specification
|
5
5
|
|
6
|
-
The version of the OpenAPI document:
|
7
|
-
Contact: blah@cliffano.com
|
6
|
+
The version of the OpenAPI document: 3.1.0
|
7
|
+
Contact: blah+oapicf@cliffano.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.12.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -36,9 +36,14 @@ module SwaggyJenkinsClient
|
|
36
36
|
}
|
37
37
|
end
|
38
38
|
|
39
|
+
# Returns attribute mapping this model knows about
|
40
|
+
def self.acceptable_attribute_map
|
41
|
+
attribute_map
|
42
|
+
end
|
43
|
+
|
39
44
|
# Returns all the JSON keys this model knows about
|
40
45
|
def self.acceptable_attributes
|
41
|
-
|
46
|
+
acceptable_attribute_map.values
|
42
47
|
end
|
43
48
|
|
44
49
|
# Attribute type mapping.
|
@@ -66,9 +71,10 @@ module SwaggyJenkinsClient
|
|
66
71
|
end
|
67
72
|
|
68
73
|
# check to see if the attribute exists and convert string to symbol for hash key
|
74
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
69
75
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
70
|
-
if (!
|
71
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `SwaggyJenkinsClient::StringParameterDefinition`. Please check the name to make sure it's valid. List of attributes: " +
|
76
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
77
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SwaggyJenkinsClient::StringParameterDefinition`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
72
78
|
end
|
73
79
|
h[k.to_sym] = v
|
74
80
|
}
|
@@ -97,6 +103,7 @@ module SwaggyJenkinsClient
|
|
97
103
|
# Show invalid properties with the reasons. Usually used together with valid?
|
98
104
|
# @return Array for valid properties with the reasons
|
99
105
|
def list_invalid_properties
|
106
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
100
107
|
invalid_properties = Array.new
|
101
108
|
invalid_properties
|
102
109
|
end
|
@@ -104,6 +111,7 @@ module SwaggyJenkinsClient
|
|
104
111
|
# Check to see if the all the properties in the model are valid
|
105
112
|
# @return true if the model is valid
|
106
113
|
def valid?
|
114
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
107
115
|
true
|
108
116
|
end
|
109
117
|
|
@@ -135,37 +143,30 @@ module SwaggyJenkinsClient
|
|
135
143
|
# @param [Hash] attributes Model attributes in the form of hash
|
136
144
|
# @return [Object] Returns the model itself
|
137
145
|
def self.build_from_hash(attributes)
|
138
|
-
new.build_from_hash(attributes)
|
139
|
-
end
|
140
|
-
|
141
|
-
# Builds the object from hash
|
142
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
143
|
-
# @return [Object] Returns the model itself
|
144
|
-
def build_from_hash(attributes)
|
145
146
|
return nil unless attributes.is_a?(Hash)
|
146
147
|
attributes = attributes.transform_keys(&:to_sym)
|
147
|
-
|
148
|
-
|
149
|
-
|
148
|
+
transformed_hash = {}
|
149
|
+
openapi_types.each_pair do |key, type|
|
150
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
151
|
+
transformed_hash["#{key}"] = nil
|
150
152
|
elsif type =~ /\AArray<(.*)>/i
|
151
153
|
# check to ensure the input is an array given that the attribute
|
152
154
|
# is documented as an array but the input is not
|
153
|
-
if attributes[
|
154
|
-
|
155
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
156
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
155
157
|
end
|
156
|
-
elsif !attributes[
|
157
|
-
|
158
|
+
elsif !attributes[attribute_map[key]].nil?
|
159
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
158
160
|
end
|
159
161
|
end
|
160
|
-
|
161
|
-
self
|
162
|
+
new(transformed_hash)
|
162
163
|
end
|
163
164
|
|
164
165
|
# Deserializes the data based on type
|
165
166
|
# @param string type Data type
|
166
167
|
# @param string value Value to be deserialized
|
167
168
|
# @return [Object] Deserialized data
|
168
|
-
def _deserialize(type, value)
|
169
|
+
def self._deserialize(type, value)
|
169
170
|
case type.to_sym
|
170
171
|
when :Time
|
171
172
|
Time.parse(value)
|
@@ -200,7 +201,7 @@ module SwaggyJenkinsClient
|
|
200
201
|
else # model
|
201
202
|
# models (e.g. Pet) or oneOf
|
202
203
|
klass = SwaggyJenkinsClient.const_get(type)
|
203
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
204
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
204
205
|
end
|
205
206
|
end
|
206
207
|
|
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
4
|
#Jenkins API clients generated from Swagger / Open API specification
|
5
5
|
|
6
|
-
The version of the OpenAPI document:
|
7
|
-
Contact: blah@cliffano.com
|
6
|
+
The version of the OpenAPI document: 3.1.0
|
7
|
+
Contact: blah+oapicf@cliffano.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.12.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -30,9 +30,14 @@ module SwaggyJenkinsClient
|
|
30
30
|
}
|
31
31
|
end
|
32
32
|
|
33
|
+
# Returns attribute mapping this model knows about
|
34
|
+
def self.acceptable_attribute_map
|
35
|
+
attribute_map
|
36
|
+
end
|
37
|
+
|
33
38
|
# Returns all the JSON keys this model knows about
|
34
39
|
def self.acceptable_attributes
|
35
|
-
|
40
|
+
acceptable_attribute_map.values
|
36
41
|
end
|
37
42
|
|
38
43
|
# Attribute type mapping.
|
@@ -58,9 +63,10 @@ module SwaggyJenkinsClient
|
|
58
63
|
end
|
59
64
|
|
60
65
|
# check to see if the attribute exists and convert string to symbol for hash key
|
66
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
61
67
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
62
|
-
if (!
|
63
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `SwaggyJenkinsClient::StringParameterValue`. Please check the name to make sure it's valid. List of attributes: " +
|
68
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
69
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SwaggyJenkinsClient::StringParameterValue`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
64
70
|
end
|
65
71
|
h[k.to_sym] = v
|
66
72
|
}
|
@@ -81,6 +87,7 @@ module SwaggyJenkinsClient
|
|
81
87
|
# Show invalid properties with the reasons. Usually used together with valid?
|
82
88
|
# @return Array for valid properties with the reasons
|
83
89
|
def list_invalid_properties
|
90
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
84
91
|
invalid_properties = Array.new
|
85
92
|
invalid_properties
|
86
93
|
end
|
@@ -88,6 +95,7 @@ module SwaggyJenkinsClient
|
|
88
95
|
# Check to see if the all the properties in the model are valid
|
89
96
|
# @return true if the model is valid
|
90
97
|
def valid?
|
98
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
91
99
|
true
|
92
100
|
end
|
93
101
|
|
@@ -117,37 +125,30 @@ module SwaggyJenkinsClient
|
|
117
125
|
# @param [Hash] attributes Model attributes in the form of hash
|
118
126
|
# @return [Object] Returns the model itself
|
119
127
|
def self.build_from_hash(attributes)
|
120
|
-
new.build_from_hash(attributes)
|
121
|
-
end
|
122
|
-
|
123
|
-
# Builds the object from hash
|
124
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
125
|
-
# @return [Object] Returns the model itself
|
126
|
-
def build_from_hash(attributes)
|
127
128
|
return nil unless attributes.is_a?(Hash)
|
128
129
|
attributes = attributes.transform_keys(&:to_sym)
|
129
|
-
|
130
|
-
|
131
|
-
|
130
|
+
transformed_hash = {}
|
131
|
+
openapi_types.each_pair do |key, type|
|
132
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
133
|
+
transformed_hash["#{key}"] = nil
|
132
134
|
elsif type =~ /\AArray<(.*)>/i
|
133
135
|
# check to ensure the input is an array given that the attribute
|
134
136
|
# is documented as an array but the input is not
|
135
|
-
if attributes[
|
136
|
-
|
137
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
138
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
137
139
|
end
|
138
|
-
elsif !attributes[
|
139
|
-
|
140
|
+
elsif !attributes[attribute_map[key]].nil?
|
141
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
140
142
|
end
|
141
143
|
end
|
142
|
-
|
143
|
-
self
|
144
|
+
new(transformed_hash)
|
144
145
|
end
|
145
146
|
|
146
147
|
# Deserializes the data based on type
|
147
148
|
# @param string type Data type
|
148
149
|
# @param string value Value to be deserialized
|
149
150
|
# @return [Object] Deserialized data
|
150
|
-
def _deserialize(type, value)
|
151
|
+
def self._deserialize(type, value)
|
151
152
|
case type.to_sym
|
152
153
|
when :Time
|
153
154
|
Time.parse(value)
|
@@ -182,7 +183,7 @@ module SwaggyJenkinsClient
|
|
182
183
|
else # model
|
183
184
|
# models (e.g. Pet) or oneOf
|
184
185
|
klass = SwaggyJenkinsClient.const_get(type)
|
185
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
186
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
186
187
|
end
|
187
188
|
end
|
188
189
|
|
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
4
|
#Jenkins API clients generated from Swagger / Open API specification
|
5
5
|
|
6
|
-
The version of the OpenAPI document:
|
7
|
-
Contact: blah@cliffano.com
|
6
|
+
The version of the OpenAPI document: 3.1.0
|
7
|
+
Contact: blah+oapicf@cliffano.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.12.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -36,9 +36,14 @@ module SwaggyJenkinsClient
|
|
36
36
|
}
|
37
37
|
end
|
38
38
|
|
39
|
+
# Returns attribute mapping this model knows about
|
40
|
+
def self.acceptable_attribute_map
|
41
|
+
attribute_map
|
42
|
+
end
|
43
|
+
|
39
44
|
# Returns all the JSON keys this model knows about
|
40
45
|
def self.acceptable_attributes
|
41
|
-
|
46
|
+
acceptable_attribute_map.values
|
42
47
|
end
|
43
48
|
|
44
49
|
# Attribute type mapping.
|
@@ -66,9 +71,10 @@ module SwaggyJenkinsClient
|
|
66
71
|
end
|
67
72
|
|
68
73
|
# check to see if the attribute exists and convert string to symbol for hash key
|
74
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
69
75
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
70
|
-
if (!
|
71
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `SwaggyJenkinsClient::SwapSpaceMonitorMemoryUsage2`. Please check the name to make sure it's valid. List of attributes: " +
|
76
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
77
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SwaggyJenkinsClient::SwapSpaceMonitorMemoryUsage2`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
72
78
|
end
|
73
79
|
h[k.to_sym] = v
|
74
80
|
}
|
@@ -97,6 +103,7 @@ module SwaggyJenkinsClient
|
|
97
103
|
# Show invalid properties with the reasons. Usually used together with valid?
|
98
104
|
# @return Array for valid properties with the reasons
|
99
105
|
def list_invalid_properties
|
106
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
100
107
|
invalid_properties = Array.new
|
101
108
|
invalid_properties
|
102
109
|
end
|
@@ -104,6 +111,7 @@ module SwaggyJenkinsClient
|
|
104
111
|
# Check to see if the all the properties in the model are valid
|
105
112
|
# @return true if the model is valid
|
106
113
|
def valid?
|
114
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
107
115
|
true
|
108
116
|
end
|
109
117
|
|
@@ -135,37 +143,30 @@ module SwaggyJenkinsClient
|
|
135
143
|
# @param [Hash] attributes Model attributes in the form of hash
|
136
144
|
# @return [Object] Returns the model itself
|
137
145
|
def self.build_from_hash(attributes)
|
138
|
-
new.build_from_hash(attributes)
|
139
|
-
end
|
140
|
-
|
141
|
-
# Builds the object from hash
|
142
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
143
|
-
# @return [Object] Returns the model itself
|
144
|
-
def build_from_hash(attributes)
|
145
146
|
return nil unless attributes.is_a?(Hash)
|
146
147
|
attributes = attributes.transform_keys(&:to_sym)
|
147
|
-
|
148
|
-
|
149
|
-
|
148
|
+
transformed_hash = {}
|
149
|
+
openapi_types.each_pair do |key, type|
|
150
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
151
|
+
transformed_hash["#{key}"] = nil
|
150
152
|
elsif type =~ /\AArray<(.*)>/i
|
151
153
|
# check to ensure the input is an array given that the attribute
|
152
154
|
# is documented as an array but the input is not
|
153
|
-
if attributes[
|
154
|
-
|
155
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
156
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
155
157
|
end
|
156
|
-
elsif !attributes[
|
157
|
-
|
158
|
+
elsif !attributes[attribute_map[key]].nil?
|
159
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
158
160
|
end
|
159
161
|
end
|
160
|
-
|
161
|
-
self
|
162
|
+
new(transformed_hash)
|
162
163
|
end
|
163
164
|
|
164
165
|
# Deserializes the data based on type
|
165
166
|
# @param string type Data type
|
166
167
|
# @param string value Value to be deserialized
|
167
168
|
# @return [Object] Deserialized data
|
168
|
-
def _deserialize(type, value)
|
169
|
+
def self._deserialize(type, value)
|
169
170
|
case type.to_sym
|
170
171
|
when :Time
|
171
172
|
Time.parse(value)
|
@@ -200,7 +201,7 @@ module SwaggyJenkinsClient
|
|
200
201
|
else # model
|
201
202
|
# models (e.g. Pet) or oneOf
|
202
203
|
klass = SwaggyJenkinsClient.const_get(type)
|
203
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
204
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
204
205
|
end
|
205
206
|
end
|
206
207
|
|
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
4
|
#Jenkins API clients generated from Swagger / Open API specification
|
5
5
|
|
6
|
-
The version of the OpenAPI document:
|
7
|
-
Contact: blah@cliffano.com
|
6
|
+
The version of the OpenAPI document: 3.1.0
|
7
|
+
Contact: blah+oapicf@cliffano.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.12.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -24,9 +24,14 @@ module SwaggyJenkinsClient
|
|
24
24
|
}
|
25
25
|
end
|
26
26
|
|
27
|
+
# Returns attribute mapping this model knows about
|
28
|
+
def self.acceptable_attribute_map
|
29
|
+
attribute_map
|
30
|
+
end
|
31
|
+
|
27
32
|
# Returns all the JSON keys this model knows about
|
28
33
|
def self.acceptable_attributes
|
29
|
-
|
34
|
+
acceptable_attribute_map.values
|
30
35
|
end
|
31
36
|
|
32
37
|
# Attribute type mapping.
|
@@ -50,9 +55,10 @@ module SwaggyJenkinsClient
|
|
50
55
|
end
|
51
56
|
|
52
57
|
# check to see if the attribute exists and convert string to symbol for hash key
|
58
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
53
59
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
54
|
-
if (!
|
55
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `SwaggyJenkinsClient::UnlabeledLoadStatistics`. Please check the name to make sure it's valid. List of attributes: " +
|
60
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SwaggyJenkinsClient::UnlabeledLoadStatistics`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
56
62
|
end
|
57
63
|
h[k.to_sym] = v
|
58
64
|
}
|
@@ -65,6 +71,7 @@ module SwaggyJenkinsClient
|
|
65
71
|
# Show invalid properties with the reasons. Usually used together with valid?
|
66
72
|
# @return Array for valid properties with the reasons
|
67
73
|
def list_invalid_properties
|
74
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
68
75
|
invalid_properties = Array.new
|
69
76
|
invalid_properties
|
70
77
|
end
|
@@ -72,6 +79,7 @@ module SwaggyJenkinsClient
|
|
72
79
|
# Check to see if the all the properties in the model are valid
|
73
80
|
# @return true if the model is valid
|
74
81
|
def valid?
|
82
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
75
83
|
true
|
76
84
|
end
|
77
85
|
|
@@ -99,37 +107,30 @@ module SwaggyJenkinsClient
|
|
99
107
|
# @param [Hash] attributes Model attributes in the form of hash
|
100
108
|
# @return [Object] Returns the model itself
|
101
109
|
def self.build_from_hash(attributes)
|
102
|
-
new.build_from_hash(attributes)
|
103
|
-
end
|
104
|
-
|
105
|
-
# Builds the object from hash
|
106
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
107
|
-
# @return [Object] Returns the model itself
|
108
|
-
def build_from_hash(attributes)
|
109
110
|
return nil unless attributes.is_a?(Hash)
|
110
111
|
attributes = attributes.transform_keys(&:to_sym)
|
111
|
-
|
112
|
-
|
113
|
-
|
112
|
+
transformed_hash = {}
|
113
|
+
openapi_types.each_pair do |key, type|
|
114
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
115
|
+
transformed_hash["#{key}"] = nil
|
114
116
|
elsif type =~ /\AArray<(.*)>/i
|
115
117
|
# check to ensure the input is an array given that the attribute
|
116
118
|
# is documented as an array but the input is not
|
117
|
-
if attributes[
|
118
|
-
|
119
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
120
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
119
121
|
end
|
120
|
-
elsif !attributes[
|
121
|
-
|
122
|
+
elsif !attributes[attribute_map[key]].nil?
|
123
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
122
124
|
end
|
123
125
|
end
|
124
|
-
|
125
|
-
self
|
126
|
+
new(transformed_hash)
|
126
127
|
end
|
127
128
|
|
128
129
|
# Deserializes the data based on type
|
129
130
|
# @param string type Data type
|
130
131
|
# @param string value Value to be deserialized
|
131
132
|
# @return [Object] Deserialized data
|
132
|
-
def _deserialize(type, value)
|
133
|
+
def self._deserialize(type, value)
|
133
134
|
case type.to_sym
|
134
135
|
when :Time
|
135
136
|
Time.parse(value)
|
@@ -164,7 +165,7 @@ module SwaggyJenkinsClient
|
|
164
165
|
else # model
|
165
166
|
# models (e.g. Pet) or oneOf
|
166
167
|
klass = SwaggyJenkinsClient.const_get(type)
|
167
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
168
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
168
169
|
end
|
169
170
|
end
|
170
171
|
|