Class: SmplkitGeneratedClient::Audit::Export

Inherits:
ApiModelBase show all
Defined in:
lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb

Overview

A request for a short-lived signed download URL. The customer chooses a ‘format` and supplies the same filter set the events list endpoint accepts. The server mints an HMAC-signed URL (valid for 30 seconds) that the browser navigates to for a native streaming download — no `Authorization` header required at download time. The download honors the **same filter-combination rules** as `GET /api/v1/events`: - `filter` must be accompanied by `filter`. - `filter` must be accompanied by either `filter` or `filter` + `filter`. A request that violates these rules is rejected at mint time with `400 Bad Request`.

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ Export

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 136

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::Audit::Export` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  acceptable_attribute_map = self.class.acceptable_attribute_map
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::Audit::Export`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'format')
    self.format = attributes[:'format']
  else
    self.format = nil
  end

  if attributes.key?(:'filter_occurred_at')
    self.filter_occurred_at = attributes[:'filter_occurred_at']
  end

  if attributes.key?(:'filter_actor_type')
    self.filter_actor_type = attributes[:'filter_actor_type']
  end

  if attributes.key?(:'filter_actor_id')
    self.filter_actor_id = attributes[:'filter_actor_id']
  end

  if attributes.key?(:'filter_event_type')
    self.filter_event_type = attributes[:'filter_event_type']
  end

  if attributes.key?(:'filter_resource_type')
    self.filter_resource_type = attributes[:'filter_resource_type']
  end

  if attributes.key?(:'filter_resource_id')
    self.filter_resource_id = attributes[:'filter_resource_id']
  end

  if attributes.key?(:'filter_search')
    self.filter_search = attributes[:'filter_search']
  end

  if attributes.key?(:'filter_do_not_forward')
    self.filter_do_not_forward = attributes[:'filter_do_not_forward']
  end

  if attributes.key?(:'url')
    self.url = attributes[:'url']
  end

  if attributes.key?(:'expires_at')
    self.expires_at = attributes[:'expires_at']
  end
end

Instance Attribute Details

#expires_atObject

When the signed URL stops being valid (ISO-8601 UTC). Open the URL well before this time — the signed token is stateless, so a single mint cannot be ‘refreshed’; mint a new export if the URL has expired.



50
51
52
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 50

def expires_at
  @expires_at
end

#filter_actor_idObject

Exact match on the event’s ‘actor_id` field.



29
30
31
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 29

def filter_actor_id
  @filter_actor_id
end

#filter_actor_typeObject

Exact match on the event’s ‘actor_type` field.



26
27
28
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 26

def filter_actor_type
  @filter_actor_type
end

#filter_do_not_forwardObject

When set, restrict to events whose ‘do_not_forward` flag matches the given boolean.



44
45
46
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 44

def filter_do_not_forward
  @filter_do_not_forward
end

#filter_event_typeObject

Exact match on the event’s ‘event_type` field.



32
33
34
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 32

def filter_event_type
  @filter_event_type
end

#filter_occurred_atObject

Date range using interval notation, e.g. ‘[2026-04-01T00:00:00Z,2026-04-15T00:00:00Z)`.



23
24
25
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 23

def filter_occurred_at
  @filter_occurred_at
end

#filter_resource_idObject

Exact match on the event’s ‘resource_id` field. Must be accompanied by `filter`.



38
39
40
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 38

def filter_resource_id
  @filter_resource_id
end

#filter_resource_typeObject

Exact match on the event’s ‘resource_type` field.



35
36
37
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 35

def filter_resource_type
  @filter_resource_type
end

#filter_searchObject

Case-insensitive substring match against ‘resource_id` or `description`. Must be accompanied by either `filter` or `filter` + `filter`.



41
42
43
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 41

def filter_search
  @filter_search
end

#formatObject

Output format for the download. ‘CSV` writes one row per event with the event payload (`data`) serialized as a JSON-encoded cell. `JSONL` writes one JSON object per line with `data` preserved as a nested object.



20
21
22
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 20

def format
  @format
end

#urlObject

Absolute, signed download URL. Open in a browser to stream the export to disk. Expires shortly after mint — see ‘expires_at`.



47
48
49
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 47

def url
  @url
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



92
93
94
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 92

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



97
98
99
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 97

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 75

def self.attribute_map
  {
    :'format' => :'format',
    :'filter_occurred_at' => :'filter[occurred_at]',
    :'filter_actor_type' => :'filter[actor_type]',
    :'filter_actor_id' => :'filter[actor_id]',
    :'filter_event_type' => :'filter[event_type]',
    :'filter_resource_type' => :'filter[resource_type]',
    :'filter_resource_id' => :'filter[resource_id]',
    :'filter_search' => :'filter[search]',
    :'filter_do_not_forward' => :'filter[do_not_forward]',
    :'url' => :'url',
    :'expires_at' => :'expires_at'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 262

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



119
120
121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 119

def self.openapi_nullable
  Set.new([
    :'filter_occurred_at',
    :'filter_actor_type',
    :'filter_actor_id',
    :'filter_event_type',
    :'filter_resource_type',
    :'filter_resource_id',
    :'filter_search',
    :'filter_do_not_forward',
    :'url',
    :'expires_at'
  ])
end

.openapi_typesObject

Attribute type mapping.



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 102

def self.openapi_types
  {
    :'format' => :'String',
    :'filter_occurred_at' => :'String',
    :'filter_actor_type' => :'String',
    :'filter_actor_id' => :'String',
    :'filter_event_type' => :'String',
    :'filter_resource_type' => :'String',
    :'filter_resource_id' => :'String',
    :'filter_search' => :'String',
    :'filter_do_not_forward' => :'Boolean',
    :'url' => :'String',
    :'expires_at' => :'Time'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 231

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      format == o.format &&
      filter_occurred_at == o.filter_occurred_at &&
      filter_actor_type == o.filter_actor_type &&
      filter_actor_id == o.filter_actor_id &&
      filter_event_type == o.filter_event_type &&
      filter_resource_type == o.filter_resource_type &&
      filter_resource_id == o.filter_resource_id &&
      filter_search == o.filter_search &&
      filter_do_not_forward == o.filter_do_not_forward &&
      url == o.url &&
      expires_at == o.expires_at
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


249
250
251
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 249

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



255
256
257
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 255

def hash
  [format, filter_occurred_at, filter_actor_type, filter_actor_id, filter_event_type, filter_resource_type, filter_resource_id, filter_search, filter_do_not_forward, url, expires_at].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



199
200
201
202
203
204
205
206
207
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 199

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  if @format.nil?
    invalid_properties.push('invalid value for "format", format cannot be nil.')
  end

  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



284
285
286
287
288
289
290
291
292
293
294
295
296
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 284

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



211
212
213
214
215
216
217
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 211

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @format.nil?
  format_validator = EnumAttributeValidator.new('String', ["CSV", "JSONL"])
  return false unless format_validator.valid?(@format)
  true
end