Project

knievel

0.0
The project is in a healthy, maintained state
Generated client library for the Knievel multi-tenant ad-serving platform.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 3.6, >= 3.6.0

Runtime

>= 1.0.1, < 3.0
>= 0
 Project Readme

knievel

Knievel - the Ruby gem for the knievel

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 0.1.16
  • Package version: 0.1.16
  • Generator version: 7.23.0-SNAPSHOT
  • Build package: org.openapitools.codegen.languages.RubyClientCodegen

Installation

Build a gem

To build the Ruby code into a gem:

gem build knievel.gemspec

Then either install the gem locally:

gem install ./knievel-0.1.16.gem

(for development, run gem install --dev ./knievel-0.1.16.gem to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:

gem 'knievel', '~> 0.1.16'

Install from Git

If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:

gem 'knievel', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'

Include the Ruby code directly

Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

# Load the gem
require 'knievel'

# Setup authorization
Knievel.configure do |config|
  # Configure Bearer authorization: BearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
  # Configure a proc to get access tokens in lieu of the static access_token configuration
  config.access_token_getter = -> { 'YOUR TOKEN GETTER PROC' } 
  # Configure faraday connection
  config.configure_faraday_connection { |connection| 'YOUR CONNECTION CONFIG PROC' }
end

api_instance = Knievel::AdLibraryApi.new
org_id = 'org_id_example' # String | 
create_ad_library_item_request = Knievel::CreateAdLibraryItemRequest.new({name: 'name_example', kind: 'kind_example'}) # CreateAdLibraryItemRequest | 

begin
  result = api_instance.create_ad_library_item(org_id, create_ad_library_item_request)
  p result
rescue Knievel::ApiError => e
  puts "Exception when calling AdLibraryApi->create_ad_library_item: #{e}"
end

Documentation for API Endpoints

All URIs are relative to http://localhost:8080

Class Method HTTP request Description
Knievel::AdLibraryApi create_ad_library_item POST /v1/orgs/{org_id}/ad-library/items
Knievel::AdLibraryApi get_ad_library_item GET /v1/orgs/{org_id}/ad-library/items/{item_id}
Knievel::AdLibraryApi list_ad_library_items GET /v1/orgs/{org_id}/ad-library/items
Knievel::AdLibraryApi update_ad_library_item PATCH /v1/orgs/{org_id}/ad-library/items/{item_id}
Knievel::AdsApi batch_upsert_ads POST /v1/projects/{project_id}/ads:batchUpsert
Knievel::AdsApi create_ad POST /v1/projects/{project_id}/ads
Knievel::AdsApi get_ad GET /v1/projects/{project_id}/ads/{id}
Knievel::AdsApi list_ads GET /v1/projects/{project_id}/ads
Knievel::AdsApi update_ad PATCH /v1/projects/{project_id}/ads/{id}
Knievel::AdvertisersApi batch_upsert_advertisers POST /v1/projects/{project_id}/advertisers:batchUpsert POST /v1/projects/:project_id/advertisers:batchUpsert — bulk by externalId. Single Postgres transaction; per API.md "Write contract" any per-row failure rolls back the whole batch with details[] listing every offending row. On success: 200 with the upserted rows in input order.
Knievel::AdvertisersApi create_advertiser POST /v1/projects/{project_id}/advertisers
Knievel::AdvertisersApi get_advertiser GET /v1/projects/{project_id}/advertisers/{id}
Knievel::AdvertisersApi list_advertisers GET /v1/projects/{project_id}/advertisers
Knievel::AdvertisersApi update_advertiser PATCH /v1/projects/{project_id}/advertisers/{id}
Knievel::AuthApi whoami GET /v1/whoami
Knievel::CampaignsApi batch_upsert_campaigns POST /v1/projects/{project_id}/campaigns:batchUpsert
Knievel::CampaignsApi create_campaign POST /v1/projects/{project_id}/campaigns
Knievel::CampaignsApi get_campaign GET /v1/projects/{project_id}/campaigns/{id}
Knievel::CampaignsApi list_campaigns GET /v1/projects/{project_id}/campaigns
Knievel::CampaignsApi update_campaign PATCH /v1/projects/{project_id}/campaigns/{id}
Knievel::CreativeTemplatesApi create_creative_template POST /v1/projects/{project_id}/creative-templates
Knievel::CreativeTemplatesApi get_creative_template GET /v1/projects/{project_id}/creative-templates/{id}
Knievel::CreativeTemplatesApi list_creative_templates GET /v1/projects/{project_id}/creative-templates
Knievel::CreativeTemplatesApi update_creative_template PATCH /v1/projects/{project_id}/creative-templates/{id} PATCH bumps version whenever the schema field is provided (per API.md § 3.6 — schema changes are versioned but do not retroactively re-validate existing creatives).
Knievel::CreativesApi create_creative POST /v1/projects/{project_id}/creatives
Knievel::CreativesApi get_creative GET /v1/projects/{project_id}/creatives/{id}
Knievel::CreativesApi list_creatives GET /v1/projects/{project_id}/creatives
Knievel::CreativesApi upload_creative_image POST /v1/projects/{project_id}/creatives/{id}/image Multipart image upload (Phase 3.32). Validates the body against the image_upload core (size + magic bytes + MIME allow-list), writes through the configured ImageStore, and updates the creative row's image_url in the same transaction. Min role: editor (matches createCreative).
Knievel::DecisionsApi decisions POST /v1/projects/{project_id}/decisions
Knievel::ExplainApi decisions_explain POST /v1/projects/{project_id}/decisions:explain
Knievel::FlightsApi batch_upsert_flights POST /v1/projects/{project_id}/flights:batchUpsert
Knievel::FlightsApi create_flight POST /v1/projects/{project_id}/flights
Knievel::FlightsApi get_flight GET /v1/projects/{project_id}/flights/{id}
Knievel::FlightsApi list_flights GET /v1/projects/{project_id}/flights
Knievel::FlightsApi update_flight PATCH /v1/projects/{project_id}/flights/{id}
Knievel::OrgsApi create_project POST /v1/orgs/{org_id}/projects Create a project under an org. Honors Idempotency-Key (24 h replay window per API.md "Idempotency"); 409 idempotency_conflict if the same key is reused with a different body. Returns 409 external_id_conflict if the externalId is already taken in this org.
Knievel::OrgsApi get_org GET /v1/orgs/{org_id} Org metadata (Phase 7.5). Powers the admin SPA's org-dashboard breadcrumbs + project-list page header. Multi-org access isn't a real feature yet; the auth check rejects when the principal's org_id doesn't match the path, so this is effectively "fetch my org."
Knievel::OrgsApi get_project GET /v1/orgs/{org_id}/projects/{project_id} Read a single project by id (path).
Knievel::OrgsApi list_projects GET /v1/orgs/{org_id}/projects List projects under an org (Phase 7.5). The cursor envelope is wired so the SPA's pagination plumbing is real, but next_cursor is always null today — the (created_at, id) tuple-cursor that TEXT-id endpoints need is deferred to Phase 6.5 (per CLAUDE.md "Open known gaps"). For now an org's full project set comes back in one page; orgs typically host single-digit project counts, so this is fine.
Knievel::SitesApi batch_upsert_sites POST /v1/projects/{project_id}/sites:batchUpsert
Knievel::SitesApi create_site POST /v1/projects/{project_id}/sites
Knievel::SitesApi get_site GET /v1/projects/{project_id}/sites/{id}
Knievel::SitesApi list_sites GET /v1/projects/{project_id}/sites
Knievel::SitesApi update_site PATCH /v1/projects/{project_id}/sites/{id}
Knievel::SitesApi upsert_site_by_url POST /v1/projects/{project_id}/sites/upsert-by-url Natural-key upsert. Returns the existing row (200) when a site with the same URL exists; otherwise creates (201). Per API.md § 3.7: :upsertByUrl is the canonical entry point for URL-driven flows.
Knievel::SystemApi healthz GET /healthz Liveness — k8s liveness probe key.
Knievel::SystemApi readyz GET /readyz Readiness — only 200 when knievel can serve. Per REQUIREMENTS.md § 10.6, the full check has four criteria; today only the DB-reachability one is real.
Knievel::SystemApi version GET /version Build metadata + effective auth policy.
Knievel::TaxonomyApi get_ad_type GET /v1/projects/{project_id}/ad-types/{id}
Knievel::TaxonomyApi get_channel GET /v1/projects/{project_id}/channels/{id}
Knievel::TaxonomyApi get_priority GET /v1/projects/{project_id}/priorities/{id}
Knievel::TaxonomyApi list_ad_types GET /v1/projects/{project_id}/ad-types
Knievel::TaxonomyApi list_channels GET /v1/projects/{project_id}/channels
Knievel::TaxonomyApi list_priorities GET /v1/projects/{project_id}/priorities
Knievel::TokensApi create_token POST /v1/orgs/{org_id}/tokens Mint an opaque token. Returns the plaintext secret exactly once. Min role: org-admin.
Knievel::TokensApi list_tokens GET /v1/orgs/{org_id}/tokens List tokens (metadata only; secrets never leave the mint response). Min role: org-admin.
Knievel::TokensApi revoke_token DELETE /v1/orgs/{org_id}/tokens/{token_id} Revoke a token (soft delete via revoked_at). The auth path filters revoked rows at the next request. Min role: org-admin.
Knievel::ZonesApi batch_upsert_zones POST /v1/projects/{project_id}/zones:batchUpsert
Knievel::ZonesApi create_zone POST /v1/projects/{project_id}/zones
Knievel::ZonesApi get_zone GET /v1/projects/{project_id}/zones/{id}
Knievel::ZonesApi list_zones GET /v1/projects/{project_id}/zones
Knievel::ZonesApi update_zone PATCH /v1/projects/{project_id}/zones/{id}

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

BearerAuth

  • Type: Bearer authentication