smplkit 3.0.54 → 3.0.55

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 248694da5a8e051c63538a30d82c0d6feab64dfaec102336643aa25e5ca47b49
4
- data.tar.gz: b33512f649be75170d5c5bf475a8e2d34bc53cba72b98f93d1bb9cc1c02bed75
3
+ metadata.gz: 0216b458ad0a207196255d0b7a54190f7cd7b26c4bb67ea990b7620cc336c21e
4
+ data.tar.gz: 831612f879ee29db10541c8f2a864f13b6aef05f3cc06c0f918a4b53b4ad411d
5
5
  SHA512:
6
- metadata.gz: 87aa819450a29feffff73a6348de1eb3c2dfb3e701c46538990618568a3725d580d44e8e0da5bef0d3be82bc1573d1c9017111dad00b4b1f5f71022b9e2b4193
7
- data.tar.gz: c9cf8caaad7120a46025386685e8e595d144c5635692025267fa6b204c973deb696cd05f5b90bb91aab81f9b54d6de55e99090259cffdb94a55f33d0f7cbb6c4
6
+ metadata.gz: e0d11dd42bd354bb3d65d7d8f80d6a168624bf034d23e5d51be61ff64926286a685060d459d18fa704f4812b48c36454e786fc263eb32fe676afaff249a48eea
7
+ data.tar.gz: f30ee6f5392f440fee8ed5030536e58d36b52657130a48b6d7a8ef12b8a9b29487d8e2482b76bcdefe8d37f4aa48ec324daaaaff70a9098eddb2463a92f1a60d
@@ -21,26 +21,26 @@ module SmplkitGeneratedClient::App
21
21
  end
22
22
  # Create Environment
23
23
  # Create a new environment. The caller provides the id (key) in the request body.
24
- # @param environment_request [EnvironmentRequest]
24
+ # @param environment_create_request [EnvironmentCreateRequest]
25
25
  # @param [Hash] opts the optional parameters
26
26
  # @return [EnvironmentResponse]
27
- def create_environment(environment_request, opts = {})
28
- data, _status_code, _headers = create_environment_with_http_info(environment_request, opts)
27
+ def create_environment(environment_create_request, opts = {})
28
+ data, _status_code, _headers = create_environment_with_http_info(environment_create_request, opts)
29
29
  data
30
30
  end
31
31
 
32
32
  # Create Environment
33
33
  # Create a new environment. The caller provides the id (key) in the request body.
34
- # @param environment_request [EnvironmentRequest]
34
+ # @param environment_create_request [EnvironmentCreateRequest]
35
35
  # @param [Hash] opts the optional parameters
36
36
  # @return [Array<(EnvironmentResponse, Integer, Hash)>] EnvironmentResponse data, response status code and response headers
37
- def create_environment_with_http_info(environment_request, opts = {})
37
+ def create_environment_with_http_info(environment_create_request, opts = {})
38
38
  if @api_client.config.debugging
39
39
  @api_client.config.logger.debug 'Calling API: EnvironmentsApi.create_environment ...'
40
40
  end
41
- # verify the required parameter 'environment_request' is set
42
- if @api_client.config.client_side_validation && environment_request.nil?
43
- fail ArgumentError, "Missing the required parameter 'environment_request' when calling EnvironmentsApi.create_environment"
41
+ # verify the required parameter 'environment_create_request' is set
42
+ if @api_client.config.client_side_validation && environment_create_request.nil?
43
+ fail ArgumentError, "Missing the required parameter 'environment_create_request' when calling EnvironmentsApi.create_environment"
44
44
  end
45
45
  # resource path
46
46
  local_var_path = '/api/v1/environments'
@@ -62,7 +62,7 @@ module SmplkitGeneratedClient::App
62
62
  form_params = opts[:form_params] || {}
63
63
 
64
64
  # http body (model)
65
- post_body = opts[:debug_body] || @api_client.object_to_http_body(environment_request)
65
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(environment_create_request)
66
66
 
67
67
  # return_type
68
68
  return_type = opts[:debug_return_type] || 'EnvironmentResponse'
@@ -21,26 +21,26 @@ module SmplkitGeneratedClient::App
21
21
  end
22
22
  # Create Service
23
23
  # Create a new service. The caller provides the id (key) in the request body.
24
- # @param service_request [ServiceRequest]
24
+ # @param service_create_request [ServiceCreateRequest]
25
25
  # @param [Hash] opts the optional parameters
26
26
  # @return [ServiceResponse]
27
- def create_service(service_request, opts = {})
28
- data, _status_code, _headers = create_service_with_http_info(service_request, opts)
27
+ def create_service(service_create_request, opts = {})
28
+ data, _status_code, _headers = create_service_with_http_info(service_create_request, opts)
29
29
  data
30
30
  end
31
31
 
32
32
  # Create Service
33
33
  # Create a new service. The caller provides the id (key) in the request body.
34
- # @param service_request [ServiceRequest]
34
+ # @param service_create_request [ServiceCreateRequest]
35
35
  # @param [Hash] opts the optional parameters
36
36
  # @return [Array<(ServiceResponse, Integer, Hash)>] ServiceResponse data, response status code and response headers
37
- def create_service_with_http_info(service_request, opts = {})
37
+ def create_service_with_http_info(service_create_request, opts = {})
38
38
  if @api_client.config.debugging
39
39
  @api_client.config.logger.debug 'Calling API: ServicesApi.create_service ...'
40
40
  end
41
- # verify the required parameter 'service_request' is set
42
- if @api_client.config.client_side_validation && service_request.nil?
43
- fail ArgumentError, "Missing the required parameter 'service_request' when calling ServicesApi.create_service"
41
+ # verify the required parameter 'service_create_request' is set
42
+ if @api_client.config.client_side_validation && service_create_request.nil?
43
+ fail ArgumentError, "Missing the required parameter 'service_create_request' when calling ServicesApi.create_service"
44
44
  end
45
45
  # resource path
46
46
  local_var_path = '/api/v1/services'
@@ -62,7 +62,7 @@ module SmplkitGeneratedClient::App
62
62
  form_params = opts[:form_params] || {}
63
63
 
64
64
  # http body (model)
65
- post_body = opts[:debug_body] || @api_client.object_to_http_body(service_request)
65
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(service_create_request)
66
66
 
67
67
  # return_type
68
68
  return_type = opts[:debug_return_type] || 'ServiceResponse'
@@ -0,0 +1,165 @@
1
+ =begin
2
+ #smplkit API
3
+
4
+ #API for the smplkit platform.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module SmplkitGeneratedClient::App
17
+ # JSON:API request envelope for creating an environment. Distinct from :class:`EnvironmentRequest` because create requires caller-supplied ``data.id`` while update does not (the id lives in the URL path).
18
+ class EnvironmentCreateRequest < ApiModelBase
19
+ attr_accessor :data
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'data' => :'data'
25
+ }
26
+ end
27
+
28
+ # Returns attribute mapping this model knows about
29
+ def self.acceptable_attribute_map
30
+ attribute_map
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ acceptable_attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'data' => :'EnvironmentCreateResource'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::App::EnvironmentCreateRequest` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ acceptable_attribute_map = self.class.acceptable_attribute_map
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!acceptable_attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::App::EnvironmentCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'data')
68
+ self.data = attributes[:'data']
69
+ else
70
+ self.data = nil
71
+ end
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properties with the reasons
76
+ def list_invalid_properties
77
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
78
+ invalid_properties = Array.new
79
+ if @data.nil?
80
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
81
+ end
82
+
83
+ invalid_properties
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ def valid?
89
+ warn '[DEPRECATED] the `valid?` method is obsolete'
90
+ return false if @data.nil?
91
+ true
92
+ end
93
+
94
+ # Custom attribute writer method with validation
95
+ # @param [Object] data Value to be assigned
96
+ def data=(data)
97
+ if data.nil?
98
+ fail ArgumentError, 'data cannot be nil'
99
+ end
100
+
101
+ @data = data
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
+ data == o.data
110
+ end
111
+
112
+ # @see the `==` method
113
+ # @param [Object] Object to be compared
114
+ def eql?(o)
115
+ self == o
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Integer] Hash code
120
+ def hash
121
+ [data].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
+ return nil unless attributes.is_a?(Hash)
129
+ attributes = attributes.transform_keys(&:to_sym)
130
+ transformed_hash = {}
131
+ openapi_types.each_pair do |key, type|
132
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
133
+ transformed_hash["#{key}"] = nil
134
+ elsif type =~ /\AArray<(.*)>/i
135
+ # check to ensure the input is an array given that the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[attribute_map[key]].is_a?(Array)
138
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
139
+ end
140
+ elsif !attributes[attribute_map[key]].nil?
141
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
142
+ end
143
+ end
144
+ new(transformed_hash)
145
+ end
146
+
147
+ # Returns the object in the form of hash
148
+ # @return [Hash] Returns the object in the form of hash
149
+ def to_hash
150
+ hash = {}
151
+ self.class.attribute_map.each_pair do |attr, param|
152
+ value = self.send(attr)
153
+ if value.nil?
154
+ is_nullable = self.class.openapi_nullable.include?(attr)
155
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
156
+ end
157
+
158
+ hash[param] = _to_hash(value)
159
+ end
160
+ hash
161
+ end
162
+
163
+ end
164
+
165
+ end
@@ -0,0 +1,242 @@
1
+ =begin
2
+ #smplkit API
3
+
4
+ #API for the smplkit platform.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module SmplkitGeneratedClient::App
17
+ # JSON:API resource envelope for creating an environment (id required).
18
+ class EnvironmentCreateResource < ApiModelBase
19
+ # Client-supplied resource id.
20
+ attr_accessor :id
21
+
22
+ attr_accessor :type
23
+
24
+ attr_accessor :attributes
25
+
26
+ class EnumAttributeValidator
27
+ attr_reader :datatype
28
+ attr_reader :allowable_values
29
+
30
+ def initialize(datatype, allowable_values)
31
+ @allowable_values = allowable_values.map do |value|
32
+ case datatype.to_s
33
+ when /Integer/i
34
+ value.to_i
35
+ when /Float/i
36
+ value.to_f
37
+ else
38
+ value
39
+ end
40
+ end
41
+ end
42
+
43
+ def valid?(value)
44
+ !value || allowable_values.include?(value)
45
+ end
46
+ end
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'id' => :'id',
52
+ :'type' => :'type',
53
+ :'attributes' => :'attributes'
54
+ }
55
+ end
56
+
57
+ # Returns attribute mapping this model knows about
58
+ def self.acceptable_attribute_map
59
+ attribute_map
60
+ end
61
+
62
+ # Returns all the JSON keys this model knows about
63
+ def self.acceptable_attributes
64
+ acceptable_attribute_map.values
65
+ end
66
+
67
+ # Attribute type mapping.
68
+ def self.openapi_types
69
+ {
70
+ :'id' => :'String',
71
+ :'type' => :'String',
72
+ :'attributes' => :'Environment'
73
+ }
74
+ end
75
+
76
+ # List of attributes with nullable: true
77
+ def self.openapi_nullable
78
+ Set.new([
79
+ ])
80
+ end
81
+
82
+ # Initializes the object
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ def initialize(attributes = {})
85
+ if (!attributes.is_a?(Hash))
86
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::App::EnvironmentCreateResource` initialize method"
87
+ end
88
+
89
+ # check to see if the attribute exists and convert string to symbol for hash key
90
+ acceptable_attribute_map = self.class.acceptable_attribute_map
91
+ attributes = attributes.each_with_object({}) { |(k, v), h|
92
+ if (!acceptable_attribute_map.key?(k.to_sym))
93
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::App::EnvironmentCreateResource`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
94
+ end
95
+ h[k.to_sym] = v
96
+ }
97
+
98
+ if attributes.key?(:'id')
99
+ self.id = attributes[:'id']
100
+ else
101
+ self.id = nil
102
+ end
103
+
104
+ if attributes.key?(:'type')
105
+ self.type = attributes[:'type']
106
+ else
107
+ self.type = nil
108
+ end
109
+
110
+ if attributes.key?(:'attributes')
111
+ self.attributes = attributes[:'attributes']
112
+ else
113
+ self.attributes = nil
114
+ end
115
+ end
116
+
117
+ # Show invalid properties with the reasons. Usually used together with valid?
118
+ # @return Array for valid properties with the reasons
119
+ def list_invalid_properties
120
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
121
+ invalid_properties = Array.new
122
+ if @id.nil?
123
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
124
+ end
125
+
126
+ if @type.nil?
127
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
128
+ end
129
+
130
+ if @attributes.nil?
131
+ invalid_properties.push('invalid value for "attributes", attributes cannot be nil.')
132
+ end
133
+
134
+ invalid_properties
135
+ end
136
+
137
+ # Check to see if the all the properties in the model are valid
138
+ # @return true if the model is valid
139
+ def valid?
140
+ warn '[DEPRECATED] the `valid?` method is obsolete'
141
+ return false if @id.nil?
142
+ return false if @type.nil?
143
+ type_validator = EnumAttributeValidator.new('String', ["environment"])
144
+ return false unless type_validator.valid?(@type)
145
+ return false if @attributes.nil?
146
+ true
147
+ end
148
+
149
+ # Custom attribute writer method with validation
150
+ # @param [Object] id Value to be assigned
151
+ def id=(id)
152
+ if id.nil?
153
+ fail ArgumentError, 'id cannot be nil'
154
+ end
155
+
156
+ @id = id
157
+ end
158
+
159
+ # Custom attribute writer method checking allowed values (enum).
160
+ # @param [Object] type Object to be assigned
161
+ def type=(type)
162
+ validator = EnumAttributeValidator.new('String', ["environment"])
163
+ unless validator.valid?(type)
164
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
165
+ end
166
+ @type = type
167
+ end
168
+
169
+ # Custom attribute writer method with validation
170
+ # @param [Object] attributes Value to be assigned
171
+ def attributes=(attributes)
172
+ if attributes.nil?
173
+ fail ArgumentError, 'attributes cannot be nil'
174
+ end
175
+
176
+ @attributes = attributes
177
+ end
178
+
179
+ # Checks equality by comparing each attribute.
180
+ # @param [Object] Object to be compared
181
+ def ==(o)
182
+ return true if self.equal?(o)
183
+ self.class == o.class &&
184
+ id == o.id &&
185
+ type == o.type &&
186
+ attributes == o.attributes
187
+ end
188
+
189
+ # @see the `==` method
190
+ # @param [Object] Object to be compared
191
+ def eql?(o)
192
+ self == o
193
+ end
194
+
195
+ # Calculates hash code according to all attributes.
196
+ # @return [Integer] Hash code
197
+ def hash
198
+ [id, type, attributes].hash
199
+ end
200
+
201
+ # Builds the object from hash
202
+ # @param [Hash] attributes Model attributes in the form of hash
203
+ # @return [Object] Returns the model itself
204
+ def self.build_from_hash(attributes)
205
+ return nil unless attributes.is_a?(Hash)
206
+ attributes = attributes.transform_keys(&:to_sym)
207
+ transformed_hash = {}
208
+ openapi_types.each_pair do |key, type|
209
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
210
+ transformed_hash["#{key}"] = nil
211
+ elsif type =~ /\AArray<(.*)>/i
212
+ # check to ensure the input is an array given that the attribute
213
+ # is documented as an array but the input is not
214
+ if attributes[attribute_map[key]].is_a?(Array)
215
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
216
+ end
217
+ elsif !attributes[attribute_map[key]].nil?
218
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
219
+ end
220
+ end
221
+ new(transformed_hash)
222
+ end
223
+
224
+ # Returns the object in the form of hash
225
+ # @return [Hash] Returns the object in the form of hash
226
+ def to_hash
227
+ hash = {}
228
+ self.class.attribute_map.each_pair do |attr, param|
229
+ value = self.send(attr)
230
+ if value.nil?
231
+ is_nullable = self.class.openapi_nullable.include?(attr)
232
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
233
+ end
234
+
235
+ hash[param] = _to_hash(value)
236
+ end
237
+ hash
238
+ end
239
+
240
+ end
241
+
242
+ end
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::App
17
- # JSON:API request envelope for creating or updating an environment.
17
+ # JSON:API request envelope for updating an environment.
18
18
  class EnvironmentRequest < ApiModelBase
19
19
  attr_accessor :data
20
20
 
@@ -0,0 +1,165 @@
1
+ =begin
2
+ #smplkit API
3
+
4
+ #API for the smplkit platform.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module SmplkitGeneratedClient::App
17
+ # JSON:API request envelope for creating a service. Distinct from :class:`ServiceRequest` because create requires caller-supplied ``data.id`` while update does not.
18
+ class ServiceCreateRequest < ApiModelBase
19
+ attr_accessor :data
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'data' => :'data'
25
+ }
26
+ end
27
+
28
+ # Returns attribute mapping this model knows about
29
+ def self.acceptable_attribute_map
30
+ attribute_map
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ acceptable_attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'data' => :'ServiceCreateResource'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::App::ServiceCreateRequest` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ acceptable_attribute_map = self.class.acceptable_attribute_map
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!acceptable_attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::App::ServiceCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'data')
68
+ self.data = attributes[:'data']
69
+ else
70
+ self.data = nil
71
+ end
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properties with the reasons
76
+ def list_invalid_properties
77
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
78
+ invalid_properties = Array.new
79
+ if @data.nil?
80
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
81
+ end
82
+
83
+ invalid_properties
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ def valid?
89
+ warn '[DEPRECATED] the `valid?` method is obsolete'
90
+ return false if @data.nil?
91
+ true
92
+ end
93
+
94
+ # Custom attribute writer method with validation
95
+ # @param [Object] data Value to be assigned
96
+ def data=(data)
97
+ if data.nil?
98
+ fail ArgumentError, 'data cannot be nil'
99
+ end
100
+
101
+ @data = data
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
+ data == o.data
110
+ end
111
+
112
+ # @see the `==` method
113
+ # @param [Object] Object to be compared
114
+ def eql?(o)
115
+ self == o
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Integer] Hash code
120
+ def hash
121
+ [data].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
+ return nil unless attributes.is_a?(Hash)
129
+ attributes = attributes.transform_keys(&:to_sym)
130
+ transformed_hash = {}
131
+ openapi_types.each_pair do |key, type|
132
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
133
+ transformed_hash["#{key}"] = nil
134
+ elsif type =~ /\AArray<(.*)>/i
135
+ # check to ensure the input is an array given that the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[attribute_map[key]].is_a?(Array)
138
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
139
+ end
140
+ elsif !attributes[attribute_map[key]].nil?
141
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
142
+ end
143
+ end
144
+ new(transformed_hash)
145
+ end
146
+
147
+ # Returns the object in the form of hash
148
+ # @return [Hash] Returns the object in the form of hash
149
+ def to_hash
150
+ hash = {}
151
+ self.class.attribute_map.each_pair do |attr, param|
152
+ value = self.send(attr)
153
+ if value.nil?
154
+ is_nullable = self.class.openapi_nullable.include?(attr)
155
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
156
+ end
157
+
158
+ hash[param] = _to_hash(value)
159
+ end
160
+ hash
161
+ end
162
+
163
+ end
164
+
165
+ end
@@ -0,0 +1,242 @@
1
+ =begin
2
+ #smplkit API
3
+
4
+ #API for the smplkit platform.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module SmplkitGeneratedClient::App
17
+ # JSON:API resource envelope for creating a service (id required).
18
+ class ServiceCreateResource < ApiModelBase
19
+ # Client-supplied resource id.
20
+ attr_accessor :id
21
+
22
+ attr_accessor :type
23
+
24
+ attr_accessor :attributes
25
+
26
+ class EnumAttributeValidator
27
+ attr_reader :datatype
28
+ attr_reader :allowable_values
29
+
30
+ def initialize(datatype, allowable_values)
31
+ @allowable_values = allowable_values.map do |value|
32
+ case datatype.to_s
33
+ when /Integer/i
34
+ value.to_i
35
+ when /Float/i
36
+ value.to_f
37
+ else
38
+ value
39
+ end
40
+ end
41
+ end
42
+
43
+ def valid?(value)
44
+ !value || allowable_values.include?(value)
45
+ end
46
+ end
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'id' => :'id',
52
+ :'type' => :'type',
53
+ :'attributes' => :'attributes'
54
+ }
55
+ end
56
+
57
+ # Returns attribute mapping this model knows about
58
+ def self.acceptable_attribute_map
59
+ attribute_map
60
+ end
61
+
62
+ # Returns all the JSON keys this model knows about
63
+ def self.acceptable_attributes
64
+ acceptable_attribute_map.values
65
+ end
66
+
67
+ # Attribute type mapping.
68
+ def self.openapi_types
69
+ {
70
+ :'id' => :'String',
71
+ :'type' => :'String',
72
+ :'attributes' => :'Service'
73
+ }
74
+ end
75
+
76
+ # List of attributes with nullable: true
77
+ def self.openapi_nullable
78
+ Set.new([
79
+ ])
80
+ end
81
+
82
+ # Initializes the object
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ def initialize(attributes = {})
85
+ if (!attributes.is_a?(Hash))
86
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::App::ServiceCreateResource` initialize method"
87
+ end
88
+
89
+ # check to see if the attribute exists and convert string to symbol for hash key
90
+ acceptable_attribute_map = self.class.acceptable_attribute_map
91
+ attributes = attributes.each_with_object({}) { |(k, v), h|
92
+ if (!acceptable_attribute_map.key?(k.to_sym))
93
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::App::ServiceCreateResource`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
94
+ end
95
+ h[k.to_sym] = v
96
+ }
97
+
98
+ if attributes.key?(:'id')
99
+ self.id = attributes[:'id']
100
+ else
101
+ self.id = nil
102
+ end
103
+
104
+ if attributes.key?(:'type')
105
+ self.type = attributes[:'type']
106
+ else
107
+ self.type = nil
108
+ end
109
+
110
+ if attributes.key?(:'attributes')
111
+ self.attributes = attributes[:'attributes']
112
+ else
113
+ self.attributes = nil
114
+ end
115
+ end
116
+
117
+ # Show invalid properties with the reasons. Usually used together with valid?
118
+ # @return Array for valid properties with the reasons
119
+ def list_invalid_properties
120
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
121
+ invalid_properties = Array.new
122
+ if @id.nil?
123
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
124
+ end
125
+
126
+ if @type.nil?
127
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
128
+ end
129
+
130
+ if @attributes.nil?
131
+ invalid_properties.push('invalid value for "attributes", attributes cannot be nil.')
132
+ end
133
+
134
+ invalid_properties
135
+ end
136
+
137
+ # Check to see if the all the properties in the model are valid
138
+ # @return true if the model is valid
139
+ def valid?
140
+ warn '[DEPRECATED] the `valid?` method is obsolete'
141
+ return false if @id.nil?
142
+ return false if @type.nil?
143
+ type_validator = EnumAttributeValidator.new('String', ["service"])
144
+ return false unless type_validator.valid?(@type)
145
+ return false if @attributes.nil?
146
+ true
147
+ end
148
+
149
+ # Custom attribute writer method with validation
150
+ # @param [Object] id Value to be assigned
151
+ def id=(id)
152
+ if id.nil?
153
+ fail ArgumentError, 'id cannot be nil'
154
+ end
155
+
156
+ @id = id
157
+ end
158
+
159
+ # Custom attribute writer method checking allowed values (enum).
160
+ # @param [Object] type Object to be assigned
161
+ def type=(type)
162
+ validator = EnumAttributeValidator.new('String', ["service"])
163
+ unless validator.valid?(type)
164
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
165
+ end
166
+ @type = type
167
+ end
168
+
169
+ # Custom attribute writer method with validation
170
+ # @param [Object] attributes Value to be assigned
171
+ def attributes=(attributes)
172
+ if attributes.nil?
173
+ fail ArgumentError, 'attributes cannot be nil'
174
+ end
175
+
176
+ @attributes = attributes
177
+ end
178
+
179
+ # Checks equality by comparing each attribute.
180
+ # @param [Object] Object to be compared
181
+ def ==(o)
182
+ return true if self.equal?(o)
183
+ self.class == o.class &&
184
+ id == o.id &&
185
+ type == o.type &&
186
+ attributes == o.attributes
187
+ end
188
+
189
+ # @see the `==` method
190
+ # @param [Object] Object to be compared
191
+ def eql?(o)
192
+ self == o
193
+ end
194
+
195
+ # Calculates hash code according to all attributes.
196
+ # @return [Integer] Hash code
197
+ def hash
198
+ [id, type, attributes].hash
199
+ end
200
+
201
+ # Builds the object from hash
202
+ # @param [Hash] attributes Model attributes in the form of hash
203
+ # @return [Object] Returns the model itself
204
+ def self.build_from_hash(attributes)
205
+ return nil unless attributes.is_a?(Hash)
206
+ attributes = attributes.transform_keys(&:to_sym)
207
+ transformed_hash = {}
208
+ openapi_types.each_pair do |key, type|
209
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
210
+ transformed_hash["#{key}"] = nil
211
+ elsif type =~ /\AArray<(.*)>/i
212
+ # check to ensure the input is an array given that the attribute
213
+ # is documented as an array but the input is not
214
+ if attributes[attribute_map[key]].is_a?(Array)
215
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
216
+ end
217
+ elsif !attributes[attribute_map[key]].nil?
218
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
219
+ end
220
+ end
221
+ new(transformed_hash)
222
+ end
223
+
224
+ # Returns the object in the form of hash
225
+ # @return [Hash] Returns the object in the form of hash
226
+ def to_hash
227
+ hash = {}
228
+ self.class.attribute_map.each_pair do |attr, param|
229
+ value = self.send(attr)
230
+ if value.nil?
231
+ is_nullable = self.class.openapi_nullable.include?(attr)
232
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
233
+ end
234
+
235
+ hash[param] = _to_hash(value)
236
+ end
237
+ hash
238
+ end
239
+
240
+ end
241
+
242
+ end
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::App
17
- # JSON:API request envelope for creating or updating a service.
17
+ # JSON:API request envelope for updating a service.
18
18
  class ServiceRequest < ApiModelBase
19
19
  attr_accessor :data
20
20
 
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::App
17
- # JSON:API resource envelope for a service. `id` must not be specified for create requests (the server assigns it).
17
+ # JSON:API resource envelope for a service. The caller supplies ``id`` (the service's key) on create.
18
18
  class ServiceResource < ApiModelBase
19
19
  attr_accessor :id
20
20
 
@@ -59,6 +59,8 @@ require 'smplkit_app_client/models/email'
59
59
  require 'smplkit_app_client/models/email_resource'
60
60
  require 'smplkit_app_client/models/email_response'
61
61
  require 'smplkit_app_client/models/environment'
62
+ require 'smplkit_app_client/models/environment_create_request'
63
+ require 'smplkit_app_client/models/environment_create_resource'
62
64
  require 'smplkit_app_client/models/environment_list_response'
63
65
  require 'smplkit_app_client/models/environment_request'
64
66
  require 'smplkit_app_client/models/environment_resource'
@@ -108,6 +110,8 @@ require 'smplkit_app_client/models/product_list_response'
108
110
  require 'smplkit_app_client/models/product_resource'
109
111
  require 'smplkit_app_client/models/register_request'
110
112
  require 'smplkit_app_client/models/service'
113
+ require 'smplkit_app_client/models/service_create_request'
114
+ require 'smplkit_app_client/models/service_create_resource'
111
115
  require 'smplkit_app_client/models/service_list_response'
112
116
  require 'smplkit_app_client/models/service_request'
113
117
  require 'smplkit_app_client/models/service_resource'
@@ -35,7 +35,7 @@ describe 'EnvironmentsApi' do
35
35
  # unit tests for create_environment
36
36
  # Create Environment
37
37
  # Create a new environment. The caller provides the id (key) in the request body.
38
- # @param environment_request
38
+ # @param environment_create_request
39
39
  # @param [Hash] opts the optional parameters
40
40
  # @return [EnvironmentResponse]
41
41
  describe 'create_environment test' do
@@ -35,7 +35,7 @@ describe 'ServicesApi' do
35
35
  # unit tests for create_service
36
36
  # Create Service
37
37
  # Create a new service. The caller provides the id (key) in the request body.
38
- # @param service_request
38
+ # @param service_create_request
39
39
  # @param [Hash] opts the optional parameters
40
40
  # @return [ServiceResponse]
41
41
  describe 'create_service test' do
@@ -0,0 +1,36 @@
1
+ =begin
2
+ #smplkit API
3
+
4
+ #API for the smplkit platform.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for SmplkitGeneratedClient::App::EnvironmentCreateRequest
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe SmplkitGeneratedClient::App::EnvironmentCreateRequest do
21
+ #let(:instance) { SmplkitGeneratedClient::App::EnvironmentCreateRequest.new }
22
+
23
+ describe 'test an instance of EnvironmentCreateRequest' do
24
+ it 'should create an instance of EnvironmentCreateRequest' do
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(SmplkitGeneratedClient::App::EnvironmentCreateRequest)
27
+ end
28
+ end
29
+
30
+ describe 'test attribute "data"' do
31
+ it 'should work' do
32
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
33
+ end
34
+ end
35
+
36
+ end
@@ -0,0 +1,52 @@
1
+ =begin
2
+ #smplkit API
3
+
4
+ #API for the smplkit platform.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for SmplkitGeneratedClient::App::EnvironmentCreateResource
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe SmplkitGeneratedClient::App::EnvironmentCreateResource do
21
+ #let(:instance) { SmplkitGeneratedClient::App::EnvironmentCreateResource.new }
22
+
23
+ describe 'test an instance of EnvironmentCreateResource' do
24
+ it 'should create an instance of EnvironmentCreateResource' do
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(SmplkitGeneratedClient::App::EnvironmentCreateResource)
27
+ end
28
+ end
29
+
30
+ describe 'test attribute "id"' do
31
+ it 'should work' do
32
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
33
+ end
34
+ end
35
+
36
+ describe 'test attribute "type"' do
37
+ it 'should work' do
38
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
39
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["environment"])
40
+ # validator.allowable_values.each do |value|
41
+ # expect { instance.type = value }.not_to raise_error
42
+ # end
43
+ end
44
+ end
45
+
46
+ describe 'test attribute "attributes"' do
47
+ it 'should work' do
48
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
49
+ end
50
+ end
51
+
52
+ end
@@ -0,0 +1,36 @@
1
+ =begin
2
+ #smplkit API
3
+
4
+ #API for the smplkit platform.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for SmplkitGeneratedClient::App::ServiceCreateRequest
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe SmplkitGeneratedClient::App::ServiceCreateRequest do
21
+ #let(:instance) { SmplkitGeneratedClient::App::ServiceCreateRequest.new }
22
+
23
+ describe 'test an instance of ServiceCreateRequest' do
24
+ it 'should create an instance of ServiceCreateRequest' do
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(SmplkitGeneratedClient::App::ServiceCreateRequest)
27
+ end
28
+ end
29
+
30
+ describe 'test attribute "data"' do
31
+ it 'should work' do
32
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
33
+ end
34
+ end
35
+
36
+ end
@@ -0,0 +1,52 @@
1
+ =begin
2
+ #smplkit API
3
+
4
+ #API for the smplkit platform.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for SmplkitGeneratedClient::App::ServiceCreateResource
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe SmplkitGeneratedClient::App::ServiceCreateResource do
21
+ #let(:instance) { SmplkitGeneratedClient::App::ServiceCreateResource.new }
22
+
23
+ describe 'test an instance of ServiceCreateResource' do
24
+ it 'should create an instance of ServiceCreateResource' do
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(SmplkitGeneratedClient::App::ServiceCreateResource)
27
+ end
28
+ end
29
+
30
+ describe 'test attribute "id"' do
31
+ it 'should work' do
32
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
33
+ end
34
+ end
35
+
36
+ describe 'test attribute "type"' do
37
+ it 'should work' do
38
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
39
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["service"])
40
+ # validator.allowable_values.each do |value|
41
+ # expect { instance.type = value }.not_to raise_error
42
+ # end
43
+ end
44
+ end
45
+
46
+ describe 'test attribute "attributes"' do
47
+ it 'should work' do
48
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
49
+ end
50
+ end
51
+
52
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smplkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.54
4
+ version: 3.0.55
5
5
  platform: ruby
6
6
  authors:
7
7
  - Smpl Solutions LLC
@@ -215,6 +215,8 @@ files:
215
215
  - lib/smplkit/_generated/app/lib/smplkit_app_client/models/email_resource.rb
216
216
  - lib/smplkit/_generated/app/lib/smplkit_app_client/models/email_response.rb
217
217
  - lib/smplkit/_generated/app/lib/smplkit_app_client/models/environment.rb
218
+ - lib/smplkit/_generated/app/lib/smplkit_app_client/models/environment_create_request.rb
219
+ - lib/smplkit/_generated/app/lib/smplkit_app_client/models/environment_create_resource.rb
218
220
  - lib/smplkit/_generated/app/lib/smplkit_app_client/models/environment_list_response.rb
219
221
  - lib/smplkit/_generated/app/lib/smplkit_app_client/models/environment_request.rb
220
222
  - lib/smplkit/_generated/app/lib/smplkit_app_client/models/environment_resource.rb
@@ -264,6 +266,8 @@ files:
264
266
  - lib/smplkit/_generated/app/lib/smplkit_app_client/models/product_resource.rb
265
267
  - lib/smplkit/_generated/app/lib/smplkit_app_client/models/register_request.rb
266
268
  - lib/smplkit/_generated/app/lib/smplkit_app_client/models/service.rb
269
+ - lib/smplkit/_generated/app/lib/smplkit_app_client/models/service_create_request.rb
270
+ - lib/smplkit/_generated/app/lib/smplkit_app_client/models/service_create_resource.rb
267
271
  - lib/smplkit/_generated/app/lib/smplkit_app_client/models/service_list_response.rb
268
272
  - lib/smplkit/_generated/app/lib/smplkit_app_client/models/service_request.rb
269
273
  - lib/smplkit/_generated/app/lib/smplkit_app_client/models/service_resource.rb
@@ -349,6 +353,8 @@ files:
349
353
  - lib/smplkit/_generated/app/spec/models/email_resource_spec.rb
350
354
  - lib/smplkit/_generated/app/spec/models/email_response_spec.rb
351
355
  - lib/smplkit/_generated/app/spec/models/email_spec.rb
356
+ - lib/smplkit/_generated/app/spec/models/environment_create_request_spec.rb
357
+ - lib/smplkit/_generated/app/spec/models/environment_create_resource_spec.rb
352
358
  - lib/smplkit/_generated/app/spec/models/environment_list_response_spec.rb
353
359
  - lib/smplkit/_generated/app/spec/models/environment_request_spec.rb
354
360
  - lib/smplkit/_generated/app/spec/models/environment_resource_spec.rb
@@ -398,6 +404,8 @@ files:
398
404
  - lib/smplkit/_generated/app/spec/models/product_resource_spec.rb
399
405
  - lib/smplkit/_generated/app/spec/models/product_spec.rb
400
406
  - lib/smplkit/_generated/app/spec/models/register_request_spec.rb
407
+ - lib/smplkit/_generated/app/spec/models/service_create_request_spec.rb
408
+ - lib/smplkit/_generated/app/spec/models/service_create_resource_spec.rb
401
409
  - lib/smplkit/_generated/app/spec/models/service_list_response_spec.rb
402
410
  - lib/smplkit/_generated/app/spec/models/service_request_spec.rb
403
411
  - lib/smplkit/_generated/app/spec/models/service_resource_spec.rb