Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions generated/apis/LiveActivitiesApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export interface UpdateLiveActivityRequest {
export class LiveActivitiesApi extends runtime.BaseAPI {

/**
* Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, and the legacy counter/timer/countdown step-based activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
* Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
* End a Live Activity
*/
async endLiveActivityRaw(requestParameters: EndLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<LiveActivityEndResponse>> {
Expand Down Expand Up @@ -98,7 +98,7 @@ export class LiveActivitiesApi extends runtime.BaseAPI {
}

/**
* Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, and the legacy counter/timer/countdown step-based activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
* Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
* End a Live Activity
*/
async endLiveActivity(requestParameters: EndLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LiveActivityEndResponse> {
Expand Down Expand Up @@ -206,7 +206,7 @@ export class LiveActivitiesApi extends runtime.BaseAPI {
}

/**
* Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, and the legacy counter/timer/countdown step-based activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
* Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
* Start a Live Activity
*/
async startLiveActivityRaw(requestParameters: StartLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<LiveActivityStartResponse>> {
Expand Down Expand Up @@ -243,7 +243,7 @@ export class LiveActivitiesApi extends runtime.BaseAPI {
}

/**
* Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, and the legacy counter/timer/countdown step-based activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
* Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
* Start a Live Activity
*/
async startLiveActivity(requestParameters: StartLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LiveActivityStartResponse> {
Expand All @@ -252,7 +252,7 @@ export class LiveActivitiesApi extends runtime.BaseAPI {
}

/**
* Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, and the legacy counter/timer/countdown step-based activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
* Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
* Update a Live Activity
*/
async updateLiveActivityRaw(requestParameters: UpdateLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<LiveActivityUpdateResponse>> {
Expand Down Expand Up @@ -289,7 +289,7 @@ export class LiveActivitiesApi extends runtime.BaseAPI {
}

/**
* Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, and the legacy counter/timer/countdown step-based activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
* Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
* Update a Live Activity
*/
async updateLiveActivity(requestParameters: UpdateLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LiveActivityUpdateResponse> {
Expand Down
87 changes: 87 additions & 0 deletions generated/apis/MetricsApi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/* tslint:disable */
/* eslint-disable */
/**
* ActivitySmith API
* Send push notifications and Live Activities to your own devices via a single API key.
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/


import * as runtime from '../runtime';
import type {
MetricError,
MetricValueUpdateRequest,
MetricValueUpdateResponse,
RateLimitError,
} from '../models/index';

export interface UpdateMetricValueRequest {
key: string;
metricValueUpdateRequest: MetricValueUpdateRequest;
}

/**
*
*/
export class MetricsApi extends runtime.BaseAPI {

/**
* Updates the latest value for a metric configured in ActivitySmith widgets. Create the metric in the web app first, then write values using its key. Numeric metric formats accept finite numbers. String metrics accept non-empty text up to 64 characters.
* Update a widget metric value
*/
async updateMetricValueRaw(requestParameters: UpdateMetricValueRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MetricValueUpdateResponse>> {
if (requestParameters['key'] == null) {
throw new runtime.RequiredError(
'key',
'Required parameter "key" was null or undefined when calling updateMetricValue().'
);
}

if (requestParameters['metricValueUpdateRequest'] == null) {
throw new runtime.RequiredError(
'metricValueUpdateRequest',
'Required parameter "metricValueUpdateRequest" was null or undefined when calling updateMetricValue().'
);
}

const queryParameters: any = {};

const headerParameters: runtime.HTTPHeaders = {};

headerParameters['Content-Type'] = 'application/json';

if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("apiKeyAuth", []);

if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/metrics/{key}/value`.replace(`{${"key"}}`, encodeURIComponent(String(requestParameters['key']))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: requestParameters['metricValueUpdateRequest'],
}, initOverrides);

return new runtime.JSONApiResponse(response);
}

/**
* Updates the latest value for a metric configured in ActivitySmith widgets. Create the metric in the web app first, then write values using its key. Numeric metric formats accept finite numbers. String metrics accept non-empty text up to 64 characters.
* Update a widget metric value
*/
async updateMetricValue(requestParameters: UpdateMetricValueRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MetricValueUpdateResponse> {
const response = await this.updateMetricValueRaw(requestParameters, initOverrides);
return await response.value();
}

}
1 change: 1 addition & 0 deletions generated/apis/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
export * from './LiveActivitiesApi';
export * from './MetricsApi';
export * from './PushNotificationsApi';
Loading