late-sdk 0.0.781 → 0.0.783
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/README.md +10 -0
- data/docs/ConnectApi.md +80 -0
- data/docs/GetYoutubeCaptions200Response.md +38 -0
- data/docs/GetYoutubeCaptions200ResponseAvailableTracksInner.md +24 -0
- data/docs/GetYoutubeCaptions200ResponseCuesInner.md +22 -0
- data/docs/UsageApi.md +8 -2
- data/docs/UsageAttributionGroup.md +22 -0
- data/docs/UsageAttributionSlice.md +20 -0
- data/docs/UsageAttributionSliceByProduct.md +34 -0
- data/docs/UsageMetering.md +5 -1
- data/docs/UsageMeteringAttribution.md +26 -0
- data/docs/UsageMeteringScope.md +49 -0
- data/docs/UsageMeteringScopeOneOf.md +18 -0
- data/lib/zernio-sdk/api/connect_api.rb +83 -0
- data/lib/zernio-sdk/api/usage_api.rb +15 -2
- data/lib/zernio-sdk/models/get_youtube_captions200_response.rb +296 -0
- data/lib/zernio-sdk/models/get_youtube_captions200_response_available_tracks_inner.rb +209 -0
- data/lib/zernio-sdk/models/get_youtube_captions200_response_cues_inner.rb +166 -0
- data/lib/zernio-sdk/models/usage_attribution_group.rb +190 -0
- data/lib/zernio-sdk/models/usage_attribution_slice.rb +156 -0
- data/lib/zernio-sdk/models/usage_attribution_slice_by_product.rb +220 -0
- data/lib/zernio-sdk/models/usage_metering.rb +22 -4
- data/lib/zernio-sdk/models/usage_metering_attribution.rb +223 -0
- data/lib/zernio-sdk/models/usage_metering_call_usage.rb +1 -1
- data/lib/zernio-sdk/models/usage_metering_peaks.rb +1 -1
- data/lib/zernio-sdk/models/usage_metering_scope.rb +105 -0
- data/lib/zernio-sdk/models/usage_metering_scope_one_of.rb +164 -0
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +9 -0
- data/openapi.yaml +206 -4
- data/spec/api/connect_api_spec.rb +16 -0
- data/spec/api/usage_api_spec.rb +4 -1
- data/spec/models/get_youtube_captions200_response_available_tracks_inner_spec.rb +58 -0
- data/spec/models/get_youtube_captions200_response_cues_inner_spec.rb +48 -0
- data/spec/models/get_youtube_captions200_response_spec.rb +104 -0
- data/spec/models/usage_attribution_group_spec.rb +48 -0
- data/spec/models/usage_attribution_slice_by_product_spec.rb +84 -0
- data/spec/models/usage_attribution_slice_spec.rb +42 -0
- data/spec/models/usage_metering_attribution_spec.rb +64 -0
- data/spec/models/usage_metering_scope_one_of_spec.rb +36 -0
- data/spec/models/usage_metering_scope_spec.rb +32 -0
- data/spec/models/usage_metering_spec.rb +12 -0
- data/zernio-sdk-0.0.783.gem +0 -0
- metadata +39 -3
- data/zernio-sdk-0.0.781.gem +0 -0
data/openapi.yaml
CHANGED
|
@@ -6960,14 +6960,14 @@ components:
|
|
|
6960
6960
|
totalUsd: { type: number }
|
|
6961
6961
|
quantity: { type: number }
|
|
6962
6962
|
peaks:
|
|
6963
|
-
type: object
|
|
6964
|
-
description: Peak counts over the window (Metronome COUNT metrics + live active-number count).
|
|
6963
|
+
type: [object, "null"]
|
|
6964
|
+
description: 'Peak counts over the window (Metronome COUNT metrics + live active-number count). Null when `profileId` / `accountId` is set.'
|
|
6965
6965
|
properties:
|
|
6966
6966
|
accounts: { type: integer }
|
|
6967
6967
|
numbers: { type: integer }
|
|
6968
6968
|
callUsage:
|
|
6969
|
-
type: object
|
|
6970
|
-
description: Billable call volumes over the window.
|
|
6969
|
+
type: [object, "null"]
|
|
6970
|
+
description: 'Billable call volumes over the window. Null when `profileId` / `accountId` is set.'
|
|
6971
6971
|
properties:
|
|
6972
6972
|
whatsapp:
|
|
6973
6973
|
type: object
|
|
@@ -7001,6 +7001,61 @@ components:
|
|
|
7001
7001
|
ratePercent: { type: [number, "null"], description: "Combined rate percentage, e.g. 21." }
|
|
7002
7002
|
jurisdictionLabel: { type: [string, "null"], description: 'Human jurisdiction label, e.g. "ES VAT" or "WA sales tax".' }
|
|
7003
7003
|
reverseCharge: { type: boolean, description: True for EU/UK B2B reverse charge (0 tax added by design). }
|
|
7004
|
+
attribution:
|
|
7005
|
+
type: object
|
|
7006
|
+
description: 'Present with `groupBy`. The window''s spend split per profile or account; `sum(groups) + unattributed` equals `totals` per product.'
|
|
7007
|
+
properties:
|
|
7008
|
+
groupBy:
|
|
7009
|
+
type: string
|
|
7010
|
+
enum: [profile, account]
|
|
7011
|
+
groups:
|
|
7012
|
+
type: array
|
|
7013
|
+
items:
|
|
7014
|
+
$ref: '#/components/schemas/UsageAttributionGroup'
|
|
7015
|
+
unattributed:
|
|
7016
|
+
$ref: '#/components/schemas/UsageAttributionSlice'
|
|
7017
|
+
description: 'Spend no profile/account can claim: credits, 10DLC fees, Verify, and usage whose record no longer resolves to an account. Zero for a restricted principal.'
|
|
7018
|
+
totals:
|
|
7019
|
+
$ref: '#/components/schemas/UsageAttributionSlice'
|
|
7020
|
+
description: 'The window totals; for a restricted principal, the sum of the visible groups.'
|
|
7021
|
+
restricted:
|
|
7022
|
+
type: boolean
|
|
7023
|
+
description: 'True when the caller (profile-scoped API key or member) cannot see every profile: `groups` are filtered, `totals` sum them, `unattributed` is zero, and the top-level `days` / `totals` / `lineItems` are projected onto the visible groups with `peaks`, `callUsage` and `tax` null.'
|
|
7024
|
+
scope:
|
|
7025
|
+
description: 'Present with `profileId` / `accountId`: echoes the group the payload was projected onto.'
|
|
7026
|
+
oneOf:
|
|
7027
|
+
- type: object
|
|
7028
|
+
required: [profileId]
|
|
7029
|
+
properties:
|
|
7030
|
+
profileId: { type: string }
|
|
7031
|
+
- type: object
|
|
7032
|
+
required: [accountId]
|
|
7033
|
+
properties:
|
|
7034
|
+
accountId: { type: string }
|
|
7035
|
+
UsageAttributionGroup:
|
|
7036
|
+
allOf:
|
|
7037
|
+
- $ref: '#/components/schemas/UsageAttributionSlice'
|
|
7038
|
+
- type: object
|
|
7039
|
+
required: [key]
|
|
7040
|
+
properties:
|
|
7041
|
+
key: { type: string, description: 'Profile id or account id, per `groupBy`.' }
|
|
7042
|
+
UsageAttributionSlice:
|
|
7043
|
+
type: object
|
|
7044
|
+
properties:
|
|
7045
|
+
byProduct:
|
|
7046
|
+
type: object
|
|
7047
|
+
description: USD per product family.
|
|
7048
|
+
properties:
|
|
7049
|
+
accounts: { type: number }
|
|
7050
|
+
numbers: { type: number }
|
|
7051
|
+
calls: { type: number }
|
|
7052
|
+
sms: { type: number }
|
|
7053
|
+
verify: { type: number }
|
|
7054
|
+
dlc: { type: number }
|
|
7055
|
+
xApi: { type: number }
|
|
7056
|
+
credits: { type: number }
|
|
7057
|
+
other: { type: number }
|
|
7058
|
+
totalUsd: { type: number }
|
|
7004
7059
|
UsageStats:
|
|
7005
7060
|
type: object
|
|
7006
7061
|
description: |
|
|
@@ -13856,6 +13911,20 @@ paths:
|
|
|
13856
13911
|
Also served at `GET /v1/usage/daily`. Usage-based accounts only —
|
|
13857
13912
|
legacy Stripe accounts get `{ "supported": false, "days": [] }`.
|
|
13858
13913
|
|
|
13914
|
+
**Attribution (metering mode):** `groupBy=profile|account` adds an
|
|
13915
|
+
`attribution` breakdown of the window's spend per profile or account,
|
|
13916
|
+
assembled from your own records and pro-rated against the invoice so
|
|
13917
|
+
`sum(groups) + unattributed` equals `totals` exactly. `profileId` /
|
|
13918
|
+
`accountId` instead project the whole payload (`days`, `totals`,
|
|
13919
|
+
`lineItems`) onto that one group; `peaks`, `callUsage` and `tax` are
|
|
13920
|
+
then `null` (workspace-level facts). Projected `days` spread the
|
|
13921
|
+
group's period share over each day (usage is attributed per period,
|
|
13922
|
+
not per day). Profile-scoped API keys and members only see their
|
|
13923
|
+
profiles' groups (`attribution.restricted: true`, with `totals`
|
|
13924
|
+
summing the visible groups). Credits, 10DLC fees and Verify are always
|
|
13925
|
+
unattributed. `profileId` / `accountId` on their own do not select
|
|
13926
|
+
metering mode: pair them with `range`.
|
|
13927
|
+
|
|
13859
13928
|
For per-domain consumption *volumes* use `GET /v1/usage/calls` and
|
|
13860
13929
|
`GET /v1/usage/sms`. For the billing statement (balance, credits,
|
|
13861
13930
|
caps, payment status) use `GET /v1/billing`.
|
|
@@ -13902,6 +13971,23 @@ paths:
|
|
|
13902
13971
|
Bucketing of the `days` series: `day` (one row per UTC day),
|
|
13903
13972
|
`month` (one row per calendar month, dated to the 1st), or `total`
|
|
13904
13973
|
(no series — read `totals`). Does not affect `totals`.
|
|
13974
|
+
- name: groupBy
|
|
13975
|
+
in: query
|
|
13976
|
+
required: false
|
|
13977
|
+
schema:
|
|
13978
|
+
type: string
|
|
13979
|
+
enum: [profile, account]
|
|
13980
|
+
description: 'Metering mode. Adds `attribution`: the window''s spend split per profile or per account (keys are ids; resolve names via `GET /v1/profiles` / `GET /v1/accounts`).'
|
|
13981
|
+
- name: profileId
|
|
13982
|
+
in: query
|
|
13983
|
+
required: false
|
|
13984
|
+
schema: { type: string }
|
|
13985
|
+
description: 'Metering mode (pair with `range`). Project the payload onto this profile''s attributed share. Mutually exclusive with `accountId`, and `groupBy` (if given) must be `profile`; 404 when the profile is not in your workspace (or outside a scoped key''s profiles).'
|
|
13986
|
+
- name: accountId
|
|
13987
|
+
in: query
|
|
13988
|
+
required: false
|
|
13989
|
+
schema: { type: string }
|
|
13990
|
+
description: 'Metering mode (pair with `range`). Project the payload onto this account''s attributed share. Mutually exclusive with `profileId`, and `groupBy` (if given) must be `account`; 404 when the account is not visible to the caller.'
|
|
13905
13991
|
responses:
|
|
13906
13992
|
'200':
|
|
13907
13993
|
description: |
|
|
@@ -22513,6 +22599,122 @@ paths:
|
|
|
22513
22599
|
'404': { description: Account not found }
|
|
22514
22600
|
'502': { description: Pinterest rejected the request (e.g. duplicate board name) }
|
|
22515
22601
|
|
|
22602
|
+
/v1/accounts/{accountId}/youtube-captions:
|
|
22603
|
+
get:
|
|
22604
|
+
x-resource-group: "accounts"
|
|
22605
|
+
operationId: getYoutubeCaptions
|
|
22606
|
+
tags: [Connect]
|
|
22607
|
+
summary: Get a YouTube video transcript
|
|
22608
|
+
description: |
|
|
22609
|
+
Returns the caption track YouTube already holds for one of the connected channel's own videos, as plain text plus timed cues. Use it instead of downloading and transcribing the video yourself.
|
|
22610
|
+
|
|
22611
|
+
Auto-generated (ASR) tracks are included: YouTube serves them to the channel owner, which is what the connected account is. Uploaded tracks win over auto-generated ones when both exist for a language.
|
|
22612
|
+
|
|
22613
|
+
Caching: we store the transcript on first read and serve it from there afterwards, so you do not need to cache it yourself. A cached read costs no YouTube quota and does not call YouTube at all. `source` tells you which happened (`youtube` on the first read, `cache` after). Pass `refresh=true` only when the captions actually changed on YouTube, since that re-downloads.
|
|
22614
|
+
|
|
22615
|
+
Notes:
|
|
22616
|
+
- Only videos owned by this connected channel. Anything else returns 404.
|
|
22617
|
+
- `contentDetails.caption` in YouTube's own API reads `false` on videos that DO have a serving auto-generated track, so it is not a usable availability signal. Call this endpoint and handle the 404.
|
|
22618
|
+
- YouTube generates auto-captions only for videos with recognisable speech, and can take a few hours after upload to publish them.
|
|
22619
|
+
parameters:
|
|
22620
|
+
- name: accountId
|
|
22621
|
+
in: path
|
|
22622
|
+
required: true
|
|
22623
|
+
schema: { type: string }
|
|
22624
|
+
description: The connected YouTube account.
|
|
22625
|
+
- name: videoId
|
|
22626
|
+
in: query
|
|
22627
|
+
required: true
|
|
22628
|
+
schema: { type: string }
|
|
22629
|
+
description: 'The YouTube video id (the `platformPostId` on a synced external post).'
|
|
22630
|
+
- name: language
|
|
22631
|
+
in: query
|
|
22632
|
+
schema: { type: string }
|
|
22633
|
+
description: 'BCP-47 language tag as YouTube labels the track. `en` also matches an `en-GB` track. Omit to take the best available track.'
|
|
22634
|
+
- name: format
|
|
22635
|
+
in: query
|
|
22636
|
+
schema: { type: string, enum: [json, srt], default: json }
|
|
22637
|
+
description: '`json` returns timed `cues`; `srt` returns the raw SubRip body instead. `text` is present either way.'
|
|
22638
|
+
- name: refresh
|
|
22639
|
+
in: query
|
|
22640
|
+
schema: { type: boolean, default: false }
|
|
22641
|
+
description: 'Re-download from YouTube instead of serving the stored copy. Spends 200 quota units.'
|
|
22642
|
+
responses:
|
|
22643
|
+
'200':
|
|
22644
|
+
description: The transcript.
|
|
22645
|
+
content:
|
|
22646
|
+
application/json:
|
|
22647
|
+
schema:
|
|
22648
|
+
type: object
|
|
22649
|
+
properties:
|
|
22650
|
+
accountId: { type: string }
|
|
22651
|
+
videoId: { type: string }
|
|
22652
|
+
language: { type: string, description: The language of the returned track. }
|
|
22653
|
+
trackId: { type: string, description: YouTube's own caption track id. }
|
|
22654
|
+
trackKind:
|
|
22655
|
+
type: string
|
|
22656
|
+
enum: [asr, standard]
|
|
22657
|
+
description: '`asr` is YouTube''s auto-generated track; `standard` was uploaded by the channel.'
|
|
22658
|
+
source:
|
|
22659
|
+
type: string
|
|
22660
|
+
enum: [cache, youtube]
|
|
22661
|
+
description: '`cache` when served from our stored copy, `youtube` when this call spent the quota units.'
|
|
22662
|
+
fetchedAt: { type: string, format: date-time, description: When the stored copy was downloaded from YouTube. }
|
|
22663
|
+
text: { type: string, description: 'The whole transcript as one paragraph, no timings.' }
|
|
22664
|
+
cues:
|
|
22665
|
+
type: array
|
|
22666
|
+
description: 'Timed cues. Present when format is json. Auto-generated cues overlap in time by design (captions roll), so `start` can precede the previous cue''s `end`.'
|
|
22667
|
+
items:
|
|
22668
|
+
type: object
|
|
22669
|
+
properties:
|
|
22670
|
+
start: { type: number, description: 'Seconds from the start of the video.' }
|
|
22671
|
+
end: { type: number }
|
|
22672
|
+
text: { type: string }
|
|
22673
|
+
srt: { type: string, description: Raw SubRip body. Present when format is srt. }
|
|
22674
|
+
availableTracks:
|
|
22675
|
+
type: array
|
|
22676
|
+
description: 'Every track on the video, so you can re-request another language. On a cached read this is the listing as it stood when we downloaded, so a language added to the video since then appears only after a `refresh=true` or when you request that language directly.'
|
|
22677
|
+
items:
|
|
22678
|
+
type: object
|
|
22679
|
+
properties:
|
|
22680
|
+
trackId: { type: string }
|
|
22681
|
+
language: { type: string }
|
|
22682
|
+
trackKind: { type: string, enum: [asr, standard] }
|
|
22683
|
+
name: { type: string, description: 'The track''s display name. Empty for auto-generated tracks.' }
|
|
22684
|
+
example:
|
|
22685
|
+
accountId: "68a1f2c3d4e5f6a7b8c9d0e1"
|
|
22686
|
+
videoId: "sdw1FML60tM"
|
|
22687
|
+
language: "en"
|
|
22688
|
+
trackId: "AUieDaanCEjmJQdL7wfZbe1QDQTbseX-hToYw99pmOJitlJz868"
|
|
22689
|
+
trackKind: "asr"
|
|
22690
|
+
source: "cache"
|
|
22691
|
+
fetchedAt: "2026-08-27T21:09:54.000Z"
|
|
22692
|
+
text: "Hey, this is Mickey. I'm the founder of this portfolio of three websites which are mainly monetized via AdSense."
|
|
22693
|
+
cues:
|
|
22694
|
+
- start: 1.6
|
|
22695
|
+
end: 8.88
|
|
22696
|
+
text: "Hey, this is Mickey. I'm the founder of"
|
|
22697
|
+
- start: 5.04
|
|
22698
|
+
end: 12.8
|
|
22699
|
+
text: "this portfolio of three websites"
|
|
22700
|
+
availableTracks:
|
|
22701
|
+
- trackId: "AUieDaanCEjmJQdL7wfZbe1QDQTbseX-hToYw99pmOJitlJz868"
|
|
22702
|
+
language: "en"
|
|
22703
|
+
trackKind: "asr"
|
|
22704
|
+
name: ""
|
|
22705
|
+
'400': { $ref: '#/components/responses/BadRequest' }
|
|
22706
|
+
'401': { $ref: '#/components/responses/Unauthorized' }
|
|
22707
|
+
'404':
|
|
22708
|
+
description: 'Account not found, the video does not belong to this channel (`video_not_found`), or the video has no caption track in the requested language (`captions_not_found`).'
|
|
22709
|
+
content:
|
|
22710
|
+
application/json:
|
|
22711
|
+
schema: { $ref: '#/components/schemas/ErrorResponse' }
|
|
22712
|
+
example:
|
|
22713
|
+
error: "This video has no caption tracks. YouTube generates them only for videos with recognisable speech, and it can take a few hours after upload."
|
|
22714
|
+
type: "not_found"
|
|
22715
|
+
code: "captions_not_found"
|
|
22716
|
+
param: "videoId"
|
|
22717
|
+
|
|
22516
22718
|
/v1/accounts/{accountId}/youtube-playlists:
|
|
22517
22719
|
get:
|
|
22518
22720
|
x-resource-group: "accounts"
|
|
@@ -343,6 +343,22 @@ describe 'ConnectApi' do
|
|
|
343
343
|
end
|
|
344
344
|
end
|
|
345
345
|
|
|
346
|
+
# unit tests for get_youtube_captions
|
|
347
|
+
# Get a YouTube video transcript
|
|
348
|
+
# Returns the caption track YouTube already holds for one of the connected channel's own videos, as plain text plus timed cues. Use it instead of downloading and transcribing the video yourself. Auto-generated (ASR) tracks are included: YouTube serves them to the channel owner, which is what the connected account is. Uploaded tracks win over auto-generated ones when both exist for a language. Caching: we store the transcript on first read and serve it from there afterwards, so you do not need to cache it yourself. A cached read costs no YouTube quota and does not call YouTube at all. `source` tells you which happened (`youtube` on the first read, `cache` after). Pass `refresh=true` only when the captions actually changed on YouTube, since that re-downloads. Notes: - Only videos owned by this connected channel. Anything else returns 404. - `contentDetails.caption` in YouTube's own API reads `false` on videos that DO have a serving auto-generated track, so it is not a usable availability signal. Call this endpoint and handle the 404. - YouTube generates auto-captions only for videos with recognisable speech, and can take a few hours after upload to publish them.
|
|
349
|
+
# @param account_id The connected YouTube account.
|
|
350
|
+
# @param video_id The YouTube video id (the `platformPostId` on a synced external post).
|
|
351
|
+
# @param [Hash] opts the optional parameters
|
|
352
|
+
# @option opts [String] :language BCP-47 language tag as YouTube labels the track. `en` also matches an `en-GB` track. Omit to take the best available track.
|
|
353
|
+
# @option opts [String] :format `json` returns timed `cues`; `srt` returns the raw SubRip body instead. `text` is present either way.
|
|
354
|
+
# @option opts [Boolean] :refresh Re-download from YouTube instead of serving the stored copy. Spends 200 quota units.
|
|
355
|
+
# @return [GetYoutubeCaptions200Response]
|
|
356
|
+
describe 'get_youtube_captions test' do
|
|
357
|
+
it 'should work' do
|
|
358
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
359
|
+
end
|
|
360
|
+
end
|
|
361
|
+
|
|
346
362
|
# unit tests for get_youtube_playlists
|
|
347
363
|
# List YouTube playlists
|
|
348
364
|
# Returns the playlists available for a connected YouTube account. Use this to get a playlist ID when creating a YouTube post with the playlistId field.
|
data/spec/api/usage_api_spec.rb
CHANGED
|
@@ -76,13 +76,16 @@ describe 'UsageApi' do
|
|
|
76
76
|
|
|
77
77
|
# unit tests for get_usage
|
|
78
78
|
# Usage snapshot (default) or billed-spend metering (with params)
|
|
79
|
-
# Dual-mode endpoint, selected by query params — fully backward compatible: **Without metering params (the default):** the plan / quota / usage snapshot — plan name, billing period, limits, usage counts, access state. Identical to `GET /v1/usage-stats`. Existing integrations keep working unchanged. **With `range`, `granularity`, `from`, or `to`:** usage METERING — billed spend (USD) by product family (`accounts`, `numbers`, `calls`, `sms`, `dlc`, `xApi`, `credits`, `other`) over the window, at `day` / `month` / `total` granularity, from Metronome's invoice breakdown (the CHARGE view — always reconciles with what gets billed). Also served at `GET /v1/usage/daily`. Usage-based accounts only — legacy Stripe accounts get `{ \"supported\": false, \"days\": [] }`. For per-domain consumption *volumes* use `GET /v1/usage/calls` and `GET /v1/usage/sms`. For the billing statement (balance, credits, caps, payment status) use `GET /v1/billing`.
|
|
79
|
+
# Dual-mode endpoint, selected by query params — fully backward compatible: **Without metering params (the default):** the plan / quota / usage snapshot — plan name, billing period, limits, usage counts, access state. Identical to `GET /v1/usage-stats`. Existing integrations keep working unchanged. **With `range`, `granularity`, `from`, or `to`:** usage METERING — billed spend (USD) by product family (`accounts`, `numbers`, `calls`, `sms`, `dlc`, `xApi`, `credits`, `other`) over the window, at `day` / `month` / `total` granularity, from Metronome's invoice breakdown (the CHARGE view — always reconciles with what gets billed). Also served at `GET /v1/usage/daily`. Usage-based accounts only — legacy Stripe accounts get `{ \"supported\": false, \"days\": [] }`. **Attribution (metering mode):** `groupBy=profile|account` adds an `attribution` breakdown of the window's spend per profile or account, assembled from your own records and pro-rated against the invoice so `sum(groups) + unattributed` equals `totals` exactly. `profileId` / `accountId` instead project the whole payload (`days`, `totals`, `lineItems`) onto that one group; `peaks`, `callUsage` and `tax` are then `null` (workspace-level facts). Projected `days` spread the group's period share over each day (usage is attributed per period, not per day). Profile-scoped API keys and members only see their profiles' groups (`attribution.restricted: true`, with `totals` summing the visible groups). Credits, 10DLC fees and Verify are always unattributed. `profileId` / `accountId` on their own do not select metering mode: pair them with `range`. For per-domain consumption *volumes* use `GET /v1/usage/calls` and `GET /v1/usage/sms`. For the billing statement (balance, credits, caps, payment status) use `GET /v1/billing`.
|
|
80
80
|
# @param [Hash] opts the optional parameters
|
|
81
81
|
# @option opts [Boolean] :reconcile Snapshot mode only. For Stripe subscription users, `true` forces a subscription reconciliation pass even when cached plan data looks complete.
|
|
82
82
|
# @option opts [String] :range Window to report. `cycle` / `prev-cycle` resolve to the customer's real billing-period bounds (falling back to a trailing 30 days when no invoice exists yet); `7d`…`12mo` are trailing windows; `custom` uses `from` / `to`.
|
|
83
83
|
# @option opts [Date] :from Inclusive start (UTC date). Required when `range=custom`.
|
|
84
84
|
# @option opts [Date] :to Inclusive end (UTC date). Required when `range=custom`. Max span 366 days.
|
|
85
85
|
# @option opts [String] :granularity Bucketing of the `days` series: `day` (one row per UTC day), `month` (one row per calendar month, dated to the 1st), or `total` (no series — read `totals`). Does not affect `totals`.
|
|
86
|
+
# @option opts [String] :group_by Metering mode. Adds `attribution`: the window's spend split per profile or per account (keys are ids; resolve names via `GET /v1/profiles` / `GET /v1/accounts`).
|
|
87
|
+
# @option opts [String] :profile_id Metering mode (pair with `range`). Project the payload onto this profile's attributed share. Mutually exclusive with `accountId`, and `groupBy` (if given) must be `profile`; 404 when the profile is not in your workspace (or outside a scoped key's profiles).
|
|
88
|
+
# @option opts [String] :account_id Metering mode (pair with `range`). Project the payload onto this account's attributed share. Mutually exclusive with `profileId`, and `groupBy` (if given) must be `account`; 404 when the account is not visible to the caller.
|
|
86
89
|
# @return [GetUsage200Response]
|
|
87
90
|
describe 'get_usage test' do
|
|
88
91
|
it 'should work' do
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.4
|
|
7
|
+
Contact: support@zernio.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for Zernio::GetYoutubeCaptions200ResponseAvailableTracksInner
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe Zernio::GetYoutubeCaptions200ResponseAvailableTracksInner do
|
|
21
|
+
#let(:instance) { Zernio::GetYoutubeCaptions200ResponseAvailableTracksInner.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of GetYoutubeCaptions200ResponseAvailableTracksInner' do
|
|
24
|
+
it 'should create an instance of GetYoutubeCaptions200ResponseAvailableTracksInner' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(Zernio::GetYoutubeCaptions200ResponseAvailableTracksInner)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "track_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 "language"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
describe 'test attribute "track_kind"' do
|
|
43
|
+
it 'should work' do
|
|
44
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
45
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["asr", "standard"])
|
|
46
|
+
# validator.allowable_values.each do |value|
|
|
47
|
+
# expect { instance.track_kind = value }.not_to raise_error
|
|
48
|
+
# end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
describe 'test attribute "name"' do
|
|
53
|
+
it 'should work' do
|
|
54
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.4
|
|
7
|
+
Contact: support@zernio.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for Zernio::GetYoutubeCaptions200ResponseCuesInner
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe Zernio::GetYoutubeCaptions200ResponseCuesInner do
|
|
21
|
+
#let(:instance) { Zernio::GetYoutubeCaptions200ResponseCuesInner.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of GetYoutubeCaptions200ResponseCuesInner' do
|
|
24
|
+
it 'should create an instance of GetYoutubeCaptions200ResponseCuesInner' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(Zernio::GetYoutubeCaptions200ResponseCuesInner)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "start"' 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 "_end"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
describe 'test attribute "text"' do
|
|
43
|
+
it 'should work' do
|
|
44
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
end
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.4
|
|
7
|
+
Contact: support@zernio.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for Zernio::GetYoutubeCaptions200Response
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe Zernio::GetYoutubeCaptions200Response do
|
|
21
|
+
#let(:instance) { Zernio::GetYoutubeCaptions200Response.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of GetYoutubeCaptions200Response' do
|
|
24
|
+
it 'should create an instance of GetYoutubeCaptions200Response' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(Zernio::GetYoutubeCaptions200Response)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "account_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 "video_id"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
describe 'test attribute "language"' do
|
|
43
|
+
it 'should work' do
|
|
44
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
describe 'test attribute "track_id"' do
|
|
49
|
+
it 'should work' do
|
|
50
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
describe 'test attribute "track_kind"' do
|
|
55
|
+
it 'should work' do
|
|
56
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
57
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["asr", "standard"])
|
|
58
|
+
# validator.allowable_values.each do |value|
|
|
59
|
+
# expect { instance.track_kind = value }.not_to raise_error
|
|
60
|
+
# end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
describe 'test attribute "source"' do
|
|
65
|
+
it 'should work' do
|
|
66
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
67
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["cache", "youtube"])
|
|
68
|
+
# validator.allowable_values.each do |value|
|
|
69
|
+
# expect { instance.source = value }.not_to raise_error
|
|
70
|
+
# end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
describe 'test attribute "fetched_at"' do
|
|
75
|
+
it 'should work' do
|
|
76
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
describe 'test attribute "text"' do
|
|
81
|
+
it 'should work' do
|
|
82
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
describe 'test attribute "cues"' do
|
|
87
|
+
it 'should work' do
|
|
88
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
describe 'test attribute "srt"' do
|
|
93
|
+
it 'should work' do
|
|
94
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
describe 'test attribute "available_tracks"' do
|
|
99
|
+
it 'should work' do
|
|
100
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.4
|
|
7
|
+
Contact: support@zernio.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for Zernio::UsageAttributionGroup
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe Zernio::UsageAttributionGroup do
|
|
21
|
+
#let(:instance) { Zernio::UsageAttributionGroup.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of UsageAttributionGroup' do
|
|
24
|
+
it 'should create an instance of UsageAttributionGroup' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(Zernio::UsageAttributionGroup)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "by_product"' 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 "total_usd"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
describe 'test attribute "key"' do
|
|
43
|
+
it 'should work' do
|
|
44
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
end
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.4
|
|
7
|
+
Contact: support@zernio.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for Zernio::UsageAttributionSliceByProduct
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe Zernio::UsageAttributionSliceByProduct do
|
|
21
|
+
#let(:instance) { Zernio::UsageAttributionSliceByProduct.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of UsageAttributionSliceByProduct' do
|
|
24
|
+
it 'should create an instance of UsageAttributionSliceByProduct' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(Zernio::UsageAttributionSliceByProduct)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "accounts"' 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 "numbers"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
describe 'test attribute "calls"' do
|
|
43
|
+
it 'should work' do
|
|
44
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
describe 'test attribute "sms"' do
|
|
49
|
+
it 'should work' do
|
|
50
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
describe 'test attribute "verify"' do
|
|
55
|
+
it 'should work' do
|
|
56
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
describe 'test attribute "dlc"' do
|
|
61
|
+
it 'should work' do
|
|
62
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
describe 'test attribute "x_api"' do
|
|
67
|
+
it 'should work' do
|
|
68
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
describe 'test attribute "credits"' do
|
|
73
|
+
it 'should work' do
|
|
74
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
describe 'test attribute "other"' do
|
|
79
|
+
it 'should work' do
|
|
80
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
end
|