Skip to content
Open
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
226 changes: 219 additions & 7 deletions src/apis/QRCodesApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ import {
BadRequestFromJSON,
BadRequestToJSON,
} from '../models/BadRequest';
import {
type BitlinkBody,
BitlinkBodyFromJSON,
BitlinkBodyToJSON,
} from '../models/BitlinkBody';
import {
type BitlinkScans,
BitlinkScansFromJSON,
Expand Down Expand Up @@ -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,
Expand All @@ -103,6 +118,11 @@ import {
QRCodesMinimalFromJSON,
QRCodesMinimalToJSON,
} from '../models/QRCodesMinimal';
import {
type RedirectQRCodeRequest,
RedirectQRCodeRequestFromJSON,
RedirectQRCodeRequestToJSON,
} from '../models/RedirectQRCodeRequest';
import {
type ScanMetrics,
ScanMetricsFromJSON,
Expand Down Expand Up @@ -217,9 +237,23 @@ export interface ListQRMinimalRequest {
tags?: Array<string>;
}

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;
}

/**
Expand Down Expand Up @@ -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<runtime.RequestOpts> {
async redirectQRCodeDestinationRequestOpts(requestParameters: RedirectQRCodeDestinationRequest): Promise<runtime.RequestOpts> {
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<runtime.ApiResponse<QRCodeMinimal>> {
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<QRCodeMinimal> {
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<runtime.RequestOpts> {
if (requestParameters['qrcode_id'] == null) {
throw new runtime.RequiredError(
'qrcode_id',
'Required parameter "qrcode_id" was null or undefined when calling updateQRCodePublic().'
);
}

Expand Down Expand Up @@ -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<runtime.RequestOpts> {
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<runtime.ApiResponse<QRCBulkUpdate>> {
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<QRCBulkUpdate> {
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<runtime.RequestOpts> {
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<runtime.ApiResponse<BitlinkBody>> {
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<BitlinkBody> {
const response = await this.upgradeQRCodeToBitlinkRaw(requestParameters, initOverrides);
return await response.value();
}

}

/**
Expand Down
34 changes: 34 additions & 0 deletions src/docs/QRCBulkUpdate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

# QRCBulkUpdate


## Properties

Name | Type
------------ | -------------
`qr_code_ids` | Array&lt;string&gt;

## 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)


42 changes: 42 additions & 0 deletions src/docs/QRCBulkUpdateRequest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

# QRCBulkUpdateRequest


## Properties

Name | Type
------------ | -------------
`action` | string
`archive` | boolean
`add_tags` | Array&lt;string&gt;
`remove_tags` | Array&lt;string&gt;
`qr_code_ids` | Array&lt;string&gt;

## 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)


Loading