smplkit 3.0.55 → 3.0.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/forwarders_api.rb +13 -13
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_create_request.rb +165 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_create_resource.rb +237 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_request.rb +1 -1
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_resource.rb +1 -1
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client.rb +2 -0
- data/lib/smplkit/_generated/audit/spec/api/forwarders_api_spec.rb +3 -3
- data/lib/smplkit/_generated/audit/spec/models/forwarder_create_request_spec.rb +36 -0
- data/lib/smplkit/_generated/audit/spec/models/forwarder_create_resource_spec.rb +52 -0
- metadata +5 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 74d41ad288136751834d3d7aa631ddfff4fcf6b6fc4e6e05b82f6c12c2bc90e9
|
|
4
|
+
data.tar.gz: db65e4fa1e1b1efae7e9bdb4b729c603c5d60671d1942fe950f82a2795687701
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f19f199b0a6bde6b1d9b110ccbed94a5fa66d93caf8dfb1dd729d552dde2f3f02e1f19b1f9d7e0025425967a573b9839e941a9a51f422e5cc5a1af870e924efc
|
|
7
|
+
data.tar.gz: 372d6d2dbf2cb66084066093185a5a534fd36a9df01acb9544010fc18c12855cfcb314668d465c50a92c6e6f05f862e5f884a7beb410a97a6decde1ebb0ea537
|
|
@@ -20,27 +20,27 @@ module SmplkitGeneratedClient::Audit
|
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
22
|
# Create Forwarder
|
|
23
|
-
# Create a forwarder for this account.
|
|
24
|
-
# @param
|
|
23
|
+
# Create a forwarder for this account. The caller supplies the forwarder's key as `data.id`. Keys are unique within an account and immutable for the lifetime of the forwarder.
|
|
24
|
+
# @param forwarder_create_request [ForwarderCreateRequest]
|
|
25
25
|
# @param [Hash] opts the optional parameters
|
|
26
26
|
# @return [ForwarderResponse]
|
|
27
|
-
def create_forwarder(
|
|
28
|
-
data, _status_code, _headers = create_forwarder_with_http_info(
|
|
27
|
+
def create_forwarder(forwarder_create_request, opts = {})
|
|
28
|
+
data, _status_code, _headers = create_forwarder_with_http_info(forwarder_create_request, opts)
|
|
29
29
|
data
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
# Create Forwarder
|
|
33
|
-
# Create a forwarder for this account.
|
|
34
|
-
# @param
|
|
33
|
+
# Create a forwarder for this account. The caller supplies the forwarder's key as `data.id`. Keys are unique within an account and immutable for the lifetime of the forwarder.
|
|
34
|
+
# @param forwarder_create_request [ForwarderCreateRequest]
|
|
35
35
|
# @param [Hash] opts the optional parameters
|
|
36
36
|
# @return [Array<(ForwarderResponse, Integer, Hash)>] ForwarderResponse data, response status code and response headers
|
|
37
|
-
def create_forwarder_with_http_info(
|
|
37
|
+
def create_forwarder_with_http_info(forwarder_create_request, opts = {})
|
|
38
38
|
if @api_client.config.debugging
|
|
39
39
|
@api_client.config.logger.debug 'Calling API: ForwardersApi.create_forwarder ...'
|
|
40
40
|
end
|
|
41
|
-
# verify the required parameter '
|
|
42
|
-
if @api_client.config.client_side_validation &&
|
|
43
|
-
fail ArgumentError, "Missing the required parameter '
|
|
41
|
+
# verify the required parameter 'forwarder_create_request' is set
|
|
42
|
+
if @api_client.config.client_side_validation && forwarder_create_request.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'forwarder_create_request' when calling ForwardersApi.create_forwarder"
|
|
44
44
|
end
|
|
45
45
|
# resource path
|
|
46
46
|
local_var_path = '/api/v1/forwarders'
|
|
@@ -62,7 +62,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
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(
|
|
65
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(forwarder_create_request)
|
|
66
66
|
|
|
67
67
|
# return_type
|
|
68
68
|
return_type = opts[:debug_return_type] || 'ForwarderResponse'
|
|
@@ -88,7 +88,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
88
88
|
end
|
|
89
89
|
|
|
90
90
|
# Delete Forwarder
|
|
91
|
-
# Delete a forwarder. Past delivery log entries are retained. A new forwarder may be created later under the same
|
|
91
|
+
# Delete a forwarder. Past delivery log entries are retained. A new forwarder may be created later under the same id.
|
|
92
92
|
# @param forwarder_id [String]
|
|
93
93
|
# @param [Hash] opts the optional parameters
|
|
94
94
|
# @return [nil]
|
|
@@ -98,7 +98,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
98
98
|
end
|
|
99
99
|
|
|
100
100
|
# Delete Forwarder
|
|
101
|
-
# Delete a forwarder. Past delivery log entries are retained. A new forwarder may be created later under the same
|
|
101
|
+
# Delete a forwarder. Past delivery log entries are retained. A new forwarder may be created later under the same id.
|
|
102
102
|
# @param forwarder_id [String]
|
|
103
103
|
# @param [Hash] opts the optional parameters
|
|
104
104
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#smplkit Audit API
|
|
3
|
+
|
|
4
|
+
#Append-only change-history substrate for smpl.* resources and customer-application events. ADR-047.
|
|
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::Audit
|
|
17
|
+
# JSON:API request envelope for creating a forwarder. Distinct from :class:`ForwarderRequest` because create requires caller-supplied ``data.id`` while update does not.
|
|
18
|
+
class ForwarderCreateRequest < 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' => :'ForwarderCreateResource'
|
|
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::Audit::ForwarderCreateRequest` 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::Audit::ForwarderCreateRequest`. 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
|
data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_create_resource.rb
ADDED
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#smplkit Audit API
|
|
3
|
+
|
|
4
|
+
#Append-only change-history substrate for smpl.* resources and customer-application events. ADR-047.
|
|
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::Audit
|
|
17
|
+
# JSON:API resource envelope for creating a forwarder (id required).
|
|
18
|
+
class ForwarderCreateResource < 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' => :'Forwarder'
|
|
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::Audit::ForwarderCreateResource` 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::Audit::ForwarderCreateResource`. 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 = 'forwarder'
|
|
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 @attributes.nil?
|
|
127
|
+
invalid_properties.push('invalid value for "attributes", attributes cannot be nil.')
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
invalid_properties
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# Check to see if the all the properties in the model are valid
|
|
134
|
+
# @return true if the model is valid
|
|
135
|
+
def valid?
|
|
136
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
137
|
+
return false if @id.nil?
|
|
138
|
+
type_validator = EnumAttributeValidator.new('String', ["forwarder"])
|
|
139
|
+
return false unless type_validator.valid?(@type)
|
|
140
|
+
return false if @attributes.nil?
|
|
141
|
+
true
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Custom attribute writer method with validation
|
|
145
|
+
# @param [Object] id Value to be assigned
|
|
146
|
+
def id=(id)
|
|
147
|
+
if id.nil?
|
|
148
|
+
fail ArgumentError, 'id cannot be nil'
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
@id = id
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
155
|
+
# @param [Object] type Object to be assigned
|
|
156
|
+
def type=(type)
|
|
157
|
+
validator = EnumAttributeValidator.new('String', ["forwarder"])
|
|
158
|
+
unless validator.valid?(type)
|
|
159
|
+
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
|
160
|
+
end
|
|
161
|
+
@type = type
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Custom attribute writer method with validation
|
|
165
|
+
# @param [Object] attributes Value to be assigned
|
|
166
|
+
def attributes=(attributes)
|
|
167
|
+
if attributes.nil?
|
|
168
|
+
fail ArgumentError, 'attributes cannot be nil'
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
@attributes = attributes
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
# Checks equality by comparing each attribute.
|
|
175
|
+
# @param [Object] Object to be compared
|
|
176
|
+
def ==(o)
|
|
177
|
+
return true if self.equal?(o)
|
|
178
|
+
self.class == o.class &&
|
|
179
|
+
id == o.id &&
|
|
180
|
+
type == o.type &&
|
|
181
|
+
attributes == o.attributes
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# @see the `==` method
|
|
185
|
+
# @param [Object] Object to be compared
|
|
186
|
+
def eql?(o)
|
|
187
|
+
self == o
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# Calculates hash code according to all attributes.
|
|
191
|
+
# @return [Integer] Hash code
|
|
192
|
+
def hash
|
|
193
|
+
[id, type, attributes].hash
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
# Builds the object from hash
|
|
197
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
198
|
+
# @return [Object] Returns the model itself
|
|
199
|
+
def self.build_from_hash(attributes)
|
|
200
|
+
return nil unless attributes.is_a?(Hash)
|
|
201
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
202
|
+
transformed_hash = {}
|
|
203
|
+
openapi_types.each_pair do |key, type|
|
|
204
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
205
|
+
transformed_hash["#{key}"] = nil
|
|
206
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
207
|
+
# check to ensure the input is an array given that the attribute
|
|
208
|
+
# is documented as an array but the input is not
|
|
209
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
210
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
211
|
+
end
|
|
212
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
213
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
214
|
+
end
|
|
215
|
+
end
|
|
216
|
+
new(transformed_hash)
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
# Returns the object in the form of hash
|
|
220
|
+
# @return [Hash] Returns the object in the form of hash
|
|
221
|
+
def to_hash
|
|
222
|
+
hash = {}
|
|
223
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
224
|
+
value = self.send(attr)
|
|
225
|
+
if value.nil?
|
|
226
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
227
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
hash[param] = _to_hash(value)
|
|
231
|
+
end
|
|
232
|
+
hash
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
end
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module SmplkitGeneratedClient::Audit
|
|
17
|
-
# JSON:API request envelope for
|
|
17
|
+
# JSON:API request envelope for updating a forwarder.
|
|
18
18
|
class ForwarderRequest < ApiModelBase
|
|
19
19
|
attr_accessor :data
|
|
20
20
|
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module SmplkitGeneratedClient::Audit
|
|
17
|
-
# JSON:API resource envelope for a forwarder. `id`
|
|
17
|
+
# JSON:API resource envelope for a forwarder. The caller supplies `id` (the forwarder's key) on create.
|
|
18
18
|
class ForwarderResource < ApiModelBase
|
|
19
19
|
attr_accessor :id
|
|
20
20
|
|
|
@@ -34,6 +34,8 @@ require 'smplkit_audit_client/models/event_type_attributes'
|
|
|
34
34
|
require 'smplkit_audit_client/models/event_type_list_response'
|
|
35
35
|
require 'smplkit_audit_client/models/event_type_resource'
|
|
36
36
|
require 'smplkit_audit_client/models/forwarder'
|
|
37
|
+
require 'smplkit_audit_client/models/forwarder_create_request'
|
|
38
|
+
require 'smplkit_audit_client/models/forwarder_create_resource'
|
|
37
39
|
require 'smplkit_audit_client/models/forwarder_delivery'
|
|
38
40
|
require 'smplkit_audit_client/models/forwarder_delivery_list_links'
|
|
39
41
|
require 'smplkit_audit_client/models/forwarder_delivery_list_meta'
|
|
@@ -34,8 +34,8 @@ describe 'ForwardersApi' do
|
|
|
34
34
|
|
|
35
35
|
# unit tests for create_forwarder
|
|
36
36
|
# Create Forwarder
|
|
37
|
-
# Create a forwarder for this account.
|
|
38
|
-
# @param
|
|
37
|
+
# Create a forwarder for this account. The caller supplies the forwarder's key as `data.id`. Keys are unique within an account and immutable for the lifetime of the forwarder.
|
|
38
|
+
# @param forwarder_create_request
|
|
39
39
|
# @param [Hash] opts the optional parameters
|
|
40
40
|
# @return [ForwarderResponse]
|
|
41
41
|
describe 'create_forwarder test' do
|
|
@@ -46,7 +46,7 @@ describe 'ForwardersApi' do
|
|
|
46
46
|
|
|
47
47
|
# unit tests for delete_forwarder
|
|
48
48
|
# Delete Forwarder
|
|
49
|
-
# Delete a forwarder. Past delivery log entries are retained. A new forwarder may be created later under the same
|
|
49
|
+
# Delete a forwarder. Past delivery log entries are retained. A new forwarder may be created later under the same id.
|
|
50
50
|
# @param forwarder_id
|
|
51
51
|
# @param [Hash] opts the optional parameters
|
|
52
52
|
# @return [nil]
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#smplkit Audit API
|
|
3
|
+
|
|
4
|
+
#Append-only change-history substrate for smpl.* resources and customer-application events. ADR-047.
|
|
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::Audit::ForwarderCreateRequest
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe SmplkitGeneratedClient::Audit::ForwarderCreateRequest do
|
|
21
|
+
#let(:instance) { SmplkitGeneratedClient::Audit::ForwarderCreateRequest.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of ForwarderCreateRequest' do
|
|
24
|
+
it 'should create an instance of ForwarderCreateRequest' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(SmplkitGeneratedClient::Audit::ForwarderCreateRequest)
|
|
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 Audit API
|
|
3
|
+
|
|
4
|
+
#Append-only change-history substrate for smpl.* resources and customer-application events. ADR-047.
|
|
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::Audit::ForwarderCreateResource
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe SmplkitGeneratedClient::Audit::ForwarderCreateResource do
|
|
21
|
+
#let(:instance) { SmplkitGeneratedClient::Audit::ForwarderCreateResource.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of ForwarderCreateResource' do
|
|
24
|
+
it 'should create an instance of ForwarderCreateResource' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(SmplkitGeneratedClient::Audit::ForwarderCreateResource)
|
|
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', ["forwarder"])
|
|
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.
|
|
4
|
+
version: 3.0.56
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Smpl Solutions LLC
|
|
@@ -462,6 +462,8 @@ files:
|
|
|
462
462
|
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_type_list_response.rb
|
|
463
463
|
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_type_resource.rb
|
|
464
464
|
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder.rb
|
|
465
|
+
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_create_request.rb
|
|
466
|
+
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_create_resource.rb
|
|
465
467
|
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_delivery.rb
|
|
466
468
|
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_delivery_list_links.rb
|
|
467
469
|
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_delivery_list_meta.rb
|
|
@@ -517,6 +519,8 @@ files:
|
|
|
517
519
|
- lib/smplkit/_generated/audit/spec/models/event_type_attributes_spec.rb
|
|
518
520
|
- lib/smplkit/_generated/audit/spec/models/event_type_list_response_spec.rb
|
|
519
521
|
- lib/smplkit/_generated/audit/spec/models/event_type_resource_spec.rb
|
|
522
|
+
- lib/smplkit/_generated/audit/spec/models/forwarder_create_request_spec.rb
|
|
523
|
+
- lib/smplkit/_generated/audit/spec/models/forwarder_create_resource_spec.rb
|
|
520
524
|
- lib/smplkit/_generated/audit/spec/models/forwarder_delivery_list_links_spec.rb
|
|
521
525
|
- lib/smplkit/_generated/audit/spec/models/forwarder_delivery_list_meta_spec.rb
|
|
522
526
|
- lib/smplkit/_generated/audit/spec/models/forwarder_delivery_list_response_spec.rb
|