budgea_client 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5051409d228f8d245f773d7171b4e4904359e850004c066f76b7672e37f4f2c0
4
- data.tar.gz: 7151b2f797ffc867c16ea633e6771a932dc49155d9f611bf1aed9ec14b0a5b3f
3
+ metadata.gz: 81d177d1a029d720e1134d29831642ef39c4fb838517ea04e8303450d0129ac9
4
+ data.tar.gz: 1f1d39dfab83c3bc47cc59e1e0e45220cc8d4d1c2d8719219dd0bafb25f9a4a1
5
5
  SHA512:
6
- metadata.gz: 9358e14a639142338701ab89a7a76afc94748d30e6632e98f6f0713f68171c711621b8c20600b69339199672a3e43fe57a4773cebcc6e2eb1c54ad5302c04460
7
- data.tar.gz: 3d5d7d5467e96d5fc2ee7346d1b7478817562373a4c4c47d24d44d4e23f2960ba67408757a5b7f1d3312de37517bd3cc96c65ff9928a0c09175a2690bbb1264f
6
+ metadata.gz: 6d801c43f9b0ddcb2e429148fee714fbf5abc7d878ef43a8172e2d72ec6bdb6e3d961a22b0b63b41f971b5101c4f4b7c4c2b1bc3533b3a67586debcb25984e86
7
+ data.tar.gz: d09ca482c479d102c97a2d2e67cc7eb744a7b0a3585868f4d3d2e04434d811a73a54b366196080793a35b7d9fb9a20dcc15d0ffedbb873d90b126af3952f0601
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- budgea_client (1.2.0)
4
+ budgea_client (1.3.0)
5
5
  json (~> 2.1, >= 2.1.0)
6
6
  typhoeus (~> 1.0, >= 1.0.1)
7
7
 
@@ -19721,16 +19721,7 @@
19721
19721
  "values": {
19722
19722
  "type": "array",
19723
19723
  "items": {
19724
- "type": "object",
19725
- "required": ["value", "label"],
19726
- "properties": {
19727
- "value": {
19728
- "type": "string"
19729
- },
19730
- "label": {
19731
- "type": "string"
19732
- }
19733
- }
19724
+ "$ref": "#/definitions/FieldValue"
19734
19725
  }
19735
19726
  }
19736
19727
  },
@@ -19745,6 +19736,21 @@
19745
19736
  "value": ""
19746
19737
  }
19747
19738
  },
19739
+ "FieldValue": {
19740
+ "required": [
19741
+ "value",
19742
+ "label"
19743
+ ],
19744
+ "type": "object",
19745
+ "properties": {
19746
+ "value": {
19747
+ "type": "string"
19748
+ },
19749
+ "label": {
19750
+ "type": "string"
19751
+ }
19752
+ }
19753
+ },
19748
19754
  "ConnectorLogo": {
19749
19755
  "required": [
19750
19756
  "id",
@@ -35,30 +35,30 @@ module BudgeaClient
35
35
  # Attribute mapping from ruby-style variable name to JSON key.
36
36
  def self.attribute_map
37
37
  {
38
- :'id_bank' => :'id_bank',
39
- :'id' => :'id',
40
- :'name' => :'name',
41
- :'label' => :'label',
42
- :'regex' => :'regex',
43
- :'type' => :'type',
38
+ :'id_bank' => :'id_bank',
39
+ :'id' => :'id',
40
+ :'name' => :'name',
41
+ :'label' => :'label',
42
+ :'regex' => :'regex',
43
+ :'type' => :'type',
44
44
  :'ephemeral' => :'ephemeral',
45
- :'value' => :'value',
46
- :'values' => :'values'
45
+ :'value' => :'value',
46
+ :'values' => :'values'
47
47
  }
48
48
  end
49
49
 
50
50
  # Attribute type mapping.
51
51
  def self.swagger_types
52
52
  {
53
- :'id_bank' => :'Integer',
54
- :'id' => :'Integer',
55
- :'name' => :'String',
56
- :'label' => :'String',
57
- :'regex' => :'String',
58
- :'type' => :'String',
53
+ :'id_bank' => :'Integer',
54
+ :'id' => :'Integer',
55
+ :'name' => :'String',
56
+ :'label' => :'String',
57
+ :'regex' => :'String',
58
+ :'type' => :'String',
59
59
  :'ephemeral' => :'BOOLEAN',
60
- :'value' => :'String',
61
- :'values' => :'Array<FieldValues>'
60
+ :'value' => :'String',
61
+ :'values' => :'Array<FieldValue>'
62
62
  }
63
63
  end
64
64
 
@@ -68,7 +68,7 @@ module BudgeaClient
68
68
  return unless attributes.is_a?(Hash)
69
69
 
70
70
  # convert string to symbol for hash key
71
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
71
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
72
72
 
73
73
  if attributes.has_key?(:'id_bank')
74
74
  self.id_bank = attributes[:'id_bank']
@@ -185,7 +185,7 @@ module BudgeaClient
185
185
  # check to ensure the input is an array given that the the attribute
186
186
  # is documented as an array but the input is not
187
187
  if attributes[self.class.attribute_map[key]].is_a?(Array)
188
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
188
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
189
189
  end
190
190
  elsif !attributes[self.class.attribute_map[key]].nil?
191
191
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
@@ -267,7 +267,7 @@ module BudgeaClient
267
267
  # @return [Hash] Returns the value in the form of hash
268
268
  def _to_hash(value)
269
269
  if value.is_a?(Array)
270
- value.compact.map { |v| _to_hash(v) }
270
+ value.compact.map{ |v| _to_hash(v) }
271
271
  elsif value.is_a?(Hash)
272
272
  {}.tap do |hash|
273
273
  value.each { |k, v| hash[k] = _to_hash(v) }
@@ -0,0 +1,197 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'date'
4
+
5
+ module BudgeaClient
6
+
7
+ class FieldValue
8
+ attr_accessor :value
9
+
10
+ attr_accessor :label
11
+
12
+
13
+ # Attribute mapping from ruby-style variable name to JSON key.
14
+ def self.attribute_map
15
+ {
16
+ :'value' => :'value',
17
+ :'label' => :'label'
18
+ }
19
+ end
20
+
21
+ # Attribute type mapping.
22
+ def self.swagger_types
23
+ {
24
+ :'value' => :'String',
25
+ :'label' => :'String'
26
+ }
27
+ end
28
+
29
+ # Initializes the object
30
+ # @param [Hash] attributes Model attributes in the form of hash
31
+ def initialize(attributes = {})
32
+ return unless attributes.is_a?(Hash)
33
+
34
+ # convert string to symbol for hash key
35
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
36
+
37
+ if attributes.has_key?(:'value')
38
+ self.value = attributes[:'value']
39
+ end
40
+
41
+ if attributes.has_key?(:'label')
42
+ self.label = attributes[:'label']
43
+ end
44
+
45
+ end
46
+
47
+ # Show invalid properties with the reasons. Usually used together with valid?
48
+ # @return Array for valid properties with the reasons
49
+ def list_invalid_properties
50
+ invalid_properties = Array.new
51
+ if @value.nil?
52
+ invalid_properties.push("invalid value for 'value', value cannot be nil.")
53
+ end
54
+
55
+ if @label.nil?
56
+ invalid_properties.push("invalid value for 'label', label cannot be nil.")
57
+ end
58
+
59
+ return invalid_properties
60
+ end
61
+
62
+ # Check to see if the all the properties in the model are valid
63
+ # @return true if the model is valid
64
+ def valid?
65
+ return false if @value.nil?
66
+ return false if @label.nil?
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
+ value == o.value &&
76
+ label == o.label
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
+ [value, label].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 = BudgeaClient.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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BudgeaClient
4
- VERSION = '1.2.0'
4
+ VERSION = '1.3.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: budgea_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chaker Nakhli
@@ -329,6 +329,7 @@ files:
329
329
  - lib/budgea_client/models/document.rb
330
330
  - lib/budgea_client/models/document_type.rb
331
331
  - lib/budgea_client/models/field.rb
332
+ - lib/budgea_client/models/field_value.rb
332
333
  - lib/budgea_client/models/file.rb
333
334
  - lib/budgea_client/models/group.rb
334
335
  - lib/budgea_client/models/hash_table.rb
@@ -389,6 +390,7 @@ files:
389
390
  - lib/budgea_client/version.rb
390
391
  - pkg/budgea_client-1.0.0.gem
391
392
  - pkg/budgea_client-1.1.0.gem
393
+ - pkg/budgea_client-1.2.0.gem
392
394
  - spec/api/administration_api_spec.rb
393
395
  - spec/api/authentication_api_spec.rb
394
396
  - spec/api/banks_api_spec.rb