late-sdk 0.0.82 → 0.0.84
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 +3 -0
- data/docs/AnalyticsListResponsePostsInner.md +1 -1
- data/docs/AnalyticsSinglePostResponse.md +1 -1
- data/docs/ConnectWhatsAppCredentialsRequest.md +1 -1
- data/docs/PostsApi.md +72 -0
- data/docs/UpdatePostMetadata200Response.md +22 -0
- data/docs/UpdatePostMetadataRequest.md +28 -0
- data/lib/late-sdk/api/posts_api.rb +74 -0
- data/lib/late-sdk/models/analytics_list_response_posts_inner.rb +1 -1
- data/lib/late-sdk/models/analytics_single_post_response.rb +1 -1
- data/lib/late-sdk/models/connect_whats_app_credentials_request.rb +1 -1
- data/lib/late-sdk/models/update_post_metadata200_response.rb +167 -0
- data/lib/late-sdk/models/update_post_metadata_request.rb +272 -0
- data/lib/late-sdk/version.rb +1 -1
- data/lib/late-sdk.rb +2 -0
- data/openapi.yaml +81 -4
- data/spec/api/posts_api_spec.rb +13 -0
- data/spec/models/update_post_metadata200_response_spec.rb +48 -0
- data/spec/models/update_post_metadata_request_spec.rb +74 -0
- data/zernio-sdk-0.0.84.gem +0 -0
- metadata +644 -636
- data/zernio-sdk-0.0.82.gem +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 967903967418dd8f28a15d5beab47f4e52214c9901021cbedd04296373ff6cb1
|
|
4
|
+
data.tar.gz: 819421b6b636625a845d518cfdf7164f33ee03ab152f754874b28adb0fc7a06e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e08997943555fe4727591956e9ad9795a0ba93d5ea779119389f65e06186d04763bd3f4b597b152958d812d3d06e8463377275872456b2bc83efc5f1de8647c1
|
|
7
|
+
data.tar.gz: ddb7f3cd5c01f18d90265dd7c3af7b4e9b1944ff5538b95d1a8d0834ccb86f2a25c2af4e3d7a6ac21d4e878da6be4cefb9635d9b57a2c0778b4b8c822b7a16ad
|
data/README.md
CHANGED
|
@@ -200,6 +200,7 @@ Class | Method | HTTP request | Description
|
|
|
200
200
|
*Late::PostsApi* | [**retry_post**](docs/PostsApi.md#retry_post) | **POST** /v1/posts/{postId}/retry | Retry failed post
|
|
201
201
|
*Late::PostsApi* | [**unpublish_post**](docs/PostsApi.md#unpublish_post) | **POST** /v1/posts/{postId}/unpublish | Unpublish post
|
|
202
202
|
*Late::PostsApi* | [**update_post**](docs/PostsApi.md#update_post) | **PUT** /v1/posts/{postId} | Update post
|
|
203
|
+
*Late::PostsApi* | [**update_post_metadata**](docs/PostsApi.md#update_post_metadata) | **POST** /v1/posts/{postId}/update-metadata | Update post metadata
|
|
203
204
|
*Late::ProfilesApi* | [**create_profile**](docs/ProfilesApi.md#create_profile) | **POST** /v1/profiles | Create profile
|
|
204
205
|
*Late::ProfilesApi* | [**delete_profile**](docs/ProfilesApi.md#delete_profile) | **DELETE** /v1/profiles/{profileId} | Delete profile
|
|
205
206
|
*Late::ProfilesApi* | [**get_profile**](docs/ProfilesApi.md#get_profile) | **GET** /v1/profiles/{profileId} | Get profile
|
|
@@ -868,6 +869,8 @@ Class | Method | HTTP request | Description
|
|
|
868
869
|
- [Late::UpdateInboxConversationRequest](docs/UpdateInboxConversationRequest.md)
|
|
869
870
|
- [Late::UpdateLinkedInOrganizationRequest](docs/UpdateLinkedInOrganizationRequest.md)
|
|
870
871
|
- [Late::UpdatePinterestBoardsRequest](docs/UpdatePinterestBoardsRequest.md)
|
|
872
|
+
- [Late::UpdatePostMetadata200Response](docs/UpdatePostMetadata200Response.md)
|
|
873
|
+
- [Late::UpdatePostMetadataRequest](docs/UpdatePostMetadataRequest.md)
|
|
871
874
|
- [Late::UpdatePostRequest](docs/UpdatePostRequest.md)
|
|
872
875
|
- [Late::UpdateProfile200Response](docs/UpdateProfile200Response.md)
|
|
873
876
|
- [Late::UpdateProfileRequest](docs/UpdateProfileRequest.md)
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
7
|
| **_id** | **String** | | [optional] |
|
|
8
|
-
| **late_post_id** | **String** | Original
|
|
8
|
+
| **late_post_id** | **String** | Original Zernio post ID if scheduled via Zernio | [optional] |
|
|
9
9
|
| **content** | **String** | | [optional] |
|
|
10
10
|
| **scheduled_for** | **Time** | | [optional] |
|
|
11
11
|
| **published_at** | **Time** | | [optional] |
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
7
|
| **post_id** | **String** | | [optional] |
|
|
8
|
-
| **late_post_id** | **String** | Original
|
|
8
|
+
| **late_post_id** | **String** | Original Zernio post ID if scheduled via Zernio | [optional] |
|
|
9
9
|
| **status** | **String** | Overall post status. \"partial\" when some platforms published and others failed. | [optional] |
|
|
10
10
|
| **content** | **String** | | [optional] |
|
|
11
11
|
| **scheduled_for** | **Time** | | [optional] |
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
|
-
| **profile_id** | **String** | Your
|
|
7
|
+
| **profile_id** | **String** | Your Zernio profile ID | |
|
|
8
8
|
| **access_token** | **String** | Permanent System User access token from Meta Business Suite | |
|
|
9
9
|
| **waba_id** | **String** | WhatsApp Business Account ID from Meta | |
|
|
10
10
|
| **phone_number_id** | **String** | Phone Number ID from Meta WhatsApp Manager | |
|
data/docs/PostsApi.md
CHANGED
|
@@ -12,6 +12,7 @@ All URIs are relative to *https://zernio.com/api*
|
|
|
12
12
|
| [**retry_post**](PostsApi.md#retry_post) | **POST** /v1/posts/{postId}/retry | Retry failed post |
|
|
13
13
|
| [**unpublish_post**](PostsApi.md#unpublish_post) | **POST** /v1/posts/{postId}/unpublish | Unpublish post |
|
|
14
14
|
| [**update_post**](PostsApi.md#update_post) | **PUT** /v1/posts/{postId} | Update post |
|
|
15
|
+
| [**update_post_metadata**](PostsApi.md#update_post_metadata) | **POST** /v1/posts/{postId}/update-metadata | Update post metadata |
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
## bulk_upload_posts
|
|
@@ -595,3 +596,74 @@ end
|
|
|
595
596
|
- **Content-Type**: application/json
|
|
596
597
|
- **Accept**: application/json
|
|
597
598
|
|
|
599
|
+
|
|
600
|
+
## update_post_metadata
|
|
601
|
+
|
|
602
|
+
> <UpdatePostMetadata200Response> update_post_metadata(post_id, update_post_metadata_request)
|
|
603
|
+
|
|
604
|
+
Update post metadata
|
|
605
|
+
|
|
606
|
+
Updates metadata of an already-published post on the specified platform without re-uploading the media. Currently only supported for YouTube videos (title, description, tags, category, privacy status). The post must have \"published\" status on the target platform. At least one updatable field is required.
|
|
607
|
+
|
|
608
|
+
### Examples
|
|
609
|
+
|
|
610
|
+
```ruby
|
|
611
|
+
require 'time'
|
|
612
|
+
require 'late-sdk'
|
|
613
|
+
# setup authorization
|
|
614
|
+
Late.configure do |config|
|
|
615
|
+
# Configure Bearer authorization (JWT): bearerAuth
|
|
616
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
617
|
+
end
|
|
618
|
+
|
|
619
|
+
api_instance = Late::PostsApi.new
|
|
620
|
+
post_id = 'post_id_example' # String |
|
|
621
|
+
update_post_metadata_request = Late::UpdatePostMetadataRequest.new({platform: 'youtube'}) # UpdatePostMetadataRequest |
|
|
622
|
+
|
|
623
|
+
begin
|
|
624
|
+
# Update post metadata
|
|
625
|
+
result = api_instance.update_post_metadata(post_id, update_post_metadata_request)
|
|
626
|
+
p result
|
|
627
|
+
rescue Late::ApiError => e
|
|
628
|
+
puts "Error when calling PostsApi->update_post_metadata: #{e}"
|
|
629
|
+
end
|
|
630
|
+
```
|
|
631
|
+
|
|
632
|
+
#### Using the update_post_metadata_with_http_info variant
|
|
633
|
+
|
|
634
|
+
This returns an Array which contains the response data, status code and headers.
|
|
635
|
+
|
|
636
|
+
> <Array(<UpdatePostMetadata200Response>, Integer, Hash)> update_post_metadata_with_http_info(post_id, update_post_metadata_request)
|
|
637
|
+
|
|
638
|
+
```ruby
|
|
639
|
+
begin
|
|
640
|
+
# Update post metadata
|
|
641
|
+
data, status_code, headers = api_instance.update_post_metadata_with_http_info(post_id, update_post_metadata_request)
|
|
642
|
+
p status_code # => 2xx
|
|
643
|
+
p headers # => { ... }
|
|
644
|
+
p data # => <UpdatePostMetadata200Response>
|
|
645
|
+
rescue Late::ApiError => e
|
|
646
|
+
puts "Error when calling PostsApi->update_post_metadata_with_http_info: #{e}"
|
|
647
|
+
end
|
|
648
|
+
```
|
|
649
|
+
|
|
650
|
+
### Parameters
|
|
651
|
+
|
|
652
|
+
| Name | Type | Description | Notes |
|
|
653
|
+
| ---- | ---- | ----------- | ----- |
|
|
654
|
+
| **post_id** | **String** | | |
|
|
655
|
+
| **update_post_metadata_request** | [**UpdatePostMetadataRequest**](UpdatePostMetadataRequest.md) | | |
|
|
656
|
+
|
|
657
|
+
### Return type
|
|
658
|
+
|
|
659
|
+
[**UpdatePostMetadata200Response**](UpdatePostMetadata200Response.md)
|
|
660
|
+
|
|
661
|
+
### Authorization
|
|
662
|
+
|
|
663
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
664
|
+
|
|
665
|
+
### HTTP request headers
|
|
666
|
+
|
|
667
|
+
- **Content-Type**: application/json
|
|
668
|
+
- **Accept**: application/json
|
|
669
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Late::UpdatePostMetadata200Response
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **success** | **Boolean** | | [optional] |
|
|
8
|
+
| **message** | **String** | | [optional] |
|
|
9
|
+
| **updated_fields** | **Array<String>** | | [optional] |
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
require 'late-sdk'
|
|
15
|
+
|
|
16
|
+
instance = Late::UpdatePostMetadata200Response.new(
|
|
17
|
+
success: null,
|
|
18
|
+
message: null,
|
|
19
|
+
updated_fields: null
|
|
20
|
+
)
|
|
21
|
+
```
|
|
22
|
+
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Late::UpdatePostMetadataRequest
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **platform** | **String** | The platform to update metadata on | |
|
|
8
|
+
| **title** | **String** | New video title (max 100 characters for YouTube) | [optional] |
|
|
9
|
+
| **description** | **String** | New video description | [optional] |
|
|
10
|
+
| **tags** | **Array<String>** | Array of keyword tags (max 500 characters combined for YouTube) | [optional] |
|
|
11
|
+
| **category_id** | **String** | YouTube video category ID | [optional] |
|
|
12
|
+
| **privacy_status** | **String** | Video privacy setting | [optional] |
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```ruby
|
|
17
|
+
require 'late-sdk'
|
|
18
|
+
|
|
19
|
+
instance = Late::UpdatePostMetadataRequest.new(
|
|
20
|
+
platform: null,
|
|
21
|
+
title: null,
|
|
22
|
+
description: null,
|
|
23
|
+
tags: null,
|
|
24
|
+
category_id: null,
|
|
25
|
+
privacy_status: null
|
|
26
|
+
)
|
|
27
|
+
```
|
|
28
|
+
|
|
@@ -601,5 +601,79 @@ module Late
|
|
|
601
601
|
end
|
|
602
602
|
return data, status_code, headers
|
|
603
603
|
end
|
|
604
|
+
|
|
605
|
+
# Update post metadata
|
|
606
|
+
# Updates metadata of an already-published post on the specified platform without re-uploading the media. Currently only supported for YouTube videos (title, description, tags, category, privacy status). The post must have \"published\" status on the target platform. At least one updatable field is required.
|
|
607
|
+
# @param post_id [String]
|
|
608
|
+
# @param update_post_metadata_request [UpdatePostMetadataRequest]
|
|
609
|
+
# @param [Hash] opts the optional parameters
|
|
610
|
+
# @return [UpdatePostMetadata200Response]
|
|
611
|
+
def update_post_metadata(post_id, update_post_metadata_request, opts = {})
|
|
612
|
+
data, _status_code, _headers = update_post_metadata_with_http_info(post_id, update_post_metadata_request, opts)
|
|
613
|
+
data
|
|
614
|
+
end
|
|
615
|
+
|
|
616
|
+
# Update post metadata
|
|
617
|
+
# Updates metadata of an already-published post on the specified platform without re-uploading the media. Currently only supported for YouTube videos (title, description, tags, category, privacy status). The post must have \"published\" status on the target platform. At least one updatable field is required.
|
|
618
|
+
# @param post_id [String]
|
|
619
|
+
# @param update_post_metadata_request [UpdatePostMetadataRequest]
|
|
620
|
+
# @param [Hash] opts the optional parameters
|
|
621
|
+
# @return [Array<(UpdatePostMetadata200Response, Integer, Hash)>] UpdatePostMetadata200Response data, response status code and response headers
|
|
622
|
+
def update_post_metadata_with_http_info(post_id, update_post_metadata_request, opts = {})
|
|
623
|
+
if @api_client.config.debugging
|
|
624
|
+
@api_client.config.logger.debug 'Calling API: PostsApi.update_post_metadata ...'
|
|
625
|
+
end
|
|
626
|
+
# verify the required parameter 'post_id' is set
|
|
627
|
+
if @api_client.config.client_side_validation && post_id.nil?
|
|
628
|
+
fail ArgumentError, "Missing the required parameter 'post_id' when calling PostsApi.update_post_metadata"
|
|
629
|
+
end
|
|
630
|
+
# verify the required parameter 'update_post_metadata_request' is set
|
|
631
|
+
if @api_client.config.client_side_validation && update_post_metadata_request.nil?
|
|
632
|
+
fail ArgumentError, "Missing the required parameter 'update_post_metadata_request' when calling PostsApi.update_post_metadata"
|
|
633
|
+
end
|
|
634
|
+
# resource path
|
|
635
|
+
local_var_path = '/v1/posts/{postId}/update-metadata'.sub('{' + 'postId' + '}', CGI.escape(post_id.to_s))
|
|
636
|
+
|
|
637
|
+
# query parameters
|
|
638
|
+
query_params = opts[:query_params] || {}
|
|
639
|
+
|
|
640
|
+
# header parameters
|
|
641
|
+
header_params = opts[:header_params] || {}
|
|
642
|
+
# HTTP header 'Accept' (if needed)
|
|
643
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
644
|
+
# HTTP header 'Content-Type'
|
|
645
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
646
|
+
if !content_type.nil?
|
|
647
|
+
header_params['Content-Type'] = content_type
|
|
648
|
+
end
|
|
649
|
+
|
|
650
|
+
# form parameters
|
|
651
|
+
form_params = opts[:form_params] || {}
|
|
652
|
+
|
|
653
|
+
# http body (model)
|
|
654
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(update_post_metadata_request)
|
|
655
|
+
|
|
656
|
+
# return_type
|
|
657
|
+
return_type = opts[:debug_return_type] || 'UpdatePostMetadata200Response'
|
|
658
|
+
|
|
659
|
+
# auth_names
|
|
660
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
661
|
+
|
|
662
|
+
new_options = opts.merge(
|
|
663
|
+
:operation => :"PostsApi.update_post_metadata",
|
|
664
|
+
:header_params => header_params,
|
|
665
|
+
:query_params => query_params,
|
|
666
|
+
:form_params => form_params,
|
|
667
|
+
:body => post_body,
|
|
668
|
+
:auth_names => auth_names,
|
|
669
|
+
:return_type => return_type
|
|
670
|
+
)
|
|
671
|
+
|
|
672
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
673
|
+
if @api_client.config.debugging
|
|
674
|
+
@api_client.config.logger.debug "API called: PostsApi#update_post_metadata\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
675
|
+
end
|
|
676
|
+
return data, status_code, headers
|
|
677
|
+
end
|
|
604
678
|
end
|
|
605
679
|
end
|
|
@@ -17,7 +17,7 @@ module Late
|
|
|
17
17
|
class AnalyticsSinglePostResponse < ApiModelBase
|
|
18
18
|
attr_accessor :post_id
|
|
19
19
|
|
|
20
|
-
# Original
|
|
20
|
+
# Original Zernio post ID if scheduled via Zernio
|
|
21
21
|
attr_accessor :late_post_id
|
|
22
22
|
|
|
23
23
|
# Overall post status. \"partial\" when some platforms published and others failed.
|
|
@@ -0,0 +1,167 @@
|
|
|
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.1
|
|
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 Late
|
|
17
|
+
class UpdatePostMetadata200Response < ApiModelBase
|
|
18
|
+
attr_accessor :success
|
|
19
|
+
|
|
20
|
+
attr_accessor :message
|
|
21
|
+
|
|
22
|
+
attr_accessor :updated_fields
|
|
23
|
+
|
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
|
+
def self.attribute_map
|
|
26
|
+
{
|
|
27
|
+
:'success' => :'success',
|
|
28
|
+
:'message' => :'message',
|
|
29
|
+
:'updated_fields' => :'updatedFields'
|
|
30
|
+
}
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Returns attribute mapping this model knows about
|
|
34
|
+
def self.acceptable_attribute_map
|
|
35
|
+
attribute_map
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Returns all the JSON keys this model knows about
|
|
39
|
+
def self.acceptable_attributes
|
|
40
|
+
acceptable_attribute_map.values
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Attribute type mapping.
|
|
44
|
+
def self.openapi_types
|
|
45
|
+
{
|
|
46
|
+
:'success' => :'Boolean',
|
|
47
|
+
:'message' => :'String',
|
|
48
|
+
:'updated_fields' => :'Array<String>'
|
|
49
|
+
}
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# List of attributes with nullable: true
|
|
53
|
+
def self.openapi_nullable
|
|
54
|
+
Set.new([
|
|
55
|
+
])
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Initializes the object
|
|
59
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
60
|
+
def initialize(attributes = {})
|
|
61
|
+
if (!attributes.is_a?(Hash))
|
|
62
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Late::UpdatePostMetadata200Response` initialize method"
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
66
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
67
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
68
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
69
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Late::UpdatePostMetadata200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
70
|
+
end
|
|
71
|
+
h[k.to_sym] = v
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if attributes.key?(:'success')
|
|
75
|
+
self.success = attributes[:'success']
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'message')
|
|
79
|
+
self.message = attributes[:'message']
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
if attributes.key?(:'updated_fields')
|
|
83
|
+
if (value = attributes[:'updated_fields']).is_a?(Array)
|
|
84
|
+
self.updated_fields = value
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
90
|
+
# @return Array for valid properties with the reasons
|
|
91
|
+
def list_invalid_properties
|
|
92
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
93
|
+
invalid_properties = Array.new
|
|
94
|
+
invalid_properties
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Check to see if the all the properties in the model are valid
|
|
98
|
+
# @return true if the model is valid
|
|
99
|
+
def valid?
|
|
100
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
101
|
+
true
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Checks equality by comparing each attribute.
|
|
105
|
+
# @param [Object] Object to be compared
|
|
106
|
+
def ==(o)
|
|
107
|
+
return true if self.equal?(o)
|
|
108
|
+
self.class == o.class &&
|
|
109
|
+
success == o.success &&
|
|
110
|
+
message == o.message &&
|
|
111
|
+
updated_fields == o.updated_fields
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# @see the `==` method
|
|
115
|
+
# @param [Object] Object to be compared
|
|
116
|
+
def eql?(o)
|
|
117
|
+
self == o
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Calculates hash code according to all attributes.
|
|
121
|
+
# @return [Integer] Hash code
|
|
122
|
+
def hash
|
|
123
|
+
[success, message, updated_fields].hash
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Builds the object from hash
|
|
127
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
128
|
+
# @return [Object] Returns the model itself
|
|
129
|
+
def self.build_from_hash(attributes)
|
|
130
|
+
return nil unless attributes.is_a?(Hash)
|
|
131
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
132
|
+
transformed_hash = {}
|
|
133
|
+
openapi_types.each_pair do |key, type|
|
|
134
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
135
|
+
transformed_hash["#{key}"] = nil
|
|
136
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
137
|
+
# check to ensure the input is an array given that the attribute
|
|
138
|
+
# is documented as an array but the input is not
|
|
139
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
140
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
141
|
+
end
|
|
142
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
143
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
new(transformed_hash)
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Returns the object in the form of hash
|
|
150
|
+
# @return [Hash] Returns the object in the form of hash
|
|
151
|
+
def to_hash
|
|
152
|
+
hash = {}
|
|
153
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
154
|
+
value = self.send(attr)
|
|
155
|
+
if value.nil?
|
|
156
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
157
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
hash[param] = _to_hash(value)
|
|
161
|
+
end
|
|
162
|
+
hash
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
end
|