Class: SmplkitGeneratedClient::Audit::Export
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- SmplkitGeneratedClient::Audit::Export
- 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
-
#environment ⇒ Object
The single environment the export is scoped to.
-
#expires_at ⇒ Object
When the signed URL stops being valid (ISO-8601 UTC).
-
#filter_actor_id ⇒ Object
Exact match on the event’s ‘actor_id` field.
-
#filter_actor_type ⇒ Object
Exact match on the event’s ‘actor_type` field.
-
#filter_do_not_forward ⇒ Object
When set, restrict to events whose ‘do_not_forward` flag matches the given boolean.
-
#filter_event_type ⇒ Object
Exact match on the event’s ‘event_type` field.
-
#filter_occurred_at ⇒ Object
Date range using interval notation, e.g.
-
#filter_resource_id ⇒ Object
Exact match on the event’s ‘resource_id` field.
-
#filter_resource_type ⇒ Object
Exact match on the event’s ‘resource_type` field.
-
#filter_search ⇒ Object
Case-insensitive substring match against ‘resource_id` or `description`.
-
#format ⇒ Object
Output format for the download.
-
#url ⇒ Object
Absolute, signed download URL.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ Export
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ Export
Initializes the object
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 196 197 198 199 200 201 202 203 204 205 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 142 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?(:'environment') self.environment = attributes[:'environment'] 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
#environment ⇒ Object
The single environment the export is scoped to. Omit it and a single-environment credential implies it (a multi-environment credential must name it), and a named environment must be one the caller may access. An export always covers exactly one environment.
23 24 25 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 23 def environment @environment end |
#expires_at ⇒ Object
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.
53 54 55 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 53 def expires_at @expires_at end |
#filter_actor_id ⇒ Object
Exact match on the event’s ‘actor_id` field.
32 33 34 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 32 def filter_actor_id @filter_actor_id end |
#filter_actor_type ⇒ Object
Exact match on the event’s ‘actor_type` field.
29 30 31 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 29 def filter_actor_type @filter_actor_type end |
#filter_do_not_forward ⇒ Object
When set, restrict to events whose ‘do_not_forward` flag matches the given boolean.
47 48 49 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 47 def filter_do_not_forward @filter_do_not_forward end |
#filter_event_type ⇒ Object
Exact match on the event’s ‘event_type` field.
35 36 37 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 35 def filter_event_type @filter_event_type end |
#filter_occurred_at ⇒ Object
Date range using interval notation, e.g. ‘[2026-04-01T00:00:00Z,2026-04-15T00:00:00Z)`.
26 27 28 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 26 def filter_occurred_at @filter_occurred_at end |
#filter_resource_id ⇒ Object
Exact match on the event’s ‘resource_id` field. Must be accompanied by `filter`.
41 42 43 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 41 def filter_resource_id @filter_resource_id end |
#filter_resource_type ⇒ Object
Exact match on the event’s ‘resource_type` field.
38 39 40 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 38 def filter_resource_type @filter_resource_type end |
#filter_search ⇒ Object
44 45 46 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 44 def filter_search @filter_search end |
#format ⇒ Object
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 |
#url ⇒ Object
Absolute, signed download URL. Open in a browser to stream the export to disk. Expires shortly after mint — see ‘expires_at`.
50 51 52 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 50 def url @url end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
96 97 98 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 96 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
101 102 103 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 101 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 78 def self.attribute_map { :'format' => :'format', :'environment' => :'environment', :'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
273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 273 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_nullable ⇒ Object
List of attributes with nullable: true
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 124 def self.openapi_nullable Set.new([ :'environment', :'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_types ⇒ Object
Attribute type mapping.
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 106 def self.openapi_types { :'format' => :'String', :'environment' => :'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.
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 241 def ==(o) return true if self.equal?(o) self.class == o.class && format == o.format && environment == o.environment && 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
260 261 262 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 260 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
266 267 268 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 266 def hash [format, environment, 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_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
209 210 211 212 213 214 215 216 217 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 209 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_hash ⇒ Hash
Returns the object in the form of hash
295 296 297 298 299 300 301 302 303 304 305 306 307 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 295 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
221 222 223 224 225 226 227 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/export.rb', line 221 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 |