wcc_ministries_client 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/Gemfile.lock +68 -0
  4. data/README.md +108 -0
  5. data/Rakefile +10 -0
  6. data/bin/gen +32 -0
  7. data/docs/Asset.md +22 -0
  8. data/docs/AssetFile.md +24 -0
  9. data/docs/AssetFileDetails.md +20 -0
  10. data/docs/AssetFileDetailsImage.md +20 -0
  11. data/docs/CachingMeta.md +20 -0
  12. data/docs/DeletedMinistry.md +20 -0
  13. data/docs/InlineResponse200.md +24 -0
  14. data/docs/InlineResponse2001.md +20 -0
  15. data/docs/InlineResponse200Links.md +26 -0
  16. data/docs/InlineResponse200Meta.md +22 -0
  17. data/docs/Ministry.md +28 -0
  18. data/docs/MinistryApi.md +141 -0
  19. data/docs/MinistryAttributes.md +24 -0
  20. data/docs/MinistryLinks.md +18 -0
  21. data/docs/MinistryRelationships.md +18 -0
  22. data/docs/Page.md +26 -0
  23. data/docs/PageAttributes.md +24 -0
  24. data/docs/PageLinks.md +18 -0
  25. data/docs/PageRelationship.md +18 -0
  26. data/docs/PageRelationshipData.md +20 -0
  27. data/git_push.sh +58 -0
  28. data/lib/wcc_ministries_client/api/ministry_api.rb +149 -0
  29. data/lib/wcc_ministries_client/api_client.rb +389 -0
  30. data/lib/wcc_ministries_client/api_error.rb +57 -0
  31. data/lib/wcc_ministries_client/configuration.rb +270 -0
  32. data/lib/wcc_ministries_client/models/asset.rb +244 -0
  33. data/lib/wcc_ministries_client/models/asset_file.rb +249 -0
  34. data/lib/wcc_ministries_client/models/asset_file_details.rb +226 -0
  35. data/lib/wcc_ministries_client/models/asset_file_details_image.rb +237 -0
  36. data/lib/wcc_ministries_client/models/caching_meta.rb +237 -0
  37. data/lib/wcc_ministries_client/models/deleted_ministry.rb +271 -0
  38. data/lib/wcc_ministries_client/models/inline_response200.rb +262 -0
  39. data/lib/wcc_ministries_client/models/inline_response2001.rb +232 -0
  40. data/lib/wcc_ministries_client/models/inline_response200_links.rb +272 -0
  41. data/lib/wcc_ministries_client/models/inline_response200_meta.rb +252 -0
  42. data/lib/wcc_ministries_client/models/ministry.rb +327 -0
  43. data/lib/wcc_ministries_client/models/ministry_attributes.rb +258 -0
  44. data/lib/wcc_ministries_client/models/ministry_links.rb +222 -0
  45. data/lib/wcc_ministries_client/models/ministry_relationships.rb +216 -0
  46. data/lib/wcc_ministries_client/models/page.rb +313 -0
  47. data/lib/wcc_ministries_client/models/page_attributes.rb +263 -0
  48. data/lib/wcc_ministries_client/models/page_links.rb +222 -0
  49. data/lib/wcc_ministries_client/models/page_relationship.rb +221 -0
  50. data/lib/wcc_ministries_client/models/page_relationship_data.rb +269 -0
  51. data/lib/wcc_ministries_client/version.rb +19 -0
  52. data/lib/wcc_ministries_client.rb +59 -0
  53. data/openapitools.json +23 -0
  54. data/pkg/wcc_ministries_client-1.0.0.gem +0 -0
  55. data/spec/api/ministry_api_spec.rb +60 -0
  56. data/spec/api_client_spec.rb +226 -0
  57. data/spec/configuration_spec.rb +42 -0
  58. data/spec/models/asset_file_details_image_spec.rb +40 -0
  59. data/spec/models/asset_file_details_spec.rb +40 -0
  60. data/spec/models/asset_file_spec.rb +52 -0
  61. data/spec/models/asset_spec.rb +46 -0
  62. data/spec/models/caching_meta_spec.rb +40 -0
  63. data/spec/models/deleted_ministry_spec.rb +44 -0
  64. data/spec/models/inline_response2001_spec.rb +40 -0
  65. data/spec/models/inline_response200_links_spec.rb +58 -0
  66. data/spec/models/inline_response200_meta_spec.rb +46 -0
  67. data/spec/models/inline_response200_spec.rb +52 -0
  68. data/spec/models/ministry_attributes_spec.rb +52 -0
  69. data/spec/models/ministry_links_spec.rb +34 -0
  70. data/spec/models/ministry_relationships_spec.rb +34 -0
  71. data/spec/models/ministry_spec.rb +68 -0
  72. data/spec/models/page_attributes_spec.rb +52 -0
  73. data/spec/models/page_links_spec.rb +34 -0
  74. data/spec/models/page_relationship_data_spec.rb +44 -0
  75. data/spec/models/page_relationship_spec.rb +34 -0
  76. data/spec/models/page_spec.rb +62 -0
  77. data/spec/spec_helper.rb +111 -0
  78. data/swagger.json +425 -0
  79. data/wcc_ministries_client.gemspec +38 -0
  80. metadata +185 -0
@@ -0,0 +1,237 @@
1
+ =begin
2
+ #WCC Ministries API
3
+
4
+ #WCC Ministries API
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: dev@watermark.org
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: unset
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module WCC::Ministries::Client
17
+ class CachingMeta
18
+ # The strong ETag is a digest of this resource. You can use the 'If-None-Match' HTTP header to do a conditional GET to the 'self' link of this person. Note the explicit quotation marks in the string - these must be included in the HTTP header.
19
+ attr_accessor :e_tag
20
+
21
+ # A timestamp when this resource was last modified. You can use the 'If-Modified-Since' HTTP header to do a conditional GET to the 'self' link of this person.
22
+ attr_accessor :last_modified
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'e_tag' => :'ETag',
28
+ :'last_modified' => :'Last-Modified'
29
+ }
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'e_tag' => :'String',
41
+ :'last_modified' => :'String'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `WCC::Ministries::Client::CachingMeta` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!self.class.attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `WCC::Ministries::Client::CachingMeta`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'e_tag')
67
+ self.e_tag = attributes[:'e_tag']
68
+ end
69
+
70
+ if attributes.key?(:'last_modified')
71
+ self.last_modified = attributes[:'last_modified']
72
+ end
73
+ end
74
+
75
+ # Show invalid properties with the reasons. Usually used together with valid?
76
+ # @return Array for valid properties with the reasons
77
+ def list_invalid_properties
78
+ invalid_properties = Array.new
79
+ if @e_tag.nil?
80
+ invalid_properties.push('invalid value for "e_tag", e_tag cannot be nil.')
81
+ end
82
+
83
+ if @last_modified.nil?
84
+ invalid_properties.push('invalid value for "last_modified", last_modified cannot be nil.')
85
+ end
86
+
87
+ invalid_properties
88
+ end
89
+
90
+ # Check to see if the all the properties in the model are valid
91
+ # @return true if the model is valid
92
+ def valid?
93
+ return false if @e_tag.nil?
94
+ return false if @last_modified.nil?
95
+ true
96
+ end
97
+
98
+ # Checks equality by comparing each attribute.
99
+ # @param [Object] Object to be compared
100
+ def ==(o)
101
+ return true if self.equal?(o)
102
+ self.class == o.class &&
103
+ e_tag == o.e_tag &&
104
+ last_modified == o.last_modified
105
+ end
106
+
107
+ # @see the `==` method
108
+ # @param [Object] Object to be compared
109
+ def eql?(o)
110
+ self == o
111
+ end
112
+
113
+ # Calculates hash code according to all attributes.
114
+ # @return [Integer] Hash code
115
+ def hash
116
+ [e_tag, last_modified].hash
117
+ end
118
+
119
+ # Builds the object from hash
120
+ # @param [Hash] attributes Model attributes in the form of hash
121
+ # @return [Object] Returns the model itself
122
+ def self.build_from_hash(attributes)
123
+ new.build_from_hash(attributes)
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def build_from_hash(attributes)
130
+ return nil unless attributes.is_a?(Hash)
131
+ self.class.openapi_types.each_pair do |key, type|
132
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
133
+ self.send("#{key}=", nil)
134
+ elsif type =~ /\AArray<(.*)>/i
135
+ # check to ensure the input is an array given that the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
138
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
139
+ end
140
+ elsif !attributes[self.class.attribute_map[key]].nil?
141
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
142
+ end
143
+ end
144
+
145
+ self
146
+ end
147
+
148
+ # Deserializes the data based on type
149
+ # @param string type Data type
150
+ # @param string value Value to be deserialized
151
+ # @return [Object] Deserialized data
152
+ def _deserialize(type, value)
153
+ case type.to_sym
154
+ when :Time
155
+ Time.parse(value)
156
+ when :Date
157
+ Date.parse(value)
158
+ when :String
159
+ value.to_s
160
+ when :Integer
161
+ value.to_i
162
+ when :Float
163
+ value.to_f
164
+ when :Boolean
165
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
166
+ true
167
+ else
168
+ false
169
+ end
170
+ when :Object
171
+ # generic object (usually a Hash), return directly
172
+ value
173
+ when /\AArray<(?<inner_type>.+)>\z/
174
+ inner_type = Regexp.last_match[:inner_type]
175
+ value.map { |v| _deserialize(inner_type, v) }
176
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
177
+ k_type = Regexp.last_match[:k_type]
178
+ v_type = Regexp.last_match[:v_type]
179
+ {}.tap do |hash|
180
+ value.each do |k, v|
181
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
182
+ end
183
+ end
184
+ else # model
185
+ # models (e.g. Pet) or oneOf
186
+ klass = WCC::Ministries::Client.const_get(type)
187
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
188
+ end
189
+ end
190
+
191
+ # Returns the string representation of the object
192
+ # @return [String] String presentation of the object
193
+ def to_s
194
+ to_hash.to_s
195
+ end
196
+
197
+ # to_body is an alias to to_hash (backward compatibility)
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_body
200
+ to_hash
201
+ end
202
+
203
+ # Returns the object in the form of hash
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_hash
206
+ hash = {}
207
+ self.class.attribute_map.each_pair do |attr, param|
208
+ value = self.send(attr)
209
+ if value.nil?
210
+ is_nullable = self.class.openapi_nullable.include?(attr)
211
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
212
+ end
213
+
214
+ hash[param] = _to_hash(value)
215
+ end
216
+ hash
217
+ end
218
+
219
+ # Outputs non-array value in the form of hash
220
+ # For object, use to_hash. Otherwise, just return the value
221
+ # @param [Object] value Any valid value
222
+ # @return [Hash] Returns the value in the form of hash
223
+ def _to_hash(value)
224
+ if value.is_a?(Array)
225
+ value.compact.map { |v| _to_hash(v) }
226
+ elsif value.is_a?(Hash)
227
+ {}.tap do |hash|
228
+ value.each { |k, v| hash[k] = _to_hash(v) }
229
+ end
230
+ elsif value.respond_to? :to_hash
231
+ value.to_hash
232
+ else
233
+ value
234
+ end
235
+ end
236
+ end
237
+ end
@@ -0,0 +1,271 @@
1
+ =begin
2
+ #WCC Ministries API
3
+
4
+ #WCC Ministries API
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: dev@watermark.org
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: unset
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module WCC::Ministries::Client
17
+ class DeletedMinistry
18
+ # The unique ID of the Ministry.
19
+ attr_accessor :id
20
+
21
+ # Always the literal string 'deletedMinistry'. This is used as a discriminator.
22
+ attr_accessor :type
23
+
24
+ class EnumAttributeValidator
25
+ attr_reader :datatype
26
+ attr_reader :allowable_values
27
+
28
+ def initialize(datatype, allowable_values)
29
+ @allowable_values = allowable_values.map do |value|
30
+ case datatype.to_s
31
+ when /Integer/i
32
+ value.to_i
33
+ when /Float/i
34
+ value.to_f
35
+ else
36
+ value
37
+ end
38
+ end
39
+ end
40
+
41
+ def valid?(value)
42
+ !value || allowable_values.include?(value)
43
+ end
44
+ end
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'id' => :'id',
50
+ :'type' => :'type'
51
+ }
52
+ end
53
+
54
+ # Returns all the JSON keys this model knows about
55
+ def self.acceptable_attributes
56
+ attribute_map.values
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.openapi_types
61
+ {
62
+ :'id' => :'String',
63
+ :'type' => :'String'
64
+ }
65
+ end
66
+
67
+ # List of attributes with nullable: true
68
+ def self.openapi_nullable
69
+ Set.new([
70
+ ])
71
+ end
72
+
73
+ # Initializes the object
74
+ # @param [Hash] attributes Model attributes in the form of hash
75
+ def initialize(attributes = {})
76
+ if (!attributes.is_a?(Hash))
77
+ fail ArgumentError, "The input argument (attributes) must be a hash in `WCC::Ministries::Client::DeletedMinistry` initialize method"
78
+ end
79
+
80
+ # check to see if the attribute exists and convert string to symbol for hash key
81
+ attributes = attributes.each_with_object({}) { |(k, v), h|
82
+ if (!self.class.attribute_map.key?(k.to_sym))
83
+ fail ArgumentError, "`#{k}` is not a valid attribute in `WCC::Ministries::Client::DeletedMinistry`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
84
+ end
85
+ h[k.to_sym] = v
86
+ }
87
+
88
+ if attributes.key?(:'id')
89
+ self.id = attributes[:'id']
90
+ end
91
+
92
+ if attributes.key?(:'type')
93
+ self.type = attributes[:'type']
94
+ end
95
+ end
96
+
97
+ # Show invalid properties with the reasons. Usually used together with valid?
98
+ # @return Array for valid properties with the reasons
99
+ def list_invalid_properties
100
+ invalid_properties = Array.new
101
+ if @id.nil?
102
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
103
+ end
104
+
105
+ if @type.nil?
106
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
107
+ end
108
+
109
+ invalid_properties
110
+ end
111
+
112
+ # Check to see if the all the properties in the model are valid
113
+ # @return true if the model is valid
114
+ def valid?
115
+ return false if @id.nil?
116
+ return false if @type.nil?
117
+ type_validator = EnumAttributeValidator.new('String', ["deletedMinistry"])
118
+ return false unless type_validator.valid?(@type)
119
+ true
120
+ end
121
+
122
+ # Custom attribute writer method checking allowed values (enum).
123
+ # @param [Object] type Object to be assigned
124
+ def type=(type)
125
+ validator = EnumAttributeValidator.new('String', ["deletedMinistry"])
126
+ unless validator.valid?(type)
127
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
128
+ end
129
+ @type = type
130
+ end
131
+
132
+ # Checks equality by comparing each attribute.
133
+ # @param [Object] Object to be compared
134
+ def ==(o)
135
+ return true if self.equal?(o)
136
+ self.class == o.class &&
137
+ id == o.id &&
138
+ type == o.type
139
+ end
140
+
141
+ # @see the `==` method
142
+ # @param [Object] Object to be compared
143
+ def eql?(o)
144
+ self == o
145
+ end
146
+
147
+ # Calculates hash code according to all attributes.
148
+ # @return [Integer] Hash code
149
+ def hash
150
+ [id, type].hash
151
+ end
152
+
153
+ # Builds the object from hash
154
+ # @param [Hash] attributes Model attributes in the form of hash
155
+ # @return [Object] Returns the model itself
156
+ def self.build_from_hash(attributes)
157
+ new.build_from_hash(attributes)
158
+ end
159
+
160
+ # Builds the object from hash
161
+ # @param [Hash] attributes Model attributes in the form of hash
162
+ # @return [Object] Returns the model itself
163
+ def build_from_hash(attributes)
164
+ return nil unless attributes.is_a?(Hash)
165
+ self.class.openapi_types.each_pair do |key, type|
166
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
167
+ self.send("#{key}=", nil)
168
+ elsif type =~ /\AArray<(.*)>/i
169
+ # check to ensure the input is an array given that the attribute
170
+ # is documented as an array but the input is not
171
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
172
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
173
+ end
174
+ elsif !attributes[self.class.attribute_map[key]].nil?
175
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
176
+ end
177
+ end
178
+
179
+ self
180
+ end
181
+
182
+ # Deserializes the data based on type
183
+ # @param string type Data type
184
+ # @param string value Value to be deserialized
185
+ # @return [Object] Deserialized data
186
+ def _deserialize(type, value)
187
+ case type.to_sym
188
+ when :Time
189
+ Time.parse(value)
190
+ when :Date
191
+ Date.parse(value)
192
+ when :String
193
+ value.to_s
194
+ when :Integer
195
+ value.to_i
196
+ when :Float
197
+ value.to_f
198
+ when :Boolean
199
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
200
+ true
201
+ else
202
+ false
203
+ end
204
+ when :Object
205
+ # generic object (usually a Hash), return directly
206
+ value
207
+ when /\AArray<(?<inner_type>.+)>\z/
208
+ inner_type = Regexp.last_match[:inner_type]
209
+ value.map { |v| _deserialize(inner_type, v) }
210
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
211
+ k_type = Regexp.last_match[:k_type]
212
+ v_type = Regexp.last_match[:v_type]
213
+ {}.tap do |hash|
214
+ value.each do |k, v|
215
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
216
+ end
217
+ end
218
+ else # model
219
+ # models (e.g. Pet) or oneOf
220
+ klass = WCC::Ministries::Client.const_get(type)
221
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
222
+ end
223
+ end
224
+
225
+ # Returns the string representation of the object
226
+ # @return [String] String presentation of the object
227
+ def to_s
228
+ to_hash.to_s
229
+ end
230
+
231
+ # to_body is an alias to to_hash (backward compatibility)
232
+ # @return [Hash] Returns the object in the form of hash
233
+ def to_body
234
+ to_hash
235
+ end
236
+
237
+ # Returns the object in the form of hash
238
+ # @return [Hash] Returns the object in the form of hash
239
+ def to_hash
240
+ hash = {}
241
+ self.class.attribute_map.each_pair do |attr, param|
242
+ value = self.send(attr)
243
+ if value.nil?
244
+ is_nullable = self.class.openapi_nullable.include?(attr)
245
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
246
+ end
247
+
248
+ hash[param] = _to_hash(value)
249
+ end
250
+ hash
251
+ end
252
+
253
+ # Outputs non-array value in the form of hash
254
+ # For object, use to_hash. Otherwise, just return the value
255
+ # @param [Object] value Any valid value
256
+ # @return [Hash] Returns the value in the form of hash
257
+ def _to_hash(value)
258
+ if value.is_a?(Array)
259
+ value.compact.map { |v| _to_hash(v) }
260
+ elsif value.is_a?(Hash)
261
+ {}.tap do |hash|
262
+ value.each { |k, v| hash[k] = _to_hash(v) }
263
+ end
264
+ elsif value.respond_to? :to_hash
265
+ value.to_hash
266
+ else
267
+ value
268
+ end
269
+ end
270
+ end
271
+ end