late-sdk 0.0.697 → 0.0.698
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.
- checksums.yaml +4 -4
- data/README.md +8 -0
- data/docs/ConnectApi.md +155 -1
- data/docs/ListInstagramPages200Response.md +18 -0
- data/docs/ListInstagramPages200ResponsePagesInner.md +24 -0
- data/docs/ListInstagramPages200ResponsePagesInnerInstagramBusinessAccount.md +22 -0
- data/docs/SelectInstagramAccount200Response.md +22 -0
- data/docs/SelectInstagramAccount200ResponseAccount.md +30 -0
- data/docs/SelectInstagramAccountRequest.md +24 -0
- data/lib/zernio-sdk/api/connect_api.rb +146 -0
- data/lib/zernio-sdk/models/list_instagram_pages200_response.rb +149 -0
- data/lib/zernio-sdk/models/list_instagram_pages200_response_pages_inner.rb +177 -0
- data/lib/zernio-sdk/models/list_instagram_pages200_response_pages_inner_instagram_business_account.rb +167 -0
- data/lib/zernio-sdk/models/select_instagram_account200_response.rb +166 -0
- data/lib/zernio-sdk/models/select_instagram_account200_response_account.rb +249 -0
- data/lib/zernio-sdk/models/select_instagram_account_request.rb +229 -0
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +6 -0
- data/openapi.yaml +147 -0
- data/spec/api/connect_api_spec.rb +26 -0
- data/spec/models/list_instagram_pages200_response_pages_inner_instagram_business_account_spec.rb +48 -0
- data/spec/models/list_instagram_pages200_response_pages_inner_spec.rb +54 -0
- data/spec/models/list_instagram_pages200_response_spec.rb +36 -0
- data/spec/models/select_instagram_account200_response_account_spec.rb +80 -0
- data/spec/models/select_instagram_account200_response_spec.rb +48 -0
- data/spec/models/select_instagram_account_request_spec.rb +54 -0
- data/zernio-sdk-0.0.698.gem +0 -0
- metadata +27 -3
- data/zernio-sdk-0.0.697.gem +0 -0
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.4
|
|
7
|
+
Contact: support@zernio.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Zernio
|
|
17
|
+
class SelectInstagramAccount200ResponseAccount < ApiModelBase
|
|
18
|
+
# ID of the created SocialAccount
|
|
19
|
+
attr_accessor :account_id
|
|
20
|
+
|
|
21
|
+
attr_accessor :platform
|
|
22
|
+
|
|
23
|
+
attr_accessor :username
|
|
24
|
+
|
|
25
|
+
# Name of the Facebook Page backing this account
|
|
26
|
+
attr_accessor :display_name
|
|
27
|
+
|
|
28
|
+
attr_accessor :profile_picture
|
|
29
|
+
|
|
30
|
+
attr_accessor :is_active
|
|
31
|
+
|
|
32
|
+
attr_accessor :login_method
|
|
33
|
+
|
|
34
|
+
class EnumAttributeValidator
|
|
35
|
+
attr_reader :datatype
|
|
36
|
+
attr_reader :allowable_values
|
|
37
|
+
|
|
38
|
+
def initialize(datatype, allowable_values)
|
|
39
|
+
@allowable_values = allowable_values.map do |value|
|
|
40
|
+
case datatype.to_s
|
|
41
|
+
when /Integer/i
|
|
42
|
+
value.to_i
|
|
43
|
+
when /Float/i
|
|
44
|
+
value.to_f
|
|
45
|
+
else
|
|
46
|
+
value
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def valid?(value)
|
|
52
|
+
!value || allowable_values.include?(value)
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
57
|
+
def self.attribute_map
|
|
58
|
+
{
|
|
59
|
+
:'account_id' => :'accountId',
|
|
60
|
+
:'platform' => :'platform',
|
|
61
|
+
:'username' => :'username',
|
|
62
|
+
:'display_name' => :'displayName',
|
|
63
|
+
:'profile_picture' => :'profilePicture',
|
|
64
|
+
:'is_active' => :'isActive',
|
|
65
|
+
:'login_method' => :'loginMethod'
|
|
66
|
+
}
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Returns attribute mapping this model knows about
|
|
70
|
+
def self.acceptable_attribute_map
|
|
71
|
+
attribute_map
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Returns all the JSON keys this model knows about
|
|
75
|
+
def self.acceptable_attributes
|
|
76
|
+
acceptable_attribute_map.values
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Attribute type mapping.
|
|
80
|
+
def self.openapi_types
|
|
81
|
+
{
|
|
82
|
+
:'account_id' => :'String',
|
|
83
|
+
:'platform' => :'String',
|
|
84
|
+
:'username' => :'String',
|
|
85
|
+
:'display_name' => :'String',
|
|
86
|
+
:'profile_picture' => :'String',
|
|
87
|
+
:'is_active' => :'Boolean',
|
|
88
|
+
:'login_method' => :'String'
|
|
89
|
+
}
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# List of attributes with nullable: true
|
|
93
|
+
def self.openapi_nullable
|
|
94
|
+
Set.new([
|
|
95
|
+
])
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Initializes the object
|
|
99
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
100
|
+
def initialize(attributes = {})
|
|
101
|
+
if (!attributes.is_a?(Hash))
|
|
102
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::SelectInstagramAccount200ResponseAccount` initialize method"
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
106
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
107
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
108
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
109
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::SelectInstagramAccount200ResponseAccount`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
110
|
+
end
|
|
111
|
+
h[k.to_sym] = v
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if attributes.key?(:'account_id')
|
|
115
|
+
self.account_id = attributes[:'account_id']
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
if attributes.key?(:'platform')
|
|
119
|
+
self.platform = attributes[:'platform']
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
if attributes.key?(:'username')
|
|
123
|
+
self.username = attributes[:'username']
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
if attributes.key?(:'display_name')
|
|
127
|
+
self.display_name = attributes[:'display_name']
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
if attributes.key?(:'profile_picture')
|
|
131
|
+
self.profile_picture = attributes[:'profile_picture']
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
if attributes.key?(:'is_active')
|
|
135
|
+
self.is_active = attributes[:'is_active']
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if attributes.key?(:'login_method')
|
|
139
|
+
self.login_method = attributes[:'login_method']
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
144
|
+
# @return Array for valid properties with the reasons
|
|
145
|
+
def list_invalid_properties
|
|
146
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
147
|
+
invalid_properties = Array.new
|
|
148
|
+
invalid_properties
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Check to see if the all the properties in the model are valid
|
|
152
|
+
# @return true if the model is valid
|
|
153
|
+
def valid?
|
|
154
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
155
|
+
platform_validator = EnumAttributeValidator.new('String', ["instagram"])
|
|
156
|
+
return false unless platform_validator.valid?(@platform)
|
|
157
|
+
login_method_validator = EnumAttributeValidator.new('String', ["facebook_login"])
|
|
158
|
+
return false unless login_method_validator.valid?(@login_method)
|
|
159
|
+
true
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
163
|
+
# @param [Object] platform Object to be assigned
|
|
164
|
+
def platform=(platform)
|
|
165
|
+
validator = EnumAttributeValidator.new('String', ["instagram"])
|
|
166
|
+
unless validator.valid?(platform)
|
|
167
|
+
fail ArgumentError, "invalid value for \"platform\", must be one of #{validator.allowable_values}."
|
|
168
|
+
end
|
|
169
|
+
@platform = platform
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
173
|
+
# @param [Object] login_method Object to be assigned
|
|
174
|
+
def login_method=(login_method)
|
|
175
|
+
validator = EnumAttributeValidator.new('String', ["facebook_login"])
|
|
176
|
+
unless validator.valid?(login_method)
|
|
177
|
+
fail ArgumentError, "invalid value for \"login_method\", must be one of #{validator.allowable_values}."
|
|
178
|
+
end
|
|
179
|
+
@login_method = login_method
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# Checks equality by comparing each attribute.
|
|
183
|
+
# @param [Object] Object to be compared
|
|
184
|
+
def ==(o)
|
|
185
|
+
return true if self.equal?(o)
|
|
186
|
+
self.class == o.class &&
|
|
187
|
+
account_id == o.account_id &&
|
|
188
|
+
platform == o.platform &&
|
|
189
|
+
username == o.username &&
|
|
190
|
+
display_name == o.display_name &&
|
|
191
|
+
profile_picture == o.profile_picture &&
|
|
192
|
+
is_active == o.is_active &&
|
|
193
|
+
login_method == o.login_method
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
# @see the `==` method
|
|
197
|
+
# @param [Object] Object to be compared
|
|
198
|
+
def eql?(o)
|
|
199
|
+
self == o
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# Calculates hash code according to all attributes.
|
|
203
|
+
# @return [Integer] Hash code
|
|
204
|
+
def hash
|
|
205
|
+
[account_id, platform, username, display_name, profile_picture, is_active, login_method].hash
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
# Builds the object from hash
|
|
209
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
210
|
+
# @return [Object] Returns the model itself
|
|
211
|
+
def self.build_from_hash(attributes)
|
|
212
|
+
return nil unless attributes.is_a?(Hash)
|
|
213
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
214
|
+
transformed_hash = {}
|
|
215
|
+
openapi_types.each_pair do |key, type|
|
|
216
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
217
|
+
transformed_hash["#{key}"] = nil
|
|
218
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
219
|
+
# check to ensure the input is an array given that the attribute
|
|
220
|
+
# is documented as an array but the input is not
|
|
221
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
222
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
223
|
+
end
|
|
224
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
225
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
226
|
+
end
|
|
227
|
+
end
|
|
228
|
+
new(transformed_hash)
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
# Returns the object in the form of hash
|
|
232
|
+
# @return [Hash] Returns the object in the form of hash
|
|
233
|
+
def to_hash
|
|
234
|
+
hash = {}
|
|
235
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
236
|
+
value = self.send(attr)
|
|
237
|
+
if value.nil?
|
|
238
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
239
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
hash[param] = _to_hash(value)
|
|
243
|
+
end
|
|
244
|
+
hash
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
end
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.4
|
|
7
|
+
Contact: support@zernio.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Zernio
|
|
17
|
+
class SelectInstagramAccountRequest < ApiModelBase
|
|
18
|
+
# Profile ID from your connection flow
|
|
19
|
+
attr_accessor :profile_id
|
|
20
|
+
|
|
21
|
+
# The Facebook Page ID selected by the user, from GET /v1/connect/instagram/select-account
|
|
22
|
+
attr_accessor :page_id
|
|
23
|
+
|
|
24
|
+
# Long-lived Facebook user access token from the OAuth callback redirect
|
|
25
|
+
attr_accessor :temp_token
|
|
26
|
+
|
|
27
|
+
# Optional custom redirect URL to return to after selection
|
|
28
|
+
attr_accessor :redirect_url
|
|
29
|
+
|
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
31
|
+
def self.attribute_map
|
|
32
|
+
{
|
|
33
|
+
:'profile_id' => :'profileId',
|
|
34
|
+
:'page_id' => :'pageId',
|
|
35
|
+
:'temp_token' => :'tempToken',
|
|
36
|
+
:'redirect_url' => :'redirect_url'
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Returns attribute mapping this model knows about
|
|
41
|
+
def self.acceptable_attribute_map
|
|
42
|
+
attribute_map
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Returns all the JSON keys this model knows about
|
|
46
|
+
def self.acceptable_attributes
|
|
47
|
+
acceptable_attribute_map.values
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Attribute type mapping.
|
|
51
|
+
def self.openapi_types
|
|
52
|
+
{
|
|
53
|
+
:'profile_id' => :'String',
|
|
54
|
+
:'page_id' => :'String',
|
|
55
|
+
:'temp_token' => :'String',
|
|
56
|
+
:'redirect_url' => :'String'
|
|
57
|
+
}
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# List of attributes with nullable: true
|
|
61
|
+
def self.openapi_nullable
|
|
62
|
+
Set.new([
|
|
63
|
+
])
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Initializes the object
|
|
67
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
68
|
+
def initialize(attributes = {})
|
|
69
|
+
if (!attributes.is_a?(Hash))
|
|
70
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::SelectInstagramAccountRequest` initialize method"
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
74
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
75
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
76
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
77
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::SelectInstagramAccountRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
78
|
+
end
|
|
79
|
+
h[k.to_sym] = v
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if attributes.key?(:'profile_id')
|
|
83
|
+
self.profile_id = attributes[:'profile_id']
|
|
84
|
+
else
|
|
85
|
+
self.profile_id = nil
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
if attributes.key?(:'page_id')
|
|
89
|
+
self.page_id = attributes[:'page_id']
|
|
90
|
+
else
|
|
91
|
+
self.page_id = nil
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
if attributes.key?(:'temp_token')
|
|
95
|
+
self.temp_token = attributes[:'temp_token']
|
|
96
|
+
else
|
|
97
|
+
self.temp_token = nil
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
if attributes.key?(:'redirect_url')
|
|
101
|
+
self.redirect_url = attributes[:'redirect_url']
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
106
|
+
# @return Array for valid properties with the reasons
|
|
107
|
+
def list_invalid_properties
|
|
108
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
109
|
+
invalid_properties = Array.new
|
|
110
|
+
if @profile_id.nil?
|
|
111
|
+
invalid_properties.push('invalid value for "profile_id", profile_id cannot be nil.')
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if @page_id.nil?
|
|
115
|
+
invalid_properties.push('invalid value for "page_id", page_id cannot be nil.')
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
if @temp_token.nil?
|
|
119
|
+
invalid_properties.push('invalid value for "temp_token", temp_token cannot be nil.')
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
invalid_properties
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Check to see if the all the properties in the model are valid
|
|
126
|
+
# @return true if the model is valid
|
|
127
|
+
def valid?
|
|
128
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
129
|
+
return false if @profile_id.nil?
|
|
130
|
+
return false if @page_id.nil?
|
|
131
|
+
return false if @temp_token.nil?
|
|
132
|
+
true
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Custom attribute writer method with validation
|
|
136
|
+
# @param [Object] profile_id Value to be assigned
|
|
137
|
+
def profile_id=(profile_id)
|
|
138
|
+
if profile_id.nil?
|
|
139
|
+
fail ArgumentError, 'profile_id cannot be nil'
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
@profile_id = profile_id
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Custom attribute writer method with validation
|
|
146
|
+
# @param [Object] page_id Value to be assigned
|
|
147
|
+
def page_id=(page_id)
|
|
148
|
+
if page_id.nil?
|
|
149
|
+
fail ArgumentError, 'page_id cannot be nil'
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
@page_id = page_id
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Custom attribute writer method with validation
|
|
156
|
+
# @param [Object] temp_token Value to be assigned
|
|
157
|
+
def temp_token=(temp_token)
|
|
158
|
+
if temp_token.nil?
|
|
159
|
+
fail ArgumentError, 'temp_token cannot be nil'
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
@temp_token = temp_token
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Checks equality by comparing each attribute.
|
|
166
|
+
# @param [Object] Object to be compared
|
|
167
|
+
def ==(o)
|
|
168
|
+
return true if self.equal?(o)
|
|
169
|
+
self.class == o.class &&
|
|
170
|
+
profile_id == o.profile_id &&
|
|
171
|
+
page_id == o.page_id &&
|
|
172
|
+
temp_token == o.temp_token &&
|
|
173
|
+
redirect_url == o.redirect_url
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
# @see the `==` method
|
|
177
|
+
# @param [Object] Object to be compared
|
|
178
|
+
def eql?(o)
|
|
179
|
+
self == o
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# Calculates hash code according to all attributes.
|
|
183
|
+
# @return [Integer] Hash code
|
|
184
|
+
def hash
|
|
185
|
+
[profile_id, page_id, temp_token, redirect_url].hash
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# Builds the object from hash
|
|
189
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
190
|
+
# @return [Object] Returns the model itself
|
|
191
|
+
def self.build_from_hash(attributes)
|
|
192
|
+
return nil unless attributes.is_a?(Hash)
|
|
193
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
194
|
+
transformed_hash = {}
|
|
195
|
+
openapi_types.each_pair do |key, type|
|
|
196
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
197
|
+
transformed_hash["#{key}"] = nil
|
|
198
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
199
|
+
# check to ensure the input is an array given that the attribute
|
|
200
|
+
# is documented as an array but the input is not
|
|
201
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
202
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
203
|
+
end
|
|
204
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
205
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
206
|
+
end
|
|
207
|
+
end
|
|
208
|
+
new(transformed_hash)
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# Returns the object in the form of hash
|
|
212
|
+
# @return [Hash] Returns the object in the form of hash
|
|
213
|
+
def to_hash
|
|
214
|
+
hash = {}
|
|
215
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
216
|
+
value = self.send(attr)
|
|
217
|
+
if value.nil?
|
|
218
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
219
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
hash[param] = _to_hash(value)
|
|
223
|
+
end
|
|
224
|
+
hash
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
end
|
data/lib/zernio-sdk/version.rb
CHANGED
data/lib/zernio-sdk.rb
CHANGED
|
@@ -903,6 +903,9 @@ require 'zernio-sdk/models/list_inbox_reviews200_response_data_inner'
|
|
|
903
903
|
require 'zernio-sdk/models/list_inbox_reviews200_response_data_inner_reply'
|
|
904
904
|
require 'zernio-sdk/models/list_inbox_reviews200_response_data_inner_reviewer'
|
|
905
905
|
require 'zernio-sdk/models/list_inbox_reviews200_response_summary'
|
|
906
|
+
require 'zernio-sdk/models/list_instagram_pages200_response'
|
|
907
|
+
require 'zernio-sdk/models/list_instagram_pages200_response_pages_inner'
|
|
908
|
+
require 'zernio-sdk/models/list_instagram_pages200_response_pages_inner_instagram_business_account'
|
|
906
909
|
require 'zernio-sdk/models/list_instagram_stories200_response'
|
|
907
910
|
require 'zernio-sdk/models/list_instagram_stories200_response_data_inner'
|
|
908
911
|
require 'zernio-sdk/models/list_lead_forms200_response'
|
|
@@ -1148,6 +1151,9 @@ require 'zernio-sdk/models/select_facebook_page_request_user_profile'
|
|
|
1148
1151
|
require 'zernio-sdk/models/select_google_business_location200_response'
|
|
1149
1152
|
require 'zernio-sdk/models/select_google_business_location200_response_account'
|
|
1150
1153
|
require 'zernio-sdk/models/select_google_business_location_request'
|
|
1154
|
+
require 'zernio-sdk/models/select_instagram_account200_response'
|
|
1155
|
+
require 'zernio-sdk/models/select_instagram_account200_response_account'
|
|
1156
|
+
require 'zernio-sdk/models/select_instagram_account_request'
|
|
1151
1157
|
require 'zernio-sdk/models/select_linked_in_organization200_response'
|
|
1152
1158
|
require 'zernio-sdk/models/select_linked_in_organization200_response_account'
|
|
1153
1159
|
require 'zernio-sdk/models/select_linked_in_organization200_response_bulk_refresh'
|
data/openapi.yaml
CHANGED
|
@@ -15705,6 +15705,17 @@ paths:
|
|
|
15705
15705
|
in: query
|
|
15706
15706
|
schema: { type: boolean, default: false }
|
|
15707
15707
|
description: When true, the user is redirected to your redirect_url with raw OAuth data (code, state) instead of Zernio's default account selection UI. Use this to build a custom connect experience.
|
|
15708
|
+
- name: loginMethod
|
|
15709
|
+
in: query
|
|
15710
|
+
schema: { type: string, enum: [instagram_login, facebook_login], default: instagram_login }
|
|
15711
|
+
description: |
|
|
15712
|
+
Instagram only. Which of the two Instagram connection methods to use. Ignored for every other platform.
|
|
15713
|
+
|
|
15714
|
+
`instagram_login` (the default, and what you get if you omit this): the Instagram Login dialog. The user authorizes their Instagram professional account directly, no Facebook Page required.
|
|
15715
|
+
|
|
15716
|
+
`facebook_login`: the Facebook Login dialog, i.e. "Instagram API with Facebook Login". The user authorizes a Facebook Page that has a linked Instagram professional account, and every API call for that account then runs through the Page. Use this when the customer manages Instagram through a Page and expects the Facebook consent screen. Because the user has to pick which Page to connect, the callback continues at the account-selection step, `/v1/connect/instagram/select-account`.
|
|
15717
|
+
|
|
15718
|
+
`facebook_login` does not support `headless=true`: its callback always redirects to Zernio's hosted account-selection page. Pass a `redirect_url` and let the standard flow return the user to you.
|
|
15708
15719
|
security:
|
|
15709
15720
|
- bearerAuth: []
|
|
15710
15721
|
responses:
|
|
@@ -16135,6 +16146,142 @@ paths:
|
|
|
16135
16146
|
'500':
|
|
16136
16147
|
description: Failed to save Facebook connection
|
|
16137
16148
|
|
|
16149
|
+
/v1/connect/instagram/select-account:
|
|
16150
|
+
get:
|
|
16151
|
+
operationId: listInstagramPages
|
|
16152
|
+
tags: [Connect]
|
|
16153
|
+
summary: List Pages with a linked Instagram account
|
|
16154
|
+
description: |
|
|
16155
|
+
Completes the `loginMethod=facebook_login` Instagram flow, i.e. "Instagram API with Facebook Login".
|
|
16156
|
+
|
|
16157
|
+
After the user authorizes on Facebook, extract `tempToken` from the redirect params and pass it here to list the Facebook Pages they manage. Only Pages that have a linked Instagram professional account are returned, so an empty array means the user has no eligible Page. Use the X-Connect-Token header if connecting via API key.
|
|
16158
|
+
|
|
16159
|
+
Not used by the default `instagram_login` flow, which creates the account without a selection step.
|
|
16160
|
+
parameters:
|
|
16161
|
+
- name: profileId
|
|
16162
|
+
in: query
|
|
16163
|
+
required: true
|
|
16164
|
+
schema: { type: string }
|
|
16165
|
+
description: Profile ID from your connection flow
|
|
16166
|
+
- name: tempToken
|
|
16167
|
+
in: query
|
|
16168
|
+
required: true
|
|
16169
|
+
schema: { type: string }
|
|
16170
|
+
description: Long-lived Facebook user access token from the OAuth callback redirect
|
|
16171
|
+
security:
|
|
16172
|
+
- bearerAuth: []
|
|
16173
|
+
- connectToken: []
|
|
16174
|
+
responses:
|
|
16175
|
+
'200':
|
|
16176
|
+
description: Facebook Pages that have a linked Instagram professional account
|
|
16177
|
+
content:
|
|
16178
|
+
application/json:
|
|
16179
|
+
schema:
|
|
16180
|
+
type: object
|
|
16181
|
+
properties:
|
|
16182
|
+
pages:
|
|
16183
|
+
type: array
|
|
16184
|
+
items:
|
|
16185
|
+
type: object
|
|
16186
|
+
properties:
|
|
16187
|
+
id: { type: string, description: Facebook Page ID }
|
|
16188
|
+
name: { type: string, description: Page name }
|
|
16189
|
+
access_token: { type: string, description: Page-specific access token }
|
|
16190
|
+
instagram_business_account:
|
|
16191
|
+
type: object
|
|
16192
|
+
description: The Instagram professional account linked to this Page
|
|
16193
|
+
properties:
|
|
16194
|
+
id: { type: string, description: Instagram Business Account ID }
|
|
16195
|
+
username: { type: string }
|
|
16196
|
+
profile_picture_url: { type: string }
|
|
16197
|
+
example:
|
|
16198
|
+
pages:
|
|
16199
|
+
- id: "811889972008357"
|
|
16200
|
+
name: "My Brand Page"
|
|
16201
|
+
access_token: "EAAxxxxx..."
|
|
16202
|
+
instagram_business_account:
|
|
16203
|
+
id: "17841400649984407"
|
|
16204
|
+
username: "mybrand"
|
|
16205
|
+
profile_picture_url: "https://..."
|
|
16206
|
+
'400': { description: 'Missing required parameters (profileId or tempToken)' }
|
|
16207
|
+
'401': { $ref: '#/components/responses/Unauthorized' }
|
|
16208
|
+
'403': { description: User does not have access to the specified profile }
|
|
16209
|
+
post:
|
|
16210
|
+
operationId: selectInstagramAccount
|
|
16211
|
+
tags: [Connect]
|
|
16212
|
+
summary: Select the Page whose Instagram account to connect
|
|
16213
|
+
description: |
|
|
16214
|
+
Saves the selected Page as an Instagram account connected via Facebook Login. The Page access token becomes the account's access token, so every Instagram call for it runs against the Facebook Graph host.
|
|
16215
|
+
|
|
16216
|
+
One Instagram account per profile: if the profile already has an Instagram account, this replaces it, and picking a different Instagram identity purges the previous account's conversations, external posts and stats.
|
|
16217
|
+
requestBody:
|
|
16218
|
+
required: true
|
|
16219
|
+
content:
|
|
16220
|
+
application/json:
|
|
16221
|
+
schema:
|
|
16222
|
+
type: object
|
|
16223
|
+
required: [profileId, pageId, tempToken]
|
|
16224
|
+
properties:
|
|
16225
|
+
profileId:
|
|
16226
|
+
type: string
|
|
16227
|
+
description: Profile ID from your connection flow
|
|
16228
|
+
pageId:
|
|
16229
|
+
type: string
|
|
16230
|
+
description: 'The Facebook Page ID selected by the user, from GET /v1/connect/instagram/select-account'
|
|
16231
|
+
tempToken:
|
|
16232
|
+
type: string
|
|
16233
|
+
description: Long-lived Facebook user access token from the OAuth callback redirect
|
|
16234
|
+
redirect_url:
|
|
16235
|
+
type: string
|
|
16236
|
+
format: uri
|
|
16237
|
+
description: Optional custom redirect URL to return to after selection
|
|
16238
|
+
example:
|
|
16239
|
+
profileId: "507f1f77bcf86cd799439011"
|
|
16240
|
+
pageId: "811889972008357"
|
|
16241
|
+
tempToken: "EAAxxxxx..."
|
|
16242
|
+
redirect_url: "https://yourdomain.com/integrations/callback"
|
|
16243
|
+
security:
|
|
16244
|
+
- bearerAuth: []
|
|
16245
|
+
- connectToken: []
|
|
16246
|
+
responses:
|
|
16247
|
+
'200':
|
|
16248
|
+
description: Instagram account connected
|
|
16249
|
+
content:
|
|
16250
|
+
application/json:
|
|
16251
|
+
schema:
|
|
16252
|
+
type: object
|
|
16253
|
+
properties:
|
|
16254
|
+
message: { type: string }
|
|
16255
|
+
redirect_url:
|
|
16256
|
+
type: string
|
|
16257
|
+
description: Redirect URL if a custom redirect_url was provided
|
|
16258
|
+
account:
|
|
16259
|
+
type: object
|
|
16260
|
+
properties:
|
|
16261
|
+
accountId: { type: string, description: ID of the created SocialAccount }
|
|
16262
|
+
platform: { type: string, enum: [instagram] }
|
|
16263
|
+
username: { type: string }
|
|
16264
|
+
displayName: { type: string, description: Name of the Facebook Page backing this account }
|
|
16265
|
+
profilePicture: { type: string }
|
|
16266
|
+
isActive: { type: boolean }
|
|
16267
|
+
loginMethod: { type: string, enum: [facebook_login] }
|
|
16268
|
+
example:
|
|
16269
|
+
message: "Instagram (via Facebook) connected"
|
|
16270
|
+
account:
|
|
16271
|
+
accountId: "64e1f0a9e2b5af0012ab34cd"
|
|
16272
|
+
platform: "instagram"
|
|
16273
|
+
username: "mybrand"
|
|
16274
|
+
displayName: "My Brand Page"
|
|
16275
|
+
profilePicture: "https://..."
|
|
16276
|
+
isActive: true
|
|
16277
|
+
loginMethod: "facebook_login"
|
|
16278
|
+
'400':
|
|
16279
|
+
description: 'Missing required fields, or the selected Page has no linked Instagram professional account'
|
|
16280
|
+
'401': { $ref: '#/components/responses/Unauthorized' }
|
|
16281
|
+
'402': { $ref: '#/components/responses/PaymentRequired' }
|
|
16282
|
+
'403': { description: User does not have access to the specified profile }
|
|
16283
|
+
'404': { description: Selected page not found among the pages this token can manage }
|
|
16284
|
+
|
|
16138
16285
|
/v1/connect/googlebusiness/locations:
|
|
16139
16286
|
get:
|
|
16140
16287
|
x-resource-group: "accounts"
|