@@ -18,6 +18,11 @@ import {
1818 BadRequestFromJSON ,
1919 BadRequestToJSON ,
2020} from '../models/BadRequest' ;
21+ import {
22+ type BitlinkBody ,
23+ BitlinkBodyFromJSON ,
24+ BitlinkBodyToJSON ,
25+ } from '../models/BitlinkBody' ;
2126import {
2227 type BitlinkScans ,
2328 BitlinkScansFromJSON ,
@@ -88,6 +93,16 @@ import {
8893 PublicUpdateQRCodeRequestFromJSON ,
8994 PublicUpdateQRCodeRequestToJSON ,
9095} from '../models/PublicUpdateQRCodeRequest' ;
96+ import {
97+ type QRCBulkUpdate ,
98+ QRCBulkUpdateFromJSON ,
99+ QRCBulkUpdateToJSON ,
100+ } from '../models/QRCBulkUpdate' ;
101+ import {
102+ type QRCBulkUpdateRequest ,
103+ QRCBulkUpdateRequestFromJSON ,
104+ QRCBulkUpdateRequestToJSON ,
105+ } from '../models/QRCBulkUpdateRequest' ;
91106import {
92107 type QRCodeDetails ,
93108 QRCodeDetailsFromJSON ,
@@ -103,6 +118,11 @@ import {
103118 QRCodesMinimalFromJSON ,
104119 QRCodesMinimalToJSON ,
105120} from '../models/QRCodesMinimal' ;
121+ import {
122+ type RedirectQRCodeRequest ,
123+ RedirectQRCodeRequestFromJSON ,
124+ RedirectQRCodeRequestToJSON ,
125+ } from '../models/RedirectQRCodeRequest' ;
106126import {
107127 type ScanMetrics ,
108128 ScanMetricsFromJSON ,
@@ -214,12 +234,27 @@ export interface ListQRMinimalRequest {
214234 is_gs1 ?: ListQRMinimalIsGs1Enum ;
215235 is_expired ?: ListQRMinimalIsExpiredEnum ;
216236 has_expiration ?: ListQRMinimalHasExpirationEnum ;
237+ has_dynamic_routing ?: ListQRMinimalHasDynamicRoutingEnum ;
217238 tags ?: Array < string > ;
218239}
219240
241+ export interface RedirectQRCodeDestinationRequest {
242+ qrcode_id : string ;
243+ redirect_qr_code_request : RedirectQRCodeRequest ;
244+ }
245+
220246export interface UpdateQRCodePublicRequest {
221247 qrcode_id : string ;
222- public_update_qr_code_request : PublicUpdateQRCodeRequest ;
248+ public_update_qr_code_request ?: PublicUpdateQRCodeRequest ;
249+ }
250+
251+ export interface UpdateQRCodesByGroupRequest {
252+ group_guid : string ;
253+ qrc_bulk_update_request : QRCBulkUpdateRequest ;
254+ }
255+
256+ export interface UpgradeQRCodeToBitlinkRequest {
257+ qrcode_id : string ;
223258}
224259
225260/**
@@ -1089,6 +1124,10 @@ export class QRCodesApi extends runtime.BaseAPI {
10891124 queryParameters [ 'has_expiration' ] = requestParameters [ 'has_expiration' ] ;
10901125 }
10911126
1127+ if ( requestParameters [ 'has_dynamic_routing' ] != null ) {
1128+ queryParameters [ 'has_dynamic_routing' ] = requestParameters [ 'has_dynamic_routing' ] ;
1129+ }
1130+
10921131 if ( requestParameters [ 'tags' ] != null ) {
10931132 queryParameters [ 'tags' ] = requestParameters [ 'tags' ] ;
10941133 }
@@ -1136,20 +1175,78 @@ export class QRCodesApi extends runtime.BaseAPI {
11361175 }
11371176
11381177 /**
1139- * Creates request options for updateQRCodePublic without sending the request
1178+ * Creates request options for redirectQRCodeDestination without sending the request
11401179 */
1141- async updateQRCodePublicRequestOpts ( requestParameters : UpdateQRCodePublicRequest ) : Promise < runtime . RequestOpts > {
1180+ async redirectQRCodeDestinationRequestOpts ( requestParameters : RedirectQRCodeDestinationRequest ) : Promise < runtime . RequestOpts > {
11421181 if ( requestParameters [ 'qrcode_id' ] == null ) {
11431182 throw new runtime . RequiredError (
11441183 'qrcode_id' ,
1145- 'Required parameter "qrcode_id" was null or undefined when calling updateQRCodePublic ().'
1184+ 'Required parameter "qrcode_id" was null or undefined when calling redirectQRCodeDestination ().'
11461185 ) ;
11471186 }
11481187
1149- if ( requestParameters [ 'public_update_qr_code_request' ] == null ) {
1188+ if ( requestParameters [ 'redirect_qr_code_request' ] == null ) {
1189+ throw new runtime . RequiredError (
1190+ 'redirect_qr_code_request' ,
1191+ 'Required parameter "redirect_qr_code_request" was null or undefined when calling redirectQRCodeDestination().'
1192+ ) ;
1193+ }
1194+
1195+ const queryParameters : any = { } ;
1196+
1197+ const headerParameters : runtime . HTTPHeaders = { } ;
1198+
1199+ headerParameters [ 'Content-Type' ] = 'application/json' ;
1200+
1201+ if ( this . configuration && this . configuration . accessToken ) {
1202+ const token = this . configuration . accessToken ;
1203+ const tokenString = await token ( "bearerAuth" , [ ] ) ;
1204+
1205+ if ( tokenString ) {
1206+ headerParameters [ "Authorization" ] = `Bearer ${ tokenString } ` ;
1207+ }
1208+ }
1209+
1210+ let urlPath = `/qr-codes/{qrcode_id}/redirect` ;
1211+ urlPath = urlPath . replace ( '{qrcode_id}' , encodeURIComponent ( String ( requestParameters [ 'qrcode_id' ] ) ) ) ;
1212+
1213+ return {
1214+ path : urlPath ,
1215+ method : 'PATCH' ,
1216+ headers : headerParameters ,
1217+ query : queryParameters ,
1218+ body : RedirectQRCodeRequestToJSON ( requestParameters [ 'redirect_qr_code_request' ] ) ,
1219+ } ;
1220+ }
1221+
1222+ /**
1223+ * 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.
1224+ * Redirect a QR Code
1225+ */
1226+ async redirectQRCodeDestinationRaw ( requestParameters : RedirectQRCodeDestinationRequest , initOverrides ?: RequestInit | runtime . InitOverrideFunction ) : Promise < runtime . ApiResponse < QRCodeMinimal > > {
1227+ const requestOptions = await this . redirectQRCodeDestinationRequestOpts ( requestParameters ) ;
1228+ const response = await this . request ( requestOptions , initOverrides ) ;
1229+
1230+ return new runtime . JSONApiResponse ( response , ( jsonValue ) => QRCodeMinimalFromJSON ( jsonValue ) ) ;
1231+ }
1232+
1233+ /**
1234+ * 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.
1235+ * Redirect a QR Code
1236+ */
1237+ async redirectQRCodeDestination ( requestParameters : RedirectQRCodeDestinationRequest , initOverrides ?: RequestInit | runtime . InitOverrideFunction ) : Promise < QRCodeMinimal > {
1238+ const response = await this . redirectQRCodeDestinationRaw ( requestParameters , initOverrides ) ;
1239+ return await response . value ( ) ;
1240+ }
1241+
1242+ /**
1243+ * Creates request options for updateQRCodePublic without sending the request
1244+ */
1245+ async updateQRCodePublicRequestOpts ( requestParameters : UpdateQRCodePublicRequest ) : Promise < runtime . RequestOpts > {
1246+ if ( requestParameters [ 'qrcode_id' ] == null ) {
11501247 throw new runtime . RequiredError (
1151- 'public_update_qr_code_request ' ,
1152- 'Required parameter "public_update_qr_code_request " was null or undefined when calling updateQRCodePublic().'
1248+ 'qrcode_id ' ,
1249+ 'Required parameter "qrcode_id " was null or undefined when calling updateQRCodePublic().'
11531250 ) ;
11541251 }
11551252
@@ -1200,6 +1297,126 @@ export class QRCodesApi extends runtime.BaseAPI {
12001297 return await response . value ( ) ;
12011298 }
12021299
1300+ /**
1301+ * Creates request options for updateQRCodesByGroup without sending the request
1302+ */
1303+ async updateQRCodesByGroupRequestOpts ( requestParameters : UpdateQRCodesByGroupRequest ) : Promise < runtime . RequestOpts > {
1304+ if ( requestParameters [ 'group_guid' ] == null ) {
1305+ throw new runtime . RequiredError (
1306+ 'group_guid' ,
1307+ 'Required parameter "group_guid" was null or undefined when calling updateQRCodesByGroup().'
1308+ ) ;
1309+ }
1310+
1311+ if ( requestParameters [ 'qrc_bulk_update_request' ] == null ) {
1312+ throw new runtime . RequiredError (
1313+ 'qrc_bulk_update_request' ,
1314+ 'Required parameter "qrc_bulk_update_request" was null or undefined when calling updateQRCodesByGroup().'
1315+ ) ;
1316+ }
1317+
1318+ const queryParameters : any = { } ;
1319+
1320+ const headerParameters : runtime . HTTPHeaders = { } ;
1321+
1322+ headerParameters [ 'Content-Type' ] = 'application/json' ;
1323+
1324+ if ( this . configuration && this . configuration . accessToken ) {
1325+ const token = this . configuration . accessToken ;
1326+ const tokenString = await token ( "bearerAuth" , [ ] ) ;
1327+
1328+ if ( tokenString ) {
1329+ headerParameters [ "Authorization" ] = `Bearer ${ tokenString } ` ;
1330+ }
1331+ }
1332+
1333+ let urlPath = `/groups/{group_guid}/qr-codes` ;
1334+ urlPath = urlPath . replace ( '{group_guid}' , encodeURIComponent ( String ( requestParameters [ 'group_guid' ] ) ) ) ;
1335+
1336+ return {
1337+ path : urlPath ,
1338+ method : 'PATCH' ,
1339+ headers : headerParameters ,
1340+ query : queryParameters ,
1341+ body : QRCBulkUpdateRequestToJSON ( requestParameters [ 'qrc_bulk_update_request' ] ) ,
1342+ } ;
1343+ }
1344+
1345+ /**
1346+ * 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.
1347+ * Bulk update QR codes
1348+ */
1349+ async updateQRCodesByGroupRaw ( requestParameters : UpdateQRCodesByGroupRequest , initOverrides ?: RequestInit | runtime . InitOverrideFunction ) : Promise < runtime . ApiResponse < QRCBulkUpdate > > {
1350+ const requestOptions = await this . updateQRCodesByGroupRequestOpts ( requestParameters ) ;
1351+ const response = await this . request ( requestOptions , initOverrides ) ;
1352+
1353+ return new runtime . JSONApiResponse ( response , ( jsonValue ) => QRCBulkUpdateFromJSON ( jsonValue ) ) ;
1354+ }
1355+
1356+ /**
1357+ * 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.
1358+ * Bulk update QR codes
1359+ */
1360+ async updateQRCodesByGroup ( requestParameters : UpdateQRCodesByGroupRequest , initOverrides ?: RequestInit | runtime . InitOverrideFunction ) : Promise < QRCBulkUpdate > {
1361+ const response = await this . updateQRCodesByGroupRaw ( requestParameters , initOverrides ) ;
1362+ return await response . value ( ) ;
1363+ }
1364+
1365+ /**
1366+ * Creates request options for upgradeQRCodeToBitlink without sending the request
1367+ */
1368+ async upgradeQRCodeToBitlinkRequestOpts ( requestParameters : UpgradeQRCodeToBitlinkRequest ) : Promise < runtime . RequestOpts > {
1369+ if ( requestParameters [ 'qrcode_id' ] == null ) {
1370+ throw new runtime . RequiredError (
1371+ 'qrcode_id' ,
1372+ 'Required parameter "qrcode_id" was null or undefined when calling upgradeQRCodeToBitlink().'
1373+ ) ;
1374+ }
1375+
1376+ const queryParameters : any = { } ;
1377+
1378+ const headerParameters : runtime . HTTPHeaders = { } ;
1379+
1380+ if ( this . configuration && this . configuration . accessToken ) {
1381+ const token = this . configuration . accessToken ;
1382+ const tokenString = await token ( "bearerAuth" , [ ] ) ;
1383+
1384+ if ( tokenString ) {
1385+ headerParameters [ "Authorization" ] = `Bearer ${ tokenString } ` ;
1386+ }
1387+ }
1388+
1389+ let urlPath = `/qr-codes/{qrcode_id}/to-bitlink` ;
1390+ urlPath = urlPath . replace ( '{qrcode_id}' , encodeURIComponent ( String ( requestParameters [ 'qrcode_id' ] ) ) ) ;
1391+
1392+ return {
1393+ path : urlPath ,
1394+ method : 'PUT' ,
1395+ headers : headerParameters ,
1396+ query : queryParameters ,
1397+ } ;
1398+ }
1399+
1400+ /**
1401+ * 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.
1402+ * Upgrade a QR Code to a bitlink
1403+ */
1404+ async upgradeQRCodeToBitlinkRaw ( requestParameters : UpgradeQRCodeToBitlinkRequest , initOverrides ?: RequestInit | runtime . InitOverrideFunction ) : Promise < runtime . ApiResponse < BitlinkBody > > {
1405+ const requestOptions = await this . upgradeQRCodeToBitlinkRequestOpts ( requestParameters ) ;
1406+ const response = await this . request ( requestOptions , initOverrides ) ;
1407+
1408+ return new runtime . JSONApiResponse ( response , ( jsonValue ) => BitlinkBodyFromJSON ( jsonValue ) ) ;
1409+ }
1410+
1411+ /**
1412+ * 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.
1413+ * Upgrade a QR Code to a bitlink
1414+ */
1415+ async upgradeQRCodeToBitlink ( requestParameters : UpgradeQRCodeToBitlinkRequest , initOverrides ?: RequestInit | runtime . InitOverrideFunction ) : Promise < BitlinkBody > {
1416+ const response = await this . upgradeQRCodeToBitlinkRaw ( requestParameters , initOverrides ) ;
1417+ return await response . value ( ) ;
1418+ }
1419+
12031420}
12041421
12051422/**
@@ -1280,3 +1497,12 @@ export enum ListQRMinimalHasExpirationEnum {
12801497 off = 'off' ,
12811498 both = 'both'
12821499}
1500+ /**
1501+ * @export
1502+ * @enum {string}
1503+ */
1504+ export enum ListQRMinimalHasDynamicRoutingEnum {
1505+ on = 'on' ,
1506+ off = 'off' ,
1507+ both = 'both'
1508+ }
0 commit comments