dyspatch_client 3.0.1 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -0
  3. data/README.md +35 -41
  4. data/Rakefile +2 -0
  5. data/docs/APIError.md +13 -2
  6. data/docs/CompiledRead.md +13 -0
  7. data/docs/Cursor.md +11 -1
  8. data/docs/DraftMetaRead.md +15 -0
  9. data/docs/DraftRead.md +17 -1
  10. data/docs/DraftsApi.md +140 -133
  11. data/docs/DraftsRead.md +11 -1
  12. data/docs/{Body.md → InlineObject.md} +10 -1
  13. data/docs/LocalizationKeyRead.md +10 -0
  14. data/docs/LocalizationMetaRead.md +14 -3
  15. data/docs/LocalizationRead.md +17 -1
  16. data/docs/LocalizationsApi.md +14 -13
  17. data/docs/TemplateMetaRead.md +16 -1
  18. data/docs/TemplateRead.md +17 -1
  19. data/docs/TemplatesApi.md +40 -36
  20. data/docs/TemplatesRead.md +11 -1
  21. data/dyspatch_client.gemspec +5 -11
  22. data/lib/dyspatch_client.rb +5 -19
  23. data/lib/dyspatch_client/api/drafts_api.rb +372 -236
  24. data/lib/dyspatch_client/api/localizations_api.rb +47 -30
  25. data/lib/dyspatch_client/api/templates_api.rb +98 -64
  26. data/lib/dyspatch_client/api_client.rb +40 -43
  27. data/lib/dyspatch_client/api_error.rb +23 -4
  28. data/lib/dyspatch_client/configuration.rb +48 -9
  29. data/lib/dyspatch_client/models/api_error.rb +46 -22
  30. data/lib/dyspatch_client/models/compiled_read.rb +45 -66
  31. data/lib/dyspatch_client/models/cursor.rb +43 -20
  32. data/lib/dyspatch_client/models/draft_meta_read.rb +49 -25
  33. data/lib/dyspatch_client/models/draft_read.rb +49 -25
  34. data/lib/dyspatch_client/models/drafts_read.rb +41 -17
  35. data/lib/dyspatch_client/models/{body.rb → inline_object.rb} +40 -17
  36. data/lib/dyspatch_client/models/localization_key_read.rb +41 -17
  37. data/lib/dyspatch_client/models/localization_meta_read.rb +53 -39
  38. data/lib/dyspatch_client/models/localization_read.rb +50 -26
  39. data/lib/dyspatch_client/models/template_meta_read.rb +48 -24
  40. data/lib/dyspatch_client/models/template_read.rb +49 -25
  41. data/lib/dyspatch_client/models/templates_read.rb +41 -17
  42. data/lib/dyspatch_client/version.rb +5 -5
  43. data/spec/api/drafts_api_spec.rb +61 -53
  44. data/spec/api/localizations_api_spec.rb +11 -10
  45. data/spec/api/templates_api_spec.rb +22 -20
  46. data/spec/api_client_spec.rb +5 -5
  47. data/spec/configuration_spec.rb +12 -14
  48. data/spec/integration_spec.rb +41 -0
  49. data/spec/models/api_error_spec.rb +6 -6
  50. data/spec/models/compiled_read_spec.rb +5 -5
  51. data/spec/models/cursor_spec.rb +5 -5
  52. data/spec/models/draft_meta_read_spec.rb +5 -5
  53. data/spec/models/draft_read_spec.rb +5 -5
  54. data/spec/models/drafts_read_spec.rb +5 -5
  55. data/spec/models/inline_object_spec.rb +41 -0
  56. data/spec/models/localization_key_read_spec.rb +5 -5
  57. data/spec/models/localization_meta_read_spec.rb +6 -12
  58. data/spec/models/localization_read_spec.rb +5 -5
  59. data/spec/models/template_meta_read_spec.rb +5 -5
  60. data/spec/models/template_read_spec.rb +5 -5
  61. data/spec/models/templates_read_spec.rb +5 -5
  62. data/spec/spec_helper.rb +4 -4
  63. metadata +15 -190
  64. data/docs/CreatedAt.md +0 -7
  65. data/docs/DraftDescription.md +0 -7
  66. data/docs/DraftId.md +0 -7
  67. data/docs/DraftName.md +0 -7
  68. data/docs/DraftUrl.md +0 -7
  69. data/docs/LanguageId.md +0 -7
  70. data/docs/LocalizationId.md +0 -7
  71. data/docs/LocalizationName.md +0 -7
  72. data/docs/LocalizationUrl.md +0 -7
  73. data/docs/TemplateDescription.md +0 -7
  74. data/docs/TemplateId.md +0 -7
  75. data/docs/TemplateName.md +0 -7
  76. data/docs/TemplateUrl.md +0 -7
  77. data/docs/UpdatedAt.md +0 -7
  78. data/git_push.sh +0 -55
  79. data/lib/dyspatch_client/models/created_at.rb +0 -175
  80. data/lib/dyspatch_client/models/draft_description.rb +0 -175
  81. data/lib/dyspatch_client/models/draft_id.rb +0 -175
  82. data/lib/dyspatch_client/models/draft_name.rb +0 -175
  83. data/lib/dyspatch_client/models/draft_url.rb +0 -175
  84. data/lib/dyspatch_client/models/language_id.rb +0 -175
  85. data/lib/dyspatch_client/models/localization_id.rb +0 -175
  86. data/lib/dyspatch_client/models/localization_name.rb +0 -175
  87. data/lib/dyspatch_client/models/localization_url.rb +0 -175
  88. data/lib/dyspatch_client/models/template_description.rb +0 -175
  89. data/lib/dyspatch_client/models/template_id.rb +0 -175
  90. data/lib/dyspatch_client/models/template_name.rb +0 -175
  91. data/lib/dyspatch_client/models/template_url.rb +0 -175
  92. data/lib/dyspatch_client/models/updated_at.rb +0 -175
  93. data/spec/models/body_spec.rb +0 -41
  94. data/spec/models/created_at_spec.rb +0 -35
  95. data/spec/models/draft_description_spec.rb +0 -35
  96. data/spec/models/draft_id_spec.rb +0 -35
  97. data/spec/models/draft_name_spec.rb +0 -35
  98. data/spec/models/draft_url_spec.rb +0 -35
  99. data/spec/models/language_id_spec.rb +0 -35
  100. data/spec/models/localization_id_spec.rb +0 -35
  101. data/spec/models/localization_name_spec.rb +0 -35
  102. data/spec/models/localization_url_spec.rb +0 -35
  103. data/spec/models/template_description_spec.rb +0 -35
  104. data/spec/models/template_id_spec.rb +0 -35
  105. data/spec/models/template_name_spec.rb +0 -35
  106. data/spec/models/template_url_spec.rb +0 -35
  107. data/spec/models/updated_at_spec.rb +0 -35
@@ -1,19 +1,19 @@
1
1
  =begin
2
2
  #Dyspatch API
3
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)
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 popular 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
5
 
6
- OpenAPI spec version: 2019.10
6
+ The version of the OpenAPI document: 2019.10
7
7
  Contact: support@dyspatch.io
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.10
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.3-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
14
 
15
15
  module DyspatchClient
16
- class Body
16
+ class InlineObject
17
17
  attr_accessor :name
18
18
 
19
19
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -24,21 +24,34 @@ module DyspatchClient
24
24
  end
25
25
 
26
26
  # Attribute type mapping.
27
- def self.swagger_types
27
+ def self.openapi_types
28
28
  {
29
29
  :'name' => :'String'
30
30
  }
31
31
  end
32
32
 
33
+ # List of attributes with nullable: true
34
+ def self.openapi_nullable
35
+ Set.new([
36
+ ])
37
+ end
38
+
33
39
  # Initializes the object
34
40
  # @param [Hash] attributes Model attributes in the form of hash
35
41
  def initialize(attributes = {})
36
- return unless attributes.is_a?(Hash)
42
+ if (!attributes.is_a?(Hash))
43
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DyspatchClient::InlineObject` initialize method"
44
+ end
37
45
 
38
- # convert string to symbol for hash key
39
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
46
+ # check to see if the attribute exists and convert string to symbol for hash key
47
+ attributes = attributes.each_with_object({}) { |(k, v), h|
48
+ if (!self.class.attribute_map.key?(k.to_sym))
49
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DyspatchClient::InlineObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
50
+ end
51
+ h[k.to_sym] = v
52
+ }
40
53
 
41
- if attributes.has_key?(:'name')
54
+ if attributes.key?(:'name')
42
55
  self.name = attributes[:'name']
43
56
  end
44
57
  end
@@ -71,19 +84,26 @@ module DyspatchClient
71
84
  end
72
85
 
73
86
  # Calculates hash code according to all attributes.
74
- # @return [Fixnum] Hash code
87
+ # @return [Integer] Hash code
75
88
  def hash
76
89
  [name].hash
77
90
  end
78
91
 
92
+ # Builds the object from hash
93
+ # @param [Hash] attributes Model attributes in the form of hash
94
+ # @return [Object] Returns the model itself
95
+ def self.build_from_hash(attributes)
96
+ new.build_from_hash(attributes)
97
+ end
98
+
79
99
  # Builds the object from hash
80
100
  # @param [Hash] attributes Model attributes in the form of hash
81
101
  # @return [Object] Returns the model itself
82
102
  def build_from_hash(attributes)
83
103
  return nil unless attributes.is_a?(Hash)
84
- self.class.swagger_types.each_pair do |key, type|
104
+ self.class.openapi_types.each_pair do |key, type|
85
105
  if type =~ /\AArray<(.*)>/i
86
- # check to ensure the input is an array given that the the attribute
106
+ # check to ensure the input is an array given that the attribute
87
107
  # is documented as an array but the input is not
88
108
  if attributes[self.class.attribute_map[key]].is_a?(Array)
89
109
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
@@ -112,7 +132,7 @@ module DyspatchClient
112
132
  value.to_i
113
133
  when :Float
114
134
  value.to_f
115
- when :BOOLEAN
135
+ when :Boolean
116
136
  if value.to_s =~ /\A(true|t|yes|y|1)\z/i
117
137
  true
118
138
  else
@@ -133,8 +153,7 @@ module DyspatchClient
133
153
  end
134
154
  end
135
155
  else # model
136
- temp_model = DyspatchClient.const_get(type).new
137
- temp_model.build_from_hash(value)
156
+ DyspatchClient.const_get(type).build_from_hash(value)
138
157
  end
139
158
  end
140
159
 
@@ -156,7 +175,11 @@ module DyspatchClient
156
175
  hash = {}
157
176
  self.class.attribute_map.each_pair do |attr, param|
158
177
  value = self.send(attr)
159
- next if value.nil?
178
+ if value.nil?
179
+ is_nullable = self.class.openapi_nullable.include?(attr)
180
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
181
+ end
182
+
160
183
  hash[param] = _to_hash(value)
161
184
  end
162
185
  hash
@@ -1,18 +1,19 @@
1
1
  =begin
2
2
  #Dyspatch API
3
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)
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 popular 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
5
 
6
- OpenAPI spec version: 2019.10
6
+ The version of the OpenAPI document: 2019.10
7
7
  Contact: support@dyspatch.io
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.10
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.3-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
14
 
15
15
  module DyspatchClient
16
+ # localization key
16
17
  class LocalizationKeyRead
17
18
  attr_accessor :key
18
19
 
@@ -27,26 +28,39 @@ module DyspatchClient
27
28
  end
28
29
 
29
30
  # Attribute type mapping.
30
- def self.swagger_types
31
+ def self.openapi_types
31
32
  {
32
33
  :'key' => :'String',
33
34
  :'comment' => :'String'
34
35
  }
35
36
  end
36
37
 
38
+ # List of attributes with nullable: true
39
+ def self.openapi_nullable
40
+ Set.new([
41
+ ])
42
+ end
43
+
37
44
  # Initializes the object
38
45
  # @param [Hash] attributes Model attributes in the form of hash
39
46
  def initialize(attributes = {})
40
- return unless attributes.is_a?(Hash)
47
+ if (!attributes.is_a?(Hash))
48
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DyspatchClient::LocalizationKeyRead` initialize method"
49
+ end
41
50
 
42
- # convert string to symbol for hash key
43
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
51
+ # check to see if the attribute exists and convert string to symbol for hash key
52
+ attributes = attributes.each_with_object({}) { |(k, v), h|
53
+ if (!self.class.attribute_map.key?(k.to_sym))
54
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DyspatchClient::LocalizationKeyRead`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
55
+ end
56
+ h[k.to_sym] = v
57
+ }
44
58
 
45
- if attributes.has_key?(:'key')
59
+ if attributes.key?(:'key')
46
60
  self.key = attributes[:'key']
47
61
  end
48
62
 
49
- if attributes.has_key?(:'comment')
63
+ if attributes.key?(:'comment')
50
64
  self.comment = attributes[:'comment']
51
65
  end
52
66
  end
@@ -80,19 +94,26 @@ module DyspatchClient
80
94
  end
81
95
 
82
96
  # Calculates hash code according to all attributes.
83
- # @return [Fixnum] Hash code
97
+ # @return [Integer] Hash code
84
98
  def hash
85
99
  [key, comment].hash
86
100
  end
87
101
 
102
+ # Builds the object from hash
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ # @return [Object] Returns the model itself
105
+ def self.build_from_hash(attributes)
106
+ new.build_from_hash(attributes)
107
+ end
108
+
88
109
  # Builds the object from hash
89
110
  # @param [Hash] attributes Model attributes in the form of hash
90
111
  # @return [Object] Returns the model itself
91
112
  def build_from_hash(attributes)
92
113
  return nil unless attributes.is_a?(Hash)
93
- self.class.swagger_types.each_pair do |key, type|
114
+ self.class.openapi_types.each_pair do |key, type|
94
115
  if type =~ /\AArray<(.*)>/i
95
- # check to ensure the input is an array given that the the attribute
116
+ # check to ensure the input is an array given that the attribute
96
117
  # is documented as an array but the input is not
97
118
  if attributes[self.class.attribute_map[key]].is_a?(Array)
98
119
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
@@ -121,7 +142,7 @@ module DyspatchClient
121
142
  value.to_i
122
143
  when :Float
123
144
  value.to_f
124
- when :BOOLEAN
145
+ when :Boolean
125
146
  if value.to_s =~ /\A(true|t|yes|y|1)\z/i
126
147
  true
127
148
  else
@@ -142,8 +163,7 @@ module DyspatchClient
142
163
  end
143
164
  end
144
165
  else # model
145
- temp_model = DyspatchClient.const_get(type).new
146
- temp_model.build_from_hash(value)
166
+ DyspatchClient.const_get(type).build_from_hash(value)
147
167
  end
148
168
  end
149
169
 
@@ -165,7 +185,11 @@ module DyspatchClient
165
185
  hash = {}
166
186
  self.class.attribute_map.each_pair do |attr, param|
167
187
  value = self.send(attr)
168
- next if value.nil?
188
+ if value.nil?
189
+ is_nullable = self.class.openapi_nullable.include?(attr)
190
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
191
+ end
192
+
169
193
  hash[param] = _to_hash(value)
170
194
  end
171
195
  hash
@@ -1,23 +1,24 @@
1
1
  =begin
2
2
  #Dyspatch API
3
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)
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 popular 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
5
 
6
- OpenAPI spec version: 2019.10
6
+ The version of the OpenAPI document: 2019.10
7
7
  Contact: support@dyspatch.io
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.10
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.3-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
14
 
15
15
  module DyspatchClient
16
+ # localization metadata
16
17
  class LocalizationMetaRead
17
18
  # An opaque, unique identifier for a localization
18
- attr_accessor :id
19
+ attr_accessor :localization
19
20
 
20
- # A language identifier comprised of a language and a country identifier. See [supported languages](https://docs.dyspatch.io/localization/supported_languages/).
21
+ # A language identifier comprised of a language and a country identifier. See [supported languages](https://docs.dyspatch.io/localization/supported_languages/).
21
22
  attr_accessor :language
22
23
 
23
24
  # The user-specified name of a localization
@@ -26,58 +27,62 @@ module DyspatchClient
26
27
  # The API url for a specific localization
27
28
  attr_accessor :url
28
29
 
29
- # An opaque, unique identifier for a draft
30
- attr_accessor :draft
31
-
32
30
  # Attribute mapping from ruby-style variable name to JSON key.
33
31
  def self.attribute_map
34
32
  {
35
- :'id' => :'id',
33
+ :'localization' => :'localization',
36
34
  :'language' => :'language',
37
35
  :'name' => :'name',
38
- :'url' => :'url',
39
- :'draft' => :'draft'
36
+ :'url' => :'url'
40
37
  }
41
38
  end
42
39
 
43
40
  # Attribute type mapping.
44
- def self.swagger_types
41
+ def self.openapi_types
45
42
  {
46
- :'id' => :'String',
43
+ :'localization' => :'String',
47
44
  :'language' => :'String',
48
45
  :'name' => :'String',
49
- :'url' => :'String',
50
- :'draft' => :'String'
46
+ :'url' => :'String'
51
47
  }
52
48
  end
53
49
 
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ ])
54
+ end
55
+
54
56
  # Initializes the object
55
57
  # @param [Hash] attributes Model attributes in the form of hash
56
58
  def initialize(attributes = {})
57
- return unless attributes.is_a?(Hash)
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DyspatchClient::LocalizationMetaRead` initialize method"
61
+ end
58
62
 
59
- # convert string to symbol for hash key
60
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!self.class.attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DyspatchClient::LocalizationMetaRead`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
61
70
 
62
- if attributes.has_key?(:'id')
63
- self.id = attributes[:'id']
71
+ if attributes.key?(:'localization')
72
+ self.localization = attributes[:'localization']
64
73
  end
65
74
 
66
- if attributes.has_key?(:'language')
75
+ if attributes.key?(:'language')
67
76
  self.language = attributes[:'language']
68
77
  end
69
78
 
70
- if attributes.has_key?(:'name')
79
+ if attributes.key?(:'name')
71
80
  self.name = attributes[:'name']
72
81
  end
73
82
 
74
- if attributes.has_key?(:'url')
83
+ if attributes.key?(:'url')
75
84
  self.url = attributes[:'url']
76
85
  end
77
-
78
- if attributes.has_key?(:'draft')
79
- self.draft = attributes[:'draft']
80
- end
81
86
  end
82
87
 
83
88
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -98,11 +103,10 @@ module DyspatchClient
98
103
  def ==(o)
99
104
  return true if self.equal?(o)
100
105
  self.class == o.class &&
101
- id == o.id &&
106
+ localization == o.localization &&
102
107
  language == o.language &&
103
108
  name == o.name &&
104
- url == o.url &&
105
- draft == o.draft
109
+ url == o.url
106
110
  end
107
111
 
108
112
  # @see the `==` method
@@ -112,9 +116,16 @@ module DyspatchClient
112
116
  end
113
117
 
114
118
  # Calculates hash code according to all attributes.
115
- # @return [Fixnum] Hash code
119
+ # @return [Integer] Hash code
116
120
  def hash
117
- [id, language, name, url, draft].hash
121
+ [localization, language, name, url].hash
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def self.build_from_hash(attributes)
128
+ new.build_from_hash(attributes)
118
129
  end
119
130
 
120
131
  # Builds the object from hash
@@ -122,9 +133,9 @@ module DyspatchClient
122
133
  # @return [Object] Returns the model itself
123
134
  def build_from_hash(attributes)
124
135
  return nil unless attributes.is_a?(Hash)
125
- self.class.swagger_types.each_pair do |key, type|
136
+ self.class.openapi_types.each_pair do |key, type|
126
137
  if type =~ /\AArray<(.*)>/i
127
- # check to ensure the input is an array given that the the attribute
138
+ # check to ensure the input is an array given that the attribute
128
139
  # is documented as an array but the input is not
129
140
  if attributes[self.class.attribute_map[key]].is_a?(Array)
130
141
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
@@ -153,7 +164,7 @@ module DyspatchClient
153
164
  value.to_i
154
165
  when :Float
155
166
  value.to_f
156
- when :BOOLEAN
167
+ when :Boolean
157
168
  if value.to_s =~ /\A(true|t|yes|y|1)\z/i
158
169
  true
159
170
  else
@@ -174,8 +185,7 @@ module DyspatchClient
174
185
  end
175
186
  end
176
187
  else # model
177
- temp_model = DyspatchClient.const_get(type).new
178
- temp_model.build_from_hash(value)
188
+ DyspatchClient.const_get(type).build_from_hash(value)
179
189
  end
180
190
  end
181
191
 
@@ -197,7 +207,11 @@ module DyspatchClient
197
207
  hash = {}
198
208
  self.class.attribute_map.each_pair do |attr, param|
199
209
  value = self.send(attr)
200
- next if value.nil?
210
+ if value.nil?
211
+ is_nullable = self.class.openapi_nullable.include?(attr)
212
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
213
+ end
214
+
201
215
  hash[param] = _to_hash(value)
202
216
  end
203
217
  hash
@@ -1,23 +1,24 @@
1
1
  =begin
2
2
  #Dyspatch API
3
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)
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 popular 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
5
 
6
- OpenAPI spec version: 2019.10
6
+ The version of the OpenAPI document: 2019.10
7
7
  Contact: support@dyspatch.io
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.10
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.3-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
14
 
15
15
  module DyspatchClient
16
+ # localization metadata and latest revision for associated template
16
17
  class LocalizationRead
17
18
  # An opaque, unique identifier for a localization
18
19
  attr_accessor :id
19
20
 
20
- # A language identifier comprised of a language and a country identifier. See [supported languages](https://docs.dyspatch.io/localization/supported_languages/).
21
+ # A language identifier comprised of a language and a country identifier. See [supported languages](https://docs.dyspatch.io/localization/supported_languages/).
21
22
  attr_accessor :language
22
23
 
23
24
  # The API url for a specific localization
@@ -52,7 +53,7 @@ module DyspatchClient
52
53
  end
53
54
 
54
55
  # Attribute type mapping.
55
- def self.swagger_types
56
+ def self.openapi_types
56
57
  {
57
58
  :'id' => :'String',
58
59
  :'language' => :'String',
@@ -65,43 +66,56 @@ module DyspatchClient
65
66
  }
66
67
  end
67
68
 
69
+ # List of attributes with nullable: true
70
+ def self.openapi_nullable
71
+ Set.new([
72
+ ])
73
+ end
74
+
68
75
  # Initializes the object
69
76
  # @param [Hash] attributes Model attributes in the form of hash
70
77
  def initialize(attributes = {})
71
- return unless attributes.is_a?(Hash)
78
+ if (!attributes.is_a?(Hash))
79
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DyspatchClient::LocalizationRead` initialize method"
80
+ end
72
81
 
73
- # convert string to symbol for hash key
74
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
82
+ # check to see if the attribute exists and convert string to symbol for hash key
83
+ attributes = attributes.each_with_object({}) { |(k, v), h|
84
+ if (!self.class.attribute_map.key?(k.to_sym))
85
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DyspatchClient::LocalizationRead`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
86
+ end
87
+ h[k.to_sym] = v
88
+ }
75
89
 
76
- if attributes.has_key?(:'id')
90
+ if attributes.key?(:'id')
77
91
  self.id = attributes[:'id']
78
92
  end
79
93
 
80
- if attributes.has_key?(:'language')
94
+ if attributes.key?(:'language')
81
95
  self.language = attributes[:'language']
82
96
  end
83
97
 
84
- if attributes.has_key?(:'url')
98
+ if attributes.key?(:'url')
85
99
  self.url = attributes[:'url']
86
100
  end
87
101
 
88
- if attributes.has_key?(:'template')
102
+ if attributes.key?(:'template')
89
103
  self.template = attributes[:'template']
90
104
  end
91
105
 
92
- if attributes.has_key?(:'compiled')
106
+ if attributes.key?(:'compiled')
93
107
  self.compiled = attributes[:'compiled']
94
108
  end
95
109
 
96
- if attributes.has_key?(:'createdAt')
97
- self.created_at = attributes[:'createdAt']
110
+ if attributes.key?(:'created_at')
111
+ self.created_at = attributes[:'created_at']
98
112
  end
99
113
 
100
- if attributes.has_key?(:'updatedAt')
101
- self.updated_at = attributes[:'updatedAt']
114
+ if attributes.key?(:'updated_at')
115
+ self.updated_at = attributes[:'updated_at']
102
116
  end
103
117
 
104
- if attributes.has_key?(:'name')
118
+ if attributes.key?(:'name')
105
119
  self.name = attributes[:'name']
106
120
  end
107
121
  end
@@ -141,19 +155,26 @@ module DyspatchClient
141
155
  end
142
156
 
143
157
  # Calculates hash code according to all attributes.
144
- # @return [Fixnum] Hash code
158
+ # @return [Integer] Hash code
145
159
  def hash
146
160
  [id, language, url, template, compiled, created_at, updated_at, name].hash
147
161
  end
148
162
 
163
+ # Builds the object from hash
164
+ # @param [Hash] attributes Model attributes in the form of hash
165
+ # @return [Object] Returns the model itself
166
+ def self.build_from_hash(attributes)
167
+ new.build_from_hash(attributes)
168
+ end
169
+
149
170
  # Builds the object from hash
150
171
  # @param [Hash] attributes Model attributes in the form of hash
151
172
  # @return [Object] Returns the model itself
152
173
  def build_from_hash(attributes)
153
174
  return nil unless attributes.is_a?(Hash)
154
- self.class.swagger_types.each_pair do |key, type|
175
+ self.class.openapi_types.each_pair do |key, type|
155
176
  if type =~ /\AArray<(.*)>/i
156
- # check to ensure the input is an array given that the the attribute
177
+ # check to ensure the input is an array given that the attribute
157
178
  # is documented as an array but the input is not
158
179
  if attributes[self.class.attribute_map[key]].is_a?(Array)
159
180
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
@@ -182,7 +203,7 @@ module DyspatchClient
182
203
  value.to_i
183
204
  when :Float
184
205
  value.to_f
185
- when :BOOLEAN
206
+ when :Boolean
186
207
  if value.to_s =~ /\A(true|t|yes|y|1)\z/i
187
208
  true
188
209
  else
@@ -203,8 +224,7 @@ module DyspatchClient
203
224
  end
204
225
  end
205
226
  else # model
206
- temp_model = DyspatchClient.const_get(type).new
207
- temp_model.build_from_hash(value)
227
+ DyspatchClient.const_get(type).build_from_hash(value)
208
228
  end
209
229
  end
210
230
 
@@ -226,7 +246,11 @@ module DyspatchClient
226
246
  hash = {}
227
247
  self.class.attribute_map.each_pair do |attr, param|
228
248
  value = self.send(attr)
229
- next if value.nil?
249
+ if value.nil?
250
+ is_nullable = self.class.openapi_nullable.include?(attr)
251
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
252
+ end
253
+
230
254
  hash[param] = _to_hash(value)
231
255
  end
232
256
  hash