sib-api-v3-sdk 4.0.0 → 4.0.1

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
  SHA1:
3
- metadata.gz: e23dd63c039bcf24c9bfffbe00bc30bdb83b39af
4
- data.tar.gz: e1e8ef093da156abfb961287f509005baded18a7
3
+ metadata.gz: 8509ba8fb05f8bedee06d5f4837dd5edc3defadc
4
+ data.tar.gz: 00f707435dcca31f90251e59a2a24fc1557f8210
5
5
  SHA512:
6
- metadata.gz: a6d4f54aed242a2b53603da40cda6b6390261a5e57332964863d8e39d0ddb57e6d6b12926179fb205a0717e68d5e767b1a33492627991b4180052cd8a515a68b
7
- data.tar.gz: f87cdd763599c024dea92e9771c1a2d62e7ecc14060d9debd3ca24726db3e1d07d507750200b70afe712e940ddd56639875f2a1f4c3adb27788828c2b4a33273
6
+ metadata.gz: 5641c31c5be716eeb23936cfce26742dfe8ca8d389a1b9f73c3bd17d962069d20b291ccdc556226e9f921e15e0e105b2893a8b470794abbda9a97b21792f0669
7
+ data.tar.gz: 0fdb8063fe720b9c2faca5f459a1cd296c3d9df6d8a7418c7f7892b45dcb29dc2ce674fa03429e4d4ab35c1d0175d901483053a7a30dbb5c92471a46a4315b83
data/README.md CHANGED
@@ -90,6 +90,7 @@ Class | Method | HTTP request | Description
90
90
  *SibApiV3Sdk::ContactsApi* | [**create_folder**](docs/ContactsApi.md#create_folder) | **POST** /contacts/folders | Create a folder
91
91
  *SibApiV3Sdk::ContactsApi* | [**create_list**](docs/ContactsApi.md#create_list) | **POST** /contacts/lists | Create a list
92
92
  *SibApiV3Sdk::ContactsApi* | [**delete_attribute**](docs/ContactsApi.md#delete_attribute) | **DELETE** /contacts/attributes/{attributeCategory}/{attributeName} | Deletes an attribute
93
+ *SibApiV3Sdk::ContactsApi* | [**delete_contact**](docs/ContactsApi.md#delete_contact) | **DELETE** /contacts/{email} | Deletes a contact
93
94
  *SibApiV3Sdk::ContactsApi* | [**delete_folder**](docs/ContactsApi.md#delete_folder) | **DELETE** /contacts/folders/{folderId} | Delete a folder (and all its lists)
94
95
  *SibApiV3Sdk::ContactsApi* | [**delete_list**](docs/ContactsApi.md#delete_list) | **DELETE** /contacts/lists/{listId} | Delete a list
95
96
  *SibApiV3Sdk::ContactsApi* | [**get_attributes**](docs/ContactsApi.md#get_attributes) | **GET** /contacts/attributes | Lists all attributes
@@ -355,3 +356,7 @@ If you find a bug, please post the issue on [Github](https://github.com/sendinbl
355
356
 
356
357
  As always, if you need additional assistance, drop us a note [here](https://account.sendinblue.com/support).
357
358
 
359
+ ## Recommendation
360
+
361
+ Please follow camelCase convention for variables in the API's. For example, use customVariable instead of custom_variable.
362
+
@@ -10,6 +10,7 @@ Method | HTTP request | Description
10
10
  [**create_folder**](ContactsApi.md#create_folder) | **POST** /contacts/folders | Create a folder
11
11
  [**create_list**](ContactsApi.md#create_list) | **POST** /contacts/lists | Create a list
12
12
  [**delete_attribute**](ContactsApi.md#delete_attribute) | **DELETE** /contacts/attributes/{attributeCategory}/{attributeName} | Deletes an attribute
13
+ [**delete_contact**](ContactsApi.md#delete_contact) | **DELETE** /contacts/{email} | Deletes a contact
13
14
  [**delete_folder**](ContactsApi.md#delete_folder) | **DELETE** /contacts/folders/{folderId} | Delete a folder (and all its lists)
14
15
  [**delete_list**](ContactsApi.md#delete_list) | **DELETE** /contacts/lists/{listId} | Delete a list
15
16
  [**get_attributes**](ContactsApi.md#get_attributes) | **GET** /contacts/attributes | Lists all attributes
@@ -353,6 +354,57 @@ nil (empty response body)
353
354
 
354
355
 
355
356
 
357
+ # **delete_contact**
358
+ > delete_contact(email)
359
+
360
+ Deletes a contact
361
+
362
+ ### Example
363
+ ```ruby
364
+ # load the gem
365
+ require 'sib-api-v3-sdk'
366
+ # setup authorization
367
+ SibApiV3Sdk.configure do |config|
368
+ # Configure API key authorization: api-key
369
+ config.api_key['api-key'] = 'YOUR API KEY'
370
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
371
+ #config.api_key_prefix['api-key'] = 'Bearer'
372
+ end
373
+
374
+ api_instance = SibApiV3Sdk::ContactsApi.new
375
+
376
+ email = "email_example" # String | Email (urlencoded) of the contact
377
+
378
+
379
+ begin
380
+ #Deletes a contact
381
+ api_instance.delete_contact(email)
382
+ rescue SibApiV3Sdk::ApiError => e
383
+ puts "Exception when calling ContactsApi->delete_contact: #{e}"
384
+ end
385
+ ```
386
+
387
+ ### Parameters
388
+
389
+ Name | Type | Description | Notes
390
+ ------------- | ------------- | ------------- | -------------
391
+ **email** | **String**| Email (urlencoded) of the contact |
392
+
393
+ ### Return type
394
+
395
+ nil (empty response body)
396
+
397
+ ### Authorization
398
+
399
+ [api-key](../README.md#api-key)
400
+
401
+ ### HTTP request headers
402
+
403
+ - **Content-Type**: application/json
404
+ - **Accept**: application/json
405
+
406
+
407
+
356
408
  # **delete_folder**
357
409
  > delete_folder(folder_id)
358
410
 
@@ -4,9 +4,10 @@
4
4
  Name | Type | Description | Notes
5
5
  ------------ | ------------- | ------------- | -------------
6
6
  **type** | **String** | Displays the plan type of the user |
7
- **credits_type** | **String** | This is the type of the credit, \"User Limit\" or \"Send Limit\" are two possible types of credit of a user. \"User Limit\" implies the total number of subscribers you can add to your account, and \"Send Limit\" implies the total number of emails you can send to the subscribers in your account. |
8
- **credits** | **Float** | Remaining credits of the user. This can either be \"User Limit\" or \"Send Limit\" depending on the plan. |
9
- **start_date** | **Date** | Date of the period from which the plan will start (only available for \"subscription\", \"unlimited\" and \"reseller\" plan type) | [optional]
10
- **end_date** | **Date** | Date of the period from which the plan will end (only available for \"subscription\", \"unlimited\" and \"reseller\" plan type) | [optional]
7
+ **credits_type** | **String** | This is the type of the credit, \"Send Limit\" is one of the possible types of credit of a user. \"Send Limit\" implies the total number of emails you can send to the subscribers in your account. |
8
+ **credits** | **Float** | Remaining credits of the user |
9
+ **start_date** | **Date** | Date of the period from which the plan will start (only available for \"subscription\" and \"reseller\" plan type) | [optional]
10
+ **end_date** | **Date** | Date of the period from which the plan will end (only available for \"subscription\" and \"reseller\" plan type) | [optional]
11
+ **user_limit** | **Integer** | Only in case of reseller account. It implies the total number of child accounts you can add to your account. | [optional]
11
12
 
12
13
 
@@ -380,6 +380,60 @@ module SibApiV3Sdk
380
380
  return data, status_code, headers
381
381
  end
382
382
 
383
+ # Deletes a contact
384
+ #
385
+ # @param email Email (urlencoded) of the contact
386
+ # @param [Hash] opts the optional parameters
387
+ # @return [nil]
388
+ def delete_contact(email, opts = {})
389
+ delete_contact_with_http_info(email, opts)
390
+ return nil
391
+ end
392
+
393
+ # Deletes a contact
394
+ #
395
+ # @param email Email (urlencoded) of the contact
396
+ # @param [Hash] opts the optional parameters
397
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
398
+ def delete_contact_with_http_info(email, opts = {})
399
+ if @api_client.config.debugging
400
+ @api_client.config.logger.debug "Calling API: ContactsApi.delete_contact ..."
401
+ end
402
+ # verify the required parameter 'email' is set
403
+ if @api_client.config.client_side_validation && email.nil?
404
+ fail ArgumentError, "Missing the required parameter 'email' when calling ContactsApi.delete_contact"
405
+ end
406
+ # resource path
407
+ local_var_path = "/contacts/{email}".sub('{' + 'email' + '}', email.to_s)
408
+
409
+ # query parameters
410
+ query_params = {}
411
+
412
+ # header parameters
413
+ header_params = {}
414
+ # HTTP header 'Accept' (if needed)
415
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
416
+ # HTTP header 'Content-Type'
417
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
418
+
419
+ # form parameters
420
+ form_params = {}
421
+
422
+ # http body (model)
423
+ post_body = nil
424
+ auth_names = ['api-key']
425
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
426
+ :header_params => header_params,
427
+ :query_params => query_params,
428
+ :form_params => form_params,
429
+ :body => post_body,
430
+ :auth_names => auth_names)
431
+ if @api_client.config.debugging
432
+ @api_client.config.logger.debug "API called: ContactsApi#delete_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
433
+ end
434
+ return data, status_code, headers
435
+ end
436
+
383
437
  # Delete a folder (and all its lists)
384
438
  #
385
439
  # @param folder_id Id of the folder
@@ -18,18 +18,21 @@ module SibApiV3Sdk
18
18
  # Displays the plan type of the user
19
19
  attr_accessor :type
20
20
 
21
- # This is the type of the credit, \"User Limit\" or \"Send Limit\" are two possible types of credit of a user. \"User Limit\" implies the total number of subscribers you can add to your account, and \"Send Limit\" implies the total number of emails you can send to the subscribers in your account.
21
+ # This is the type of the credit, \"Send Limit\" is one of the possible types of credit of a user. \"Send Limit\" implies the total number of emails you can send to the subscribers in your account.
22
22
  attr_accessor :credits_type
23
23
 
24
- # Remaining credits of the user. This can either be \"User Limit\" or \"Send Limit\" depending on the plan.
24
+ # Remaining credits of the user
25
25
  attr_accessor :credits
26
26
 
27
- # Date of the period from which the plan will start (only available for \"subscription\", \"unlimited\" and \"reseller\" plan type)
27
+ # Date of the period from which the plan will start (only available for \"subscription\" and \"reseller\" plan type)
28
28
  attr_accessor :start_date
29
29
 
30
- # Date of the period from which the plan will end (only available for \"subscription\", \"unlimited\" and \"reseller\" plan type)
30
+ # Date of the period from which the plan will end (only available for \"subscription\" and \"reseller\" plan type)
31
31
  attr_accessor :end_date
32
32
 
33
+ # Only in case of reseller account. It implies the total number of child accounts you can add to your account.
34
+ attr_accessor :user_limit
35
+
33
36
  class EnumAttributeValidator
34
37
  attr_reader :datatype
35
38
  attr_reader :allowable_values
@@ -59,7 +62,8 @@ module SibApiV3Sdk
59
62
  :'credits_type' => :'creditsType',
60
63
  :'credits' => :'credits',
61
64
  :'start_date' => :'startDate',
62
- :'end_date' => :'endDate'
65
+ :'end_date' => :'endDate',
66
+ :'user_limit' => :'userLimit'
63
67
  }
64
68
  end
65
69
 
@@ -70,7 +74,8 @@ module SibApiV3Sdk
70
74
  :'credits_type' => :'String',
71
75
  :'credits' => :'Float',
72
76
  :'start_date' => :'Date',
73
- :'end_date' => :'Date'
77
+ :'end_date' => :'Date',
78
+ :'user_limit' => :'Integer'
74
79
  }
75
80
  end
76
81
 
@@ -102,6 +107,10 @@ module SibApiV3Sdk
102
107
  self.end_date = attributes[:'endDate']
103
108
  end
104
109
 
110
+ if attributes.has_key?(:'userLimit')
111
+ self.user_limit = attributes[:'userLimit']
112
+ end
113
+
105
114
  end
106
115
 
107
116
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -127,10 +136,10 @@ module SibApiV3Sdk
127
136
  # @return true if the model is valid
128
137
  def valid?
129
138
  return false if @type.nil?
130
- type_validator = EnumAttributeValidator.new('String', ["payAsYouGo", "unlimited", "free", "subscription", "sms", "reseller"])
139
+ type_validator = EnumAttributeValidator.new('String', ["payAsYouGo", "free", "subscription", "sms", "reseller"])
131
140
  return false unless type_validator.valid?(@type)
132
141
  return false if @credits_type.nil?
133
- credits_type_validator = EnumAttributeValidator.new('String', ["userLimit", "sendLimit"])
142
+ credits_type_validator = EnumAttributeValidator.new('String', ["sendLimit"])
134
143
  return false unless credits_type_validator.valid?(@credits_type)
135
144
  return false if @credits.nil?
136
145
  return true
@@ -139,7 +148,7 @@ module SibApiV3Sdk
139
148
  # Custom attribute writer method checking allowed values (enum).
140
149
  # @param [Object] type Object to be assigned
141
150
  def type=(type)
142
- validator = EnumAttributeValidator.new('String', ["payAsYouGo", "unlimited", "free", "subscription", "sms", "reseller"])
151
+ validator = EnumAttributeValidator.new('String', ["payAsYouGo", "free", "subscription", "sms", "reseller"])
143
152
  unless validator.valid?(type)
144
153
  fail ArgumentError, "invalid value for 'type', must be one of #{validator.allowable_values}."
145
154
  end
@@ -149,7 +158,7 @@ module SibApiV3Sdk
149
158
  # Custom attribute writer method checking allowed values (enum).
150
159
  # @param [Object] credits_type Object to be assigned
151
160
  def credits_type=(credits_type)
152
- validator = EnumAttributeValidator.new('String', ["userLimit", "sendLimit"])
161
+ validator = EnumAttributeValidator.new('String', ["sendLimit"])
153
162
  unless validator.valid?(credits_type)
154
163
  fail ArgumentError, "invalid value for 'credits_type', must be one of #{validator.allowable_values}."
155
164
  end
@@ -165,7 +174,8 @@ module SibApiV3Sdk
165
174
  credits_type == o.credits_type &&
166
175
  credits == o.credits &&
167
176
  start_date == o.start_date &&
168
- end_date == o.end_date
177
+ end_date == o.end_date &&
178
+ user_limit == o.user_limit
169
179
  end
170
180
 
171
181
  # @see the `==` method
@@ -177,7 +187,7 @@ module SibApiV3Sdk
177
187
  # Calculates hash code according to all attributes.
178
188
  # @return [Fixnum] Hash code
179
189
  def hash
180
- [type, credits_type, credits, start_date, end_date].hash
190
+ [type, credits_type, credits, start_date, end_date, user_limit].hash
181
191
  end
182
192
 
183
193
  # Builds the object from hash
@@ -11,5 +11,5 @@ Swagger Codegen version: 2.3.1
11
11
  =end
12
12
 
13
13
  module SibApiV3Sdk
14
- VERSION = "4.0.0"
14
+ VERSION = "4.0.1"
15
15
  end
@@ -108,6 +108,18 @@ describe 'ContactsApi' do
108
108
  end
109
109
  end
110
110
 
111
+ # unit tests for delete_contact
112
+ # Deletes a contact
113
+ #
114
+ # @param email Email (urlencoded) of the contact
115
+ # @param [Hash] opts the optional parameters
116
+ # @return [nil]
117
+ describe 'delete_contact test' do
118
+ it "should work" do
119
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
120
+ end
121
+ end
122
+
111
123
  # unit tests for delete_folder
112
124
  # Delete a folder (and all its lists)
113
125
  #
@@ -35,7 +35,7 @@ describe 'GetAccountPlan' do
35
35
  describe 'test attribute "type"' do
36
36
  it 'should work' do
37
37
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
- #validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["payAsYouGo", "unlimited", "free", "subscription", "sms", "reseller"])
38
+ #validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["payAsYouGo", "free", "subscription", "sms", "reseller"])
39
39
  #validator.allowable_values.each do |value|
40
40
  # expect { @instance.type = value }.not_to raise_error
41
41
  #end
@@ -45,7 +45,7 @@ describe 'GetAccountPlan' do
45
45
  describe 'test attribute "credits_type"' do
46
46
  it 'should work' do
47
47
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
48
- #validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["userLimit", "sendLimit"])
48
+ #validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["sendLimit"])
49
49
  #validator.allowable_values.each do |value|
50
50
  # expect { @instance.credits_type = value }.not_to raise_error
51
51
  #end
@@ -70,5 +70,11 @@ describe 'GetAccountPlan' do
70
70
  end
71
71
  end
72
72
 
73
+ describe 'test attribute "user_limit"' do
74
+ it 'should work' do
75
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
76
+ end
77
+ end
78
+
73
79
  end
74
80
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sib-api-v3-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - SendinBlue Developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-22 00:00:00.000000000 Z
11
+ date: 2018-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus