Class: SparteraApiSdk::EndpointsUpdate
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- SparteraApiSdk::EndpointsUpdate
- Defined in:
- lib/spartera_api_sdk/models/endpoints_update.rb
Overview
Update schema for modifying Endpoint
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#access_method ⇒ Object
Access control method (OPEN, API_KEY, IP, EMAIL, DOMAIN).
-
#access_whitelist ⇒ Object
List of allowed IPs, emails, or domains based on access_method.
-
#active ⇒ Object
Required.
-
#approval_status ⇒ Object
Approval status before marketplace publication.
-
#approved_at ⇒ Object
Timestamp of marketplace approval.
-
#approved_by_user_id ⇒ Object
User who approved this endpoint for marketplace.
-
#auc_id ⇒ Object
Primary use case for marketplace discovery.
-
#company_id ⇒ Object
References companies.company_id — A Spartera seller or buyer company account.
-
#connection_id ⇒ Object
Connection to the data source.
-
#customer_name ⇒ Object
Named customer for B2B deals (marketplace uses price_credits instead).
-
#date_created ⇒ Object
Required.
-
#description ⇒ Object
Description of what this endpoint provides.
-
#endpoint_schema ⇒ Object
Column configurations including aggregations, filters, and visibility.
-
#industry_id ⇒ Object
Industry / category for marketplace discovery.
-
#last_accessed ⇒ Object
When this endpoint was last called.
-
#last_updated ⇒ Object
Required.
-
#max_records_per_request ⇒ Object
Seller-enforced row cap per request.
-
#name ⇒ Object
Human-readable name for the endpoint.
-
#price_credits ⇒ Object
Credits deducted from the buyer’s pool per successful (200 OK) request.
-
#price_usd ⇒ Object
USD reference price for billing records and seller dashboards.
-
#rate_limit_granularity ⇒ Object
How to group rate limits (IP, USER, COMPANY, API_KEY, GLOBAL).
-
#rate_limit_period ⇒ Object
Time period for rate limiting (HOUR, DAY, MONTH).
-
#rate_limit_requests ⇒ Object
Number of requests allowed per rate_limit_period.
-
#sample_response ⇒ Object
Last successful request, response envelope.
-
#sell_in_marketplace ⇒ Object
Whether this endpoint appears in the public marketplace.
-
#slug ⇒ Object
Human-readable, URL-safe slug derived from name at creation time.
-
#source_schema_name ⇒ Object
Schema/database name where the table resides.
-
#source_table_name ⇒ Object
Table name to query from.
-
#status ⇒ Object
Current status of the endpoint (ACTIVE, INACTIVE, DEPRECATED).
-
#tags ⇒ Object
Comma-separated tags for organizing endpoints.
-
#user_id ⇒ Object
User who created this endpoint.
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 = {}) ⇒ EndpointsUpdate
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 = {}) ⇒ EndpointsUpdate
Initializes the object
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 226 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `SparteraApiSdk::EndpointsUpdate` 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 `SparteraApiSdk::EndpointsUpdate`. 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?(:'date_created') self.date_created = attributes[:'date_created'] end if attributes.key?(:'last_updated') self.last_updated = attributes[:'last_updated'] end if attributes.key?(:'user_id') self.user_id = attributes[:'user_id'] end if attributes.key?(:'company_id') self.company_id = attributes[:'company_id'] end if attributes.key?(:'connection_id') self.connection_id = attributes[:'connection_id'] end if attributes.key?(:'industry_id') self.industry_id = attributes[:'industry_id'] end if attributes.key?(:'auc_id') self.auc_id = attributes[:'auc_id'] end if attributes.key?(:'approval_status') self.approval_status = attributes[:'approval_status'] end if attributes.key?(:'approved_by_user_id') self.approved_by_user_id = attributes[:'approved_by_user_id'] end if attributes.key?(:'approved_at') self.approved_at = attributes[:'approved_at'] end if attributes.key?(:'sell_in_marketplace') self.sell_in_marketplace = attributes[:'sell_in_marketplace'] end if attributes.key?(:'price_credits') self.price_credits = attributes[:'price_credits'] end if attributes.key?(:'name') self.name = attributes[:'name'] end if attributes.key?(:'slug') self.slug = attributes[:'slug'] end if attributes.key?(:'description') self.description = attributes[:'description'] end if attributes.key?(:'source_schema_name') self.source_schema_name = attributes[:'source_schema_name'] end if attributes.key?(:'source_table_name') self.source_table_name = attributes[:'source_table_name'] end if attributes.key?(:'customer_name') self.customer_name = attributes[:'customer_name'] end if attributes.key?(:'price_usd') self.price_usd = attributes[:'price_usd'] end if attributes.key?(:'endpoint_schema') self.endpoint_schema = attributes[:'endpoint_schema'] end if attributes.key?(:'rate_limit_requests') self.rate_limit_requests = attributes[:'rate_limit_requests'] end if attributes.key?(:'rate_limit_period') self.rate_limit_period = attributes[:'rate_limit_period'] end if attributes.key?(:'rate_limit_granularity') self.rate_limit_granularity = attributes[:'rate_limit_granularity'] end if attributes.key?(:'access_method') self.access_method = attributes[:'access_method'] end if attributes.key?(:'access_whitelist') self.access_whitelist = attributes[:'access_whitelist'] end if attributes.key?(:'status') self.status = attributes[:'status'] end if attributes.key?(:'tags') self. = attributes[:'tags'] end if attributes.key?(:'last_accessed') self.last_accessed = attributes[:'last_accessed'] end if attributes.key?(:'max_records_per_request') self.max_records_per_request = attributes[:'max_records_per_request'] end if attributes.key?(:'sample_response') self.sample_response = attributes[:'sample_response'] end if attributes.key?(:'active') self.active = attributes[:'active'] end end |
Instance Attribute Details
#access_method ⇒ Object
Access control method (OPEN, API_KEY, IP, EMAIL, DOMAIN)
89 90 91 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 89 def access_method @access_method end |
#access_whitelist ⇒ Object
List of allowed IPs, emails, or domains based on access_method. Format: ‘ip’|‘email’|‘domain’, values: [‘192.168.1.1’, …]
92 93 94 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 92 def access_whitelist @access_whitelist end |
#active ⇒ Object
Required.
110 111 112 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 110 def active @active end |
#approval_status ⇒ Object
Approval status before marketplace publication
41 42 43 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 41 def approval_status @approval_status end |
#approved_at ⇒ Object
Timestamp of marketplace approval
47 48 49 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 47 def approved_at @approved_at end |
#approved_by_user_id ⇒ Object
User who approved this endpoint for marketplace
44 45 46 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 44 def approved_by_user_id @approved_by_user_id end |
#auc_id ⇒ Object
Primary use case for marketplace discovery
38 39 40 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 38 def auc_id @auc_id end |
#company_id ⇒ Object
References companies.company_id — A Spartera seller or buyer company account. See GET /companies for valid values. Required.
29 30 31 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 29 def company_id @company_id end |
#connection_id ⇒ Object
Connection to the data source
32 33 34 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 32 def connection_id @connection_id end |
#customer_name ⇒ Object
Named customer for B2B deals (marketplace uses price_credits instead)
71 72 73 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 71 def customer_name @customer_name end |
#date_created ⇒ Object
Required.
20 21 22 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 20 def date_created @date_created end |
#description ⇒ Object
Description of what this endpoint provides
62 63 64 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 62 def description @description end |
#endpoint_schema ⇒ Object
Column configurations including aggregations, filters, and visibility. Format: [{name, type, aggregation, filter, is_hidden, alias, …]}. This is the source of truth — SQL is generated at runtime from this configuration.
77 78 79 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 77 def endpoint_schema @endpoint_schema end |
#industry_id ⇒ Object
Industry / category for marketplace discovery
35 36 37 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 35 def industry_id @industry_id end |
#last_accessed ⇒ Object
When this endpoint was last called
101 102 103 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 101 def last_accessed @last_accessed end |
#last_updated ⇒ Object
Required.
23 24 25 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 23 def last_updated @last_updated end |
#max_records_per_request ⇒ Object
Seller-enforced row cap per request. Buyers cannot exceed this. Default 1000.
104 105 106 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 104 def max_records_per_request @max_records_per_request end |
#name ⇒ Object
Human-readable name for the endpoint
56 57 58 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 56 def name @name end |
#price_credits ⇒ Object
Credits deducted from the buyer’s pool per successful (200 OK) request. Same credit pool as assets. price_usd kept for billing records / dashboards.
53 54 55 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 53 def price_credits @price_credits end |
#price_usd ⇒ Object
USD reference price for billing records and seller dashboards
74 75 76 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 74 def price_usd @price_usd end |
#rate_limit_granularity ⇒ Object
How to group rate limits (IP, USER, COMPANY, API_KEY, GLOBAL)
86 87 88 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 86 def rate_limit_granularity @rate_limit_granularity end |
#rate_limit_period ⇒ Object
Time period for rate limiting (HOUR, DAY, MONTH)
83 84 85 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 83 def rate_limit_period @rate_limit_period end |
#rate_limit_requests ⇒ Object
Number of requests allowed per rate_limit_period
80 81 82 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 80 def rate_limit_requests @rate_limit_requests end |
#sample_response ⇒ Object
Last successful request, response envelope. Saved on each successful marketplace run. Displayed as preview on product page load.
107 108 109 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 107 def sample_response @sample_response end |
#sell_in_marketplace ⇒ Object
Whether this endpoint appears in the public marketplace
50 51 52 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 50 def sell_in_marketplace @sell_in_marketplace end |
#slug ⇒ Object
Human-readable, URL-safe slug derived from name at creation time. e.g. ‘NFL Live Moneyline & Spread Odds’ → ‘nfl-live-moneyline-spread-odds’. Never changes after creation. Unique within company (DB constraint). Creation fails with 409 if a duplicate name exists in the same company.
59 60 61 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 59 def slug @slug end |
#source_schema_name ⇒ Object
Schema/database name where the table resides
65 66 67 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 65 def source_schema_name @source_schema_name end |
#source_table_name ⇒ Object
Table name to query from
68 69 70 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 68 def source_table_name @source_table_name end |
#status ⇒ Object
Current status of the endpoint (ACTIVE, INACTIVE, DEPRECATED)
95 96 97 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 95 def status @status end |
#tags ⇒ Object
Comma-separated tags for organizing endpoints
98 99 100 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 98 def @tags end |
#user_id ⇒ Object
User who created this endpoint
26 27 28 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 26 def user_id @user_id end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
172 173 174 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 172 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
177 178 179 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 177 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
135 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 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 135 def self.attribute_map { :'date_created' => :'date_created', :'last_updated' => :'last_updated', :'user_id' => :'user_id', :'company_id' => :'company_id', :'connection_id' => :'connection_id', :'industry_id' => :'industry_id', :'auc_id' => :'auc_id', :'approval_status' => :'approval_status', :'approved_by_user_id' => :'approved_by_user_id', :'approved_at' => :'approved_at', :'sell_in_marketplace' => :'sell_in_marketplace', :'price_credits' => :'price_credits', :'name' => :'name', :'slug' => :'slug', :'description' => :'description', :'source_schema_name' => :'source_schema_name', :'source_table_name' => :'source_table_name', :'customer_name' => :'customer_name', :'price_usd' => :'price_usd', :'endpoint_schema' => :'endpoint_schema', :'rate_limit_requests' => :'rate_limit_requests', :'rate_limit_period' => :'rate_limit_period', :'rate_limit_granularity' => :'rate_limit_granularity', :'access_method' => :'access_method', :'access_whitelist' => :'access_whitelist', :'status' => :'status', :'tags' => :'tags', :'last_accessed' => :'last_accessed', :'max_records_per_request' => :'max_records_per_request', :'sample_response' => :'sample_response', :'active' => :'active' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 493 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
219 220 221 222 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 219 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 182 def self.openapi_types { :'date_created' => :'Time', :'last_updated' => :'Time', :'user_id' => :'String', :'company_id' => :'String', :'connection_id' => :'String', :'industry_id' => :'Integer', :'auc_id' => :'Integer', :'approval_status' => :'String', :'approved_by_user_id' => :'String', :'approved_at' => :'Time', :'sell_in_marketplace' => :'Boolean', :'price_credits' => :'Integer', :'name' => :'String', :'slug' => :'String', :'description' => :'String', :'source_schema_name' => :'String', :'source_table_name' => :'String', :'customer_name' => :'String', :'price_usd' => :'Float', :'endpoint_schema' => :'Object', :'rate_limit_requests' => :'Integer', :'rate_limit_period' => :'String', :'rate_limit_granularity' => :'String', :'access_method' => :'String', :'access_whitelist' => :'Object', :'status' => :'String', :'tags' => :'String', :'last_accessed' => :'Time', :'max_records_per_request' => :'Integer', :'sample_response' => :'Object', :'active' => :'Boolean' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 442 def ==(o) return true if self.equal?(o) self.class == o.class && date_created == o.date_created && last_updated == o.last_updated && user_id == o.user_id && company_id == o.company_id && connection_id == o.connection_id && industry_id == o.industry_id && auc_id == o.auc_id && approval_status == o.approval_status && approved_by_user_id == o.approved_by_user_id && approved_at == o.approved_at && sell_in_marketplace == o.sell_in_marketplace && price_credits == o.price_credits && name == o.name && slug == o.slug && description == o.description && source_schema_name == o.source_schema_name && source_table_name == o.source_table_name && customer_name == o.customer_name && price_usd == o.price_usd && endpoint_schema == o.endpoint_schema && rate_limit_requests == o.rate_limit_requests && rate_limit_period == o.rate_limit_period && rate_limit_granularity == o.rate_limit_granularity && access_method == o.access_method && access_whitelist == o.access_whitelist && status == o.status && == o. && last_accessed == o.last_accessed && max_records_per_request == o.max_records_per_request && sample_response == o.sample_response && active == o.active end |
#eql?(o) ⇒ Boolean
480 481 482 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 480 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
486 487 488 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 486 def hash [date_created, last_updated, user_id, company_id, connection_id, industry_id, auc_id, approval_status, approved_by_user_id, approved_at, sell_in_marketplace, price_credits, name, slug, description, source_schema_name, source_table_name, customer_name, price_usd, endpoint_schema, rate_limit_requests, rate_limit_period, rate_limit_granularity, access_method, access_whitelist, status, , last_accessed, max_records_per_request, sample_response, active].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
367 368 369 370 371 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 367 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
515 516 517 518 519 520 521 522 523 524 525 526 527 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 515 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
375 376 377 378 379 380 381 382 383 384 385 386 387 388 |
# File 'lib/spartera_api_sdk/models/endpoints_update.rb', line 375 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' approval_status_validator = EnumAttributeValidator.new('String', ["PENDING", "APPROVED", "REJECTED", "NEEDS_REVISION"]) return false unless approval_status_validator.valid?(@approval_status) rate_limit_period_validator = EnumAttributeValidator.new('String', ["SECOND", "MINUTE", "HOUR", "DAY"]) return false unless rate_limit_period_validator.valid?(@rate_limit_period) rate_limit_granularity_validator = EnumAttributeValidator.new('String', ["USER", "COMPANY", "IP", "GLOBAL"]) return false unless rate_limit_granularity_validator.valid?(@rate_limit_granularity) access_method_validator = EnumAttributeValidator.new('String', ["OPEN", "API_KEY", "IP", "EMAIL", "DOMAIN"]) return false unless access_method_validator.valid?(@access_method) status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "INACTIVE", "DEPRECATED"]) return false unless status_validator.valid?(@status) true end |