diff --git a/src/apis/QRCodesApi.ts b/src/apis/QRCodesApi.ts index aee5189..3dd6cd4 100644 --- a/src/apis/QRCodesApi.ts +++ b/src/apis/QRCodesApi.ts @@ -18,6 +18,11 @@ import { BadRequestFromJSON, BadRequestToJSON, } from '../models/BadRequest'; +import { + type BitlinkBody, + BitlinkBodyFromJSON, + BitlinkBodyToJSON, +} from '../models/BitlinkBody'; import { type BitlinkScans, BitlinkScansFromJSON, @@ -88,6 +93,16 @@ import { PublicUpdateQRCodeRequestFromJSON, PublicUpdateQRCodeRequestToJSON, } from '../models/PublicUpdateQRCodeRequest'; +import { + type QRCBulkUpdate, + QRCBulkUpdateFromJSON, + QRCBulkUpdateToJSON, +} from '../models/QRCBulkUpdate'; +import { + type QRCBulkUpdateRequest, + QRCBulkUpdateRequestFromJSON, + QRCBulkUpdateRequestToJSON, +} from '../models/QRCBulkUpdateRequest'; import { type QRCodeDetails, QRCodeDetailsFromJSON, @@ -103,6 +118,11 @@ import { QRCodesMinimalFromJSON, QRCodesMinimalToJSON, } from '../models/QRCodesMinimal'; +import { + type RedirectQRCodeRequest, + RedirectQRCodeRequestFromJSON, + RedirectQRCodeRequestToJSON, +} from '../models/RedirectQRCodeRequest'; import { type ScanMetrics, ScanMetricsFromJSON, @@ -217,9 +237,23 @@ export interface ListQRMinimalRequest { tags?: Array; } +export interface RedirectQRCodeDestinationRequest { + qrcode_id: string; + redirect_qr_code_request: RedirectQRCodeRequest; +} + export interface UpdateQRCodePublicRequest { qrcode_id: string; - public_update_qr_code_request: PublicUpdateQRCodeRequest; + public_update_qr_code_request?: PublicUpdateQRCodeRequest; +} + +export interface UpdateQRCodesByGroupRequest { + group_guid: string; + qrc_bulk_update_request: QRCBulkUpdateRequest; +} + +export interface UpgradeQRCodeToBitlinkRequest { + qrcode_id: string; } /** @@ -1136,20 +1170,78 @@ export class QRCodesApi extends runtime.BaseAPI { } /** - * Creates request options for updateQRCodePublic without sending the request + * Creates request options for redirectQRCodeDestination without sending the request */ - async updateQRCodePublicRequestOpts(requestParameters: UpdateQRCodePublicRequest): Promise { + async redirectQRCodeDestinationRequestOpts(requestParameters: RedirectQRCodeDestinationRequest): Promise { if (requestParameters['qrcode_id'] == null) { throw new runtime.RequiredError( 'qrcode_id', - 'Required parameter "qrcode_id" was null or undefined when calling updateQRCodePublic().' + 'Required parameter "qrcode_id" was null or undefined when calling redirectQRCodeDestination().' ); } - if (requestParameters['public_update_qr_code_request'] == null) { + if (requestParameters['redirect_qr_code_request'] == null) { throw new runtime.RequiredError( - 'public_update_qr_code_request', - 'Required parameter "public_update_qr_code_request" was null or undefined when calling updateQRCodePublic().' + 'redirect_qr_code_request', + 'Required parameter "redirect_qr_code_request" was null or undefined when calling redirectQRCodeDestination().' + ); + } + + 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("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/qr-codes/{qrcode_id}/redirect`; + urlPath = urlPath.replace('{qrcode_id}', encodeURIComponent(String(requestParameters['qrcode_id']))); + + return { + path: urlPath, + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + body: RedirectQRCodeRequestToJSON(requestParameters['redirect_qr_code_request']), + }; + } + + /** + * Changes the destination URL that a stand alone QR Code redirects to. This only works for stand alone QR Codes; a QR Code already associated with a bitlink must be updated via the Bitlinks API. + * Redirect a QR Code + */ + async redirectQRCodeDestinationRaw(requestParameters: RedirectQRCodeDestinationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.redirectQRCodeDestinationRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => QRCodeMinimalFromJSON(jsonValue)); + } + + /** + * Changes the destination URL that a stand alone QR Code redirects to. This only works for stand alone QR Codes; a QR Code already associated with a bitlink must be updated via the Bitlinks API. + * Redirect a QR Code + */ + async redirectQRCodeDestination(requestParameters: RedirectQRCodeDestinationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.redirectQRCodeDestinationRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for updateQRCodePublic without sending the request + */ + async updateQRCodePublicRequestOpts(requestParameters: UpdateQRCodePublicRequest): Promise { + if (requestParameters['qrcode_id'] == null) { + throw new runtime.RequiredError( + 'qrcode_id', + 'Required parameter "qrcode_id" was null or undefined when calling updateQRCodePublic().' ); } @@ -1200,6 +1292,126 @@ export class QRCodesApi extends runtime.BaseAPI { return await response.value(); } + /** + * Creates request options for updateQRCodesByGroup without sending the request + */ + async updateQRCodesByGroupRequestOpts(requestParameters: UpdateQRCodesByGroupRequest): Promise { + if (requestParameters['group_guid'] == null) { + throw new runtime.RequiredError( + 'group_guid', + 'Required parameter "group_guid" was null or undefined when calling updateQRCodesByGroup().' + ); + } + + if (requestParameters['qrc_bulk_update_request'] == null) { + throw new runtime.RequiredError( + 'qrc_bulk_update_request', + 'Required parameter "qrc_bulk_update_request" was null or undefined when calling updateQRCodesByGroup().' + ); + } + + 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("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/groups/{group_guid}/qr-codes`; + urlPath = urlPath.replace('{group_guid}', encodeURIComponent(String(requestParameters['group_guid']))); + + return { + path: urlPath, + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + body: QRCBulkUpdateRequestToJSON(requestParameters['qrc_bulk_update_request']), + }; + } + + /** + * Bulk update can add or remove tags, or archive/un-archive, up to 100 QR codes at a time. Pages QR codes cannot be updated with this endpoint. The response includes a list of QR code ids that were updated. + * Bulk update QR codes + */ + async updateQRCodesByGroupRaw(requestParameters: UpdateQRCodesByGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.updateQRCodesByGroupRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => QRCBulkUpdateFromJSON(jsonValue)); + } + + /** + * Bulk update can add or remove tags, or archive/un-archive, up to 100 QR codes at a time. Pages QR codes cannot be updated with this endpoint. The response includes a list of QR code ids that were updated. + * Bulk update QR codes + */ + async updateQRCodesByGroup(requestParameters: UpdateQRCodesByGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateQRCodesByGroupRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for upgradeQRCodeToBitlink without sending the request + */ + async upgradeQRCodeToBitlinkRequestOpts(requestParameters: UpgradeQRCodeToBitlinkRequest): Promise { + if (requestParameters['qrcode_id'] == null) { + throw new runtime.RequiredError( + 'qrcode_id', + 'Required parameter "qrcode_id" was null or undefined when calling upgradeQRCodeToBitlink().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/qr-codes/{qrcode_id}/to-bitlink`; + urlPath = urlPath.replace('{qrcode_id}', encodeURIComponent(String(requestParameters['qrcode_id']))); + + return { + path: urlPath, + method: 'PUT', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Upgrades a stand alone (decoupled) QR Code to a coupled QR Code by associating it with its underlying Bitly short link. This operation consumes one encode from the organization\'s monthly Link limit. If the QR Code is already coupled, no encode is consumed. + * Upgrade a QR Code to a bitlink + */ + async upgradeQRCodeToBitlinkRaw(requestParameters: UpgradeQRCodeToBitlinkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.upgradeQRCodeToBitlinkRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => BitlinkBodyFromJSON(jsonValue)); + } + + /** + * Upgrades a stand alone (decoupled) QR Code to a coupled QR Code by associating it with its underlying Bitly short link. This operation consumes one encode from the organization\'s monthly Link limit. If the QR Code is already coupled, no encode is consumed. + * Upgrade a QR Code to a bitlink + */ + async upgradeQRCodeToBitlink(requestParameters: UpgradeQRCodeToBitlinkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.upgradeQRCodeToBitlinkRaw(requestParameters, initOverrides); + return await response.value(); + } + } /** diff --git a/src/docs/QRCBulkUpdate.md b/src/docs/QRCBulkUpdate.md new file mode 100644 index 0000000..51b4a9a --- /dev/null +++ b/src/docs/QRCBulkUpdate.md @@ -0,0 +1,34 @@ + +# QRCBulkUpdate + + +## Properties + +Name | Type +------------ | ------------- +`qr_code_ids` | Array<string> + +## Example + +```typescript +import type { QRCBulkUpdate } from '' + +// TODO: Update the object below with actual values +const example = { + "qr_code_ids": null, +} satisfies QRCBulkUpdate + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as QRCBulkUpdate +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/docs/QRCBulkUpdateRequest.md b/src/docs/QRCBulkUpdateRequest.md new file mode 100644 index 0000000..f0f7b2d --- /dev/null +++ b/src/docs/QRCBulkUpdateRequest.md @@ -0,0 +1,42 @@ + +# QRCBulkUpdateRequest + + +## Properties + +Name | Type +------------ | ------------- +`action` | string +`archive` | boolean +`add_tags` | Array<string> +`remove_tags` | Array<string> +`qr_code_ids` | Array<string> + +## Example + +```typescript +import type { QRCBulkUpdateRequest } from '' + +// TODO: Update the object below with actual values +const example = { + "action": null, + "archive": null, + "add_tags": null, + "remove_tags": null, + "qr_code_ids": null, +} satisfies QRCBulkUpdateRequest + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as QRCBulkUpdateRequest +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/docs/QRCodesApi.md b/src/docs/QRCodesApi.md index be2bcf5..57f632c 100644 --- a/src/docs/QRCodesApi.md +++ b/src/docs/QRCodesApi.md @@ -16,7 +16,10 @@ All URIs are relative to *https://api-ssl.bitly.com/v4* | [**getScanMetricsForQRCodeByDevicesOS**](QRCodesApi.md#getscanmetricsforqrcodebydevicesos) | **GET** /qr-codes/{qrcode_id}/scans/device_os | Get Scans for a QR Code by Device OS | | [**getScanMetricsSummaryForQRCode**](QRCodesApi.md#getscanmetricssummaryforqrcode) | **GET** /qr-codes/{qrcode_id}/scans/summary | Get Scans Summary for a QR Code | | [**listQRMinimal**](QRCodesApi.md#listqrminimal) | **GET** /groups/{group_guid}/qr-codes | Retrieve QR Codes by Group | +| [**redirectQRCodeDestination**](QRCodesApi.md#redirectqrcodedestination) | **PATCH** /qr-codes/{qrcode_id}/redirect | Redirect a QR Code | | [**updateQRCodePublic**](QRCodesApi.md#updateqrcodepublic) | **PATCH** /qr-codes/{qrcode_id} | Update a QR Code | +| [**updateQRCodesByGroup**](QRCodesApi.md#updateqrcodesbygroup) | **PATCH** /groups/{group_guid}/qr-codes | Bulk update QR codes | +| [**upgradeQRCodeToBitlink**](QRCodesApi.md#upgradeqrcodetobitlink) | **PUT** /qr-codes/{qrcode_id}/to-bitlink | Upgrade a QR Code to a bitlink | @@ -1063,6 +1066,88 @@ example().catch(console.error); [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) +## redirectQRCodeDestination + +> QRCodeMinimal redirectQRCodeDestination(qrcode_id, redirect_qr_code_request) + +Redirect a QR Code + +Changes the destination URL that a stand alone QR Code redirects to. This only works for stand alone QR Codes; a QR Code already associated with a bitlink must be updated via the Bitlinks API. + +### Example + +```ts +import { + Configuration, + QRCodesApi, +} from ''; +import type { RedirectQRCodeDestinationRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new QRCodesApi(config); + + const body = { + // string + qrcode_id: qrcode_id_example, + // RedirectQRCodeRequest + redirect_qr_code_request: ..., + } satisfies RedirectQRCodeDestinationRequest; + + try { + const data = await api.redirectQRCodeDestination(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **qrcode_id** | `string` | | [Defaults to `undefined`] | +| **redirect_qr_code_request** | [RedirectQRCodeRequest](RedirectQRCodeRequest.md) | | | + +### Return type + +[**QRCodeMinimal**](QRCodeMinimal.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | SUCCESS | - | +| **400** | BAD_REQUEST | - | +| **402** | UPGRADE_REQUIRED | - | +| **403** | FORBIDDEN | - | +| **404** | NOT_FOUND | - | +| **410** | GONE | - | +| **422** | UNPROCESSABLE_ENTITY | - | +| **429** | MONTHLY_LIMIT_EXCEEDED | - | +| **500** | INTERNAL_ERROR | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + ## updateQRCodePublic > QRCodeMinimal updateQRCodePublic(qrcode_id, public_update_qr_code_request) @@ -1091,7 +1176,7 @@ async function example() { const body = { // string | The QR code ID qrcode_id: Qabc123, - // PublicUpdateQRCodeRequest + // PublicUpdateQRCodeRequest (optional) public_update_qr_code_request: {"title":"Minimal QR Code Updated","tags":["tag1","tag2"]}, } satisfies UpdateQRCodePublicRequest; @@ -1113,7 +1198,7 @@ example().catch(console.error); | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **qrcode_id** | `string` | The QR code ID | [Defaults to `undefined`] | -| **public_update_qr_code_request** | [PublicUpdateQRCodeRequest](PublicUpdateQRCodeRequest.md) | | | +| **public_update_qr_code_request** | [PublicUpdateQRCodeRequest](PublicUpdateQRCodeRequest.md) | | [Optional] | ### Return type @@ -1141,3 +1226,161 @@ example().catch(console.error); [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +## updateQRCodesByGroup + +> QRCBulkUpdate updateQRCodesByGroup(group_guid, qrc_bulk_update_request) + +Bulk update QR codes + +Bulk update can add or remove tags, or archive/un-archive, up to 100 QR codes at a time. Pages QR codes cannot be updated with this endpoint. The response includes a list of QR code ids that were updated. + +### Example + +```ts +import { + Configuration, + QRCodesApi, +} from ''; +import type { UpdateQRCodesByGroupRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new QRCodesApi(config); + + const body = { + // string | A GUID for a Bitly group + group_guid: Ba1bc23dE4F, + // QRCBulkUpdateRequest + qrc_bulk_update_request: ..., + } satisfies UpdateQRCodesByGroupRequest; + + try { + const data = await api.updateQRCodesByGroup(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **group_guid** | `string` | A GUID for a Bitly group | [Defaults to `undefined`] | +| **qrc_bulk_update_request** | [QRCBulkUpdateRequest](QRCBulkUpdateRequest.md) | | | + +### Return type + +[**QRCBulkUpdate**](QRCBulkUpdate.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | SUCCESS | - | +| **400** | BAD_REQUEST | - | +| **403** | FORBIDDEN | - | +| **404** | NOT_FOUND | - | +| **410** | GONE | - | +| **422** | UNPROCESSABLE_ENTITY | - | +| **429** | MONTHLY_LIMIT_EXCEEDED | - | +| **500** | INTERNAL_ERROR | - | +| **503** | TEMPORARILY_UNAVAILABLE | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## upgradeQRCodeToBitlink + +> BitlinkBody upgradeQRCodeToBitlink(qrcode_id) + +Upgrade a QR Code to a bitlink + +Upgrades a stand alone (decoupled) QR Code to a coupled QR Code by associating it with its underlying Bitly short link. This operation consumes one encode from the organization\'s monthly Link limit. If the QR Code is already coupled, no encode is consumed. + +### Example + +```ts +import { + Configuration, + QRCodesApi, +} from ''; +import type { UpgradeQRCodeToBitlinkRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new QRCodesApi(config); + + const body = { + // string + qrcode_id: qrcode_id_example, + } satisfies UpgradeQRCodeToBitlinkRequest; + + try { + const data = await api.upgradeQRCodeToBitlink(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **qrcode_id** | `string` | | [Defaults to `undefined`] | + +### Return type + +[**BitlinkBody**](BitlinkBody.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | SUCCESS | - | +| **400** | BAD_REQUEST | - | +| **403** | FORBIDDEN | - | +| **404** | NOT_FOUND | - | +| **429** | MONTHLY_LIMIT_EXCEEDED | - | +| **500** | INTERNAL_ERROR | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/src/docs/RedirectQRCodeRequest.md b/src/docs/RedirectQRCodeRequest.md new file mode 100644 index 0000000..c45b8e1 --- /dev/null +++ b/src/docs/RedirectQRCodeRequest.md @@ -0,0 +1,35 @@ + +# RedirectQRCodeRequest + +Request to redirect a QRCode + +## Properties + +Name | Type +------------ | ------------- +`long_url` | string + +## Example + +```typescript +import type { RedirectQRCodeRequest } from '' + +// TODO: Update the object below with actual values +const example = { + "long_url": https://www.google.com, +} satisfies RedirectQRCodeRequest + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as RedirectQRCodeRequest +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/src/models/QRCBulkUpdate.ts b/src/models/QRCBulkUpdate.ts new file mode 100644 index 0000000..74d936e --- /dev/null +++ b/src/models/QRCBulkUpdate.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bitly API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 4.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 { mapValues } from '../runtime'; +/** + * + * @export + * @interface QRCBulkUpdate + */ +export interface QRCBulkUpdate { + /** + * + * @type {Array} + * @memberof QRCBulkUpdate + */ + qr_code_ids?: Array; +} + +/** + * Check if a given object implements the QRCBulkUpdate interface. + */ +export function instanceOfQRCBulkUpdate(value: object): value is QRCBulkUpdate { + return true; +} + +export function QRCBulkUpdateFromJSON(json: any): QRCBulkUpdate { + return QRCBulkUpdateFromJSONTyped(json, false); +} + +export function QRCBulkUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): QRCBulkUpdate { + if (json == null) { + return json; + } + return { + + 'qr_code_ids': json['qr_code_ids'] == null ? undefined : json['qr_code_ids'], + }; +} + +export function QRCBulkUpdateToJSON(json: any): QRCBulkUpdate { + return QRCBulkUpdateToJSONTyped(json, false); +} + +export function QRCBulkUpdateToJSONTyped(value?: QRCBulkUpdate | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'qr_code_ids': value['qr_code_ids'], + }; +} + diff --git a/src/models/QRCBulkUpdateRequest.ts b/src/models/QRCBulkUpdateRequest.ts new file mode 100644 index 0000000..4b878b6 --- /dev/null +++ b/src/models/QRCBulkUpdateRequest.ts @@ -0,0 +1,108 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bitly API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 4.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 { mapValues } from '../runtime'; +/** + * + * @export + * @interface QRCBulkUpdateRequest + */ +export interface QRCBulkUpdateRequest { + /** + * archive or edit_tags + * @type {QRCBulkUpdateRequestActionEnum} + * @memberof QRCBulkUpdateRequest + */ + action: QRCBulkUpdateRequestActionEnum; + /** + * + * @type {boolean} + * @memberof QRCBulkUpdateRequest + */ + archive?: boolean; + /** + * + * @type {Array} + * @memberof QRCBulkUpdateRequest + */ + add_tags?: Array; + /** + * + * @type {Array} + * @memberof QRCBulkUpdateRequest + */ + remove_tags?: Array; + /** + * this is limited to 100 QR code ids; Pages QR codes are not supported + * @type {Array} + * @memberof QRCBulkUpdateRequest + */ + qr_code_ids?: Array; +} + +/** +* @export +* @enum {string} +*/ +export enum QRCBulkUpdateRequestActionEnum { + archive = 'archive', + edit_tags = 'edit_tags' +} + + +/** + * Check if a given object implements the QRCBulkUpdateRequest interface. + */ +export function instanceOfQRCBulkUpdateRequest(value: object): value is QRCBulkUpdateRequest { + if (!('action' in value) || value['action'] === undefined) return false; + return true; +} + +export function QRCBulkUpdateRequestFromJSON(json: any): QRCBulkUpdateRequest { + return QRCBulkUpdateRequestFromJSONTyped(json, false); +} + +export function QRCBulkUpdateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): QRCBulkUpdateRequest { + if (json == null) { + return json; + } + return { + + 'action': json['action'], + 'archive': json['archive'] == null ? undefined : json['archive'], + 'add_tags': json['add_tags'] == null ? undefined : json['add_tags'], + 'remove_tags': json['remove_tags'] == null ? undefined : json['remove_tags'], + 'qr_code_ids': json['qr_code_ids'] == null ? undefined : json['qr_code_ids'], + }; +} + +export function QRCBulkUpdateRequestToJSON(json: any): QRCBulkUpdateRequest { + return QRCBulkUpdateRequestToJSONTyped(json, false); +} + +export function QRCBulkUpdateRequestToJSONTyped(value?: QRCBulkUpdateRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'action': value['action'], + 'archive': value['archive'], + 'add_tags': value['add_tags'], + 'remove_tags': value['remove_tags'], + 'qr_code_ids': value['qr_code_ids'], + }; +} + diff --git a/src/models/RedirectQRCodeRequest.ts b/src/models/RedirectQRCodeRequest.ts new file mode 100644 index 0000000..43a7bd9 --- /dev/null +++ b/src/models/RedirectQRCodeRequest.ts @@ -0,0 +1,66 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bitly API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 4.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 { mapValues } from '../runtime'; +/** + * Request to redirect a QRCode + * @export + * @interface RedirectQRCodeRequest + */ +export interface RedirectQRCodeRequest { + /** + * + * @type {string} + * @memberof RedirectQRCodeRequest + */ + long_url: string; +} + +/** + * Check if a given object implements the RedirectQRCodeRequest interface. + */ +export function instanceOfRedirectQRCodeRequest(value: object): value is RedirectQRCodeRequest { + if (!('long_url' in value) || value['long_url'] === undefined) return false; + return true; +} + +export function RedirectQRCodeRequestFromJSON(json: any): RedirectQRCodeRequest { + return RedirectQRCodeRequestFromJSONTyped(json, false); +} + +export function RedirectQRCodeRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): RedirectQRCodeRequest { + if (json == null) { + return json; + } + return { + + 'long_url': json['long_url'], + }; +} + +export function RedirectQRCodeRequestToJSON(json: any): RedirectQRCodeRequest { + return RedirectQRCodeRequestToJSONTyped(json, false); +} + +export function RedirectQRCodeRequestToJSONTyped(value?: RedirectQRCodeRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'long_url': value['long_url'], + }; +} + diff --git a/src/models/index.ts b/src/models/index.ts index e780d36..c4d6a9e 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -99,6 +99,8 @@ export * from './PublicDeleteQRCodeResponse'; export * from './PublicQRCodeImageResponse'; export * from './PublicStaticQRCodeResponse'; export * from './PublicUpdateQRCodeRequest'; +export * from './QRCBulkUpdate'; +export * from './QRCBulkUpdateRequest'; export * from './QRCodeBranding'; export * from './QRCodeCorner'; export * from './QRCodeCorners'; @@ -120,6 +122,7 @@ export * from './QRCodeTypeEnum'; export * from './QRCodesMinimal'; export * from './QRPagination'; export * from './QRScans'; +export * from './RedirectQRCodeRequest'; export * from './ReferrersByDomain'; export * from './ReferrersByDomains'; export * from './ScanMetric';