late-sdk 0.0.56 → 0.0.57

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.
@@ -17,6 +17,10 @@ module Late
17
17
  class AnalyticsSinglePostResponse < ApiModelBase
18
18
  attr_accessor :post_id
19
19
 
20
+ # Original Late post ID if scheduled via Late
21
+ attr_accessor :late_post_id
22
+
23
+ # Overall post status. \"partial\" when some platforms published and others failed.
20
24
  attr_accessor :status
21
25
 
22
26
  attr_accessor :content
@@ -35,6 +39,12 @@ module Late
35
39
 
36
40
  attr_accessor :is_external
37
41
 
42
+ # Overall sync state across all platforms
43
+ attr_accessor :sync_status
44
+
45
+ # Human-readable status message for pending, partial, or failed states
46
+ attr_accessor :message
47
+
38
48
  attr_accessor :thumbnail_url
39
49
 
40
50
  attr_accessor :media_type
@@ -68,6 +78,7 @@ module Late
68
78
  def self.attribute_map
69
79
  {
70
80
  :'post_id' => :'postId',
81
+ :'late_post_id' => :'latePostId',
71
82
  :'status' => :'status',
72
83
  :'content' => :'content',
73
84
  :'scheduled_for' => :'scheduledFor',
@@ -77,6 +88,8 @@ module Late
77
88
  :'platform' => :'platform',
78
89
  :'platform_post_url' => :'platformPostUrl',
79
90
  :'is_external' => :'isExternal',
91
+ :'sync_status' => :'syncStatus',
92
+ :'message' => :'message',
80
93
  :'thumbnail_url' => :'thumbnailUrl',
81
94
  :'media_type' => :'mediaType',
82
95
  :'media_items' => :'mediaItems'
@@ -97,6 +110,7 @@ module Late
97
110
  def self.openapi_types
98
111
  {
99
112
  :'post_id' => :'String',
113
+ :'late_post_id' => :'String',
100
114
  :'status' => :'String',
101
115
  :'content' => :'String',
102
116
  :'scheduled_for' => :'Time',
@@ -106,6 +120,8 @@ module Late
106
120
  :'platform' => :'String',
107
121
  :'platform_post_url' => :'String',
108
122
  :'is_external' => :'Boolean',
123
+ :'sync_status' => :'String',
124
+ :'message' => :'String',
109
125
  :'thumbnail_url' => :'String',
110
126
  :'media_type' => :'String',
111
127
  :'media_items' => :'Array<AnalyticsSinglePostResponseMediaItemsInner>'
@@ -138,6 +154,10 @@ module Late
138
154
  self.post_id = attributes[:'post_id']
139
155
  end
140
156
 
157
+ if attributes.key?(:'late_post_id')
158
+ self.late_post_id = attributes[:'late_post_id']
159
+ end
160
+
141
161
  if attributes.key?(:'status')
142
162
  self.status = attributes[:'status']
143
163
  end
@@ -176,6 +196,14 @@ module Late
176
196
  self.is_external = attributes[:'is_external']
177
197
  end
178
198
 
199
+ if attributes.key?(:'sync_status')
200
+ self.sync_status = attributes[:'sync_status']
201
+ end
202
+
203
+ if attributes.key?(:'message')
204
+ self.message = attributes[:'message']
205
+ end
206
+
179
207
  if attributes.key?(:'thumbnail_url')
180
208
  self.thumbnail_url = attributes[:'thumbnail_url']
181
209
  end
@@ -203,11 +231,35 @@ module Late
203
231
  # @return true if the model is valid
204
232
  def valid?
205
233
  warn '[DEPRECATED] the `valid?` method is obsolete'
234
+ status_validator = EnumAttributeValidator.new('String', ["published", "failed", "partial"])
235
+ return false unless status_validator.valid?(@status)
236
+ sync_status_validator = EnumAttributeValidator.new('String', ["synced", "pending", "partial", "unavailable"])
237
+ return false unless sync_status_validator.valid?(@sync_status)
206
238
  media_type_validator = EnumAttributeValidator.new('String', ["image", "video", "carousel", "text"])
207
239
  return false unless media_type_validator.valid?(@media_type)
208
240
  true
209
241
  end
210
242
 
243
+ # Custom attribute writer method checking allowed values (enum).
244
+ # @param [Object] status Object to be assigned
245
+ def status=(status)
246
+ validator = EnumAttributeValidator.new('String', ["published", "failed", "partial"])
247
+ unless validator.valid?(status)
248
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
249
+ end
250
+ @status = status
251
+ end
252
+
253
+ # Custom attribute writer method checking allowed values (enum).
254
+ # @param [Object] sync_status Object to be assigned
255
+ def sync_status=(sync_status)
256
+ validator = EnumAttributeValidator.new('String', ["synced", "pending", "partial", "unavailable"])
257
+ unless validator.valid?(sync_status)
258
+ fail ArgumentError, "invalid value for \"sync_status\", must be one of #{validator.allowable_values}."
259
+ end
260
+ @sync_status = sync_status
261
+ end
262
+
211
263
  # Custom attribute writer method checking allowed values (enum).
212
264
  # @param [Object] media_type Object to be assigned
213
265
  def media_type=(media_type)
@@ -224,6 +276,7 @@ module Late
224
276
  return true if self.equal?(o)
225
277
  self.class == o.class &&
226
278
  post_id == o.post_id &&
279
+ late_post_id == o.late_post_id &&
227
280
  status == o.status &&
228
281
  content == o.content &&
229
282
  scheduled_for == o.scheduled_for &&
@@ -233,6 +286,8 @@ module Late
233
286
  platform == o.platform &&
234
287
  platform_post_url == o.platform_post_url &&
235
288
  is_external == o.is_external &&
289
+ sync_status == o.sync_status &&
290
+ message == o.message &&
236
291
  thumbnail_url == o.thumbnail_url &&
237
292
  media_type == o.media_type &&
238
293
  media_items == o.media_items
@@ -247,7 +302,7 @@ module Late
247
302
  # Calculates hash code according to all attributes.
248
303
  # @return [Integer] Hash code
249
304
  def hash
250
- [post_id, status, content, scheduled_for, published_at, analytics, platform_analytics, platform, platform_post_url, is_external, thumbnail_url, media_type, media_items].hash
305
+ [post_id, late_post_id, status, content, scheduled_for, published_at, analytics, platform_analytics, platform, platform_post_url, is_external, sync_status, message, thumbnail_url, media_type, media_items].hash
251
306
  end
252
307
 
253
308
  # Builds the object from hash
@@ -0,0 +1,157 @@
1
+ =begin
2
+ #Late API
3
+
4
+ #API reference for Late. Authenticate with a Bearer API key. Base URL: https://getlate.dev/api
5
+
6
+ The version of the OpenAPI document: 1.0.1
7
+ Contact: support@getlate.dev
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 Late
17
+ class GetAnalytics400Response < ApiModelBase
18
+ attr_accessor :error
19
+
20
+ # Detailed validation errors
21
+ attr_accessor :details
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'error' => :'error',
27
+ :'details' => :'details'
28
+ }
29
+ end
30
+
31
+ # Returns attribute mapping this model knows about
32
+ def self.acceptable_attribute_map
33
+ attribute_map
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ acceptable_attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'error' => :'String',
45
+ :'details' => :'Object'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::GetAnalytics400Response` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ acceptable_attribute_map = self.class.acceptable_attribute_map
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!acceptable_attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::GetAnalytics400Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'error')
72
+ self.error = attributes[:'error']
73
+ end
74
+
75
+ if attributes.key?(:'details')
76
+ self.details = attributes[:'details']
77
+ end
78
+ end
79
+
80
+ # Show invalid properties with the reasons. Usually used together with valid?
81
+ # @return Array for valid properties with the reasons
82
+ def list_invalid_properties
83
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
84
+ invalid_properties = Array.new
85
+ invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ warn '[DEPRECATED] the `valid?` method is obsolete'
92
+ true
93
+ end
94
+
95
+ # Checks equality by comparing each attribute.
96
+ # @param [Object] Object to be compared
97
+ def ==(o)
98
+ return true if self.equal?(o)
99
+ self.class == o.class &&
100
+ error == o.error &&
101
+ details == o.details
102
+ end
103
+
104
+ # @see the `==` method
105
+ # @param [Object] Object to be compared
106
+ def eql?(o)
107
+ self == o
108
+ end
109
+
110
+ # Calculates hash code according to all attributes.
111
+ # @return [Integer] Hash code
112
+ def hash
113
+ [error, details].hash
114
+ end
115
+
116
+ # Builds the object from hash
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ # @return [Object] Returns the model itself
119
+ def self.build_from_hash(attributes)
120
+ return nil unless attributes.is_a?(Hash)
121
+ attributes = attributes.transform_keys(&:to_sym)
122
+ transformed_hash = {}
123
+ openapi_types.each_pair do |key, type|
124
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
125
+ transformed_hash["#{key}"] = nil
126
+ elsif type =~ /\AArray<(.*)>/i
127
+ # check to ensure the input is an array given that the attribute
128
+ # is documented as an array but the input is not
129
+ if attributes[attribute_map[key]].is_a?(Array)
130
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
131
+ end
132
+ elsif !attributes[attribute_map[key]].nil?
133
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
134
+ end
135
+ end
136
+ new(transformed_hash)
137
+ end
138
+
139
+ # Returns the object in the form of hash
140
+ # @return [Hash] Returns the object in the form of hash
141
+ def to_hash
142
+ hash = {}
143
+ self.class.attribute_map.each_pair do |attr, param|
144
+ value = self.send(attr)
145
+ if value.nil?
146
+ is_nullable = self.class.openapi_nullable.include?(attr)
147
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
148
+ end
149
+
150
+ hash[param] = _to_hash(value)
151
+ end
152
+ hash
153
+ end
154
+
155
+ end
156
+
157
+ end
@@ -25,7 +25,35 @@ module Late
25
25
 
26
26
  attr_accessor :analytics
27
27
 
28
- attr_accessor :account_metrics
28
+ # Sync state of analytics for this platform
29
+ attr_accessor :sync_status
30
+
31
+ attr_accessor :platform_post_url
32
+
33
+ # Error details when status is failed
34
+ attr_accessor :error_message
35
+
36
+ class EnumAttributeValidator
37
+ attr_reader :datatype
38
+ attr_reader :allowable_values
39
+
40
+ def initialize(datatype, allowable_values)
41
+ @allowable_values = allowable_values.map do |value|
42
+ case datatype.to_s
43
+ when /Integer/i
44
+ value.to_i
45
+ when /Float/i
46
+ value.to_f
47
+ else
48
+ value
49
+ end
50
+ end
51
+ end
52
+
53
+ def valid?(value)
54
+ !value || allowable_values.include?(value)
55
+ end
56
+ end
29
57
 
30
58
  # Attribute mapping from ruby-style variable name to JSON key.
31
59
  def self.attribute_map
@@ -35,7 +63,9 @@ module Late
35
63
  :'account_id' => :'accountId',
36
64
  :'account_username' => :'accountUsername',
37
65
  :'analytics' => :'analytics',
38
- :'account_metrics' => :'accountMetrics'
66
+ :'sync_status' => :'syncStatus',
67
+ :'platform_post_url' => :'platformPostUrl',
68
+ :'error_message' => :'errorMessage'
39
69
  }
40
70
  end
41
71
 
@@ -57,7 +87,9 @@ module Late
57
87
  :'account_id' => :'String',
58
88
  :'account_username' => :'String',
59
89
  :'analytics' => :'PostAnalytics',
60
- :'account_metrics' => :'PlatformAnalyticsAccountMetrics'
90
+ :'sync_status' => :'String',
91
+ :'platform_post_url' => :'String',
92
+ :'error_message' => :'String'
61
93
  }
62
94
  end
63
95
 
@@ -103,8 +135,16 @@ module Late
103
135
  self.analytics = attributes[:'analytics']
104
136
  end
105
137
 
106
- if attributes.key?(:'account_metrics')
107
- self.account_metrics = attributes[:'account_metrics']
138
+ if attributes.key?(:'sync_status')
139
+ self.sync_status = attributes[:'sync_status']
140
+ end
141
+
142
+ if attributes.key?(:'platform_post_url')
143
+ self.platform_post_url = attributes[:'platform_post_url']
144
+ end
145
+
146
+ if attributes.key?(:'error_message')
147
+ self.error_message = attributes[:'error_message']
108
148
  end
109
149
  end
110
150
 
@@ -120,9 +160,33 @@ module Late
120
160
  # @return true if the model is valid
121
161
  def valid?
122
162
  warn '[DEPRECATED] the `valid?` method is obsolete'
163
+ status_validator = EnumAttributeValidator.new('String', ["published", "failed"])
164
+ return false unless status_validator.valid?(@status)
165
+ sync_status_validator = EnumAttributeValidator.new('String', ["synced", "pending", "unavailable"])
166
+ return false unless sync_status_validator.valid?(@sync_status)
123
167
  true
124
168
  end
125
169
 
170
+ # Custom attribute writer method checking allowed values (enum).
171
+ # @param [Object] status Object to be assigned
172
+ def status=(status)
173
+ validator = EnumAttributeValidator.new('String', ["published", "failed"])
174
+ unless validator.valid?(status)
175
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
176
+ end
177
+ @status = status
178
+ end
179
+
180
+ # Custom attribute writer method checking allowed values (enum).
181
+ # @param [Object] sync_status Object to be assigned
182
+ def sync_status=(sync_status)
183
+ validator = EnumAttributeValidator.new('String', ["synced", "pending", "unavailable"])
184
+ unless validator.valid?(sync_status)
185
+ fail ArgumentError, "invalid value for \"sync_status\", must be one of #{validator.allowable_values}."
186
+ end
187
+ @sync_status = sync_status
188
+ end
189
+
126
190
  # Checks equality by comparing each attribute.
127
191
  # @param [Object] Object to be compared
128
192
  def ==(o)
@@ -133,7 +197,9 @@ module Late
133
197
  account_id == o.account_id &&
134
198
  account_username == o.account_username &&
135
199
  analytics == o.analytics &&
136
- account_metrics == o.account_metrics
200
+ sync_status == o.sync_status &&
201
+ platform_post_url == o.platform_post_url &&
202
+ error_message == o.error_message
137
203
  end
138
204
 
139
205
  # @see the `==` method
@@ -145,7 +211,7 @@ module Late
145
211
  # Calculates hash code according to all attributes.
146
212
  # @return [Integer] Hash code
147
213
  def hash
148
- [platform, status, account_id, account_username, analytics, account_metrics].hash
214
+ [platform, status, account_id, account_username, analytics, sync_status, platform_post_url, error_message].hash
149
215
  end
150
216
 
151
217
  # Builds the object from hash
@@ -11,5 +11,5 @@ Generator version: 7.19.0
11
11
  =end
12
12
 
13
13
  module Late
14
- VERSION = '0.0.56'
14
+ VERSION = '0.0.57'
15
15
  end
data/lib/late-sdk.rb CHANGED
@@ -28,6 +28,7 @@ require 'late-sdk/models/add_whats_app_broadcast_recipients_request_recipients_i
28
28
  require 'late-sdk/models/analytics_list_response'
29
29
  require 'late-sdk/models/analytics_list_response_posts_inner'
30
30
  require 'late-sdk/models/analytics_overview'
31
+ require 'late-sdk/models/analytics_overview_data_staleness'
31
32
  require 'late-sdk/models/analytics_single_post_response'
32
33
  require 'late-sdk/models/analytics_single_post_response_media_items_inner'
33
34
  require 'late-sdk/models/api_key'
@@ -140,6 +141,7 @@ require 'late-sdk/models/get_all_accounts_health200_response'
140
141
  require 'late-sdk/models/get_all_accounts_health200_response_accounts_inner'
141
142
  require 'late-sdk/models/get_all_accounts_health200_response_summary'
142
143
  require 'late-sdk/models/get_analytics200_response'
144
+ require 'late-sdk/models/get_analytics400_response'
143
145
  require 'late-sdk/models/get_analytics402_response'
144
146
  require 'late-sdk/models/get_best_time_to_post200_response'
145
147
  require 'late-sdk/models/get_best_time_to_post200_response_slots_inner'
@@ -345,7 +347,6 @@ require 'late-sdk/models/pagination'
345
347
  require 'late-sdk/models/pending'
346
348
  require 'late-sdk/models/pinterest_platform_data'
347
349
  require 'late-sdk/models/platform_analytics'
348
- require 'late-sdk/models/platform_analytics_account_metrics'
349
350
  require 'late-sdk/models/platform_target'
350
351
  require 'late-sdk/models/platform_target_account_id'
351
352
  require 'late-sdk/models/platform_target_platform_specific_data'