Skip to content

Sync: latest swagger update changes for get-contacts and event-report… #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/ContactsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,8 @@ api_instance = SibApiV3Sdk::ContactsApi.new

opts = {
limit: 50, # Integer | Number of documents per page
offset: 0 # Integer | Index of the first document of the page
offset: 0, # Integer | Index of the first document of the page
modified_since: DateTime.parse("2013-10-20T19:20:30+01:00") # DateTime | Filter (urlencoded) the contacts modified after a given date-time (YYYY-MM-DDTHH:mm:ss.SSSZ)
}

begin
Expand All @@ -635,6 +636,7 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**limit** | **Integer**| Number of documents per page | [optional] [default to 50]
**offset** | **Integer**| Index of the first document of the page | [optional] [default to 0]
**modified_since** | **DateTime**| Filter (urlencoded) the contacts modified after a given date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) | [optional]

### Return type

Expand Down
5 changes: 3 additions & 2 deletions docs/GetEmailEventReportEvents.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**email** | **String** | Email address which generates the event |
**date** | **Date** | Date on which the event has been generated |
**date** | **DateTime** | Date on which the event has been generated |
**subject** | **String** | Subject of the event | [optional]
**message_id** | **String** | Message ID which generated the event |
**event** | **String** | Event which occurred |
**reason** | **String** | Reason of bounce (only available if the event is hardbounce or softbounce) |
**reason** | **String** | Reason of bounce (only available if the event is hardbounce or softbounce) | [optional]
**tag** | **String** | Tag of the email which generated the event |
**ip** | **String** | IP from which the user has opened the email or clicked on the link (only available if the event is opened or clicks) | [optional]
**link** | **String** | The link which is sent to the user (only available if the event is requests or opened or clicks) | [optional]
**from** | **String** | Sender email from which the emails are sent |


3 changes: 3 additions & 0 deletions lib/sib-api-v3-sdk/api/contacts_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,7 @@ def get_contact_stats_with_http_info(email, opts = {})
# @param [Hash] opts the optional parameters
# @option opts [Integer] :limit Number of documents per page (default to 50)
# @option opts [Integer] :offset Index of the first document of the page (default to 0)
# @option opts [DateTime] :modified_since Filter (urlencoded) the contacts modified after a given date-time (YYYY-MM-DDTHH:mm:ss.SSSZ)
# @return [GetContacts]
def get_contacts(opts = {})
data, _status_code, _headers = get_contacts_with_http_info(opts)
Expand All @@ -638,6 +639,7 @@ def get_contacts(opts = {})
# @param [Hash] opts the optional parameters
# @option opts [Integer] :limit Number of documents per page
# @option opts [Integer] :offset Index of the first document of the page
# @option opts [DateTime] :modified_since Filter (urlencoded) the contacts modified after a given date-time (YYYY-MM-DDTHH:mm:ss.SSSZ)
# @return [Array<(GetContacts, Fixnum, Hash)>] GetContacts data, response status code and response headers
def get_contacts_with_http_info(opts = {})
if @api_client.config.debugging
Expand All @@ -654,6 +656,7 @@ def get_contacts_with_http_info(opts = {})
query_params = {}
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
query_params[:'modifiedSince'] = opts[:'modified_since'] if !opts[:'modified_since'].nil?

# header parameters
header_params = {}
Expand Down
30 changes: 20 additions & 10 deletions lib/sib-api-v3-sdk/models/get_email_event_report_events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ class GetEmailEventReportEvents
# The link which is sent to the user (only available if the event is requests or opened or clicks)
attr_accessor :link

# Sender email from which the emails are sent
attr_accessor :from

class EnumAttributeValidator
attr_reader :datatype
attr_reader :allowable_values
Expand Down Expand Up @@ -75,22 +78,24 @@ def self.attribute_map
:'reason' => :'reason',
:'tag' => :'tag',
:'ip' => :'ip',
:'link' => :'link'
:'link' => :'link',
:'from' => :'from'
}
end

# Attribute type mapping.
def self.swagger_types
{
:'email' => :'String',
:'date' => :'Date',
:'date' => :'DateTime',
:'subject' => :'String',
:'message_id' => :'String',
:'event' => :'String',
:'reason' => :'String',
:'tag' => :'String',
:'ip' => :'String',
:'link' => :'String'
:'link' => :'String',
:'from' => :'String'
}
end

Expand Down Expand Up @@ -138,6 +143,10 @@ def initialize(attributes = {})
self.link = attributes[:'link']
end

if attributes.has_key?(:'from')
self.from = attributes[:'from']
end

end

# Show invalid properties with the reasons. Usually used together with valid?
Expand All @@ -160,14 +169,14 @@ def list_invalid_properties
invalid_properties.push("invalid value for 'event', event cannot be nil.")
end

if @reason.nil?
invalid_properties.push("invalid value for 'reason', reason cannot be nil.")
end

if @tag.nil?
invalid_properties.push("invalid value for 'tag', tag cannot be nil.")
end

if @from.nil?
invalid_properties.push("invalid value for 'from', from cannot be nil.")
end

return invalid_properties
end

Expand All @@ -180,8 +189,8 @@ def valid?
return false if @event.nil?
event_validator = EnumAttributeValidator.new('String', ["bounces", "hardBounces", "softBounces", "delivered", "spam", "requests", "opened", "clicks", "invalid", "deferred", "blocked"])
return false unless event_validator.valid?(@event)
return false if @reason.nil?
return false if @tag.nil?
return false if @from.nil?
return true
end

Expand All @@ -208,7 +217,8 @@ def ==(o)
reason == o.reason &&
tag == o.tag &&
ip == o.ip &&
link == o.link
link == o.link &&
from == o.from
end

# @see the `==` method
Expand All @@ -220,7 +230,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Fixnum] Hash code
def hash
[email, date, subject, message_id, event, reason, tag, ip, link].hash
[email, date, subject, message_id, event, reason, tag, ip, link, from].hash
end

# Builds the object from hash
Expand Down
2 changes: 1 addition & 1 deletion lib/sib-api-v3-sdk/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
=end

module SibApiV3Sdk
VERSION = "2.1.1"
VERSION = "2.1.2"
end
1 change: 1 addition & 0 deletions spec/api/contacts_api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@
# @param [Hash] opts the optional parameters
# @option opts [Integer] :limit Number of documents per page
# @option opts [Integer] :offset Index of the first document of the page
# @option opts [DateTime] :modified_since Filter (urlencoded) the contacts modified after a given date-time (YYYY-MM-DDTHH:mm:ss.SSSZ)
# @return [GetContacts]
describe 'get_contacts test' do
it "should work" do
Expand Down
6 changes: 6 additions & 0 deletions spec/models/get_email_event_report_events_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,11 @@
end
end

describe 'test attribute "from"' do
it 'should work' do
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
end
end

end