Class: BrevoRuby::ExternalFeedsApi
- Inherits:
-
Object
- Object
- BrevoRuby::ExternalFeedsApi
- Defined in:
- lib/brevo-ruby/api/external_feeds_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_external_feed(create_external_feed, opts = {}) ⇒ InlineResponse2014
Create an external feed This endpoint will create an external feed.
-
#create_external_feed_with_http_info(create_external_feed, opts = {}) ⇒ Array<(InlineResponse2014, Fixnum, Hash)>
Create an external feed This endpoint will create an external feed.
-
#delete_external_feed(uuid, opts = {}) ⇒ nil
Delete an external feed This endpoint will delete an external feed.
-
#delete_external_feed_with_http_info(uuid, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Delete an external feed This endpoint will delete an external feed.
-
#get_all_external_feeds(opts = {}) ⇒ GetAllExternalFeeds
Fetch all external feeds This endpoint can fetch all created external feeds.
-
#get_all_external_feeds_with_http_info(opts = {}) ⇒ Array<(GetAllExternalFeeds, Fixnum, Hash)>
Fetch all external feeds This endpoint can fetch all created external feeds.
-
#get_external_feed_by_uuid(uuid, opts = {}) ⇒ GetExternalFeedByUUID
Get an external feed by UUID This endpoint will update an external feed.
-
#get_external_feed_by_uuid_with_http_info(uuid, opts = {}) ⇒ Array<(GetExternalFeedByUUID, Fixnum, Hash)>
Get an external feed by UUID This endpoint will update an external feed.
-
#initialize(api_client = ApiClient.default) ⇒ ExternalFeedsApi
constructor
A new instance of ExternalFeedsApi.
-
#setUserAgent(user_agent) ⇒ Object
Set custom user_agent if explicitly passed in api default will still remain Swagger-Codegen/#VERSION/ruby.
-
#update_external_feed(uuid, update_external_feed, opts = {}) ⇒ nil
Update an external feed This endpoint will update an external feed.
-
#update_external_feed_with_http_info(uuid, update_external_feed, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Update an external feed This endpoint will update an external feed.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ ExternalFeedsApi
Returns a new instance of ExternalFeedsApi.
19 20 21 |
# File 'lib/brevo-ruby/api/external_feeds_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/brevo-ruby/api/external_feeds_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#create_external_feed(create_external_feed, opts = {}) ⇒ InlineResponse2014
Create an external feed This endpoint will create an external feed.
37 38 39 40 |
# File 'lib/brevo-ruby/api/external_feeds_api.rb', line 37 def create_external_feed(create_external_feed, opts = {}) data, _status_code, _headers = create_external_feed_with_http_info(create_external_feed, opts) data end |
#create_external_feed_with_http_info(create_external_feed, opts = {}) ⇒ Array<(InlineResponse2014, Fixnum, Hash)>
Create an external feed This endpoint will create an external feed.
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/brevo-ruby/api/external_feeds_api.rb', line 47 def create_external_feed_with_http_info(create_external_feed, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ExternalFeedsApi.create_external_feed ...' end # verify the required parameter 'create_external_feed' is set if @api_client.config.client_side_validation && create_external_feed.nil? fail ArgumentError, "Missing the required parameter 'create_external_feed' when calling ExternalFeedsApi.create_external_feed" end # resource path local_var_path = '/feeds' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(create_external_feed) auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'InlineResponse2014') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalFeedsApi#create_external_feed\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_external_feed(uuid, opts = {}) ⇒ nil
Delete an external feed This endpoint will delete an external feed.
91 92 93 94 |
# File 'lib/brevo-ruby/api/external_feeds_api.rb', line 91 def delete_external_feed(uuid, opts = {}) delete_external_feed_with_http_info(uuid, opts) nil end |
#delete_external_feed_with_http_info(uuid, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Delete an external feed This endpoint will delete an external feed.
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/brevo-ruby/api/external_feeds_api.rb', line 101 def delete_external_feed_with_http_info(uuid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ExternalFeedsApi.delete_external_feed ...' end # verify the required parameter 'uuid' is set if @api_client.config.client_side_validation && uuid.nil? fail ArgumentError, "Missing the required parameter 'uuid' when calling ExternalFeedsApi.delete_external_feed" end # resource path local_var_path = '/feeds/{uuid}'.sub('{' + 'uuid' + '}', uuid.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalFeedsApi#delete_external_feed\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_all_external_feeds(opts = {}) ⇒ GetAllExternalFeeds
Fetch all external feeds This endpoint can fetch all created external feeds.
150 151 152 153 |
# File 'lib/brevo-ruby/api/external_feeds_api.rb', line 150 def get_all_external_feeds(opts = {}) data, _status_code, _headers = get_all_external_feeds_with_http_info(opts) data end |
#get_all_external_feeds_with_http_info(opts = {}) ⇒ Array<(GetAllExternalFeeds, Fixnum, Hash)>
Fetch all external feeds This endpoint can fetch all created external feeds.
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 |
# File 'lib/brevo-ruby/api/external_feeds_api.rb', line 166 def get_all_external_feeds_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ExternalFeedsApi.get_all_external_feeds ...' end if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort']) fail ArgumentError, 'invalid value for "sort", must be one of asc, desc' end if @api_client.config.client_side_validation && opts[:'auth_type'] && !['basic', 'token', 'noAuth'].include?(opts[:'auth_type']) fail ArgumentError, 'invalid value for "auth_type", must be one of basic, token, noAuth' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ExternalFeedsApi.get_all_external_feeds, must be smaller than or equal to 500.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 0 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ExternalFeedsApi.get_all_external_feeds, must be greater than or equal to 0.' end # resource path local_var_path = '/feeds' # query parameters query_params = {} query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil? query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil? query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'authType'] = opts[:'auth_type'] if !opts[:'auth_type'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'GetAllExternalFeeds') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalFeedsApi#get_all_external_feeds\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_external_feed_by_uuid(uuid, opts = {}) ⇒ GetExternalFeedByUUID
Get an external feed by UUID This endpoint will update an external feed.
227 228 229 230 |
# File 'lib/brevo-ruby/api/external_feeds_api.rb', line 227 def get_external_feed_by_uuid(uuid, opts = {}) data, _status_code, _headers = get_external_feed_by_uuid_with_http_info(uuid, opts) data end |
#get_external_feed_by_uuid_with_http_info(uuid, opts = {}) ⇒ Array<(GetExternalFeedByUUID, Fixnum, Hash)>
Get an external feed by UUID This endpoint will update an external feed.
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 |
# File 'lib/brevo-ruby/api/external_feeds_api.rb', line 237 def get_external_feed_by_uuid_with_http_info(uuid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ExternalFeedsApi.get_external_feed_by_uuid ...' end # verify the required parameter 'uuid' is set if @api_client.config.client_side_validation && uuid.nil? fail ArgumentError, "Missing the required parameter 'uuid' when calling ExternalFeedsApi.get_external_feed_by_uuid" end # resource path local_var_path = '/feeds/{uuid}'.sub('{' + 'uuid' + '}', uuid.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'GetExternalFeedByUUID') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalFeedsApi#get_external_feed_by_uuid\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#setUserAgent(user_agent) ⇒ Object
Set custom user_agent if explicitly passed in api default will still remain Swagger-Codegen/#VERSION/ruby
25 26 27 28 29 30 |
# File 'lib/brevo-ruby/api/external_feeds_api.rb', line 25 def setUserAgent(user_agent) @user_agent = user_agent if user_agent.is_a?(String) && user_agent.downcase.start_with?('brevo_') @api_client.default_headers['User-Agent'] = @user_agent end end |
#update_external_feed(uuid, update_external_feed, opts = {}) ⇒ nil
Update an external feed This endpoint will update an external feed.
282 283 284 285 |
# File 'lib/brevo-ruby/api/external_feeds_api.rb', line 282 def update_external_feed(uuid, update_external_feed, opts = {}) update_external_feed_with_http_info(uuid, update_external_feed, opts) nil end |
#update_external_feed_with_http_info(uuid, update_external_feed, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Update an external feed This endpoint will update an external feed.
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 |
# File 'lib/brevo-ruby/api/external_feeds_api.rb', line 293 def update_external_feed_with_http_info(uuid, update_external_feed, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ExternalFeedsApi.update_external_feed ...' end # verify the required parameter 'uuid' is set if @api_client.config.client_side_validation && uuid.nil? fail ArgumentError, "Missing the required parameter 'uuid' when calling ExternalFeedsApi.update_external_feed" end # verify the required parameter 'update_external_feed' is set if @api_client.config.client_side_validation && update_external_feed.nil? fail ArgumentError, "Missing the required parameter 'update_external_feed' when calling ExternalFeedsApi.update_external_feed" end # resource path local_var_path = '/feeds/{uuid}'.sub('{' + 'uuid' + '}', uuid.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(update_external_feed) auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalFeedsApi#update_external_feed\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |