dyspatch_client 3.0.0 → 6.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 (109) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -1
  3. data/README.md +45 -53
  4. data/Rakefile +2 -0
  5. data/docs/APIError.md +13 -2
  6. data/docs/CompiledRead.md +15 -0
  7. data/docs/Cursor.md +11 -1
  8. data/docs/DraftMetaRead.md +14 -1
  9. data/docs/DraftRead.md +17 -1
  10. data/docs/DraftsApi.md +140 -131
  11. data/docs/DraftsRead.md +12 -2
  12. data/docs/{Body.md → InlineObject.md} +10 -1
  13. data/docs/LocalizationKeyRead.md +10 -0
  14. data/docs/LocalizationMetaRead.md +15 -2
  15. data/docs/LocalizationRead.md +19 -1
  16. data/docs/LocalizationsApi.md +75 -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 -20
  23. data/lib/dyspatch_client/api/drafts_api.rb +375 -234
  24. data/lib/dyspatch_client/api/localizations_api.rb +135 -31
  25. data/lib/dyspatch_client/api/templates_api.rb +99 -65
  26. data/lib/dyspatch_client/api_client.rb +46 -47
  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 +56 -67
  31. data/lib/dyspatch_client/models/cursor.rb +43 -20
  32. data/lib/dyspatch_client/models/draft_meta_read.rb +49 -35
  33. data/lib/dyspatch_client/models/draft_read.rb +49 -25
  34. data/lib/dyspatch_client/models/drafts_read.rb +42 -19
  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 +62 -36
  38. data/lib/dyspatch_client/models/localization_read.rb +71 -35
  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 +26 -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 +4 -4
  48. data/spec/spec_helper.rb +4 -4
  49. metadata +11 -219
  50. data/LICENSE +0 -202
  51. data/docs/Body1.md +0 -8
  52. data/docs/CreatedAt.md +0 -7
  53. data/docs/DraftDescription.md +0 -7
  54. data/docs/DraftId.md +0 -7
  55. data/docs/DraftName.md +0 -7
  56. data/docs/DraftUrl.md +0 -7
  57. data/docs/LanguageId.md +0 -7
  58. data/docs/LocalizationId.md +0 -7
  59. data/docs/LocalizationName.md +0 -7
  60. data/docs/LocalizationUrl.md +0 -7
  61. data/docs/TemplateDescription.md +0 -7
  62. data/docs/TemplateId.md +0 -7
  63. data/docs/TemplateName.md +0 -7
  64. data/docs/TemplateUrl.md +0 -7
  65. data/docs/UpdatedAt.md +0 -7
  66. data/git_push.sh +0 -55
  67. data/lib/dyspatch_client/models/body_1.rb +0 -183
  68. data/lib/dyspatch_client/models/created_at.rb +0 -175
  69. data/lib/dyspatch_client/models/draft_description.rb +0 -175
  70. data/lib/dyspatch_client/models/draft_id.rb +0 -175
  71. data/lib/dyspatch_client/models/draft_name.rb +0 -175
  72. data/lib/dyspatch_client/models/draft_url.rb +0 -175
  73. data/lib/dyspatch_client/models/language_id.rb +0 -175
  74. data/lib/dyspatch_client/models/localization_id.rb +0 -175
  75. data/lib/dyspatch_client/models/localization_name.rb +0 -175
  76. data/lib/dyspatch_client/models/localization_url.rb +0 -175
  77. data/lib/dyspatch_client/models/template_description.rb +0 -175
  78. data/lib/dyspatch_client/models/template_id.rb +0 -175
  79. data/lib/dyspatch_client/models/template_name.rb +0 -175
  80. data/lib/dyspatch_client/models/template_url.rb +0 -175
  81. data/lib/dyspatch_client/models/updated_at.rb +0 -175
  82. data/spec/models/api_error_spec.rb +0 -57
  83. data/spec/models/body_1_spec.rb +0 -41
  84. data/spec/models/body_spec.rb +0 -41
  85. data/spec/models/compiled_read_spec.rb +0 -65
  86. data/spec/models/created_at_spec.rb +0 -35
  87. data/spec/models/cursor_spec.rb +0 -47
  88. data/spec/models/draft_description_spec.rb +0 -35
  89. data/spec/models/draft_id_spec.rb +0 -35
  90. data/spec/models/draft_meta_read_spec.rb +0 -77
  91. data/spec/models/draft_name_spec.rb +0 -35
  92. data/spec/models/draft_read_spec.rb +0 -83
  93. data/spec/models/draft_url_spec.rb +0 -35
  94. data/spec/models/drafts_read_spec.rb +0 -47
  95. data/spec/models/language_id_spec.rb +0 -35
  96. data/spec/models/localization_id_spec.rb +0 -35
  97. data/spec/models/localization_key_read_spec.rb +0 -47
  98. data/spec/models/localization_meta_read_spec.rb +0 -65
  99. data/spec/models/localization_name_spec.rb +0 -35
  100. data/spec/models/localization_read_spec.rb +0 -83
  101. data/spec/models/localization_url_spec.rb +0 -35
  102. data/spec/models/template_description_spec.rb +0 -35
  103. data/spec/models/template_id_spec.rb +0 -35
  104. data/spec/models/template_meta_read_spec.rb +0 -77
  105. data/spec/models/template_name_spec.rb +0 -35
  106. data/spec/models/template_read_spec.rb +0 -83
  107. data/spec/models/template_url_spec.rb +0 -35
  108. data/spec/models/templates_read_spec.rb +0 -47
  109. data/spec/models/updated_at_spec.rb +0 -35
@@ -1,175 +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
- # The API url for a specific template
17
- class TemplateUrl
18
- # Attribute mapping from ruby-style variable name to JSON key.
19
- def self.attribute_map
20
- {
21
- }
22
- end
23
-
24
- # Attribute type mapping.
25
- def self.swagger_types
26
- {
27
- }
28
- end
29
-
30
- # Initializes the object
31
- # @param [Hash] attributes Model attributes in the form of hash
32
- def initialize(attributes = {})
33
- return unless attributes.is_a?(Hash)
34
-
35
- # convert string to symbol for hash key
36
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
37
- end
38
-
39
- # Show invalid properties with the reasons. Usually used together with valid?
40
- # @return Array for valid properties with the reasons
41
- def list_invalid_properties
42
- invalid_properties = Array.new
43
- invalid_properties
44
- end
45
-
46
- # Check to see if the all the properties in the model are valid
47
- # @return true if the model is valid
48
- def valid?
49
- true
50
- end
51
-
52
- # Checks equality by comparing each attribute.
53
- # @param [Object] Object to be compared
54
- def ==(o)
55
- return true if self.equal?(o)
56
- self.class == o.class
57
- end
58
-
59
- # @see the `==` method
60
- # @param [Object] Object to be compared
61
- def eql?(o)
62
- self == o
63
- end
64
-
65
- # Calculates hash code according to all attributes.
66
- # @return [Fixnum] Hash code
67
- def hash
68
- [].hash
69
- end
70
-
71
- # Builds the object from hash
72
- # @param [Hash] attributes Model attributes in the form of hash
73
- # @return [Object] Returns the model itself
74
- def build_from_hash(attributes)
75
- return nil unless attributes.is_a?(Hash)
76
- self.class.swagger_types.each_pair do |key, type|
77
- if type =~ /\AArray<(.*)>/i
78
- # check to ensure the input is an array given that the the attribute
79
- # is documented as an array but the input is not
80
- if attributes[self.class.attribute_map[key]].is_a?(Array)
81
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
82
- end
83
- elsif !attributes[self.class.attribute_map[key]].nil?
84
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
85
- end # or else data not found in attributes(hash), not an issue as the data can be optional
86
- end
87
-
88
- self
89
- end
90
-
91
- # Deserializes the data based on type
92
- # @param string type Data type
93
- # @param string value Value to be deserialized
94
- # @return [Object] Deserialized data
95
- def _deserialize(type, value)
96
- case type.to_sym
97
- when :DateTime
98
- DateTime.parse(value)
99
- when :Date
100
- Date.parse(value)
101
- when :String
102
- value.to_s
103
- when :Integer
104
- value.to_i
105
- when :Float
106
- value.to_f
107
- when :BOOLEAN
108
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
109
- true
110
- else
111
- false
112
- end
113
- when :Object
114
- # generic object (usually a Hash), return directly
115
- value
116
- when /\AArray<(?<inner_type>.+)>\z/
117
- inner_type = Regexp.last_match[:inner_type]
118
- value.map { |v| _deserialize(inner_type, v) }
119
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
120
- k_type = Regexp.last_match[:k_type]
121
- v_type = Regexp.last_match[:v_type]
122
- {}.tap do |hash|
123
- value.each do |k, v|
124
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
125
- end
126
- end
127
- else # model
128
- temp_model = DyspatchClient.const_get(type).new
129
- temp_model.build_from_hash(value)
130
- end
131
- end
132
-
133
- # Returns the string representation of the object
134
- # @return [String] String presentation of the object
135
- def to_s
136
- to_hash.to_s
137
- end
138
-
139
- # to_body is an alias to to_hash (backward compatibility)
140
- # @return [Hash] Returns the object in the form of hash
141
- def to_body
142
- to_hash
143
- end
144
-
145
- # Returns the object in the form of hash
146
- # @return [Hash] Returns the object in the form of hash
147
- def to_hash
148
- hash = {}
149
- self.class.attribute_map.each_pair do |attr, param|
150
- value = self.send(attr)
151
- next if value.nil?
152
- hash[param] = _to_hash(value)
153
- end
154
- hash
155
- end
156
-
157
- # Outputs non-array value in the form of hash
158
- # For object, use to_hash. Otherwise, just return the value
159
- # @param [Object] value Any valid value
160
- # @return [Hash] Returns the value in the form of hash
161
- def _to_hash(value)
162
- if value.is_a?(Array)
163
- value.compact.map { |v| _to_hash(v) }
164
- elsif value.is_a?(Hash)
165
- {}.tap do |hash|
166
- value.each { |k, v| hash[k] = _to_hash(v) }
167
- end
168
- elsif value.respond_to? :to_hash
169
- value.to_hash
170
- else
171
- value
172
- end
173
- end
174
- end
175
- end
@@ -1,175 +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
- # The time of last update
17
- class UpdatedAt
18
- # Attribute mapping from ruby-style variable name to JSON key.
19
- def self.attribute_map
20
- {
21
- }
22
- end
23
-
24
- # Attribute type mapping.
25
- def self.swagger_types
26
- {
27
- }
28
- end
29
-
30
- # Initializes the object
31
- # @param [Hash] attributes Model attributes in the form of hash
32
- def initialize(attributes = {})
33
- return unless attributes.is_a?(Hash)
34
-
35
- # convert string to symbol for hash key
36
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
37
- end
38
-
39
- # Show invalid properties with the reasons. Usually used together with valid?
40
- # @return Array for valid properties with the reasons
41
- def list_invalid_properties
42
- invalid_properties = Array.new
43
- invalid_properties
44
- end
45
-
46
- # Check to see if the all the properties in the model are valid
47
- # @return true if the model is valid
48
- def valid?
49
- true
50
- end
51
-
52
- # Checks equality by comparing each attribute.
53
- # @param [Object] Object to be compared
54
- def ==(o)
55
- return true if self.equal?(o)
56
- self.class == o.class
57
- end
58
-
59
- # @see the `==` method
60
- # @param [Object] Object to be compared
61
- def eql?(o)
62
- self == o
63
- end
64
-
65
- # Calculates hash code according to all attributes.
66
- # @return [Fixnum] Hash code
67
- def hash
68
- [].hash
69
- end
70
-
71
- # Builds the object from hash
72
- # @param [Hash] attributes Model attributes in the form of hash
73
- # @return [Object] Returns the model itself
74
- def build_from_hash(attributes)
75
- return nil unless attributes.is_a?(Hash)
76
- self.class.swagger_types.each_pair do |key, type|
77
- if type =~ /\AArray<(.*)>/i
78
- # check to ensure the input is an array given that the the attribute
79
- # is documented as an array but the input is not
80
- if attributes[self.class.attribute_map[key]].is_a?(Array)
81
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
82
- end
83
- elsif !attributes[self.class.attribute_map[key]].nil?
84
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
85
- end # or else data not found in attributes(hash), not an issue as the data can be optional
86
- end
87
-
88
- self
89
- end
90
-
91
- # Deserializes the data based on type
92
- # @param string type Data type
93
- # @param string value Value to be deserialized
94
- # @return [Object] Deserialized data
95
- def _deserialize(type, value)
96
- case type.to_sym
97
- when :DateTime
98
- DateTime.parse(value)
99
- when :Date
100
- Date.parse(value)
101
- when :String
102
- value.to_s
103
- when :Integer
104
- value.to_i
105
- when :Float
106
- value.to_f
107
- when :BOOLEAN
108
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
109
- true
110
- else
111
- false
112
- end
113
- when :Object
114
- # generic object (usually a Hash), return directly
115
- value
116
- when /\AArray<(?<inner_type>.+)>\z/
117
- inner_type = Regexp.last_match[:inner_type]
118
- value.map { |v| _deserialize(inner_type, v) }
119
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
120
- k_type = Regexp.last_match[:k_type]
121
- v_type = Regexp.last_match[:v_type]
122
- {}.tap do |hash|
123
- value.each do |k, v|
124
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
125
- end
126
- end
127
- else # model
128
- temp_model = DyspatchClient.const_get(type).new
129
- temp_model.build_from_hash(value)
130
- end
131
- end
132
-
133
- # Returns the string representation of the object
134
- # @return [String] String presentation of the object
135
- def to_s
136
- to_hash.to_s
137
- end
138
-
139
- # to_body is an alias to to_hash (backward compatibility)
140
- # @return [Hash] Returns the object in the form of hash
141
- def to_body
142
- to_hash
143
- end
144
-
145
- # Returns the object in the form of hash
146
- # @return [Hash] Returns the object in the form of hash
147
- def to_hash
148
- hash = {}
149
- self.class.attribute_map.each_pair do |attr, param|
150
- value = self.send(attr)
151
- next if value.nil?
152
- hash[param] = _to_hash(value)
153
- end
154
- hash
155
- end
156
-
157
- # Outputs non-array value in the form of hash
158
- # For object, use to_hash. Otherwise, just return the value
159
- # @param [Object] value Any valid value
160
- # @return [Hash] Returns the value in the form of hash
161
- def _to_hash(value)
162
- if value.is_a?(Array)
163
- value.compact.map { |v| _to_hash(v) }
164
- elsif value.is_a?(Hash)
165
- {}.tap do |hash|
166
- value.each { |k, v| hash[k] = _to_hash(v) }
167
- end
168
- elsif value.respond_to? :to_hash
169
- value.to_hash
170
- else
171
- value
172
- end
173
- end
174
- end
175
- end
@@ -1,57 +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::APIError
18
- # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
- # Please update as you see appropriate
20
- describe 'APIError' do
21
- before do
22
- # run before each test
23
- @instance = DyspatchClient::APIError.new
24
- end
25
-
26
- after do
27
- # run after each test
28
- end
29
-
30
- describe 'test an instance of APIError' do
31
- it 'should create an instance of APIError' do
32
- expect(@instance).to be_instance_of(DyspatchClient::APIError)
33
- end
34
- end
35
- describe 'test attribute "code"' do
36
- it 'should work' do
37
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
- # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["server_error", "invalid_parameter", "invalid_body", "invalid_request", "unauthorized", "unauthenticated", "not_found", "rate_limited"])
39
- # validator.allowable_values.each do |value|
40
- # expect { @instance.code = value }.not_to raise_error
41
- # end
42
- end
43
- end
44
-
45
- describe 'test attribute "message"' do
46
- it 'should work' do
47
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
48
- end
49
- end
50
-
51
- describe 'test attribute "parameter"' do
52
- it 'should work' do
53
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
54
- end
55
- end
56
-
57
- end
@@ -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