budgea_client 2.0.1 → 2.0.2

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: a1ec043e81509da439e460c10aca0b9e6894b4e7b63816e59386e7fceff98b24
4
- data.tar.gz: 14fb09eec18ff1efb4c7485fd7e5f8df4742a3078947a4deab0aa178f4329b49
3
+ metadata.gz: 8cd8784e37d32038438d73ad2131f6de46de51e7051e5057c0ed5ec59e97091b
4
+ data.tar.gz: c77c4ea49e33e73fa437629b80ec2afcccaf134462fe8f49689f13406d21f27e
5
5
  SHA512:
6
- metadata.gz: 616b0bb0531e13056ea3371acddfc10fdaa291b5ffec7d4d35007b1fbbf63e41689efe0abae6650e33473f2c067c9757c6d79c3998721ab1b6103fa66a4b9857
7
- data.tar.gz: d22ff9b43b4ce1aff5d2f0863c6422e8edcac127a6798d60ee6d3e9675719622e32cbb892a40379d15456251e07520587f45783af499c4ec342223a896f370f8
6
+ metadata.gz: 12bedcb431c5c588485c6da04124730498830e38ecbe9a0f3e6e64731d1066759eb22572d72cb468d1d53c57e1c950efceac5c75c5d2a0ae088c819d907c6c3e
7
+ data.tar.gz: dc4cbe6abed193e9a2a9a4828283a2d828e84f7096edd7d037b1215addb0fb23bfe0c675a92f049cfdbd5a1d7442746e16460a036de9577e2a9c2ddb195bcae1
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- budgea_client (2.0.1)
4
+ budgea_client (2.0.2)
5
5
  json (~> 2.1, >= 2.1.0)
6
6
  typhoeus (~> 1.0, >= 1.0.1)
7
7
 
data/Rakefile CHANGED
@@ -1,9 +1,13 @@
1
1
  begin
2
2
  require 'rspec/core/rake_task'
3
- require 'bundler/gem_tasks'
4
3
 
5
4
  RSpec::Core::RakeTask.new(:spec)
6
5
  task default: :spec
7
6
  rescue LoadError
8
7
  # no rspec available
9
8
  end
9
+ begin
10
+ require 'bundler/gem_tasks'
11
+ rescue LoadError
12
+ # no rspec available
13
+ end
@@ -0,0 +1,10 @@
1
+ # BudgeaClient::AuthProvider
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **id** | **Integer** | |
7
+ **name** | **String** | Name to differentiate the authentication type |
8
+ **type** | **String** | Authentication type to use when pushing the webhook |
9
+
10
+
@@ -0,0 +1,13 @@
1
+ # BudgeaClient::ConfigLog
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **id** | **Integer** | |
7
+ **key** | **String** | |
8
+ **previous_value** | **String** | | [optional]
9
+ **new_value** | **String** | | [optional]
10
+ **type** | **String** | Action done on the config: add, update or delete |
11
+ **timestamp** | **DateTime** | Timestamp of when the configuration key was changed |
12
+
13
+
@@ -0,0 +1,62 @@
1
+ # BudgeaClient::HUBApi
2
+
3
+ All URIs are relative to *https://demo.biapi.pro/2.0/*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**webhooks_id_webhook_add_to_data_post**](HUBApi.md#webhooks_id_webhook_add_to_data_post) | **POST** /webhooks/{id_webhook}/add_to_data | Setup a field to store in user config when calling the endpoint
8
+
9
+
10
+ # **webhooks_id_webhook_add_to_data_post**
11
+ > webhooks_id_webhook_add_to_data_post(id_webhook)
12
+
13
+ Setup a field to store in user config when calling the endpoint
14
+
15
+ For each parameter, a value will be added in the webhook data. Use the key to set the name of the field. The values that can be added are to be found in the user configuration.<br><br>
16
+
17
+ ### Example
18
+ ```ruby
19
+ # load the gem
20
+ require 'budgea_client'
21
+ # setup authorization
22
+ BudgeaClient.configure do |config|
23
+ # Configure API key authorization: api_key
24
+ config.api_key['Authorization'] = 'YOUR API KEY'
25
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
26
+ #config.api_key_prefix['Authorization'] = 'Bearer'
27
+ end
28
+
29
+ api_instance = BudgeaClient::HUBApi.new
30
+
31
+ id_webhook = 56 # Integer |
32
+
33
+
34
+ begin
35
+ #Setup a field to store in user config when calling the endpoint
36
+ api_instance.webhooks_id_webhook_add_to_data_post(id_webhook)
37
+ rescue BudgeaClient::ApiError => e
38
+ puts "Exception when calling HUBApi->webhooks_id_webhook_add_to_data_post: #{e}"
39
+ end
40
+ ```
41
+
42
+ ### Parameters
43
+
44
+ Name | Type | Description | Notes
45
+ ------------- | ------------- | ------------- | -------------
46
+ **id_webhook** | **Integer**| |
47
+
48
+ ### Return type
49
+
50
+ nil (empty response body)
51
+
52
+ ### Authorization
53
+
54
+ [api_key](../README.md#api_key)
55
+
56
+ ### HTTP request headers
57
+
58
+ - **Content-Type**: application/json, multipart/form-data
59
+ - **Accept**: application/json
60
+
61
+
62
+
@@ -0,0 +1,8 @@
1
+ # BudgeaClient::InlineResponse20037
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **authproviders** | [**Array&lt;AuthProvider&gt;**](AuthProvider.md) | |
7
+
8
+
@@ -0,0 +1,8 @@
1
+ # BudgeaClient::InlineResponse20038
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **webhooklogs** | [**Array&lt;WebhookLog&gt;**](WebhookLog.md) | |
7
+
8
+
@@ -0,0 +1,12 @@
1
+ # BudgeaClient::Keyword
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **id** | **Integer** | |
7
+ **keyword** | **String** | |
8
+ **id_category** | **Integer** | |
9
+ **priority** | **Integer** | |
10
+ **income** | **BOOLEAN** | |
11
+
12
+
@@ -0,0 +1,16 @@
1
+ # BudgeaClient::WebhookData
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **id** | **Integer** | ID of the webhook data |
7
+ **id_webhook** | **Integer** | ID of the webhook |
8
+ **id_service** | **Integer** | ID of the recipient service | [optional]
9
+ **id_user** | **Integer** | ID of the emitter user |
10
+ **id_resource** | **Integer** | a changing ID used to filter webhookdata depending on the event triggered | [optional]
11
+ **data** | **String** | Data emitted | [optional]
12
+ **mimetype** | **String** | Mimetype of the data | [optional]
13
+ **created** | **DateTime** | Timestamp when the hook data was generated |
14
+ **success** | **DateTime** | Timestamp when the hook has been successfully called | [optional]
15
+
16
+
@@ -0,0 +1,76 @@
1
+ =begin
2
+ #Budgea API Documentation
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 2.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.1
10
+
11
+ =end
12
+
13
+ require 'uri'
14
+
15
+ module BudgeaClient
16
+ class HUBApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Setup a field to store in user config when calling the endpoint
23
+ # For each parameter, a value will be added in the webhook data. Use the key to set the name of the field. The values that can be added are to be found in the user configuration.<br><br>
24
+ # @param id_webhook
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [nil]
27
+ def webhooks_id_webhook_add_to_data_post(id_webhook, opts = {})
28
+ webhooks_id_webhook_add_to_data_post_with_http_info(id_webhook, opts)
29
+ nil
30
+ end
31
+
32
+ # Setup a field to store in user config when calling the endpoint
33
+ # For each parameter, a value will be added in the webhook data. Use the key to set the name of the field. The values that can be added are to be found in the user configuration.&lt;br&gt;&lt;br&gt;
34
+ # @param id_webhook
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
37
+ def webhooks_id_webhook_add_to_data_post_with_http_info(id_webhook, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: HUBApi.webhooks_id_webhook_add_to_data_post ...'
40
+ end
41
+ # verify the required parameter 'id_webhook' is set
42
+ if @api_client.config.client_side_validation && id_webhook.nil?
43
+ fail ArgumentError, "Missing the required parameter 'id_webhook' when calling HUBApi.webhooks_id_webhook_add_to_data_post"
44
+ end
45
+ # resource path
46
+ local_var_path = '/webhooks/{id_webhook}/add_to_data'.sub('{' + 'id_webhook' + '}', id_webhook.to_s)
47
+
48
+ # query parameters
49
+ query_params = {}
50
+
51
+ # header parameters
52
+ header_params = {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
55
+ # HTTP header 'Content-Type'
56
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'multipart/form-data'])
57
+
58
+ # form parameters
59
+ form_params = {}
60
+
61
+ # http body (model)
62
+ post_body = nil
63
+ auth_names = ['api_key']
64
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
65
+ :header_params => header_params,
66
+ :query_params => query_params,
67
+ :form_params => form_params,
68
+ :body => post_body,
69
+ :auth_names => auth_names)
70
+ if @api_client.config.debugging
71
+ @api_client.config.logger.debug "API called: HUBApi#webhooks_id_webhook_add_to_data_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
72
+ end
73
+ return data, status_code, headers
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,218 @@
1
+ =begin
2
+ #Budgea API Documentation
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 2.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module BudgeaClient
16
+ class AuthProvider
17
+ attr_accessor :id
18
+
19
+ # Name to differentiate the authentication type
20
+ attr_accessor :name
21
+
22
+ # Authentication type to use when pushing the webhook
23
+ attr_accessor :type
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'id' => :'id',
29
+ :'name' => :'name',
30
+ :'type' => :'type'
31
+ }
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.swagger_types
36
+ {
37
+ :'id' => :'Integer',
38
+ :'name' => :'String',
39
+ :'type' => :'String'
40
+ }
41
+ end
42
+
43
+ # Initializes the object
44
+ # @param [Hash] attributes Model attributes in the form of hash
45
+ def initialize(attributes = {})
46
+ return unless attributes.is_a?(Hash)
47
+
48
+ # convert string to symbol for hash key
49
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
50
+
51
+ if attributes.has_key?(:'id')
52
+ self.id = attributes[:'id']
53
+ end
54
+
55
+ if attributes.has_key?(:'name')
56
+ self.name = attributes[:'name']
57
+ end
58
+
59
+ if attributes.has_key?(:'type')
60
+ self.type = attributes[:'type']
61
+ end
62
+ end
63
+
64
+ # Show invalid properties with the reasons. Usually used together with valid?
65
+ # @return Array for valid properties with the reasons
66
+ def list_invalid_properties
67
+ invalid_properties = Array.new
68
+ if @id.nil?
69
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
70
+ end
71
+
72
+ if @name.nil?
73
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
74
+ end
75
+
76
+ if @type.nil?
77
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
78
+ end
79
+
80
+ invalid_properties
81
+ end
82
+
83
+ # Check to see if the all the properties in the model are valid
84
+ # @return true if the model is valid
85
+ def valid?
86
+ return false if @id.nil?
87
+ return false if @name.nil?
88
+ return false if @type.nil?
89
+ true
90
+ end
91
+
92
+ # Checks equality by comparing each attribute.
93
+ # @param [Object] Object to be compared
94
+ def ==(o)
95
+ return true if self.equal?(o)
96
+ self.class == o.class &&
97
+ id == o.id &&
98
+ name == o.name &&
99
+ type == o.type
100
+ end
101
+
102
+ # @see the `==` method
103
+ # @param [Object] Object to be compared
104
+ def eql?(o)
105
+ self == o
106
+ end
107
+
108
+ # Calculates hash code according to all attributes.
109
+ # @return [Fixnum] Hash code
110
+ def hash
111
+ [id, name, type].hash
112
+ end
113
+
114
+ # Builds the object from hash
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ # @return [Object] Returns the model itself
117
+ def build_from_hash(attributes)
118
+ return nil unless attributes.is_a?(Hash)
119
+ self.class.swagger_types.each_pair do |key, type|
120
+ if type =~ /\AArray<(.*)>/i
121
+ # check to ensure the input is an array given that the the attribute
122
+ # is documented as an array but the input is not
123
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
124
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
125
+ end
126
+ elsif !attributes[self.class.attribute_map[key]].nil?
127
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
128
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
129
+ end
130
+
131
+ self
132
+ end
133
+
134
+ # Deserializes the data based on type
135
+ # @param string type Data type
136
+ # @param string value Value to be deserialized
137
+ # @return [Object] Deserialized data
138
+ def _deserialize(type, value)
139
+ case type.to_sym
140
+ when :DateTime
141
+ DateTime.parse(value)
142
+ when :Date
143
+ Date.parse(value)
144
+ when :String
145
+ value.to_s
146
+ when :Integer
147
+ value.to_i
148
+ when :Float
149
+ value.to_f
150
+ when :BOOLEAN
151
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
152
+ true
153
+ else
154
+ false
155
+ end
156
+ when :Object
157
+ # generic object (usually a Hash), return directly
158
+ value
159
+ when /\AArray<(?<inner_type>.+)>\z/
160
+ inner_type = Regexp.last_match[:inner_type]
161
+ value.map { |v| _deserialize(inner_type, v) }
162
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
163
+ k_type = Regexp.last_match[:k_type]
164
+ v_type = Regexp.last_match[:v_type]
165
+ {}.tap do |hash|
166
+ value.each do |k, v|
167
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
168
+ end
169
+ end
170
+ else # model
171
+ temp_model = BudgeaClient.const_get(type).new
172
+ temp_model.build_from_hash(value)
173
+ end
174
+ end
175
+
176
+ # Returns the string representation of the object
177
+ # @return [String] String presentation of the object
178
+ def to_s
179
+ to_hash.to_s
180
+ end
181
+
182
+ # to_body is an alias to to_hash (backward compatibility)
183
+ # @return [Hash] Returns the object in the form of hash
184
+ def to_body
185
+ to_hash
186
+ end
187
+
188
+ # Returns the object in the form of hash
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_hash
191
+ hash = {}
192
+ self.class.attribute_map.each_pair do |attr, param|
193
+ value = self.send(attr)
194
+ next if value.nil?
195
+ hash[param] = _to_hash(value)
196
+ end
197
+ hash
198
+ end
199
+
200
+ # Outputs non-array value in the form of hash
201
+ # For object, use to_hash. Otherwise, just return the value
202
+ # @param [Object] value Any valid value
203
+ # @return [Hash] Returns the value in the form of hash
204
+ def _to_hash(value)
205
+ if value.is_a?(Array)
206
+ value.compact.map { |v| _to_hash(v) }
207
+ elsif value.is_a?(Hash)
208
+ {}.tap do |hash|
209
+ value.each { |k, v| hash[k] = _to_hash(v) }
210
+ end
211
+ elsif value.respond_to? :to_hash
212
+ value.to_hash
213
+ else
214
+ value
215
+ end
216
+ end
217
+ end
218
+ end