dyspatch_client 3.0.0 → 3.0.1
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 +5 -5
- data/README.md +17 -20
- data/docs/DraftsApi.md +4 -2
- data/docs/DraftsRead.md +1 -1
- data/docs/TemplatesApi.md +1 -1
- data/dyspatch_client.gemspec +1 -1
- data/lib/dyspatch_client.rb +1 -2
- data/lib/dyspatch_client/api/drafts_api.rb +4 -1
- data/lib/dyspatch_client/api/localizations_api.rb +1 -1
- data/lib/dyspatch_client/api/templates_api.rb +1 -1
- data/lib/dyspatch_client/api_client.rb +1 -1
- data/lib/dyspatch_client/api_error.rb +1 -1
- data/lib/dyspatch_client/configuration.rb +1 -1
- data/lib/dyspatch_client/models/api_error.rb +1 -1
- data/lib/dyspatch_client/models/body.rb +1 -1
- data/lib/dyspatch_client/models/compiled_read.rb +1 -1
- data/lib/dyspatch_client/models/created_at.rb +1 -1
- data/lib/dyspatch_client/models/cursor.rb +1 -1
- data/lib/dyspatch_client/models/draft_description.rb +1 -1
- data/lib/dyspatch_client/models/draft_id.rb +1 -1
- data/lib/dyspatch_client/models/draft_meta_read.rb +1 -1
- data/lib/dyspatch_client/models/draft_name.rb +1 -1
- data/lib/dyspatch_client/models/draft_read.rb +1 -1
- data/lib/dyspatch_client/models/draft_url.rb +1 -1
- data/lib/dyspatch_client/models/drafts_read.rb +2 -3
- data/lib/dyspatch_client/models/language_id.rb +1 -1
- data/lib/dyspatch_client/models/localization_id.rb +1 -1
- data/lib/dyspatch_client/models/localization_key_read.rb +1 -1
- data/lib/dyspatch_client/models/localization_meta_read.rb +1 -1
- data/lib/dyspatch_client/models/localization_name.rb +1 -1
- data/lib/dyspatch_client/models/localization_read.rb +1 -1
- data/lib/dyspatch_client/models/localization_url.rb +1 -1
- data/lib/dyspatch_client/models/template_description.rb +1 -1
- data/lib/dyspatch_client/models/template_id.rb +1 -1
- data/lib/dyspatch_client/models/template_meta_read.rb +1 -1
- data/lib/dyspatch_client/models/template_name.rb +1 -1
- data/lib/dyspatch_client/models/template_read.rb +1 -1
- data/lib/dyspatch_client/models/template_url.rb +1 -1
- data/lib/dyspatch_client/models/templates_read.rb +1 -1
- data/lib/dyspatch_client/models/updated_at.rb +1 -1
- data/lib/dyspatch_client/version.rb +2 -2
- metadata +15 -20
- data/docs/Body1.md +0 -8
- data/lib/dyspatch_client/models/body_1.rb +0 -183
- data/spec/models/body_1_spec.rb +0 -41
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 238489323d4d8e321f2ce5059e9baf4dd5975175b8b6058b1d2061a280e2002c
|
4
|
+
data.tar.gz: ea5d07242807bf52ce5f7f9f2d41fb3e774b45cc3a56fe8cca3d81af523d4fe0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68018572834ebfc10c1318dafc3f0019c6be4049105dd7f331c1c06ffd05568790c2ba5b0779f2434f54a116b0276f8322a141a8ff31ffaffcbfd663c231573f
|
7
|
+
data.tar.gz: fb59200c0c2e719fec0ccf7e8148dced12b57c0bf2e6f7b148f76a8070b34c5e5c79611c87b79d7efe4c14637f4a844c29bc0d543a632a2ca5f02c07bb6a230e
|
data/README.md
CHANGED
@@ -1,28 +1,27 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
DyspatchClient - the Ruby gem for the Dyspatch API
|
1
|
+
# Dyspatch Ruby API Client
|
4
2
|
|
5
3
|
# Introduction
|
6
4
|
|
7
|
-
The Dyspatch API is based on the REST paradigm and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch.
|
8
|
-
|
9
|
-
## API Client Libraries Dyspatch provides API Clients for the following languages and web frameworks:
|
10
|
-
- [Java](https://github.com/getdyspatch/dyspatch-java)
|
11
|
-
- [Javascript](https://github.com/getdyspatch/dyspatch-javascript)
|
12
|
-
- [Python](https://github.com/getdyspatch/dyspatch-python)
|
13
|
-
- [C#](https://github.com/getdyspatch/dyspatch-dotnet)
|
14
|
-
- [Go](https://github.com/getdyspatch/dyspatch-golang)
|
15
|
-
- [Ruby](https://github.com/getdyspatch/dyspatch-ruby)
|
5
|
+
The Dyspatch API is based on the REST paradigm and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch.
|
16
6
|
|
17
7
|
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
18
8
|
|
19
9
|
- API version: 2019.10
|
20
|
-
- Package version: 3.0.
|
10
|
+
- Package version: 3.0.1
|
21
11
|
- Build package: io.swagger.codegen.languages.RubyClientCodegen
|
12
|
+
|
22
13
|
For more information, please visit [https://docs.dyspatch.io](https://docs.dyspatch.io)
|
23
14
|
|
24
15
|
## Installation
|
25
16
|
|
17
|
+
### RubyGems
|
18
|
+
|
19
|
+
Install from Rubygems:
|
20
|
+
|
21
|
+
```shell
|
22
|
+
gem install dyspatch_client
|
23
|
+
```
|
24
|
+
|
26
25
|
### Build a gem
|
27
26
|
|
28
27
|
To build the Ruby code into a gem:
|
@@ -34,15 +33,15 @@ gem build dyspatch_client.gemspec
|
|
34
33
|
Then either install the gem locally:
|
35
34
|
|
36
35
|
```shell
|
37
|
-
gem install ./dyspatch_client-3.0.
|
36
|
+
gem install ./dyspatch_client-3.0.1.gem
|
38
37
|
```
|
39
|
-
(for development, run `gem install --dev ./dyspatch_client-3.0.
|
38
|
+
(for development, run `gem install --dev ./dyspatch_client-3.0.1.gem` to install the development dependencies)
|
40
39
|
|
41
40
|
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
42
41
|
|
43
42
|
Finally add this to the Gemfile:
|
44
43
|
|
45
|
-
gem 'dyspatch_client', '~> 3.0.
|
44
|
+
gem 'dyspatch_client', '~> 3.0.1'
|
46
45
|
|
47
46
|
### Install from Git
|
48
47
|
|
@@ -69,8 +68,7 @@ require 'dyspatch_client'
|
|
69
68
|
DyspatchClient.configure do |config|
|
70
69
|
# Configure API key authorization: Bearer
|
71
70
|
config.api_key['Authorization'] = 'YOUR API KEY'
|
72
|
-
|
73
|
-
#config.api_key_prefix['Authorization'] = 'Bearer'
|
71
|
+
config.api_key_prefix['Authorization'] = 'Bearer'
|
74
72
|
end
|
75
73
|
|
76
74
|
api_instance = DyspatchClient::DraftsApi.new
|
@@ -81,7 +79,7 @@ target_language = 'target_language_example' # String | The type of templating la
|
|
81
79
|
|
82
80
|
|
83
81
|
begin
|
84
|
-
#Get Draft by ID
|
82
|
+
# Get Draft by ID
|
85
83
|
result = api_instance.drafts_draft_id_get(draft_id, target_language)
|
86
84
|
p result
|
87
85
|
rescue DyspatchClient::ApiError => e
|
@@ -113,7 +111,6 @@ Class | Method | HTTP request | Description
|
|
113
111
|
|
114
112
|
- [DyspatchClient::APIError](docs/APIError.md)
|
115
113
|
- [DyspatchClient::Body](docs/Body.md)
|
116
|
-
- [DyspatchClient::Body1](docs/Body1.md)
|
117
114
|
- [DyspatchClient::CompiledRead](docs/CompiledRead.md)
|
118
115
|
- [DyspatchClient::CreatedAt](docs/CreatedAt.md)
|
119
116
|
- [DyspatchClient::Cursor](docs/Cursor.md)
|
data/docs/DraftsApi.md
CHANGED
@@ -264,7 +264,7 @@ draft_id = 'draft_id_example' # String | A draft ID
|
|
264
264
|
|
265
265
|
language_id = 'language_id_example' # String | A language ID (eg: en-US)
|
266
266
|
|
267
|
-
body = DyspatchClient::
|
267
|
+
body = DyspatchClient::Body.new # Body |
|
268
268
|
|
269
269
|
|
270
270
|
begin
|
@@ -281,7 +281,7 @@ Name | Type | Description | Notes
|
|
281
281
|
------------- | ------------- | ------------- | -------------
|
282
282
|
**draft_id** | **String**| A draft ID |
|
283
283
|
**language_id** | **String**| A language ID (eg: en-US) |
|
284
|
-
**body** | [**
|
284
|
+
**body** | [**Body**](Body.md)| |
|
285
285
|
|
286
286
|
### Return type
|
287
287
|
|
@@ -432,6 +432,7 @@ end
|
|
432
432
|
api_instance = DyspatchClient::DraftsApi.new
|
433
433
|
|
434
434
|
opts = {
|
435
|
+
cursor: 'cursor_example', # String | A cursor value used to retrieve a specific page from a paginated result set.
|
435
436
|
status: 'status_example' # String | Filter the list of drafts by a particular status
|
436
437
|
}
|
437
438
|
|
@@ -448,6 +449,7 @@ end
|
|
448
449
|
|
449
450
|
Name | Type | Description | Notes
|
450
451
|
------------- | ------------- | ------------- | -------------
|
452
|
+
**cursor** | **String**| A cursor value used to retrieve a specific page from a paginated result set. | [optional]
|
451
453
|
**status** | **String**| Filter the list of drafts by a particular status | [optional]
|
452
454
|
|
453
455
|
### Return type
|
data/docs/DraftsRead.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
## Properties
|
4
4
|
Name | Type | Description | Notes
|
5
5
|
------------ | ------------- | ------------- | -------------
|
6
|
-
**cursor** | **
|
6
|
+
**cursor** | [**Cursor**](Cursor.md) | | [optional]
|
7
7
|
**data** | [**Array<DraftMetaRead>**](DraftMetaRead.md) | A list of draft metadata objects | [optional]
|
8
8
|
|
9
9
|
|
data/docs/TemplatesApi.md
CHANGED
@@ -30,7 +30,7 @@ end
|
|
30
30
|
api_instance = DyspatchClient::TemplatesApi.new
|
31
31
|
|
32
32
|
opts = {
|
33
|
-
cursor: 'cursor_example' # String | A cursor value used to retrieve a specific page from a paginated result set.
|
33
|
+
cursor: 'cursor_example', # String | A cursor value used to retrieve a specific page from a paginated result set.
|
34
34
|
}
|
35
35
|
|
36
36
|
begin
|
data/dyspatch_client.gemspec
CHANGED
data/lib/dyspatch_client.rb
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
OpenAPI spec version: 2019.10
|
7
7
|
Contact: support@dyspatch.io
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.4.
|
9
|
+
Swagger Codegen version: 2.4.10
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -19,7 +19,6 @@ require 'dyspatch_client/configuration'
|
|
19
19
|
# Models
|
20
20
|
require 'dyspatch_client/models/api_error'
|
21
21
|
require 'dyspatch_client/models/body'
|
22
|
-
require 'dyspatch_client/models/body_1'
|
23
22
|
require 'dyspatch_client/models/compiled_read'
|
24
23
|
require 'dyspatch_client/models/created_at'
|
25
24
|
require 'dyspatch_client/models/cursor'
|
@@ -6,7 +6,7 @@
|
|
6
6
|
OpenAPI spec version: 2019.10
|
7
7
|
Contact: support@dyspatch.io
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.4.
|
9
|
+
Swagger Codegen version: 2.4.10
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -426,6 +426,7 @@ module DyspatchClient
|
|
426
426
|
# List Drafts
|
427
427
|
# Gets a list of all drafts for your oranization. Up to 25 results returned before results are paginated.
|
428
428
|
# @param [Hash] opts the optional parameters
|
429
|
+
# @option opts [String] :cursor A cursor value used to retrieve a specific page from a paginated result set.
|
429
430
|
# @option opts [String] :status Filter the list of drafts by a particular status
|
430
431
|
# @return [DraftsRead]
|
431
432
|
def drafts_get(opts = {})
|
@@ -436,6 +437,7 @@ module DyspatchClient
|
|
436
437
|
# List Drafts
|
437
438
|
# Gets a list of all drafts for your oranization. Up to 25 results returned before results are paginated.
|
438
439
|
# @param [Hash] opts the optional parameters
|
440
|
+
# @option opts [String] :cursor A cursor value used to retrieve a specific page from a paginated result set.
|
439
441
|
# @option opts [String] :status Filter the list of drafts by a particular status
|
440
442
|
# @return [Array<(DraftsRead, Fixnum, Hash)>] DraftsRead data, response status code and response headers
|
441
443
|
def drafts_get_with_http_info(opts = {})
|
@@ -450,6 +452,7 @@ module DyspatchClient
|
|
450
452
|
|
451
453
|
# query parameters
|
452
454
|
query_params = {}
|
455
|
+
query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
|
453
456
|
query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
|
454
457
|
|
455
458
|
# header parameters
|
@@ -6,7 +6,7 @@
|
|
6
6
|
OpenAPI spec version: 2019.10
|
7
7
|
Contact: support@dyspatch.io
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.4.
|
9
|
+
Swagger Codegen version: 2.4.10
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -14,7 +14,6 @@ require 'date'
|
|
14
14
|
|
15
15
|
module DyspatchClient
|
16
16
|
class DraftsRead
|
17
|
-
# Information about paginated results
|
18
17
|
attr_accessor :cursor
|
19
18
|
|
20
19
|
# A list of draft metadata objects
|
@@ -31,7 +30,7 @@ module DyspatchClient
|
|
31
30
|
# Attribute type mapping.
|
32
31
|
def self.swagger_types
|
33
32
|
{
|
34
|
-
:'cursor' => :'
|
33
|
+
:'cursor' => :'Cursor',
|
35
34
|
:'data' => :'Array<DraftMetaRead>'
|
36
35
|
}
|
37
36
|
end
|
@@ -6,10 +6,10 @@
|
|
6
6
|
OpenAPI spec version: 2019.10
|
7
7
|
Contact: support@dyspatch.io
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.4.
|
9
|
+
Swagger Codegen version: 2.4.10
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
module DyspatchClient
|
14
|
-
VERSION = '3.0.
|
14
|
+
VERSION = '3.0.1'
|
15
15
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dyspatch_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dyspatch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -34,42 +34,42 @@ dependencies:
|
|
34
34
|
name: json
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
|
-
- - "~>"
|
38
|
-
- !ruby/object:Gem::Version
|
39
|
-
version: '2.1'
|
40
37
|
- - ">="
|
41
38
|
- !ruby/object:Gem::Version
|
42
39
|
version: 2.1.0
|
40
|
+
- - "~>"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '2.1'
|
43
43
|
type: :runtime
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- - "~>"
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
version: '2.1'
|
50
47
|
- - ">="
|
51
48
|
- !ruby/object:Gem::Version
|
52
49
|
version: 2.1.0
|
50
|
+
- - "~>"
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '2.1'
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: rspec
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
56
56
|
requirements:
|
57
|
-
- - "~>"
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
version: '3.6'
|
60
57
|
- - ">="
|
61
58
|
- !ruby/object:Gem::Version
|
62
59
|
version: 3.6.0
|
60
|
+
- - "~>"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '3.6'
|
63
63
|
type: :development
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- - "~>"
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '3.6'
|
70
67
|
- - ">="
|
71
68
|
- !ruby/object:Gem::Version
|
72
69
|
version: 3.6.0
|
70
|
+
- - "~>"
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '3.6'
|
73
73
|
- !ruby/object:Gem::Dependency
|
74
74
|
name: vcr
|
75
75
|
requirement: !ruby/object:Gem::Requirement
|
@@ -211,7 +211,6 @@ files:
|
|
211
211
|
- Rakefile
|
212
212
|
- docs/APIError.md
|
213
213
|
- docs/Body.md
|
214
|
-
- docs/Body1.md
|
215
214
|
- docs/CompiledRead.md
|
216
215
|
- docs/CreatedAt.md
|
217
216
|
- docs/Cursor.md
|
@@ -251,7 +250,6 @@ files:
|
|
251
250
|
- lib/dyspatch_client/configuration.rb
|
252
251
|
- lib/dyspatch_client/models/api_error.rb
|
253
252
|
- lib/dyspatch_client/models/body.rb
|
254
|
-
- lib/dyspatch_client/models/body_1.rb
|
255
253
|
- lib/dyspatch_client/models/compiled_read.rb
|
256
254
|
- lib/dyspatch_client/models/created_at.rb
|
257
255
|
- lib/dyspatch_client/models/cursor.rb
|
@@ -284,7 +282,6 @@ files:
|
|
284
282
|
- spec/api_client_spec.rb
|
285
283
|
- spec/configuration_spec.rb
|
286
284
|
- spec/models/api_error_spec.rb
|
287
|
-
- spec/models/body_1_spec.rb
|
288
285
|
- spec/models/body_spec.rb
|
289
286
|
- spec/models/compiled_read_spec.rb
|
290
287
|
- spec/models/created_at_spec.rb
|
@@ -331,8 +328,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
331
328
|
- !ruby/object:Gem::Version
|
332
329
|
version: '0'
|
333
330
|
requirements: []
|
334
|
-
|
335
|
-
rubygems_version: 2.6.11
|
331
|
+
rubygems_version: 3.0.6
|
336
332
|
signing_key:
|
337
333
|
specification_version: 4
|
338
334
|
summary: Dyspatch is an email production platform that helps teams create and change
|
@@ -353,7 +349,6 @@ test_files:
|
|
353
349
|
- spec/models/updated_at_spec.rb
|
354
350
|
- spec/models/draft_meta_read_spec.rb
|
355
351
|
- spec/models/api_error_spec.rb
|
356
|
-
- spec/models/body_1_spec.rb
|
357
352
|
- spec/models/template_meta_read_spec.rb
|
358
353
|
- spec/models/localization_id_spec.rb
|
359
354
|
- spec/models/localization_name_spec.rb
|
data/docs/Body1.md
DELETED
@@ -1,183 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#Dyspatch API
|
3
|
-
|
4
|
-
## Introduction The Dyspatch API is based on the REST paradigm and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for the following languages and web frameworks: - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby)
|
5
|
-
|
6
|
-
OpenAPI spec version: 2019.10
|
7
|
-
Contact: support@dyspatch.io
|
8
|
-
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.4.9
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'date'
|
14
|
-
|
15
|
-
module DyspatchClient
|
16
|
-
class Body1
|
17
|
-
attr_accessor :name
|
18
|
-
|
19
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
20
|
-
def self.attribute_map
|
21
|
-
{
|
22
|
-
:'name' => :'name'
|
23
|
-
}
|
24
|
-
end
|
25
|
-
|
26
|
-
# Attribute type mapping.
|
27
|
-
def self.swagger_types
|
28
|
-
{
|
29
|
-
:'name' => :'String'
|
30
|
-
}
|
31
|
-
end
|
32
|
-
|
33
|
-
# Initializes the object
|
34
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
35
|
-
def initialize(attributes = {})
|
36
|
-
return unless attributes.is_a?(Hash)
|
37
|
-
|
38
|
-
# convert string to symbol for hash key
|
39
|
-
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
40
|
-
|
41
|
-
if attributes.has_key?(:'name')
|
42
|
-
self.name = attributes[:'name']
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
47
|
-
# @return Array for valid properties with the reasons
|
48
|
-
def list_invalid_properties
|
49
|
-
invalid_properties = Array.new
|
50
|
-
invalid_properties
|
51
|
-
end
|
52
|
-
|
53
|
-
# Check to see if the all the properties in the model are valid
|
54
|
-
# @return true if the model is valid
|
55
|
-
def valid?
|
56
|
-
true
|
57
|
-
end
|
58
|
-
|
59
|
-
# Checks equality by comparing each attribute.
|
60
|
-
# @param [Object] Object to be compared
|
61
|
-
def ==(o)
|
62
|
-
return true if self.equal?(o)
|
63
|
-
self.class == o.class &&
|
64
|
-
name == o.name
|
65
|
-
end
|
66
|
-
|
67
|
-
# @see the `==` method
|
68
|
-
# @param [Object] Object to be compared
|
69
|
-
def eql?(o)
|
70
|
-
self == o
|
71
|
-
end
|
72
|
-
|
73
|
-
# Calculates hash code according to all attributes.
|
74
|
-
# @return [Fixnum] Hash code
|
75
|
-
def hash
|
76
|
-
[name].hash
|
77
|
-
end
|
78
|
-
|
79
|
-
# Builds the object from hash
|
80
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
81
|
-
# @return [Object] Returns the model itself
|
82
|
-
def build_from_hash(attributes)
|
83
|
-
return nil unless attributes.is_a?(Hash)
|
84
|
-
self.class.swagger_types.each_pair do |key, type|
|
85
|
-
if type =~ /\AArray<(.*)>/i
|
86
|
-
# check to ensure the input is an array given that the the attribute
|
87
|
-
# is documented as an array but the input is not
|
88
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
89
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
90
|
-
end
|
91
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
92
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
93
|
-
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
94
|
-
end
|
95
|
-
|
96
|
-
self
|
97
|
-
end
|
98
|
-
|
99
|
-
# Deserializes the data based on type
|
100
|
-
# @param string type Data type
|
101
|
-
# @param string value Value to be deserialized
|
102
|
-
# @return [Object] Deserialized data
|
103
|
-
def _deserialize(type, value)
|
104
|
-
case type.to_sym
|
105
|
-
when :DateTime
|
106
|
-
DateTime.parse(value)
|
107
|
-
when :Date
|
108
|
-
Date.parse(value)
|
109
|
-
when :String
|
110
|
-
value.to_s
|
111
|
-
when :Integer
|
112
|
-
value.to_i
|
113
|
-
when :Float
|
114
|
-
value.to_f
|
115
|
-
when :BOOLEAN
|
116
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
117
|
-
true
|
118
|
-
else
|
119
|
-
false
|
120
|
-
end
|
121
|
-
when :Object
|
122
|
-
# generic object (usually a Hash), return directly
|
123
|
-
value
|
124
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
125
|
-
inner_type = Regexp.last_match[:inner_type]
|
126
|
-
value.map { |v| _deserialize(inner_type, v) }
|
127
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
128
|
-
k_type = Regexp.last_match[:k_type]
|
129
|
-
v_type = Regexp.last_match[:v_type]
|
130
|
-
{}.tap do |hash|
|
131
|
-
value.each do |k, v|
|
132
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
133
|
-
end
|
134
|
-
end
|
135
|
-
else # model
|
136
|
-
temp_model = DyspatchClient.const_get(type).new
|
137
|
-
temp_model.build_from_hash(value)
|
138
|
-
end
|
139
|
-
end
|
140
|
-
|
141
|
-
# Returns the string representation of the object
|
142
|
-
# @return [String] String presentation of the object
|
143
|
-
def to_s
|
144
|
-
to_hash.to_s
|
145
|
-
end
|
146
|
-
|
147
|
-
# to_body is an alias to to_hash (backward compatibility)
|
148
|
-
# @return [Hash] Returns the object in the form of hash
|
149
|
-
def to_body
|
150
|
-
to_hash
|
151
|
-
end
|
152
|
-
|
153
|
-
# Returns the object in the form of hash
|
154
|
-
# @return [Hash] Returns the object in the form of hash
|
155
|
-
def to_hash
|
156
|
-
hash = {}
|
157
|
-
self.class.attribute_map.each_pair do |attr, param|
|
158
|
-
value = self.send(attr)
|
159
|
-
next if value.nil?
|
160
|
-
hash[param] = _to_hash(value)
|
161
|
-
end
|
162
|
-
hash
|
163
|
-
end
|
164
|
-
|
165
|
-
# Outputs non-array value in the form of hash
|
166
|
-
# For object, use to_hash. Otherwise, just return the value
|
167
|
-
# @param [Object] value Any valid value
|
168
|
-
# @return [Hash] Returns the value in the form of hash
|
169
|
-
def _to_hash(value)
|
170
|
-
if value.is_a?(Array)
|
171
|
-
value.compact.map { |v| _to_hash(v) }
|
172
|
-
elsif value.is_a?(Hash)
|
173
|
-
{}.tap do |hash|
|
174
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
175
|
-
end
|
176
|
-
elsif value.respond_to? :to_hash
|
177
|
-
value.to_hash
|
178
|
-
else
|
179
|
-
value
|
180
|
-
end
|
181
|
-
end
|
182
|
-
end
|
183
|
-
end
|
data/spec/models/body_1_spec.rb
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#Dyspatch API
|
3
|
-
|
4
|
-
## Introduction The Dyspatch API is based on the REST paradigm and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for the following languages and web frameworks: - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby)
|
5
|
-
|
6
|
-
OpenAPI spec version: 2019.10
|
7
|
-
Contact: support@dyspatch.io
|
8
|
-
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.4.9
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'spec_helper'
|
14
|
-
require 'json'
|
15
|
-
require 'date'
|
16
|
-
|
17
|
-
# Unit tests for DyspatchClient::Body1
|
18
|
-
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
19
|
-
# Please update as you see appropriate
|
20
|
-
describe 'Body1' do
|
21
|
-
before do
|
22
|
-
# run before each test
|
23
|
-
@instance = DyspatchClient::Body1.new
|
24
|
-
end
|
25
|
-
|
26
|
-
after do
|
27
|
-
# run after each test
|
28
|
-
end
|
29
|
-
|
30
|
-
describe 'test an instance of Body1' do
|
31
|
-
it 'should create an instance of Body1' do
|
32
|
-
expect(@instance).to be_instance_of(DyspatchClient::Body1)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
describe 'test attribute "name"' do
|
36
|
-
it 'should work' do
|
37
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
end
|