messagemedia_conversations_sdk 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +201 -0
  3. data/README.md +149 -0
  4. data/lib/message_media_conversations.rb +63 -0
  5. data/lib/message_media_conversations/api_helper.rb +273 -0
  6. data/lib/message_media_conversations/configuration.rb +29 -0
  7. data/lib/message_media_conversations/controllers/app_users_controller.rb +285 -0
  8. data/lib/message_media_conversations/controllers/base_controller.rb +59 -0
  9. data/lib/message_media_conversations/controllers/configuration_controller.rb +90 -0
  10. data/lib/message_media_conversations/controllers/facebook_controller.rb +192 -0
  11. data/lib/message_media_conversations/exceptions/api_exception.rb +18 -0
  12. data/lib/message_media_conversations/http/auth/basic_auth.rb +20 -0
  13. data/lib/message_media_conversations/http/faraday_client.rb +55 -0
  14. data/lib/message_media_conversations/http/http_call_back.rb +22 -0
  15. data/lib/message_media_conversations/http/http_client.rb +102 -0
  16. data/lib/message_media_conversations/http/http_context.rb +18 -0
  17. data/lib/message_media_conversations/http/http_method_enum.rb +11 -0
  18. data/lib/message_media_conversations/http/http_request.rb +48 -0
  19. data/lib/message_media_conversations/http/http_response.rb +21 -0
  20. data/lib/message_media_conversations/message_media_conversations_client.rb +39 -0
  21. data/lib/message_media_conversations/models/app_user_dto.rb +51 -0
  22. data/lib/message_media_conversations/models/app_users_dto.rb +40 -0
  23. data/lib/message_media_conversations/models/base_message_dto.rb +42 -0
  24. data/lib/message_media_conversations/models/base_model.rb +34 -0
  25. data/lib/message_media_conversations/models/configure_account_request.rb +42 -0
  26. data/lib/message_media_conversations/models/configure_account_response.rb +42 -0
  27. data/lib/message_media_conversations/models/facebook_authorisation_response.rb +33 -0
  28. data/lib/message_media_conversations/models/facebook_page_dto.rb +42 -0
  29. data/lib/message_media_conversations/models/facebook_pages_dto.rb +40 -0
  30. data/lib/message_media_conversations/models/get_app_user_by_id_response.rb +51 -0
  31. data/lib/message_media_conversations/models/get_app_user_messages_response.rb +33 -0
  32. data/lib/message_media_conversations/models/get_app_users_response.rb +33 -0
  33. data/lib/message_media_conversations/models/get_facebook_authorisation_url_response.rb +33 -0
  34. data/lib/message_media_conversations/models/get_facebook_pages_response.rb +33 -0
  35. data/lib/message_media_conversations/models/message_dto.rb +60 -0
  36. data/lib/message_media_conversations/models/messages_dto.rb +40 -0
  37. data/lib/message_media_conversations/models/provision_account_request.rb +42 -0
  38. data/lib/message_media_conversations/models/send_message_response.rb +42 -0
  39. metadata +169 -0
@@ -0,0 +1,40 @@
1
+ # This file was automatically generated for MessageMedia by APIMATIC v2.0
2
+ # ( https://apimatic.io ).
3
+
4
+ module MessageMediaConversations
5
+ # FacebookPagesDto Model.
6
+ class FacebookPagesDto < BaseModel
7
+ # TODO: Write general description for this method
8
+ # @return [List of FacebookPageDto]
9
+ attr_accessor :pages
10
+
11
+ # A mapping from model property names to API property names.
12
+ def self.names
13
+ @_hash = {} if @_hash.nil?
14
+ @_hash['pages'] = 'pages'
15
+ @_hash
16
+ end
17
+
18
+ def initialize(pages = nil)
19
+ @pages = pages
20
+ end
21
+
22
+ # Creates an instance of the object from a hash.
23
+ def self.from_hash(hash)
24
+ return nil unless hash
25
+
26
+ # Extract variables from the hash.
27
+ # Parameter is an array, so we need to iterate through it
28
+ pages = nil
29
+ unless hash['pages'].nil?
30
+ pages = []
31
+ hash['pages'].each do |structure|
32
+ pages << (FacebookPageDto.from_hash(structure) if structure)
33
+ end
34
+ end
35
+
36
+ # Create object from extracted values.
37
+ FacebookPagesDto.new(pages)
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,51 @@
1
+ # This file was automatically generated for MessageMedia by APIMATIC v2.0
2
+ # ( https://apimatic.io ).
3
+
4
+ module MessageMediaConversations
5
+ # GetAppUserByIdResponse Model.
6
+ class GetAppUserByIdResponse < BaseModel
7
+ # TODO: Write general description for this method
8
+ # @return [String]
9
+ attr_accessor :id
10
+
11
+ # TODO: Write general description for this method
12
+ # @return [String]
13
+ attr_accessor :surname
14
+
15
+ # TODO: Write general description for this method
16
+ # @return [String]
17
+ attr_accessor :given_name
18
+
19
+ # A mapping from model property names to API property names.
20
+ def self.names
21
+ @_hash = {} if @_hash.nil?
22
+ @_hash['id'] = 'id'
23
+ @_hash['surname'] = 'surname'
24
+ @_hash['given_name'] = 'given_name'
25
+ @_hash
26
+ end
27
+
28
+ def initialize(id = nil,
29
+ surname = nil,
30
+ given_name = nil)
31
+ @id = id
32
+ @surname = surname
33
+ @given_name = given_name
34
+ end
35
+
36
+ # Creates an instance of the object from a hash.
37
+ def self.from_hash(hash)
38
+ return nil unless hash
39
+
40
+ # Extract variables from the hash.
41
+ id = hash['id']
42
+ surname = hash['surname']
43
+ given_name = hash['given_name']
44
+
45
+ # Create object from extracted values.
46
+ GetAppUserByIdResponse.new(id,
47
+ surname,
48
+ given_name)
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,33 @@
1
+ # This file was automatically generated for MessageMedia by APIMATIC v2.0
2
+ # ( https://apimatic.io ).
3
+
4
+ module MessageMediaConversations
5
+ # GetAppUserMessagesResponse Model.
6
+ class GetAppUserMessagesResponse < BaseModel
7
+ # TODO: Write general description for this method
8
+ # @return [List of Object]
9
+ attr_accessor :data
10
+
11
+ # A mapping from model property names to API property names.
12
+ def self.names
13
+ @_hash = {} if @_hash.nil?
14
+ @_hash['data'] = 'data'
15
+ @_hash
16
+ end
17
+
18
+ def initialize(data = nil)
19
+ @data = data
20
+ end
21
+
22
+ # Creates an instance of the object from a hash.
23
+ def self.from_hash(hash)
24
+ return nil unless hash
25
+
26
+ # Extract variables from the hash.
27
+ data = hash['data']
28
+
29
+ # Create object from extracted values.
30
+ GetAppUserMessagesResponse.new(data)
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,33 @@
1
+ # This file was automatically generated for MessageMedia by APIMATIC v2.0
2
+ # ( https://apimatic.io ).
3
+
4
+ module MessageMediaConversations
5
+ # GetAppUsersResponse Model.
6
+ class GetAppUsersResponse < BaseModel
7
+ # TODO: Write general description for this method
8
+ # @return [List of Object]
9
+ attr_accessor :data
10
+
11
+ # A mapping from model property names to API property names.
12
+ def self.names
13
+ @_hash = {} if @_hash.nil?
14
+ @_hash['data'] = 'data'
15
+ @_hash
16
+ end
17
+
18
+ def initialize(data = nil)
19
+ @data = data
20
+ end
21
+
22
+ # Creates an instance of the object from a hash.
23
+ def self.from_hash(hash)
24
+ return nil unless hash
25
+
26
+ # Extract variables from the hash.
27
+ data = hash['data']
28
+
29
+ # Create object from extracted values.
30
+ GetAppUsersResponse.new(data)
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,33 @@
1
+ # This file was automatically generated for MessageMedia by APIMATIC v2.0
2
+ # ( https://apimatic.io ).
3
+
4
+ module MessageMediaConversations
5
+ # GetFacebookAuthorisationURLResponse Model.
6
+ class GetFacebookAuthorisationURLResponse < BaseModel
7
+ # TODO: Write general description for this method
8
+ # @return [String]
9
+ attr_accessor :authorisation_url
10
+
11
+ # A mapping from model property names to API property names.
12
+ def self.names
13
+ @_hash = {} if @_hash.nil?
14
+ @_hash['authorisation_url'] = 'authorisation_url'
15
+ @_hash
16
+ end
17
+
18
+ def initialize(authorisation_url = nil)
19
+ @authorisation_url = authorisation_url
20
+ end
21
+
22
+ # Creates an instance of the object from a hash.
23
+ def self.from_hash(hash)
24
+ return nil unless hash
25
+
26
+ # Extract variables from the hash.
27
+ authorisation_url = hash['authorisation_url']
28
+
29
+ # Create object from extracted values.
30
+ GetFacebookAuthorisationURLResponse.new(authorisation_url)
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,33 @@
1
+ # This file was automatically generated for MessageMedia by APIMATIC v2.0
2
+ # ( https://apimatic.io ).
3
+
4
+ module MessageMediaConversations
5
+ # GetFacebookPagesResponse Model.
6
+ class GetFacebookPagesResponse < BaseModel
7
+ # TODO: Write general description for this method
8
+ # @return [List of Object]
9
+ attr_accessor :data
10
+
11
+ # A mapping from model property names to API property names.
12
+ def self.names
13
+ @_hash = {} if @_hash.nil?
14
+ @_hash['data'] = 'data'
15
+ @_hash
16
+ end
17
+
18
+ def initialize(data = nil)
19
+ @data = data
20
+ end
21
+
22
+ # Creates an instance of the object from a hash.
23
+ def self.from_hash(hash)
24
+ return nil unless hash
25
+
26
+ # Extract variables from the hash.
27
+ data = hash['data']
28
+
29
+ # Create object from extracted values.
30
+ GetFacebookPagesResponse.new(data)
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,60 @@
1
+ # This file was automatically generated for MessageMedia by APIMATIC v2.0
2
+ # ( https://apimatic.io ).
3
+
4
+ module MessageMediaConversations
5
+ # MessageDto Model.
6
+ class MessageDto < BaseModel
7
+ # TODO: Write general description for this method
8
+ # @return [String]
9
+ attr_accessor :channel
10
+
11
+ # TODO: Write general description for this method
12
+ # @return [String]
13
+ attr_accessor :id
14
+
15
+ # TODO: Write general description for this method
16
+ # @return [String]
17
+ attr_accessor :text
18
+
19
+ # TODO: Write general description for this method
20
+ # @return [String]
21
+ attr_accessor :timestamp
22
+
23
+ # A mapping from model property names to API property names.
24
+ def self.names
25
+ @_hash = {} if @_hash.nil?
26
+ @_hash['channel'] = 'channel'
27
+ @_hash['id'] = 'id'
28
+ @_hash['text'] = 'text'
29
+ @_hash['timestamp'] = 'timestamp'
30
+ @_hash
31
+ end
32
+
33
+ def initialize(channel = nil,
34
+ id = nil,
35
+ text = nil,
36
+ timestamp = nil)
37
+ @channel = channel
38
+ @id = id
39
+ @text = text
40
+ @timestamp = timestamp
41
+ end
42
+
43
+ # Creates an instance of the object from a hash.
44
+ def self.from_hash(hash)
45
+ return nil unless hash
46
+
47
+ # Extract variables from the hash.
48
+ channel = hash['channel']
49
+ id = hash['id']
50
+ text = hash['text']
51
+ timestamp = hash['timestamp']
52
+
53
+ # Create object from extracted values.
54
+ MessageDto.new(channel,
55
+ id,
56
+ text,
57
+ timestamp)
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,40 @@
1
+ # This file was automatically generated for MessageMedia by APIMATIC v2.0
2
+ # ( https://apimatic.io ).
3
+
4
+ module MessageMediaConversations
5
+ # MessagesDto Model.
6
+ class MessagesDto < BaseModel
7
+ # TODO: Write general description for this method
8
+ # @return [List of MessageDto]
9
+ attr_accessor :messages
10
+
11
+ # A mapping from model property names to API property names.
12
+ def self.names
13
+ @_hash = {} if @_hash.nil?
14
+ @_hash['messages'] = 'messages'
15
+ @_hash
16
+ end
17
+
18
+ def initialize(messages = nil)
19
+ @messages = messages
20
+ end
21
+
22
+ # Creates an instance of the object from a hash.
23
+ def self.from_hash(hash)
24
+ return nil unless hash
25
+
26
+ # Extract variables from the hash.
27
+ # Parameter is an array, so we need to iterate through it
28
+ messages = nil
29
+ unless hash['messages'].nil?
30
+ messages = []
31
+ hash['messages'].each do |structure|
32
+ messages << (MessageDto.from_hash(structure) if structure)
33
+ end
34
+ end
35
+
36
+ # Create object from extracted values.
37
+ MessagesDto.new(messages)
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,42 @@
1
+ # This file was automatically generated for MessageMedia by APIMATIC v2.0
2
+ # ( https://apimatic.io ).
3
+
4
+ module MessageMediaConversations
5
+ # ProvisionAccountRequest Model.
6
+ class ProvisionAccountRequest < BaseModel
7
+ # TODO: Write general description for this method
8
+ # @return [String]
9
+ attr_accessor :callback_url
10
+
11
+ # TODO: Write general description for this method
12
+ # @return [String]
13
+ attr_accessor :name
14
+
15
+ # A mapping from model property names to API property names.
16
+ def self.names
17
+ @_hash = {} if @_hash.nil?
18
+ @_hash['callback_url'] = 'callbackUrl'
19
+ @_hash['name'] = 'name'
20
+ @_hash
21
+ end
22
+
23
+ def initialize(callback_url = nil,
24
+ name = nil)
25
+ @callback_url = callback_url
26
+ @name = name
27
+ end
28
+
29
+ # Creates an instance of the object from a hash.
30
+ def self.from_hash(hash)
31
+ return nil unless hash
32
+
33
+ # Extract variables from the hash.
34
+ callback_url = hash['callbackUrl']
35
+ name = hash['name']
36
+
37
+ # Create object from extracted values.
38
+ ProvisionAccountRequest.new(callback_url,
39
+ name)
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,42 @@
1
+ # This file was automatically generated for MessageMedia by APIMATIC v2.0
2
+ # ( https://apimatic.io ).
3
+
4
+ module MessageMediaConversations
5
+ # SendMessageResponse Model.
6
+ class SendMessageResponse < BaseModel
7
+ # TODO: Write general description for this method
8
+ # @return [String]
9
+ attr_accessor :channel
10
+
11
+ # TODO: Write general description for this method
12
+ # @return [String]
13
+ attr_accessor :text
14
+
15
+ # A mapping from model property names to API property names.
16
+ def self.names
17
+ @_hash = {} if @_hash.nil?
18
+ @_hash['channel'] = 'channel'
19
+ @_hash['text'] = 'text'
20
+ @_hash
21
+ end
22
+
23
+ def initialize(channel = nil,
24
+ text = nil)
25
+ @channel = channel
26
+ @text = text
27
+ end
28
+
29
+ # Creates an instance of the object from a hash.
30
+ def self.from_hash(hash)
31
+ return nil unless hash
32
+
33
+ # Extract variables from the hash.
34
+ channel = hash['channel']
35
+ text = hash['text']
36
+
37
+ # Create object from extracted values.
38
+ SendMessageResponse.new(channel,
39
+ text)
40
+ end
41
+ end
42
+ end
metadata ADDED
@@ -0,0 +1,169 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: messagemedia_conversations_sdk
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - MessageMedia Developers
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-10-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: logging
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: faraday
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.10.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.10.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: test-unit
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 3.1.5
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 3.1.5
55
+ - !ruby/object:Gem::Dependency
56
+ name: certifi
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2016.9'
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: 2016.09.26
65
+ type: :runtime
66
+ prerelease: false
67
+ version_requirements: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - "~>"
70
+ - !ruby/object:Gem::Version
71
+ version: '2016.9'
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: 2016.09.26
75
+ - !ruby/object:Gem::Dependency
76
+ name: faraday-http-cache
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '1.2'
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: 1.2.2
85
+ type: :runtime
86
+ prerelease: false
87
+ version_requirements: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - "~>"
90
+ - !ruby/object:Gem::Version
91
+ version: '1.2'
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: 1.2.2
95
+ description: The Conversations API allows users to communicate by sending and receiving
96
+ messages via Over-The-Top (OTT) messaging services. OTT application is an app or
97
+ service that provides a product over the Internet and bypasses traditional distribution.
98
+ Here's an in-depth explanation of what the term means.This feature is disabled by
99
+ default. To enable it, you don't need to make any changes to your application, just
100
+ an account configuration change by MessageMedia's support team support@messagemedia.com.For
101
+ our initial release, we're releasing Facebook Messenger which allows you to send
102
+ messages as a Facebook page owner and receive messages from other Facebook users.
103
+ email: developers@messagemedia.com
104
+ executables: []
105
+ extensions: []
106
+ extra_rdoc_files: []
107
+ files:
108
+ - LICENSE
109
+ - README.md
110
+ - lib/message_media_conversations.rb
111
+ - lib/message_media_conversations/api_helper.rb
112
+ - lib/message_media_conversations/configuration.rb
113
+ - lib/message_media_conversations/controllers/app_users_controller.rb
114
+ - lib/message_media_conversations/controllers/base_controller.rb
115
+ - lib/message_media_conversations/controllers/configuration_controller.rb
116
+ - lib/message_media_conversations/controllers/facebook_controller.rb
117
+ - lib/message_media_conversations/exceptions/api_exception.rb
118
+ - lib/message_media_conversations/http/auth/basic_auth.rb
119
+ - lib/message_media_conversations/http/faraday_client.rb
120
+ - lib/message_media_conversations/http/http_call_back.rb
121
+ - lib/message_media_conversations/http/http_client.rb
122
+ - lib/message_media_conversations/http/http_context.rb
123
+ - lib/message_media_conversations/http/http_method_enum.rb
124
+ - lib/message_media_conversations/http/http_request.rb
125
+ - lib/message_media_conversations/http/http_response.rb
126
+ - lib/message_media_conversations/message_media_conversations_client.rb
127
+ - lib/message_media_conversations/models/app_user_dto.rb
128
+ - lib/message_media_conversations/models/app_users_dto.rb
129
+ - lib/message_media_conversations/models/base_message_dto.rb
130
+ - lib/message_media_conversations/models/base_model.rb
131
+ - lib/message_media_conversations/models/configure_account_request.rb
132
+ - lib/message_media_conversations/models/configure_account_response.rb
133
+ - lib/message_media_conversations/models/facebook_authorisation_response.rb
134
+ - lib/message_media_conversations/models/facebook_page_dto.rb
135
+ - lib/message_media_conversations/models/facebook_pages_dto.rb
136
+ - lib/message_media_conversations/models/get_app_user_by_id_response.rb
137
+ - lib/message_media_conversations/models/get_app_user_messages_response.rb
138
+ - lib/message_media_conversations/models/get_app_users_response.rb
139
+ - lib/message_media_conversations/models/get_facebook_authorisation_url_response.rb
140
+ - lib/message_media_conversations/models/get_facebook_pages_response.rb
141
+ - lib/message_media_conversations/models/message_dto.rb
142
+ - lib/message_media_conversations/models/messages_dto.rb
143
+ - lib/message_media_conversations/models/provision_account_request.rb
144
+ - lib/message_media_conversations/models/send_message_response.rb
145
+ homepage: https://developers.messagemedia.com
146
+ licenses:
147
+ - Apache-2.0
148
+ metadata: {}
149
+ post_install_message:
150
+ rdoc_options: []
151
+ require_paths:
152
+ - lib
153
+ required_ruby_version: !ruby/object:Gem::Requirement
154
+ requirements:
155
+ - - "~>"
156
+ - !ruby/object:Gem::Version
157
+ version: '2.0'
158
+ required_rubygems_version: !ruby/object:Gem::Requirement
159
+ requirements:
160
+ - - ">="
161
+ - !ruby/object:Gem::Version
162
+ version: '0'
163
+ requirements: []
164
+ rubyforge_project:
165
+ rubygems_version: 2.5.2
166
+ signing_key:
167
+ specification_version: 4
168
+ summary: messagemedia_conversations_sdk
169
+ test_files: []