diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 0148306..d411873 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: f28179cc-ef59-426d-9e85-60cec22fc642 management: - docChecksum: c38ab49043c57320aee33ca443a1c66b + docChecksum: 98ca9bc4e949829ec5b766834b0ad8c5 docVersion: 0.0.1 - speakeasyVersion: 1.284.0 + speakeasyVersion: 1.286.0 generationVersion: 2.326.3 - releaseVersion: 0.29.0 - configChecksum: 0905076054c076f5c1185ecc3a5d9945 + releaseVersion: 0.29.1 + configChecksum: 6f6d30c5a12a247a1c1897cfaf975279 repoURL: https://github.com/dubinc/dub-node.git installationURL: https://github.com/dubinc/dub-node published: true @@ -81,6 +81,7 @@ generatedFiles: - src/models/operations/deletelink.ts - src/models/operations/updatelink.ts - src/models/operations/bulkcreatelinks.ts + - src/models/operations/upsertlink.ts - src/models/operations/getqrcode.ts - src/models/operations/getclicksanalytics.ts - src/models/operations/gettimeseriesanalytics.ts @@ -171,6 +172,10 @@ generatedFiles: - docs/models/operations/bulkcreatelinkstagnames.md - docs/models/operations/bulkcreatelinksgeo.md - docs/models/operations/requestbody.md + - docs/models/operations/upsertlinktagids.md + - docs/models/operations/upsertlinktagnames.md + - docs/models/operations/upsertlinkgeo.md + - docs/models/operations/upsertlinkrequestbody.md - docs/models/operations/level.md - docs/models/operations/getqrcoderequest.md - docs/models/operations/interval.md diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 37d5f46..33bd06b 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -12,7 +12,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: false typescript: - version: 0.29.0 + version: 0.29.1 additionalDependencies: dependencies: {} devDependencies: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index eaade3e..82d5de5 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.285.1 +speakeasyVersion: 1.286.0 sources: my-first-source: sourceNamespace: my-first-source - sourceRevisionDigest: sha256:f649bbfd443ab1f410f772b0cc1a8fd4f3ca6491b1662c55d9ba732b67d1c809 - sourceBlobDigest: sha256:b76d35f06695399d6328570e0db59823fd95024783e73330503db724e7656537 + sourceRevisionDigest: sha256:ad02d35bb4135d56025bfdc45e8bc727dca8d374bb5b2fe4719807a8daa5a00f + sourceBlobDigest: sha256:55f6456f8fe9211e115022e8d60509a48bec957c9d004192c4746749b46ffd89 tags: - latest - main @@ -11,8 +11,8 @@ targets: my-first-target: source: my-first-source sourceNamespace: my-first-source - sourceRevisionDigest: sha256:f649bbfd443ab1f410f772b0cc1a8fd4f3ca6491b1662c55d9ba732b67d1c809 - sourceBlobDigest: sha256:b76d35f06695399d6328570e0db59823fd95024783e73330503db724e7656537 + sourceRevisionDigest: sha256:ad02d35bb4135d56025bfdc45e8bc727dca8d374bb5b2fe4719807a8daa5a00f + sourceBlobDigest: sha256:55f6456f8fe9211e115022e8d60509a48bec957c9d004192c4746749b46ffd89 outLocation: /github/workspace/repo workflow: workflowVersion: 1.0.0 diff --git a/README.md b/README.md index a252736..a98abd5 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md). ## SDK Example Usage -### Example +### Example 1 ```typescript import { Dub } from "dub"; @@ -57,6 +57,29 @@ async function run() { run(); +``` + +### Example 2 + +```typescript +import { Dub } from "dub"; + +const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", +}); + +async function run() { + const result = await dub.links.upsert({ + url: "https://google/com", + }); + + // Handle the result + console.log(result); +} + +run(); + ``` @@ -72,6 +95,7 @@ run(); * [delete](docs/sdks/links/README.md#delete) - Delete a link * [update](docs/sdks/links/README.md#update) - Update a link * [createMany](docs/sdks/links/README.md#createmany) - Bulk create links +* [upsert](docs/sdks/links/README.md#upsert) - Upsert a link ### [qrCodes](docs/sdks/qrcodes/README.md) diff --git a/RELEASES.md b/RELEASES.md index 086a04a..e09ce92 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -256,4 +256,14 @@ Based on: ### Generated - [typescript v0.29.0] . ### Releases -- [NPM v0.29.0] https://www.npmjs.com/package/dub/v/0.29.0 - . \ No newline at end of file +- [NPM v0.29.0] https://www.npmjs.com/package/dub/v/0.29.0 - . + +## 2024-05-12 17:52:03 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.286.0 (2.326.3) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v0.29.1] . +### Releases +- [NPM v0.29.1] https://www.npmjs.com/package/dub/v/0.29.1 - . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md index 296748c..3af1805 100644 --- a/USAGE.md +++ b/USAGE.md @@ -18,5 +18,26 @@ async function run() { run(); +``` + +```typescript +import { Dub } from "dub"; + +const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", +}); + +async function run() { + const result = await dub.links.upsert({ + url: "https://google/com", + }); + + // Handle the result + console.log(result); +} + +run(); + ``` \ No newline at end of file diff --git a/codeSamples.yaml b/codeSamples.yaml index 2bde36d..928cc3c 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -3,6 +3,137 @@ info: title: CodeSamples overlay for typescript target version: 0.0.0 actions: + - target: $["paths"]["/analytics/device"]["get"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "getDeviceAnalytics" + "source": |- + import { Dub } from "dub"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.devices({}); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/analytics/top_urls"]["get"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "getTopURLs" + "source": |- + import { Dub } from "dub"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.topUrls({}); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/analytics/city"]["get"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "getCityAnalytics" + "source": |- + import { Dub } from "dub"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.cities({}); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/workspaces"]["post"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "createWorkspace" + "source": |- + import { Dub } from "dub"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.create({ + name: "", + slug: "", + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/links"]["post"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "createLink" + "source": |- + import { Dub } from "dub"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.create({ + url: "https://google/com", + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/links/count"]["get"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "getLinksCount" + "source": |- + import { Dub } from "dub"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.count({}); + + // Handle the result + console.log(result) + } + + run(); - target: $["paths"]["/links/{linkId}"]["patch"] update: "x-codeSamples": @@ -25,6 +156,249 @@ actions: console.log(result) } + run(); + - target: $["paths"]["/qr"]["get"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "getQRCode" + "source": |- + import { Dub } from "dub"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.get({ + url: "https://brief-micronutrient.org", + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/analytics/timeseries"]["get"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "getTimeseriesAnalytics" + "source": |- + import { Dub } from "dub"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.timeseries({}); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/analytics/country"]["get"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "getCountryAnalytics" + "source": |- + import { Dub } from "dub"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.countries({}); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/tags"]["post"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "createTag" + "source": |- + import { Dub } from "dub"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.create({ + tag: "", + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/domains/{slug}/transfer"]["post"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "transferDomain" + "source": |- + import { Dub } from "dub"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.transfer("acme.com", { + newWorkspaceId: "", + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/links/upsert"]["put"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "upsertLink" + "source": |- + import { Dub } from "dub"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.upsert({ + url: "https://google/com", + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/links"]["get"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "getLinks" + "source": |- + import { Dub } from "dub"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.list({}); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/links/bulk"]["post"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "bulkCreateLinks" + "source": |- + import { Dub } from "dub"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.createMany([ + { + url: "https://google/com", + }, + ]); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/analytics/os"]["get"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "getOSAnalytics" + "source": |- + import { Dub } from "dub"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.os({}); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/analytics/top_links"]["get"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "getTopLinks" + "source": |- + import { Dub } from "dub"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.topLinks({}); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/domains"]["get"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "listDomains" + "source": |- + import { Dub } from "dub"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.list({}); + + // Handle the result + console.log(result) + } + run(); - target: $["paths"]["/analytics/browser"]["get"] update: @@ -47,11 +421,11 @@ actions: } run(); - - target: $["paths"]["/workspaces/{idOrSlug}"]["get"] + - target: $["paths"]["/workspaces"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "getWorkspace" + "label": "getWorkspaces" "source": |- import { Dub } from "dub"; @@ -61,14 +435,119 @@ actions: }); async function run() { - const result = await dub.get({ - idOrSlug: "", + const result = await dub.list(); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/domains"]["post"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "addDomain" + "source": |- + import { Dub } from "dub"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.add({ + slug: "acme.com", }); // Handle the result console.log(result) } + run(); + - target: $["paths"]["/domains/{slug}"]["patch"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "updateDomain" + "source": |- + import { Dub } from "dub"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.update("acme.com", {}); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/links/info"]["get"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "getLinkInfo" + "source": |- + import { Dub } from "dub"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.get({}); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/analytics/referer"]["get"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "getRefererAnalytics" + "source": |- + import { Dub } from "dub"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.referers({}); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/domains/{slug}/primary"]["post"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "setPrimaryDomain" + "source": |- + import { Dub } from "dub"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.setPrimary("acme.com"); + + // Handle the result + console.log(result) + } + run(); - target: $["paths"]["/links/{linkId}"]["delete"] update: @@ -90,6 +569,27 @@ actions: console.log(result) } + run(); + - target: $["paths"]["/tags"]["get"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "getTags" + "source": |- + import { Dub } from "dub"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.list({}); + + // Handle the result + console.log(result) + } + run(); - target: $["paths"]["/metatags"]["get"] update: @@ -135,11 +635,11 @@ actions: } run(); - - target: $["paths"]["/domains"]["post"] + - target: $["paths"]["/workspaces/{idOrSlug}"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "addDomain" + "label": "getWorkspace" "source": |- import { Dub } from "dub"; @@ -149,361 +649,14 @@ actions: }); async function run() { - const result = await dub.add({ - slug: "acme.com", + const result = await dub.get({ + idOrSlug: "", }); // Handle the result console.log(result) } - run(); - - target: $["paths"]["/domains/{slug}/primary"]["post"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "setPrimaryDomain" - "source": |- - import { Dub } from "dub"; - - const dub = new Dub({ - token: "DUB_API_KEY", - workspaceId: "", - }); - - async function run() { - const result = await dub.setPrimary("acme.com"); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/analytics/city"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "getCityAnalytics" - "source": |- - import { Dub } from "dub"; - - const dub = new Dub({ - token: "DUB_API_KEY", - workspaceId: "", - }); - - async function run() { - const result = await dub.cities({}); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/links"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "getLinks" - "source": |- - import { Dub } from "dub"; - - const dub = new Dub({ - token: "DUB_API_KEY", - workspaceId: "", - }); - - async function run() { - const result = await dub.list({}); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/analytics/top_links"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "getTopLinks" - "source": |- - import { Dub } from "dub"; - - const dub = new Dub({ - token: "DUB_API_KEY", - workspaceId: "", - }); - - async function run() { - const result = await dub.topLinks({}); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/links"]["post"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "createLink" - "source": |- - import { Dub } from "dub"; - - const dub = new Dub({ - token: "DUB_API_KEY", - workspaceId: "", - }); - - async function run() { - const result = await dub.create({ - url: "https://google/com", - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/links/bulk"]["post"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "bulkCreateLinks" - "source": |- - import { Dub } from "dub"; - - const dub = new Dub({ - token: "DUB_API_KEY", - workspaceId: "", - }); - - async function run() { - const result = await dub.createMany([ - { - url: "https://google/com", - }, - ]); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/qr"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "getQRCode" - "source": |- - import { Dub } from "dub"; - - const dub = new Dub({ - token: "DUB_API_KEY", - workspaceId: "", - }); - - async function run() { - const result = await dub.get({}); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/analytics/referer"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "getRefererAnalytics" - "source": |- - import { Dub } from "dub"; - - const dub = new Dub({ - token: "DUB_API_KEY", - workspaceId: "", - }); - - async function run() { - const result = await dub.referers({}); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/domains"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "listDomains" - "source": |- - import { Dub } from "dub"; - - const dub = new Dub({ - token: "DUB_API_KEY", - workspaceId: "", - }); - - async function run() { - const result = await dub.list({}); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/links/count"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "getLinksCount" - "source": |- - import { Dub } from "dub"; - - const dub = new Dub({ - token: "DUB_API_KEY", - workspaceId: "", - }); - - async function run() { - const result = await dub.count({}); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/analytics/device"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "getDeviceAnalytics" - "source": |- - import { Dub } from "dub"; - - const dub = new Dub({ - token: "DUB_API_KEY", - workspaceId: "", - }); - - async function run() { - const result = await dub.devices({}); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/analytics/top_urls"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "getTopURLs" - "source": |- - import { Dub } from "dub"; - - const dub = new Dub({ - token: "DUB_API_KEY", - workspaceId: "", - }); - - async function run() { - const result = await dub.topUrls({}); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/workspaces"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "getWorkspaces" - "source": |- - import { Dub } from "dub"; - - const dub = new Dub({ - token: "DUB_API_KEY", - workspaceId: "", - }); - - async function run() { - const result = await dub.list(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/workspaces"]["post"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "createWorkspace" - "source": |- - import { Dub } from "dub"; - - const dub = new Dub({ - token: "DUB_API_KEY", - workspaceId: "", - }); - - async function run() { - const result = await dub.create({ - name: "", - slug: "", - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/tags"]["post"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "createTag" - "source": |- - import { Dub } from "dub"; - - const dub = new Dub({ - token: "DUB_API_KEY", - workspaceId: "", - }); - - async function run() { - const result = await dub.create({ - tag: "", - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/analytics/country"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "getCountryAnalytics" - "source": |- - import { Dub } from "dub"; - - const dub = new Dub({ - token: "DUB_API_KEY", - workspaceId: "", - }); - - async function run() { - const result = await dub.countries({}); - - // Handle the result - console.log(result) - } - run(); - target: $["paths"]["/domains/{slug}"]["delete"] update: @@ -525,132 +678,4 @@ actions: console.log(result) } - run(); - - target: $["paths"]["/analytics/os"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "getOSAnalytics" - "source": |- - import { Dub } from "dub"; - - const dub = new Dub({ - token: "DUB_API_KEY", - workspaceId: "", - }); - - async function run() { - const result = await dub.os({}); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/analytics/timeseries"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "getTimeseriesAnalytics" - "source": |- - import { Dub } from "dub"; - - const dub = new Dub({ - token: "DUB_API_KEY", - workspaceId: "", - }); - - async function run() { - const result = await dub.timeseries({}); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/tags"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "getTags" - "source": |- - import { Dub } from "dub"; - - const dub = new Dub({ - token: "DUB_API_KEY", - workspaceId: "", - }); - - async function run() { - const result = await dub.list({}); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/domains/{slug}"]["patch"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "updateDomain" - "source": |- - import { Dub } from "dub"; - - const dub = new Dub({ - token: "DUB_API_KEY", - workspaceId: "", - }); - - async function run() { - const result = await dub.update("acme.com", {}); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/domains/{slug}/transfer"]["post"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "transferDomain" - "source": |- - import { Dub } from "dub"; - - const dub = new Dub({ - token: "DUB_API_KEY", - workspaceId: "", - }); - - async function run() { - const result = await dub.transfer("acme.com", { - newWorkspaceId: "", - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/links/info"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "getLinkInfo" - "source": |- - import { Dub } from "dub"; - - const dub = new Dub({ - token: "DUB_API_KEY", - workspaceId: "", - }); - - async function run() { - const result = await dub.get({}); - - // Handle the result - console.log(result) - } - run(); diff --git a/docs/models/errors/errort.md b/docs/models/errors/errort.md index b8b44f2..fc81758 100644 --- a/docs/models/errors/errort.md +++ b/docs/models/errors/errort.md @@ -7,4 +7,4 @@ | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | | `code` | [errors.Code](../../models/errors/code.md) | :heavy_check_mark: | A short code indicating the error code returned. | bad_request | | `message` | *string* | :heavy_check_mark: | A human readable explanation of what went wrong. | The requested resource was not found. | -| `docUrl` | *string* | :heavy_minus_sign: | A link to our documentation with more details about this error code | https://dub.co/docs/api-reference/errors#bad_request | \ No newline at end of file +| `docUrl` | *string* | :heavy_minus_sign: | A link to our documentation with more details about this error code | https://dub.co/docs/api-reference/errors#bad-request | \ No newline at end of file diff --git a/docs/models/errors/internalservererrorerror.md b/docs/models/errors/internalservererrorerror.md index 3568e6d..eb453e7 100644 --- a/docs/models/errors/internalservererrorerror.md +++ b/docs/models/errors/internalservererrorerror.md @@ -7,4 +7,4 @@ | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | | `code` | [errors.InternalServerErrorCode](../../models/errors/internalservererrorcode.md) | :heavy_check_mark: | A short code indicating the error code returned. | internal_server_error | | `message` | *string* | :heavy_check_mark: | A human readable explanation of what went wrong. | The requested resource was not found. | -| `docUrl` | *string* | :heavy_minus_sign: | A link to our documentation with more details about this error code | https://dub.co/docs/api-reference/errors#internal_server_error | \ No newline at end of file +| `docUrl` | *string* | :heavy_minus_sign: | A link to our documentation with more details about this error code | https://dub.co/docs/api-reference/errors#internal-server_error | \ No newline at end of file diff --git a/docs/models/errors/inviteexpirederror.md b/docs/models/errors/inviteexpirederror.md index 31f1382..9129500 100644 --- a/docs/models/errors/inviteexpirederror.md +++ b/docs/models/errors/inviteexpirederror.md @@ -7,4 +7,4 @@ | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | | `code` | [errors.InviteExpiredCode](../../models/errors/inviteexpiredcode.md) | :heavy_check_mark: | A short code indicating the error code returned. | invite_expired | | `message` | *string* | :heavy_check_mark: | A human readable explanation of what went wrong. | The requested resource was not found. | -| `docUrl` | *string* | :heavy_minus_sign: | A link to our documentation with more details about this error code | https://dub.co/docs/api-reference/errors#invite_expired | \ No newline at end of file +| `docUrl` | *string* | :heavy_minus_sign: | A link to our documentation with more details about this error code | https://dub.co/docs/api-reference/errors#invite-expired | \ No newline at end of file diff --git a/docs/models/errors/notfounderror.md b/docs/models/errors/notfounderror.md index 340439d..84115aa 100644 --- a/docs/models/errors/notfounderror.md +++ b/docs/models/errors/notfounderror.md @@ -7,4 +7,4 @@ | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | | `code` | [errors.NotFoundCode](../../models/errors/notfoundcode.md) | :heavy_check_mark: | A short code indicating the error code returned. | not_found | | `message` | *string* | :heavy_check_mark: | A human readable explanation of what went wrong. | The requested resource was not found. | -| `docUrl` | *string* | :heavy_minus_sign: | A link to our documentation with more details about this error code | https://dub.co/docs/api-reference/errors#not_found | \ No newline at end of file +| `docUrl` | *string* | :heavy_minus_sign: | A link to our documentation with more details about this error code | https://dub.co/docs/api-reference/errors#not-found | \ No newline at end of file diff --git a/docs/models/errors/ratelimitexceedederror.md b/docs/models/errors/ratelimitexceedederror.md index db87525..4d64c8e 100644 --- a/docs/models/errors/ratelimitexceedederror.md +++ b/docs/models/errors/ratelimitexceedederror.md @@ -7,4 +7,4 @@ | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | | `code` | [errors.RateLimitExceededCode](../../models/errors/ratelimitexceededcode.md) | :heavy_check_mark: | A short code indicating the error code returned. | rate_limit_exceeded | | `message` | *string* | :heavy_check_mark: | A human readable explanation of what went wrong. | The requested resource was not found. | -| `docUrl` | *string* | :heavy_minus_sign: | A link to our documentation with more details about this error code | https://dub.co/docs/api-reference/errors#rate_limit_exceeded | \ No newline at end of file +| `docUrl` | *string* | :heavy_minus_sign: | A link to our documentation with more details about this error code | https://dub.co/docs/api-reference/errors#rate-limit_exceeded | \ No newline at end of file diff --git a/docs/models/errors/unprocessableentityerror.md b/docs/models/errors/unprocessableentityerror.md index 40c7ee9..845c87f 100644 --- a/docs/models/errors/unprocessableentityerror.md +++ b/docs/models/errors/unprocessableentityerror.md @@ -7,4 +7,4 @@ | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | | `code` | [errors.UnprocessableEntityCode](../../models/errors/unprocessableentitycode.md) | :heavy_check_mark: | A short code indicating the error code returned. | unprocessable_entity | | `message` | *string* | :heavy_check_mark: | A human readable explanation of what went wrong. | The requested resource was not found. | -| `docUrl` | *string* | :heavy_minus_sign: | A link to our documentation with more details about this error code | https://dub.co/docs/api-reference/errors#unprocessable_entity | \ No newline at end of file +| `docUrl` | *string* | :heavy_minus_sign: | A link to our documentation with more details about this error code | https://dub.co/docs/api-reference/errors#unprocessable-entity | \ No newline at end of file diff --git a/docs/models/operations/getbrowseranalyticsqueryparaminterval.md b/docs/models/operations/getbrowseranalyticsqueryparaminterval.md index 1fc1ba8..ddcf3fd 100644 --- a/docs/models/operations/getbrowseranalyticsqueryparaminterval.md +++ b/docs/models/operations/getbrowseranalyticsqueryparaminterval.md @@ -1,6 +1,6 @@ # GetBrowserAnalyticsQueryParamInterval -The interval to retrieve analytics for. +The interval to retrieve analytics for. Takes precedence over start and end. ## Values @@ -12,4 +12,6 @@ The interval to retrieve analytics for. | `Sevend` | 7d | | `Thirtyd` | 30d | | `Ninetyd` | 90d | +| `Ytd` | ytd | +| `Oney` | 1y | | `All` | all | \ No newline at end of file diff --git a/docs/models/operations/getbrowseranalyticsrequest.md b/docs/models/operations/getbrowseranalyticsrequest.md index a66581d..c6a08a4 100644 --- a/docs/models/operations/getbrowseranalyticsrequest.md +++ b/docs/models/operations/getbrowseranalyticsrequest.md @@ -9,7 +9,9 @@ | `key` | *string* | :heavy_minus_sign: | The short link slug. | | `linkId` | *string* | :heavy_minus_sign: | The unique ID of the short link on Dub. | | `externalId` | *string* | :heavy_minus_sign: | This is the ID of the link in the your database. Must be prefixed with 'ext_' when passed as a query parameter. | -| `interval` | [operations.GetBrowserAnalyticsQueryParamInterval](../../models/operations/getbrowseranalyticsqueryparaminterval.md) | :heavy_minus_sign: | The interval to retrieve analytics for. | +| `interval` | [operations.GetBrowserAnalyticsQueryParamInterval](../../models/operations/getbrowseranalyticsqueryparaminterval.md) | :heavy_minus_sign: | The interval to retrieve analytics for. Takes precedence over start and end. | +| `start` | *string* | :heavy_minus_sign: | The start date and time when to retrieve analytics from. | +| `end` | *string* | :heavy_minus_sign: | The end date and time when to retrieve analytics from. If not provided, defaults to the current date. | | `country` | [operations.GetBrowserAnalyticsQueryParamCountry](../../models/operations/getbrowseranalyticsqueryparamcountry.md) | :heavy_minus_sign: | The country to retrieve analytics for. | | `city` | *string* | :heavy_minus_sign: | The city to retrieve analytics for. | | `device` | *string* | :heavy_minus_sign: | The device to retrieve analytics for. | diff --git a/docs/models/operations/getcityanalyticsqueryparaminterval.md b/docs/models/operations/getcityanalyticsqueryparaminterval.md index b806498..48c09ee 100644 --- a/docs/models/operations/getcityanalyticsqueryparaminterval.md +++ b/docs/models/operations/getcityanalyticsqueryparaminterval.md @@ -1,6 +1,6 @@ # GetCityAnalyticsQueryParamInterval -The interval to retrieve analytics for. +The interval to retrieve analytics for. Takes precedence over start and end. ## Values @@ -12,4 +12,6 @@ The interval to retrieve analytics for. | `Sevend` | 7d | | `Thirtyd` | 30d | | `Ninetyd` | 90d | +| `Ytd` | ytd | +| `Oney` | 1y | | `All` | all | \ No newline at end of file diff --git a/docs/models/operations/getcityanalyticsrequest.md b/docs/models/operations/getcityanalyticsrequest.md index dad2cca..9086417 100644 --- a/docs/models/operations/getcityanalyticsrequest.md +++ b/docs/models/operations/getcityanalyticsrequest.md @@ -9,7 +9,9 @@ | `key` | *string* | :heavy_minus_sign: | The short link slug. | | `linkId` | *string* | :heavy_minus_sign: | The unique ID of the short link on Dub. | | `externalId` | *string* | :heavy_minus_sign: | This is the ID of the link in the your database. Must be prefixed with 'ext_' when passed as a query parameter. | -| `interval` | [operations.GetCityAnalyticsQueryParamInterval](../../models/operations/getcityanalyticsqueryparaminterval.md) | :heavy_minus_sign: | The interval to retrieve analytics for. | +| `interval` | [operations.GetCityAnalyticsQueryParamInterval](../../models/operations/getcityanalyticsqueryparaminterval.md) | :heavy_minus_sign: | The interval to retrieve analytics for. Takes precedence over start and end. | +| `start` | *string* | :heavy_minus_sign: | The start date and time when to retrieve analytics from. | +| `end` | *string* | :heavy_minus_sign: | The end date and time when to retrieve analytics from. If not provided, defaults to the current date. | | `country` | [operations.GetCityAnalyticsQueryParamCountry](../../models/operations/getcityanalyticsqueryparamcountry.md) | :heavy_minus_sign: | The country to retrieve analytics for. | | `city` | *string* | :heavy_minus_sign: | The city to retrieve analytics for. | | `device` | *string* | :heavy_minus_sign: | The device to retrieve analytics for. | diff --git a/docs/models/operations/getclicksanalyticsrequest.md b/docs/models/operations/getclicksanalyticsrequest.md index bec709a..19ffc0b 100644 --- a/docs/models/operations/getclicksanalyticsrequest.md +++ b/docs/models/operations/getclicksanalyticsrequest.md @@ -9,7 +9,9 @@ | `key` | *string* | :heavy_minus_sign: | The short link slug. | | `linkId` | *string* | :heavy_minus_sign: | The unique ID of the short link on Dub. | | `externalId` | *string* | :heavy_minus_sign: | This is the ID of the link in the your database. Must be prefixed with 'ext_' when passed as a query parameter. | -| `interval` | [operations.Interval](../../models/operations/interval.md) | :heavy_minus_sign: | The interval to retrieve analytics for. | +| `interval` | [operations.Interval](../../models/operations/interval.md) | :heavy_minus_sign: | The interval to retrieve analytics for. Takes precedence over start and end. | +| `start` | *string* | :heavy_minus_sign: | The start date and time when to retrieve analytics from. | +| `end` | *string* | :heavy_minus_sign: | The end date and time when to retrieve analytics from. If not provided, defaults to the current date. | | `country` | [operations.Country](../../models/operations/country.md) | :heavy_minus_sign: | The country to retrieve analytics for. | | `city` | *string* | :heavy_minus_sign: | The city to retrieve analytics for. | | `device` | *string* | :heavy_minus_sign: | The device to retrieve analytics for. | diff --git a/docs/models/operations/getcountryanalyticsqueryparaminterval.md b/docs/models/operations/getcountryanalyticsqueryparaminterval.md index 7a4a717..5e71b2d 100644 --- a/docs/models/operations/getcountryanalyticsqueryparaminterval.md +++ b/docs/models/operations/getcountryanalyticsqueryparaminterval.md @@ -1,6 +1,6 @@ # GetCountryAnalyticsQueryParamInterval -The interval to retrieve analytics for. +The interval to retrieve analytics for. Takes precedence over start and end. ## Values @@ -12,4 +12,6 @@ The interval to retrieve analytics for. | `Sevend` | 7d | | `Thirtyd` | 30d | | `Ninetyd` | 90d | +| `Ytd` | ytd | +| `Oney` | 1y | | `All` | all | \ No newline at end of file diff --git a/docs/models/operations/getcountryanalyticsrequest.md b/docs/models/operations/getcountryanalyticsrequest.md index 42b5f58..1a1ddb2 100644 --- a/docs/models/operations/getcountryanalyticsrequest.md +++ b/docs/models/operations/getcountryanalyticsrequest.md @@ -9,7 +9,9 @@ | `key` | *string* | :heavy_minus_sign: | The short link slug. | | `linkId` | *string* | :heavy_minus_sign: | The unique ID of the short link on Dub. | | `externalId` | *string* | :heavy_minus_sign: | This is the ID of the link in the your database. Must be prefixed with 'ext_' when passed as a query parameter. | -| `interval` | [operations.GetCountryAnalyticsQueryParamInterval](../../models/operations/getcountryanalyticsqueryparaminterval.md) | :heavy_minus_sign: | The interval to retrieve analytics for. | +| `interval` | [operations.GetCountryAnalyticsQueryParamInterval](../../models/operations/getcountryanalyticsqueryparaminterval.md) | :heavy_minus_sign: | The interval to retrieve analytics for. Takes precedence over start and end. | +| `start` | *string* | :heavy_minus_sign: | The start date and time when to retrieve analytics from. | +| `end` | *string* | :heavy_minus_sign: | The end date and time when to retrieve analytics from. If not provided, defaults to the current date. | | `country` | [operations.GetCountryAnalyticsQueryParamCountry](../../models/operations/getcountryanalyticsqueryparamcountry.md) | :heavy_minus_sign: | The country to retrieve analytics for. | | `city` | *string* | :heavy_minus_sign: | The city to retrieve analytics for. | | `device` | *string* | :heavy_minus_sign: | The device to retrieve analytics for. | diff --git a/docs/models/operations/getdeviceanalyticsqueryparaminterval.md b/docs/models/operations/getdeviceanalyticsqueryparaminterval.md index 79b56f3..f411083 100644 --- a/docs/models/operations/getdeviceanalyticsqueryparaminterval.md +++ b/docs/models/operations/getdeviceanalyticsqueryparaminterval.md @@ -1,6 +1,6 @@ # GetDeviceAnalyticsQueryParamInterval -The interval to retrieve analytics for. +The interval to retrieve analytics for. Takes precedence over start and end. ## Values @@ -12,4 +12,6 @@ The interval to retrieve analytics for. | `Sevend` | 7d | | `Thirtyd` | 30d | | `Ninetyd` | 90d | +| `Ytd` | ytd | +| `Oney` | 1y | | `All` | all | \ No newline at end of file diff --git a/docs/models/operations/getdeviceanalyticsrequest.md b/docs/models/operations/getdeviceanalyticsrequest.md index 8889646..920b27a 100644 --- a/docs/models/operations/getdeviceanalyticsrequest.md +++ b/docs/models/operations/getdeviceanalyticsrequest.md @@ -9,7 +9,9 @@ | `key` | *string* | :heavy_minus_sign: | The short link slug. | | `linkId` | *string* | :heavy_minus_sign: | The unique ID of the short link on Dub. | | `externalId` | *string* | :heavy_minus_sign: | This is the ID of the link in the your database. Must be prefixed with 'ext_' when passed as a query parameter. | -| `interval` | [operations.GetDeviceAnalyticsQueryParamInterval](../../models/operations/getdeviceanalyticsqueryparaminterval.md) | :heavy_minus_sign: | The interval to retrieve analytics for. | +| `interval` | [operations.GetDeviceAnalyticsQueryParamInterval](../../models/operations/getdeviceanalyticsqueryparaminterval.md) | :heavy_minus_sign: | The interval to retrieve analytics for. Takes precedence over start and end. | +| `start` | *string* | :heavy_minus_sign: | The start date and time when to retrieve analytics from. | +| `end` | *string* | :heavy_minus_sign: | The end date and time when to retrieve analytics from. If not provided, defaults to the current date. | | `country` | [operations.GetDeviceAnalyticsQueryParamCountry](../../models/operations/getdeviceanalyticsqueryparamcountry.md) | :heavy_minus_sign: | The country to retrieve analytics for. | | `city` | *string* | :heavy_minus_sign: | The city to retrieve analytics for. | | `device` | *string* | :heavy_minus_sign: | The device to retrieve analytics for. | diff --git a/docs/models/operations/getosanalyticsqueryparaminterval.md b/docs/models/operations/getosanalyticsqueryparaminterval.md index 1bb5bda..0efa0de 100644 --- a/docs/models/operations/getosanalyticsqueryparaminterval.md +++ b/docs/models/operations/getosanalyticsqueryparaminterval.md @@ -1,6 +1,6 @@ # GetOSAnalyticsQueryParamInterval -The interval to retrieve analytics for. +The interval to retrieve analytics for. Takes precedence over start and end. ## Values @@ -12,4 +12,6 @@ The interval to retrieve analytics for. | `Sevend` | 7d | | `Thirtyd` | 30d | | `Ninetyd` | 90d | +| `Ytd` | ytd | +| `Oney` | 1y | | `All` | all | \ No newline at end of file diff --git a/docs/models/operations/getosanalyticsrequest.md b/docs/models/operations/getosanalyticsrequest.md index a34d6a0..c9322ca 100644 --- a/docs/models/operations/getosanalyticsrequest.md +++ b/docs/models/operations/getosanalyticsrequest.md @@ -9,7 +9,9 @@ | `key` | *string* | :heavy_minus_sign: | The short link slug. | | `linkId` | *string* | :heavy_minus_sign: | The unique ID of the short link on Dub. | | `externalId` | *string* | :heavy_minus_sign: | This is the ID of the link in the your database. Must be prefixed with 'ext_' when passed as a query parameter. | -| `interval` | [operations.GetOSAnalyticsQueryParamInterval](../../models/operations/getosanalyticsqueryparaminterval.md) | :heavy_minus_sign: | The interval to retrieve analytics for. | +| `interval` | [operations.GetOSAnalyticsQueryParamInterval](../../models/operations/getosanalyticsqueryparaminterval.md) | :heavy_minus_sign: | The interval to retrieve analytics for. Takes precedence over start and end. | +| `start` | *string* | :heavy_minus_sign: | The start date and time when to retrieve analytics from. | +| `end` | *string* | :heavy_minus_sign: | The end date and time when to retrieve analytics from. If not provided, defaults to the current date. | | `country` | [operations.GetOSAnalyticsQueryParamCountry](../../models/operations/getosanalyticsqueryparamcountry.md) | :heavy_minus_sign: | The country to retrieve analytics for. | | `city` | *string* | :heavy_minus_sign: | The city to retrieve analytics for. | | `device` | *string* | :heavy_minus_sign: | The device to retrieve analytics for. | diff --git a/docs/models/operations/getqrcoderequest.md b/docs/models/operations/getqrcoderequest.md index 30c3ee3..ebef683 100644 --- a/docs/models/operations/getqrcoderequest.md +++ b/docs/models/operations/getqrcoderequest.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | -| `url` | *string* | :heavy_minus_sign: | The URL to generate a QR code for. Defaults to `https://dub.co` if not provided. | +| `url` | *string* | :heavy_check_mark: | The URL to generate a QR code for. | | `size` | *number* | :heavy_minus_sign: | The size of the QR code in pixels. Defaults to `600` if not provided. | | `level` | [operations.Level](../../models/operations/level.md) | :heavy_minus_sign: | The level of error correction to use for the QR code. Defaults to `L` if not provided. | | `fgColor` | *string* | :heavy_minus_sign: | The foreground color of the QR code in hex format. Defaults to `#000000` if not provided. | diff --git a/docs/models/operations/getrefereranalyticsqueryparaminterval.md b/docs/models/operations/getrefereranalyticsqueryparaminterval.md index 6fbafd1..21b6bf0 100644 --- a/docs/models/operations/getrefereranalyticsqueryparaminterval.md +++ b/docs/models/operations/getrefereranalyticsqueryparaminterval.md @@ -1,6 +1,6 @@ # GetRefererAnalyticsQueryParamInterval -The interval to retrieve analytics for. +The interval to retrieve analytics for. Takes precedence over start and end. ## Values @@ -12,4 +12,6 @@ The interval to retrieve analytics for. | `Sevend` | 7d | | `Thirtyd` | 30d | | `Ninetyd` | 90d | +| `Ytd` | ytd | +| `Oney` | 1y | | `All` | all | \ No newline at end of file diff --git a/docs/models/operations/getrefereranalyticsrequest.md b/docs/models/operations/getrefereranalyticsrequest.md index 0929699..6cd4839 100644 --- a/docs/models/operations/getrefereranalyticsrequest.md +++ b/docs/models/operations/getrefereranalyticsrequest.md @@ -9,7 +9,9 @@ | `key` | *string* | :heavy_minus_sign: | The short link slug. | | `linkId` | *string* | :heavy_minus_sign: | The unique ID of the short link on Dub. | | `externalId` | *string* | :heavy_minus_sign: | This is the ID of the link in the your database. Must be prefixed with 'ext_' when passed as a query parameter. | -| `interval` | [operations.GetRefererAnalyticsQueryParamInterval](../../models/operations/getrefereranalyticsqueryparaminterval.md) | :heavy_minus_sign: | The interval to retrieve analytics for. | +| `interval` | [operations.GetRefererAnalyticsQueryParamInterval](../../models/operations/getrefereranalyticsqueryparaminterval.md) | :heavy_minus_sign: | The interval to retrieve analytics for. Takes precedence over start and end. | +| `start` | *string* | :heavy_minus_sign: | The start date and time when to retrieve analytics from. | +| `end` | *string* | :heavy_minus_sign: | The end date and time when to retrieve analytics from. If not provided, defaults to the current date. | | `country` | [operations.GetRefererAnalyticsQueryParamCountry](../../models/operations/getrefereranalyticsqueryparamcountry.md) | :heavy_minus_sign: | The country to retrieve analytics for. | | `city` | *string* | :heavy_minus_sign: | The city to retrieve analytics for. | | `device` | *string* | :heavy_minus_sign: | The device to retrieve analytics for. | diff --git a/docs/models/operations/gettimeseriesanalyticsrequest.md b/docs/models/operations/gettimeseriesanalyticsrequest.md index 0447384..1c6cf1b 100644 --- a/docs/models/operations/gettimeseriesanalyticsrequest.md +++ b/docs/models/operations/gettimeseriesanalyticsrequest.md @@ -9,7 +9,9 @@ | `key` | *string* | :heavy_minus_sign: | The short link slug. | | `linkId` | *string* | :heavy_minus_sign: | The unique ID of the short link on Dub. | | `externalId` | *string* | :heavy_minus_sign: | This is the ID of the link in the your database. Must be prefixed with 'ext_' when passed as a query parameter. | -| `interval` | [operations.QueryParamInterval](../../models/operations/queryparaminterval.md) | :heavy_minus_sign: | The interval to retrieve analytics for. | +| `interval` | [operations.QueryParamInterval](../../models/operations/queryparaminterval.md) | :heavy_minus_sign: | The interval to retrieve analytics for. Takes precedence over start and end. | +| `start` | *string* | :heavy_minus_sign: | The start date and time when to retrieve analytics from. | +| `end` | *string* | :heavy_minus_sign: | The end date and time when to retrieve analytics from. If not provided, defaults to the current date. | | `country` | [operations.QueryParamCountry](../../models/operations/queryparamcountry.md) | :heavy_minus_sign: | The country to retrieve analytics for. | | `city` | *string* | :heavy_minus_sign: | The city to retrieve analytics for. | | `device` | *string* | :heavy_minus_sign: | The device to retrieve analytics for. | diff --git a/docs/models/operations/gettoplinksqueryparaminterval.md b/docs/models/operations/gettoplinksqueryparaminterval.md index 4a16001..3deb6a2 100644 --- a/docs/models/operations/gettoplinksqueryparaminterval.md +++ b/docs/models/operations/gettoplinksqueryparaminterval.md @@ -1,6 +1,6 @@ # GetTopLinksQueryParamInterval -The interval to retrieve analytics for. +The interval to retrieve analytics for. Takes precedence over start and end. ## Values @@ -12,4 +12,6 @@ The interval to retrieve analytics for. | `Sevend` | 7d | | `Thirtyd` | 30d | | `Ninetyd` | 90d | +| `Ytd` | ytd | +| `Oney` | 1y | | `All` | all | \ No newline at end of file diff --git a/docs/models/operations/gettoplinksrequest.md b/docs/models/operations/gettoplinksrequest.md index 4121f0b..69a5089 100644 --- a/docs/models/operations/gettoplinksrequest.md +++ b/docs/models/operations/gettoplinksrequest.md @@ -9,7 +9,9 @@ | `key` | *string* | :heavy_minus_sign: | The short link slug. | | `linkId` | *string* | :heavy_minus_sign: | The unique ID of the short link on Dub. | | `externalId` | *string* | :heavy_minus_sign: | This is the ID of the link in the your database. Must be prefixed with 'ext_' when passed as a query parameter. | -| `interval` | [operations.GetTopLinksQueryParamInterval](../../models/operations/gettoplinksqueryparaminterval.md) | :heavy_minus_sign: | The interval to retrieve analytics for. | +| `interval` | [operations.GetTopLinksQueryParamInterval](../../models/operations/gettoplinksqueryparaminterval.md) | :heavy_minus_sign: | The interval to retrieve analytics for. Takes precedence over start and end. | +| `start` | *string* | :heavy_minus_sign: | The start date and time when to retrieve analytics from. | +| `end` | *string* | :heavy_minus_sign: | The end date and time when to retrieve analytics from. If not provided, defaults to the current date. | | `country` | [operations.GetTopLinksQueryParamCountry](../../models/operations/gettoplinksqueryparamcountry.md) | :heavy_minus_sign: | The country to retrieve analytics for. | | `city` | *string* | :heavy_minus_sign: | The city to retrieve analytics for. | | `device` | *string* | :heavy_minus_sign: | The device to retrieve analytics for. | diff --git a/docs/models/operations/gettopurlsqueryparaminterval.md b/docs/models/operations/gettopurlsqueryparaminterval.md index ce6c83f..a13d7fd 100644 --- a/docs/models/operations/gettopurlsqueryparaminterval.md +++ b/docs/models/operations/gettopurlsqueryparaminterval.md @@ -1,6 +1,6 @@ # GetTopURLsQueryParamInterval -The interval to retrieve analytics for. +The interval to retrieve analytics for. Takes precedence over start and end. ## Values @@ -12,4 +12,6 @@ The interval to retrieve analytics for. | `Sevend` | 7d | | `Thirtyd` | 30d | | `Ninetyd` | 90d | +| `Ytd` | ytd | +| `Oney` | 1y | | `All` | all | \ No newline at end of file diff --git a/docs/models/operations/gettopurlsrequest.md b/docs/models/operations/gettopurlsrequest.md index f9a6f12..070b491 100644 --- a/docs/models/operations/gettopurlsrequest.md +++ b/docs/models/operations/gettopurlsrequest.md @@ -9,7 +9,9 @@ | `key` | *string* | :heavy_minus_sign: | The short link slug. | | `linkId` | *string* | :heavy_minus_sign: | The unique ID of the short link on Dub. | | `externalId` | *string* | :heavy_minus_sign: | This is the ID of the link in the your database. Must be prefixed with 'ext_' when passed as a query parameter. | -| `interval` | [operations.GetTopURLsQueryParamInterval](../../models/operations/gettopurlsqueryparaminterval.md) | :heavy_minus_sign: | The interval to retrieve analytics for. | +| `interval` | [operations.GetTopURLsQueryParamInterval](../../models/operations/gettopurlsqueryparaminterval.md) | :heavy_minus_sign: | The interval to retrieve analytics for. Takes precedence over start and end. | +| `start` | *string* | :heavy_minus_sign: | The start date and time when to retrieve analytics from. | +| `end` | *string* | :heavy_minus_sign: | The end date and time when to retrieve analytics from. If not provided, defaults to the current date. | | `country` | [operations.GetTopURLsQueryParamCountry](../../models/operations/gettopurlsqueryparamcountry.md) | :heavy_minus_sign: | The country to retrieve analytics for. | | `city` | *string* | :heavy_minus_sign: | The city to retrieve analytics for. | | `device` | *string* | :heavy_minus_sign: | The device to retrieve analytics for. | diff --git a/docs/models/operations/interval.md b/docs/models/operations/interval.md index efa8f7c..a54d818 100644 --- a/docs/models/operations/interval.md +++ b/docs/models/operations/interval.md @@ -1,6 +1,6 @@ # Interval -The interval to retrieve analytics for. +The interval to retrieve analytics for. Takes precedence over start and end. ## Values @@ -12,4 +12,6 @@ The interval to retrieve analytics for. | `Sevend` | 7d | | `Thirtyd` | 30d | | `Ninetyd` | 90d | +| `Ytd` | ytd | +| `Oney` | 1y | | `All` | all | \ No newline at end of file diff --git a/docs/models/operations/queryparaminterval.md b/docs/models/operations/queryparaminterval.md index 0a9b632..0192e28 100644 --- a/docs/models/operations/queryparaminterval.md +++ b/docs/models/operations/queryparaminterval.md @@ -1,6 +1,6 @@ # QueryParamInterval -The interval to retrieve analytics for. +The interval to retrieve analytics for. Takes precedence over start and end. ## Values @@ -12,4 +12,6 @@ The interval to retrieve analytics for. | `Sevend` | 7d | | `Thirtyd` | 30d | | `Ninetyd` | 90d | +| `Ytd` | ytd | +| `Oney` | 1y | | `All` | all | \ No newline at end of file diff --git a/docs/models/operations/upsertlinkgeo.md b/docs/models/operations/upsertlinkgeo.md new file mode 100644 index 0000000..3ff84fe --- /dev/null +++ b/docs/models/operations/upsertlinkgeo.md @@ -0,0 +1,259 @@ +# UpsertLinkGeo + +Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `af` | *string* | :heavy_minus_sign: | N/A | +| `al` | *string* | :heavy_minus_sign: | N/A | +| `dz` | *string* | :heavy_minus_sign: | N/A | +| `as` | *string* | :heavy_minus_sign: | N/A | +| `ad` | *string* | :heavy_minus_sign: | N/A | +| `ao` | *string* | :heavy_minus_sign: | N/A | +| `ai` | *string* | :heavy_minus_sign: | N/A | +| `aq` | *string* | :heavy_minus_sign: | N/A | +| `ag` | *string* | :heavy_minus_sign: | N/A | +| `ar` | *string* | :heavy_minus_sign: | N/A | +| `am` | *string* | :heavy_minus_sign: | N/A | +| `aw` | *string* | :heavy_minus_sign: | N/A | +| `au` | *string* | :heavy_minus_sign: | N/A | +| `at` | *string* | :heavy_minus_sign: | N/A | +| `az` | *string* | :heavy_minus_sign: | N/A | +| `bs` | *string* | :heavy_minus_sign: | N/A | +| `bh` | *string* | :heavy_minus_sign: | N/A | +| `bd` | *string* | :heavy_minus_sign: | N/A | +| `bb` | *string* | :heavy_minus_sign: | N/A | +| `by` | *string* | :heavy_minus_sign: | N/A | +| `be` | *string* | :heavy_minus_sign: | N/A | +| `bz` | *string* | :heavy_minus_sign: | N/A | +| `bj` | *string* | :heavy_minus_sign: | N/A | +| `bm` | *string* | :heavy_minus_sign: | N/A | +| `bt` | *string* | :heavy_minus_sign: | N/A | +| `bo` | *string* | :heavy_minus_sign: | N/A | +| `ba` | *string* | :heavy_minus_sign: | N/A | +| `bw` | *string* | :heavy_minus_sign: | N/A | +| `bv` | *string* | :heavy_minus_sign: | N/A | +| `br` | *string* | :heavy_minus_sign: | N/A | +| `io` | *string* | :heavy_minus_sign: | N/A | +| `bn` | *string* | :heavy_minus_sign: | N/A | +| `bg` | *string* | :heavy_minus_sign: | N/A | +| `bf` | *string* | :heavy_minus_sign: | N/A | +| `bi` | *string* | :heavy_minus_sign: | N/A | +| `kh` | *string* | :heavy_minus_sign: | N/A | +| `cm` | *string* | :heavy_minus_sign: | N/A | +| `ca` | *string* | :heavy_minus_sign: | N/A | +| `cv` | *string* | :heavy_minus_sign: | N/A | +| `ky` | *string* | :heavy_minus_sign: | N/A | +| `cf` | *string* | :heavy_minus_sign: | N/A | +| `td` | *string* | :heavy_minus_sign: | N/A | +| `cl` | *string* | :heavy_minus_sign: | N/A | +| `cn` | *string* | :heavy_minus_sign: | N/A | +| `cx` | *string* | :heavy_minus_sign: | N/A | +| `cc` | *string* | :heavy_minus_sign: | N/A | +| `co` | *string* | :heavy_minus_sign: | N/A | +| `km` | *string* | :heavy_minus_sign: | N/A | +| `cg` | *string* | :heavy_minus_sign: | N/A | +| `cd` | *string* | :heavy_minus_sign: | N/A | +| `ck` | *string* | :heavy_minus_sign: | N/A | +| `cr` | *string* | :heavy_minus_sign: | N/A | +| `ci` | *string* | :heavy_minus_sign: | N/A | +| `hr` | *string* | :heavy_minus_sign: | N/A | +| `cu` | *string* | :heavy_minus_sign: | N/A | +| `cy` | *string* | :heavy_minus_sign: | N/A | +| `cz` | *string* | :heavy_minus_sign: | N/A | +| `dk` | *string* | :heavy_minus_sign: | N/A | +| `dj` | *string* | :heavy_minus_sign: | N/A | +| `dm` | *string* | :heavy_minus_sign: | N/A | +| `do` | *string* | :heavy_minus_sign: | N/A | +| `ec` | *string* | :heavy_minus_sign: | N/A | +| `eg` | *string* | :heavy_minus_sign: | N/A | +| `sv` | *string* | :heavy_minus_sign: | N/A | +| `gq` | *string* | :heavy_minus_sign: | N/A | +| `er` | *string* | :heavy_minus_sign: | N/A | +| `ee` | *string* | :heavy_minus_sign: | N/A | +| `et` | *string* | :heavy_minus_sign: | N/A | +| `fk` | *string* | :heavy_minus_sign: | N/A | +| `fo` | *string* | :heavy_minus_sign: | N/A | +| `fj` | *string* | :heavy_minus_sign: | N/A | +| `fi` | *string* | :heavy_minus_sign: | N/A | +| `fr` | *string* | :heavy_minus_sign: | N/A | +| `gf` | *string* | :heavy_minus_sign: | N/A | +| `pf` | *string* | :heavy_minus_sign: | N/A | +| `tf` | *string* | :heavy_minus_sign: | N/A | +| `ga` | *string* | :heavy_minus_sign: | N/A | +| `gm` | *string* | :heavy_minus_sign: | N/A | +| `ge` | *string* | :heavy_minus_sign: | N/A | +| `de` | *string* | :heavy_minus_sign: | N/A | +| `gh` | *string* | :heavy_minus_sign: | N/A | +| `gi` | *string* | :heavy_minus_sign: | N/A | +| `gr` | *string* | :heavy_minus_sign: | N/A | +| `gl` | *string* | :heavy_minus_sign: | N/A | +| `gd` | *string* | :heavy_minus_sign: | N/A | +| `gp` | *string* | :heavy_minus_sign: | N/A | +| `gu` | *string* | :heavy_minus_sign: | N/A | +| `gt` | *string* | :heavy_minus_sign: | N/A | +| `gn` | *string* | :heavy_minus_sign: | N/A | +| `gw` | *string* | :heavy_minus_sign: | N/A | +| `gy` | *string* | :heavy_minus_sign: | N/A | +| `ht` | *string* | :heavy_minus_sign: | N/A | +| `hm` | *string* | :heavy_minus_sign: | N/A | +| `va` | *string* | :heavy_minus_sign: | N/A | +| `hn` | *string* | :heavy_minus_sign: | N/A | +| `hk` | *string* | :heavy_minus_sign: | N/A | +| `hu` | *string* | :heavy_minus_sign: | N/A | +| `is` | *string* | :heavy_minus_sign: | N/A | +| `in` | *string* | :heavy_minus_sign: | N/A | +| `id` | *string* | :heavy_minus_sign: | N/A | +| `ir` | *string* | :heavy_minus_sign: | N/A | +| `iq` | *string* | :heavy_minus_sign: | N/A | +| `ie` | *string* | :heavy_minus_sign: | N/A | +| `il` | *string* | :heavy_minus_sign: | N/A | +| `it` | *string* | :heavy_minus_sign: | N/A | +| `jm` | *string* | :heavy_minus_sign: | N/A | +| `jp` | *string* | :heavy_minus_sign: | N/A | +| `jo` | *string* | :heavy_minus_sign: | N/A | +| `kz` | *string* | :heavy_minus_sign: | N/A | +| `ke` | *string* | :heavy_minus_sign: | N/A | +| `ki` | *string* | :heavy_minus_sign: | N/A | +| `kp` | *string* | :heavy_minus_sign: | N/A | +| `kr` | *string* | :heavy_minus_sign: | N/A | +| `kw` | *string* | :heavy_minus_sign: | N/A | +| `kg` | *string* | :heavy_minus_sign: | N/A | +| `la` | *string* | :heavy_minus_sign: | N/A | +| `lv` | *string* | :heavy_minus_sign: | N/A | +| `lb` | *string* | :heavy_minus_sign: | N/A | +| `ls` | *string* | :heavy_minus_sign: | N/A | +| `lr` | *string* | :heavy_minus_sign: | N/A | +| `ly` | *string* | :heavy_minus_sign: | N/A | +| `li` | *string* | :heavy_minus_sign: | N/A | +| `lt` | *string* | :heavy_minus_sign: | N/A | +| `lu` | *string* | :heavy_minus_sign: | N/A | +| `mo` | *string* | :heavy_minus_sign: | N/A | +| `mg` | *string* | :heavy_minus_sign: | N/A | +| `mw` | *string* | :heavy_minus_sign: | N/A | +| `my` | *string* | :heavy_minus_sign: | N/A | +| `mv` | *string* | :heavy_minus_sign: | N/A | +| `ml` | *string* | :heavy_minus_sign: | N/A | +| `mt` | *string* | :heavy_minus_sign: | N/A | +| `mh` | *string* | :heavy_minus_sign: | N/A | +| `mq` | *string* | :heavy_minus_sign: | N/A | +| `mr` | *string* | :heavy_minus_sign: | N/A | +| `mu` | *string* | :heavy_minus_sign: | N/A | +| `yt` | *string* | :heavy_minus_sign: | N/A | +| `mx` | *string* | :heavy_minus_sign: | N/A | +| `fm` | *string* | :heavy_minus_sign: | N/A | +| `md` | *string* | :heavy_minus_sign: | N/A | +| `mc` | *string* | :heavy_minus_sign: | N/A | +| `mn` | *string* | :heavy_minus_sign: | N/A | +| `ms` | *string* | :heavy_minus_sign: | N/A | +| `ma` | *string* | :heavy_minus_sign: | N/A | +| `mz` | *string* | :heavy_minus_sign: | N/A | +| `mm` | *string* | :heavy_minus_sign: | N/A | +| `na` | *string* | :heavy_minus_sign: | N/A | +| `nr` | *string* | :heavy_minus_sign: | N/A | +| `np` | *string* | :heavy_minus_sign: | N/A | +| `nl` | *string* | :heavy_minus_sign: | N/A | +| `nc` | *string* | :heavy_minus_sign: | N/A | +| `nz` | *string* | :heavy_minus_sign: | N/A | +| `ni` | *string* | :heavy_minus_sign: | N/A | +| `ne` | *string* | :heavy_minus_sign: | N/A | +| `ng` | *string* | :heavy_minus_sign: | N/A | +| `nu` | *string* | :heavy_minus_sign: | N/A | +| `nf` | *string* | :heavy_minus_sign: | N/A | +| `mk` | *string* | :heavy_minus_sign: | N/A | +| `mp` | *string* | :heavy_minus_sign: | N/A | +| `no` | *string* | :heavy_minus_sign: | N/A | +| `om` | *string* | :heavy_minus_sign: | N/A | +| `pk` | *string* | :heavy_minus_sign: | N/A | +| `pw` | *string* | :heavy_minus_sign: | N/A | +| `ps` | *string* | :heavy_minus_sign: | N/A | +| `pa` | *string* | :heavy_minus_sign: | N/A | +| `pg` | *string* | :heavy_minus_sign: | N/A | +| `py` | *string* | :heavy_minus_sign: | N/A | +| `pe` | *string* | :heavy_minus_sign: | N/A | +| `ph` | *string* | :heavy_minus_sign: | N/A | +| `pn` | *string* | :heavy_minus_sign: | N/A | +| `pl` | *string* | :heavy_minus_sign: | N/A | +| `pt` | *string* | :heavy_minus_sign: | N/A | +| `pr` | *string* | :heavy_minus_sign: | N/A | +| `qa` | *string* | :heavy_minus_sign: | N/A | +| `re` | *string* | :heavy_minus_sign: | N/A | +| `ro` | *string* | :heavy_minus_sign: | N/A | +| `ru` | *string* | :heavy_minus_sign: | N/A | +| `rw` | *string* | :heavy_minus_sign: | N/A | +| `sh` | *string* | :heavy_minus_sign: | N/A | +| `kn` | *string* | :heavy_minus_sign: | N/A | +| `lc` | *string* | :heavy_minus_sign: | N/A | +| `pm` | *string* | :heavy_minus_sign: | N/A | +| `vc` | *string* | :heavy_minus_sign: | N/A | +| `ws` | *string* | :heavy_minus_sign: | N/A | +| `sm` | *string* | :heavy_minus_sign: | N/A | +| `st` | *string* | :heavy_minus_sign: | N/A | +| `sa` | *string* | :heavy_minus_sign: | N/A | +| `sn` | *string* | :heavy_minus_sign: | N/A | +| `sc` | *string* | :heavy_minus_sign: | N/A | +| `sl` | *string* | :heavy_minus_sign: | N/A | +| `sg` | *string* | :heavy_minus_sign: | N/A | +| `sk` | *string* | :heavy_minus_sign: | N/A | +| `si` | *string* | :heavy_minus_sign: | N/A | +| `sb` | *string* | :heavy_minus_sign: | N/A | +| `so` | *string* | :heavy_minus_sign: | N/A | +| `za` | *string* | :heavy_minus_sign: | N/A | +| `gs` | *string* | :heavy_minus_sign: | N/A | +| `es` | *string* | :heavy_minus_sign: | N/A | +| `lk` | *string* | :heavy_minus_sign: | N/A | +| `sd` | *string* | :heavy_minus_sign: | N/A | +| `sr` | *string* | :heavy_minus_sign: | N/A | +| `sj` | *string* | :heavy_minus_sign: | N/A | +| `sz` | *string* | :heavy_minus_sign: | N/A | +| `se` | *string* | :heavy_minus_sign: | N/A | +| `ch` | *string* | :heavy_minus_sign: | N/A | +| `sy` | *string* | :heavy_minus_sign: | N/A | +| `tw` | *string* | :heavy_minus_sign: | N/A | +| `tj` | *string* | :heavy_minus_sign: | N/A | +| `tz` | *string* | :heavy_minus_sign: | N/A | +| `th` | *string* | :heavy_minus_sign: | N/A | +| `tl` | *string* | :heavy_minus_sign: | N/A | +| `tg` | *string* | :heavy_minus_sign: | N/A | +| `tk` | *string* | :heavy_minus_sign: | N/A | +| `to` | *string* | :heavy_minus_sign: | N/A | +| `tt` | *string* | :heavy_minus_sign: | N/A | +| `tn` | *string* | :heavy_minus_sign: | N/A | +| `tr` | *string* | :heavy_minus_sign: | N/A | +| `tm` | *string* | :heavy_minus_sign: | N/A | +| `tc` | *string* | :heavy_minus_sign: | N/A | +| `tv` | *string* | :heavy_minus_sign: | N/A | +| `ug` | *string* | :heavy_minus_sign: | N/A | +| `ua` | *string* | :heavy_minus_sign: | N/A | +| `ae` | *string* | :heavy_minus_sign: | N/A | +| `gb` | *string* | :heavy_minus_sign: | N/A | +| `us` | *string* | :heavy_minus_sign: | N/A | +| `um` | *string* | :heavy_minus_sign: | N/A | +| `uy` | *string* | :heavy_minus_sign: | N/A | +| `uz` | *string* | :heavy_minus_sign: | N/A | +| `vu` | *string* | :heavy_minus_sign: | N/A | +| `ve` | *string* | :heavy_minus_sign: | N/A | +| `vn` | *string* | :heavy_minus_sign: | N/A | +| `vg` | *string* | :heavy_minus_sign: | N/A | +| `vi` | *string* | :heavy_minus_sign: | N/A | +| `wf` | *string* | :heavy_minus_sign: | N/A | +| `eh` | *string* | :heavy_minus_sign: | N/A | +| `ye` | *string* | :heavy_minus_sign: | N/A | +| `zm` | *string* | :heavy_minus_sign: | N/A | +| `zw` | *string* | :heavy_minus_sign: | N/A | +| `ax` | *string* | :heavy_minus_sign: | N/A | +| `bq` | *string* | :heavy_minus_sign: | N/A | +| `cw` | *string* | :heavy_minus_sign: | N/A | +| `gg` | *string* | :heavy_minus_sign: | N/A | +| `im` | *string* | :heavy_minus_sign: | N/A | +| `je` | *string* | :heavy_minus_sign: | N/A | +| `me` | *string* | :heavy_minus_sign: | N/A | +| `bl` | *string* | :heavy_minus_sign: | N/A | +| `mf` | *string* | :heavy_minus_sign: | N/A | +| `rs` | *string* | :heavy_minus_sign: | N/A | +| `sx` | *string* | :heavy_minus_sign: | N/A | +| `ss` | *string* | :heavy_minus_sign: | N/A | +| `xk` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/upsertlinkrequestbody.md b/docs/models/operations/upsertlinkrequestbody.md new file mode 100644 index 0000000..b0e8e87 --- /dev/null +++ b/docs/models/operations/upsertlinkrequestbody.md @@ -0,0 +1,29 @@ +# UpsertLinkRequestBody + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `url` | *string* | :heavy_check_mark: | The destination URL of the short link. | https://google/com | +| `domain` | *string* | :heavy_minus_sign: | The domain of the short link. If not provided, the primary domain for the workspace will be used (or `dub.sh` if the workspace has no domains). | | +| `key` | *string* | :heavy_minus_sign: | The short link slug. If not provided, a random 7-character slug will be generated. | | +| `externalId` | *string* | :heavy_minus_sign: | This is the ID of the link in your database. If set, it can be used to identify the link in the future. Must be prefixed with `ext_` when passed as a query parameter. | 123456 | +| `prefix` | *string* | :heavy_minus_sign: | The prefix of the short link slug for randomly-generated keys (e.g. if prefix is `/c/`, generated keys will be in the `/c/:key` format). Will be ignored if `key` is provided. | | +| `archived` | *boolean* | :heavy_minus_sign: | Whether the short link is archived. | | +| `publicStats` | *boolean* | :heavy_minus_sign: | Whether the short link's stats are publicly accessible. | | +| ~~`tagId`~~ | *string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

The unique ID of the tag assigned to the short link. This field is deprecated – use `tagIds` instead. | | +| `tagIds` | *operations.UpsertLinkTagIds* | :heavy_minus_sign: | The unique IDs of the tags assigned to the short link. | [
"clux0rgak00011..."
] | +| `tagNames` | *operations.UpsertLinkTagNames* | :heavy_minus_sign: | The unique name of the tags assigned to the short link (case insensitive). | | +| `comments` | *string* | :heavy_minus_sign: | The comments for the short link. | | +| `expiresAt` | *string* | :heavy_minus_sign: | The date and time when the short link will expire at. | | +| `expiredUrl` | *string* | :heavy_minus_sign: | The URL to redirect to when the short link has expired. | | +| `password` | *string* | :heavy_minus_sign: | The password required to access the destination URL of the short link. | | +| `proxy` | *boolean* | :heavy_minus_sign: | Whether the short link uses Custom Social Media Cards feature. | | +| `title` | *string* | :heavy_minus_sign: | The title of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | +| `description` | *string* | :heavy_minus_sign: | The description of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | +| `image` | *string* | :heavy_minus_sign: | The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | +| `rewrite` | *boolean* | :heavy_minus_sign: | Whether the short link uses link cloaking. | | +| `ios` | *string* | :heavy_minus_sign: | The iOS destination URL for the short link for iOS device targeting. | | +| `android` | *string* | :heavy_minus_sign: | The Android destination URL for the short link for Android device targeting. | | +| `geo` | [operations.UpsertLinkGeo](../../models/operations/upsertlinkgeo.md) | :heavy_minus_sign: | Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. | | \ No newline at end of file diff --git a/docs/models/operations/upsertlinktagids.md b/docs/models/operations/upsertlinktagids.md new file mode 100644 index 0000000..3516e4c --- /dev/null +++ b/docs/models/operations/upsertlinktagids.md @@ -0,0 +1,4 @@ +# UpsertLinkTagIds + +The unique IDs of the tags assigned to the short link. + diff --git a/docs/models/operations/upsertlinktagnames.md b/docs/models/operations/upsertlinktagnames.md new file mode 100644 index 0000000..aa7e638 --- /dev/null +++ b/docs/models/operations/upsertlinktagnames.md @@ -0,0 +1,4 @@ +# UpsertLinkTagNames + +The unique name of the tags assigned to the short link (case insensitive). + diff --git a/docs/sdks/links/README.md b/docs/sdks/links/README.md index 9b3c0ad..7d3b93a 100644 --- a/docs/sdks/links/README.md +++ b/docs/sdks/links/README.md @@ -10,6 +10,7 @@ * [delete](#delete) - Delete a link * [update](#update) - Update a link * [createMany](#createmany) - Bulk create links +* [upsert](#upsert) - Upsert a link ## list @@ -270,7 +271,7 @@ run(); ## update -Update a link for the authenticated workspace. +Update a link for the authenticated workspace. If there's no change, returns as is. ### Example Usage @@ -376,3 +377,56 @@ run(); | errors.RateLimitExceeded | 429 | application/json | | errors.InternalServerError | 500 | application/json | | errors.SDKError | 4xx-5xx | */* | + +## upsert + +Upsert a link for the authenticated workspace by its URL. If a link with the same URL already exists, returns as is if there's no change, or update it. Otherwise, a new link will be created. + +### Example Usage + +```typescript +import { Dub } from "dub"; + +const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", +}); + +async function run() { + const result = await dub.links.upsert({ + url: "https://google/com", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.UpsertLinkRequestBody](../../models/operations/upsertlinkrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | + + +### Response + +**Promise<[components.LinkSchema](../../models/components/linkschema.md)>** +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.Conflict | 409 | application/json | +| errors.InviteExpired | 410 | application/json | +| errors.UnprocessableEntity | 422 | application/json | +| errors.RateLimitExceeded | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/qrcodes/README.md b/docs/sdks/qrcodes/README.md index 6197988..5e7ea6a 100644 --- a/docs/sdks/qrcodes/README.md +++ b/docs/sdks/qrcodes/README.md @@ -20,7 +20,9 @@ const dub = new Dub({ }); async function run() { - const result = await dub.qrCodes.get({}); + const result = await dub.qrCodes.get({ + url: "https://brief-micronutrient.org", + }); // Handle the result console.log(result) diff --git a/jsr.json b/jsr.json index efe42b6..43c5a51 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "dub", - "version": "0.29.0", + "version": "0.29.1", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index 45135a1..d5b19f6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "dub", - "version": "0.29.0", + "version": "0.29.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "dub", - "version": "0.29.0", + "version": "0.29.1", "devDependencies": { "@types/jsonpath": "^0.2.4", "@types/node": "^20.12.7", diff --git a/package.json b/package.json index 0aa9abb..aef3997 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dub", - "version": "0.29.0", + "version": "0.29.1", "author": "Dub", "main": "./index.js", "sideEffects": false, diff --git a/src/lib/config.ts b/src/lib/config.ts index e157cc1..d60376b 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -64,7 +64,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "0.0.1", - sdkVersion: "0.29.0", + sdkVersion: "0.29.1", genVersion: "2.326.3", - userAgent: "speakeasy-sdk/typescript 0.29.0 2.326.3 0.0.1 dub", + userAgent: "speakeasy-sdk/typescript 0.29.1 2.326.3 0.0.1 dub", } as const; diff --git a/src/models/operations/getbrowseranalytics.ts b/src/models/operations/getbrowseranalytics.ts index d2887a5..5c5de24 100644 --- a/src/models/operations/getbrowseranalytics.ts +++ b/src/models/operations/getbrowseranalytics.ts @@ -5,7 +5,7 @@ import * as z from "zod"; /** - * The interval to retrieve analytics for. + * The interval to retrieve analytics for. Takes precedence over start and end. */ export const GetBrowserAnalyticsQueryParamInterval = { Oneh: "1h", @@ -13,10 +13,12 @@ export const GetBrowserAnalyticsQueryParamInterval = { Sevend: "7d", Thirtyd: "30d", Ninetyd: "90d", + Ytd: "ytd", + Oney: "1y", All: "all", } as const; /** - * The interval to retrieve analytics for. + * The interval to retrieve analytics for. Takes precedence over start and end. */ export type GetBrowserAnalyticsQueryParamInterval = (typeof GetBrowserAnalyticsQueryParamInterval)[keyof typeof GetBrowserAnalyticsQueryParamInterval]; @@ -300,9 +302,17 @@ export type GetBrowserAnalyticsRequest = { */ externalId?: string | undefined; /** - * The interval to retrieve analytics for. + * The interval to retrieve analytics for. Takes precedence over start and end. */ interval?: GetBrowserAnalyticsQueryParamInterval | undefined; + /** + * The start date and time when to retrieve analytics from. + */ + start?: string | undefined; + /** + * The end date and time when to retrieve analytics from. If not provided, defaults to the current date. + */ + end?: string | undefined; /** * The country to retrieve analytics for. */ @@ -374,6 +384,8 @@ export namespace GetBrowserAnalyticsRequest$ { linkId?: string | undefined; externalId?: string | undefined; interval?: GetBrowserAnalyticsQueryParamInterval | undefined; + start?: string | undefined; + end?: string | undefined; country?: GetBrowserAnalyticsQueryParamCountry | undefined; city?: string | undefined; device?: string | undefined; @@ -393,6 +405,8 @@ export namespace GetBrowserAnalyticsRequest$ { linkId: z.string().optional(), externalId: z.string().optional(), interval: GetBrowserAnalyticsQueryParamInterval$.optional(), + start: z.string().optional(), + end: z.string().optional(), country: GetBrowserAnalyticsQueryParamCountry$.optional(), city: z.string().optional(), device: z.string().optional(), @@ -411,6 +425,8 @@ export namespace GetBrowserAnalyticsRequest$ { ...(v.linkId === undefined ? null : { linkId: v.linkId }), ...(v.externalId === undefined ? null : { externalId: v.externalId }), ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.start === undefined ? null : { start: v.start }), + ...(v.end === undefined ? null : { end: v.end }), ...(v.country === undefined ? null : { country: v.country }), ...(v.city === undefined ? null : { city: v.city }), ...(v.device === undefined ? null : { device: v.device }), @@ -430,6 +446,8 @@ export namespace GetBrowserAnalyticsRequest$ { linkId?: string | undefined; externalId?: string | undefined; interval?: GetBrowserAnalyticsQueryParamInterval | undefined; + start?: string | undefined; + end?: string | undefined; country?: GetBrowserAnalyticsQueryParamCountry | undefined; city?: string | undefined; device?: string | undefined; @@ -449,6 +467,8 @@ export namespace GetBrowserAnalyticsRequest$ { linkId: z.string().optional(), externalId: z.string().optional(), interval: GetBrowserAnalyticsQueryParamInterval$.optional(), + start: z.string().optional(), + end: z.string().optional(), country: GetBrowserAnalyticsQueryParamCountry$.optional(), city: z.string().optional(), device: z.string().optional(), @@ -467,6 +487,8 @@ export namespace GetBrowserAnalyticsRequest$ { ...(v.linkId === undefined ? null : { linkId: v.linkId }), ...(v.externalId === undefined ? null : { externalId: v.externalId }), ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.start === undefined ? null : { start: v.start }), + ...(v.end === undefined ? null : { end: v.end }), ...(v.country === undefined ? null : { country: v.country }), ...(v.city === undefined ? null : { city: v.city }), ...(v.device === undefined ? null : { device: v.device }), diff --git a/src/models/operations/getcityanalytics.ts b/src/models/operations/getcityanalytics.ts index 2dbb14d..79d0775 100644 --- a/src/models/operations/getcityanalytics.ts +++ b/src/models/operations/getcityanalytics.ts @@ -5,7 +5,7 @@ import * as z from "zod"; /** - * The interval to retrieve analytics for. + * The interval to retrieve analytics for. Takes precedence over start and end. */ export const GetCityAnalyticsQueryParamInterval = { Oneh: "1h", @@ -13,10 +13,12 @@ export const GetCityAnalyticsQueryParamInterval = { Sevend: "7d", Thirtyd: "30d", Ninetyd: "90d", + Ytd: "ytd", + Oney: "1y", All: "all", } as const; /** - * The interval to retrieve analytics for. + * The interval to retrieve analytics for. Takes precedence over start and end. */ export type GetCityAnalyticsQueryParamInterval = (typeof GetCityAnalyticsQueryParamInterval)[keyof typeof GetCityAnalyticsQueryParamInterval]; @@ -300,9 +302,17 @@ export type GetCityAnalyticsRequest = { */ externalId?: string | undefined; /** - * The interval to retrieve analytics for. + * The interval to retrieve analytics for. Takes precedence over start and end. */ interval?: GetCityAnalyticsQueryParamInterval | undefined; + /** + * The start date and time when to retrieve analytics from. + */ + start?: string | undefined; + /** + * The end date and time when to retrieve analytics from. If not provided, defaults to the current date. + */ + end?: string | undefined; /** * The country to retrieve analytics for. */ @@ -639,6 +649,8 @@ export namespace GetCityAnalyticsRequest$ { linkId?: string | undefined; externalId?: string | undefined; interval?: GetCityAnalyticsQueryParamInterval | undefined; + start?: string | undefined; + end?: string | undefined; country?: GetCityAnalyticsQueryParamCountry | undefined; city?: string | undefined; device?: string | undefined; @@ -658,6 +670,8 @@ export namespace GetCityAnalyticsRequest$ { linkId: z.string().optional(), externalId: z.string().optional(), interval: GetCityAnalyticsQueryParamInterval$.optional(), + start: z.string().optional(), + end: z.string().optional(), country: GetCityAnalyticsQueryParamCountry$.optional(), city: z.string().optional(), device: z.string().optional(), @@ -676,6 +690,8 @@ export namespace GetCityAnalyticsRequest$ { ...(v.linkId === undefined ? null : { linkId: v.linkId }), ...(v.externalId === undefined ? null : { externalId: v.externalId }), ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.start === undefined ? null : { start: v.start }), + ...(v.end === undefined ? null : { end: v.end }), ...(v.country === undefined ? null : { country: v.country }), ...(v.city === undefined ? null : { city: v.city }), ...(v.device === undefined ? null : { device: v.device }), @@ -695,6 +711,8 @@ export namespace GetCityAnalyticsRequest$ { linkId?: string | undefined; externalId?: string | undefined; interval?: GetCityAnalyticsQueryParamInterval | undefined; + start?: string | undefined; + end?: string | undefined; country?: GetCityAnalyticsQueryParamCountry | undefined; city?: string | undefined; device?: string | undefined; @@ -714,6 +732,8 @@ export namespace GetCityAnalyticsRequest$ { linkId: z.string().optional(), externalId: z.string().optional(), interval: GetCityAnalyticsQueryParamInterval$.optional(), + start: z.string().optional(), + end: z.string().optional(), country: GetCityAnalyticsQueryParamCountry$.optional(), city: z.string().optional(), device: z.string().optional(), @@ -732,6 +752,8 @@ export namespace GetCityAnalyticsRequest$ { ...(v.linkId === undefined ? null : { linkId: v.linkId }), ...(v.externalId === undefined ? null : { externalId: v.externalId }), ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.start === undefined ? null : { start: v.start }), + ...(v.end === undefined ? null : { end: v.end }), ...(v.country === undefined ? null : { country: v.country }), ...(v.city === undefined ? null : { city: v.city }), ...(v.device === undefined ? null : { device: v.device }), diff --git a/src/models/operations/getclicksanalytics.ts b/src/models/operations/getclicksanalytics.ts index f433112..1036647 100644 --- a/src/models/operations/getclicksanalytics.ts +++ b/src/models/operations/getclicksanalytics.ts @@ -5,7 +5,7 @@ import * as z from "zod"; /** - * The interval to retrieve analytics for. + * The interval to retrieve analytics for. Takes precedence over start and end. */ export const Interval = { Oneh: "1h", @@ -13,10 +13,12 @@ export const Interval = { Sevend: "7d", Thirtyd: "30d", Ninetyd: "90d", + Ytd: "ytd", + Oney: "1y", All: "all", } as const; /** - * The interval to retrieve analytics for. + * The interval to retrieve analytics for. Takes precedence over start and end. */ export type Interval = (typeof Interval)[keyof typeof Interval]; @@ -298,9 +300,17 @@ export type GetClicksAnalyticsRequest = { */ externalId?: string | undefined; /** - * The interval to retrieve analytics for. + * The interval to retrieve analytics for. Takes precedence over start and end. */ interval?: Interval | undefined; + /** + * The start date and time when to retrieve analytics from. + */ + start?: string | undefined; + /** + * The end date and time when to retrieve analytics from. If not provided, defaults to the current date. + */ + end?: string | undefined; /** * The country to retrieve analytics for. */ @@ -357,6 +367,8 @@ export namespace GetClicksAnalyticsRequest$ { linkId?: string | undefined; externalId?: string | undefined; interval?: Interval | undefined; + start?: string | undefined; + end?: string | undefined; country?: Country | undefined; city?: string | undefined; device?: string | undefined; @@ -376,6 +388,8 @@ export namespace GetClicksAnalyticsRequest$ { linkId: z.string().optional(), externalId: z.string().optional(), interval: Interval$.optional(), + start: z.string().optional(), + end: z.string().optional(), country: Country$.optional(), city: z.string().optional(), device: z.string().optional(), @@ -394,6 +408,8 @@ export namespace GetClicksAnalyticsRequest$ { ...(v.linkId === undefined ? null : { linkId: v.linkId }), ...(v.externalId === undefined ? null : { externalId: v.externalId }), ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.start === undefined ? null : { start: v.start }), + ...(v.end === undefined ? null : { end: v.end }), ...(v.country === undefined ? null : { country: v.country }), ...(v.city === undefined ? null : { city: v.city }), ...(v.device === undefined ? null : { device: v.device }), @@ -413,6 +429,8 @@ export namespace GetClicksAnalyticsRequest$ { linkId?: string | undefined; externalId?: string | undefined; interval?: Interval | undefined; + start?: string | undefined; + end?: string | undefined; country?: Country | undefined; city?: string | undefined; device?: string | undefined; @@ -432,6 +450,8 @@ export namespace GetClicksAnalyticsRequest$ { linkId: z.string().optional(), externalId: z.string().optional(), interval: Interval$.optional(), + start: z.string().optional(), + end: z.string().optional(), country: Country$.optional(), city: z.string().optional(), device: z.string().optional(), @@ -450,6 +470,8 @@ export namespace GetClicksAnalyticsRequest$ { ...(v.linkId === undefined ? null : { linkId: v.linkId }), ...(v.externalId === undefined ? null : { externalId: v.externalId }), ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.start === undefined ? null : { start: v.start }), + ...(v.end === undefined ? null : { end: v.end }), ...(v.country === undefined ? null : { country: v.country }), ...(v.city === undefined ? null : { city: v.city }), ...(v.device === undefined ? null : { device: v.device }), diff --git a/src/models/operations/getcountryanalytics.ts b/src/models/operations/getcountryanalytics.ts index 6cc4fb4..f4e45be 100644 --- a/src/models/operations/getcountryanalytics.ts +++ b/src/models/operations/getcountryanalytics.ts @@ -5,7 +5,7 @@ import * as z from "zod"; /** - * The interval to retrieve analytics for. + * The interval to retrieve analytics for. Takes precedence over start and end. */ export const GetCountryAnalyticsQueryParamInterval = { Oneh: "1h", @@ -13,10 +13,12 @@ export const GetCountryAnalyticsQueryParamInterval = { Sevend: "7d", Thirtyd: "30d", Ninetyd: "90d", + Ytd: "ytd", + Oney: "1y", All: "all", } as const; /** - * The interval to retrieve analytics for. + * The interval to retrieve analytics for. Takes precedence over start and end. */ export type GetCountryAnalyticsQueryParamInterval = (typeof GetCountryAnalyticsQueryParamInterval)[keyof typeof GetCountryAnalyticsQueryParamInterval]; @@ -300,9 +302,17 @@ export type GetCountryAnalyticsRequest = { */ externalId?: string | undefined; /** - * The interval to retrieve analytics for. + * The interval to retrieve analytics for. Takes precedence over start and end. */ interval?: GetCountryAnalyticsQueryParamInterval | undefined; + /** + * The start date and time when to retrieve analytics from. + */ + start?: string | undefined; + /** + * The end date and time when to retrieve analytics from. If not provided, defaults to the current date. + */ + end?: string | undefined; /** * The country to retrieve analytics for. */ @@ -635,6 +645,8 @@ export namespace GetCountryAnalyticsRequest$ { linkId?: string | undefined; externalId?: string | undefined; interval?: GetCountryAnalyticsQueryParamInterval | undefined; + start?: string | undefined; + end?: string | undefined; country?: GetCountryAnalyticsQueryParamCountry | undefined; city?: string | undefined; device?: string | undefined; @@ -654,6 +666,8 @@ export namespace GetCountryAnalyticsRequest$ { linkId: z.string().optional(), externalId: z.string().optional(), interval: GetCountryAnalyticsQueryParamInterval$.optional(), + start: z.string().optional(), + end: z.string().optional(), country: GetCountryAnalyticsQueryParamCountry$.optional(), city: z.string().optional(), device: z.string().optional(), @@ -672,6 +686,8 @@ export namespace GetCountryAnalyticsRequest$ { ...(v.linkId === undefined ? null : { linkId: v.linkId }), ...(v.externalId === undefined ? null : { externalId: v.externalId }), ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.start === undefined ? null : { start: v.start }), + ...(v.end === undefined ? null : { end: v.end }), ...(v.country === undefined ? null : { country: v.country }), ...(v.city === undefined ? null : { city: v.city }), ...(v.device === undefined ? null : { device: v.device }), @@ -691,6 +707,8 @@ export namespace GetCountryAnalyticsRequest$ { linkId?: string | undefined; externalId?: string | undefined; interval?: GetCountryAnalyticsQueryParamInterval | undefined; + start?: string | undefined; + end?: string | undefined; country?: GetCountryAnalyticsQueryParamCountry | undefined; city?: string | undefined; device?: string | undefined; @@ -710,6 +728,8 @@ export namespace GetCountryAnalyticsRequest$ { linkId: z.string().optional(), externalId: z.string().optional(), interval: GetCountryAnalyticsQueryParamInterval$.optional(), + start: z.string().optional(), + end: z.string().optional(), country: GetCountryAnalyticsQueryParamCountry$.optional(), city: z.string().optional(), device: z.string().optional(), @@ -728,6 +748,8 @@ export namespace GetCountryAnalyticsRequest$ { ...(v.linkId === undefined ? null : { linkId: v.linkId }), ...(v.externalId === undefined ? null : { externalId: v.externalId }), ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.start === undefined ? null : { start: v.start }), + ...(v.end === undefined ? null : { end: v.end }), ...(v.country === undefined ? null : { country: v.country }), ...(v.city === undefined ? null : { city: v.city }), ...(v.device === undefined ? null : { device: v.device }), diff --git a/src/models/operations/getdeviceanalytics.ts b/src/models/operations/getdeviceanalytics.ts index 5d6f5df..81ff80a 100644 --- a/src/models/operations/getdeviceanalytics.ts +++ b/src/models/operations/getdeviceanalytics.ts @@ -5,7 +5,7 @@ import * as z from "zod"; /** - * The interval to retrieve analytics for. + * The interval to retrieve analytics for. Takes precedence over start and end. */ export const GetDeviceAnalyticsQueryParamInterval = { Oneh: "1h", @@ -13,10 +13,12 @@ export const GetDeviceAnalyticsQueryParamInterval = { Sevend: "7d", Thirtyd: "30d", Ninetyd: "90d", + Ytd: "ytd", + Oney: "1y", All: "all", } as const; /** - * The interval to retrieve analytics for. + * The interval to retrieve analytics for. Takes precedence over start and end. */ export type GetDeviceAnalyticsQueryParamInterval = (typeof GetDeviceAnalyticsQueryParamInterval)[keyof typeof GetDeviceAnalyticsQueryParamInterval]; @@ -300,9 +302,17 @@ export type GetDeviceAnalyticsRequest = { */ externalId?: string | undefined; /** - * The interval to retrieve analytics for. + * The interval to retrieve analytics for. Takes precedence over start and end. */ interval?: GetDeviceAnalyticsQueryParamInterval | undefined; + /** + * The start date and time when to retrieve analytics from. + */ + start?: string | undefined; + /** + * The end date and time when to retrieve analytics from. If not provided, defaults to the current date. + */ + end?: string | undefined; /** * The country to retrieve analytics for. */ @@ -374,6 +384,8 @@ export namespace GetDeviceAnalyticsRequest$ { linkId?: string | undefined; externalId?: string | undefined; interval?: GetDeviceAnalyticsQueryParamInterval | undefined; + start?: string | undefined; + end?: string | undefined; country?: GetDeviceAnalyticsQueryParamCountry | undefined; city?: string | undefined; device?: string | undefined; @@ -393,6 +405,8 @@ export namespace GetDeviceAnalyticsRequest$ { linkId: z.string().optional(), externalId: z.string().optional(), interval: GetDeviceAnalyticsQueryParamInterval$.optional(), + start: z.string().optional(), + end: z.string().optional(), country: GetDeviceAnalyticsQueryParamCountry$.optional(), city: z.string().optional(), device: z.string().optional(), @@ -411,6 +425,8 @@ export namespace GetDeviceAnalyticsRequest$ { ...(v.linkId === undefined ? null : { linkId: v.linkId }), ...(v.externalId === undefined ? null : { externalId: v.externalId }), ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.start === undefined ? null : { start: v.start }), + ...(v.end === undefined ? null : { end: v.end }), ...(v.country === undefined ? null : { country: v.country }), ...(v.city === undefined ? null : { city: v.city }), ...(v.device === undefined ? null : { device: v.device }), @@ -430,6 +446,8 @@ export namespace GetDeviceAnalyticsRequest$ { linkId?: string | undefined; externalId?: string | undefined; interval?: GetDeviceAnalyticsQueryParamInterval | undefined; + start?: string | undefined; + end?: string | undefined; country?: GetDeviceAnalyticsQueryParamCountry | undefined; city?: string | undefined; device?: string | undefined; @@ -449,6 +467,8 @@ export namespace GetDeviceAnalyticsRequest$ { linkId: z.string().optional(), externalId: z.string().optional(), interval: GetDeviceAnalyticsQueryParamInterval$.optional(), + start: z.string().optional(), + end: z.string().optional(), country: GetDeviceAnalyticsQueryParamCountry$.optional(), city: z.string().optional(), device: z.string().optional(), @@ -467,6 +487,8 @@ export namespace GetDeviceAnalyticsRequest$ { ...(v.linkId === undefined ? null : { linkId: v.linkId }), ...(v.externalId === undefined ? null : { externalId: v.externalId }), ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.start === undefined ? null : { start: v.start }), + ...(v.end === undefined ? null : { end: v.end }), ...(v.country === undefined ? null : { country: v.country }), ...(v.city === undefined ? null : { city: v.city }), ...(v.device === undefined ? null : { device: v.device }), diff --git a/src/models/operations/getosanalytics.ts b/src/models/operations/getosanalytics.ts index 04ef439..2319685 100644 --- a/src/models/operations/getosanalytics.ts +++ b/src/models/operations/getosanalytics.ts @@ -5,7 +5,7 @@ import * as z from "zod"; /** - * The interval to retrieve analytics for. + * The interval to retrieve analytics for. Takes precedence over start and end. */ export const GetOSAnalyticsQueryParamInterval = { Oneh: "1h", @@ -13,10 +13,12 @@ export const GetOSAnalyticsQueryParamInterval = { Sevend: "7d", Thirtyd: "30d", Ninetyd: "90d", + Ytd: "ytd", + Oney: "1y", All: "all", } as const; /** - * The interval to retrieve analytics for. + * The interval to retrieve analytics for. Takes precedence over start and end. */ export type GetOSAnalyticsQueryParamInterval = (typeof GetOSAnalyticsQueryParamInterval)[keyof typeof GetOSAnalyticsQueryParamInterval]; @@ -300,9 +302,17 @@ export type GetOSAnalyticsRequest = { */ externalId?: string | undefined; /** - * The interval to retrieve analytics for. + * The interval to retrieve analytics for. Takes precedence over start and end. */ interval?: GetOSAnalyticsQueryParamInterval | undefined; + /** + * The start date and time when to retrieve analytics from. + */ + start?: string | undefined; + /** + * The end date and time when to retrieve analytics from. If not provided, defaults to the current date. + */ + end?: string | undefined; /** * The country to retrieve analytics for. */ @@ -374,6 +384,8 @@ export namespace GetOSAnalyticsRequest$ { linkId?: string | undefined; externalId?: string | undefined; interval?: GetOSAnalyticsQueryParamInterval | undefined; + start?: string | undefined; + end?: string | undefined; country?: GetOSAnalyticsQueryParamCountry | undefined; city?: string | undefined; device?: string | undefined; @@ -393,6 +405,8 @@ export namespace GetOSAnalyticsRequest$ { linkId: z.string().optional(), externalId: z.string().optional(), interval: GetOSAnalyticsQueryParamInterval$.optional(), + start: z.string().optional(), + end: z.string().optional(), country: GetOSAnalyticsQueryParamCountry$.optional(), city: z.string().optional(), device: z.string().optional(), @@ -411,6 +425,8 @@ export namespace GetOSAnalyticsRequest$ { ...(v.linkId === undefined ? null : { linkId: v.linkId }), ...(v.externalId === undefined ? null : { externalId: v.externalId }), ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.start === undefined ? null : { start: v.start }), + ...(v.end === undefined ? null : { end: v.end }), ...(v.country === undefined ? null : { country: v.country }), ...(v.city === undefined ? null : { city: v.city }), ...(v.device === undefined ? null : { device: v.device }), @@ -430,6 +446,8 @@ export namespace GetOSAnalyticsRequest$ { linkId?: string | undefined; externalId?: string | undefined; interval?: GetOSAnalyticsQueryParamInterval | undefined; + start?: string | undefined; + end?: string | undefined; country?: GetOSAnalyticsQueryParamCountry | undefined; city?: string | undefined; device?: string | undefined; @@ -449,6 +467,8 @@ export namespace GetOSAnalyticsRequest$ { linkId: z.string().optional(), externalId: z.string().optional(), interval: GetOSAnalyticsQueryParamInterval$.optional(), + start: z.string().optional(), + end: z.string().optional(), country: GetOSAnalyticsQueryParamCountry$.optional(), city: z.string().optional(), device: z.string().optional(), @@ -467,6 +487,8 @@ export namespace GetOSAnalyticsRequest$ { ...(v.linkId === undefined ? null : { linkId: v.linkId }), ...(v.externalId === undefined ? null : { externalId: v.externalId }), ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.start === undefined ? null : { start: v.start }), + ...(v.end === undefined ? null : { end: v.end }), ...(v.country === undefined ? null : { country: v.country }), ...(v.city === undefined ? null : { city: v.city }), ...(v.device === undefined ? null : { device: v.device }), diff --git a/src/models/operations/getqrcode.ts b/src/models/operations/getqrcode.ts index 579774b..d514d50 100644 --- a/src/models/operations/getqrcode.ts +++ b/src/models/operations/getqrcode.ts @@ -20,9 +20,9 @@ export type Level = (typeof Level)[keyof typeof Level]; export type GetQRCodeRequest = { /** - * The URL to generate a QR code for. Defaults to `https://dub.co` if not provided. + * The URL to generate a QR code for. */ - url?: string | undefined; + url: string; /** * The size of the QR code in pixels. Defaults to `600` if not provided. */ @@ -51,7 +51,7 @@ export const Level$: z.ZodNativeEnum = z.nativeEnum(Level); /** @internal */ export namespace GetQRCodeRequest$ { export type Inbound = { - url?: string | undefined; + url: string; size?: number | undefined; level?: Level | undefined; fgColor?: string | undefined; @@ -61,7 +61,7 @@ export namespace GetQRCodeRequest$ { export const inboundSchema: z.ZodType = z .object({ - url: z.string().default("https://dub.co"), + url: z.string(), size: z.number().default(600), level: Level$.default("L"), fgColor: z.string().default("#000000"), @@ -90,7 +90,7 @@ export namespace GetQRCodeRequest$ { export const outboundSchema: z.ZodType = z .object({ - url: z.string().default("https://dub.co"), + url: z.string(), size: z.number().default(600), level: Level$.default("L"), fgColor: z.string().default("#000000"), diff --git a/src/models/operations/getrefereranalytics.ts b/src/models/operations/getrefereranalytics.ts index 2509df2..82b67c8 100644 --- a/src/models/operations/getrefereranalytics.ts +++ b/src/models/operations/getrefereranalytics.ts @@ -5,7 +5,7 @@ import * as z from "zod"; /** - * The interval to retrieve analytics for. + * The interval to retrieve analytics for. Takes precedence over start and end. */ export const GetRefererAnalyticsQueryParamInterval = { Oneh: "1h", @@ -13,10 +13,12 @@ export const GetRefererAnalyticsQueryParamInterval = { Sevend: "7d", Thirtyd: "30d", Ninetyd: "90d", + Ytd: "ytd", + Oney: "1y", All: "all", } as const; /** - * The interval to retrieve analytics for. + * The interval to retrieve analytics for. Takes precedence over start and end. */ export type GetRefererAnalyticsQueryParamInterval = (typeof GetRefererAnalyticsQueryParamInterval)[keyof typeof GetRefererAnalyticsQueryParamInterval]; @@ -300,9 +302,17 @@ export type GetRefererAnalyticsRequest = { */ externalId?: string | undefined; /** - * The interval to retrieve analytics for. + * The interval to retrieve analytics for. Takes precedence over start and end. */ interval?: GetRefererAnalyticsQueryParamInterval | undefined; + /** + * The start date and time when to retrieve analytics from. + */ + start?: string | undefined; + /** + * The end date and time when to retrieve analytics from. If not provided, defaults to the current date. + */ + end?: string | undefined; /** * The country to retrieve analytics for. */ @@ -374,6 +384,8 @@ export namespace GetRefererAnalyticsRequest$ { linkId?: string | undefined; externalId?: string | undefined; interval?: GetRefererAnalyticsQueryParamInterval | undefined; + start?: string | undefined; + end?: string | undefined; country?: GetRefererAnalyticsQueryParamCountry | undefined; city?: string | undefined; device?: string | undefined; @@ -393,6 +405,8 @@ export namespace GetRefererAnalyticsRequest$ { linkId: z.string().optional(), externalId: z.string().optional(), interval: GetRefererAnalyticsQueryParamInterval$.optional(), + start: z.string().optional(), + end: z.string().optional(), country: GetRefererAnalyticsQueryParamCountry$.optional(), city: z.string().optional(), device: z.string().optional(), @@ -411,6 +425,8 @@ export namespace GetRefererAnalyticsRequest$ { ...(v.linkId === undefined ? null : { linkId: v.linkId }), ...(v.externalId === undefined ? null : { externalId: v.externalId }), ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.start === undefined ? null : { start: v.start }), + ...(v.end === undefined ? null : { end: v.end }), ...(v.country === undefined ? null : { country: v.country }), ...(v.city === undefined ? null : { city: v.city }), ...(v.device === undefined ? null : { device: v.device }), @@ -430,6 +446,8 @@ export namespace GetRefererAnalyticsRequest$ { linkId?: string | undefined; externalId?: string | undefined; interval?: GetRefererAnalyticsQueryParamInterval | undefined; + start?: string | undefined; + end?: string | undefined; country?: GetRefererAnalyticsQueryParamCountry | undefined; city?: string | undefined; device?: string | undefined; @@ -449,6 +467,8 @@ export namespace GetRefererAnalyticsRequest$ { linkId: z.string().optional(), externalId: z.string().optional(), interval: GetRefererAnalyticsQueryParamInterval$.optional(), + start: z.string().optional(), + end: z.string().optional(), country: GetRefererAnalyticsQueryParamCountry$.optional(), city: z.string().optional(), device: z.string().optional(), @@ -467,6 +487,8 @@ export namespace GetRefererAnalyticsRequest$ { ...(v.linkId === undefined ? null : { linkId: v.linkId }), ...(v.externalId === undefined ? null : { externalId: v.externalId }), ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.start === undefined ? null : { start: v.start }), + ...(v.end === undefined ? null : { end: v.end }), ...(v.country === undefined ? null : { country: v.country }), ...(v.city === undefined ? null : { city: v.city }), ...(v.device === undefined ? null : { device: v.device }), diff --git a/src/models/operations/gettimeseriesanalytics.ts b/src/models/operations/gettimeseriesanalytics.ts index 44f4aed..1cf0b77 100644 --- a/src/models/operations/gettimeseriesanalytics.ts +++ b/src/models/operations/gettimeseriesanalytics.ts @@ -5,7 +5,7 @@ import * as z from "zod"; /** - * The interval to retrieve analytics for. + * The interval to retrieve analytics for. Takes precedence over start and end. */ export const QueryParamInterval = { Oneh: "1h", @@ -13,10 +13,12 @@ export const QueryParamInterval = { Sevend: "7d", Thirtyd: "30d", Ninetyd: "90d", + Ytd: "ytd", + Oney: "1y", All: "all", } as const; /** - * The interval to retrieve analytics for. + * The interval to retrieve analytics for. Takes precedence over start and end. */ export type QueryParamInterval = (typeof QueryParamInterval)[keyof typeof QueryParamInterval]; @@ -298,9 +300,17 @@ export type GetTimeseriesAnalyticsRequest = { */ externalId?: string | undefined; /** - * The interval to retrieve analytics for. + * The interval to retrieve analytics for. Takes precedence over start and end. */ interval?: QueryParamInterval | undefined; + /** + * The start date and time when to retrieve analytics from. + */ + start?: string | undefined; + /** + * The end date and time when to retrieve analytics from. If not provided, defaults to the current date. + */ + end?: string | undefined; /** * The country to retrieve analytics for. */ @@ -370,6 +380,8 @@ export namespace GetTimeseriesAnalyticsRequest$ { linkId?: string | undefined; externalId?: string | undefined; interval?: QueryParamInterval | undefined; + start?: string | undefined; + end?: string | undefined; country?: QueryParamCountry | undefined; city?: string | undefined; device?: string | undefined; @@ -389,6 +401,8 @@ export namespace GetTimeseriesAnalyticsRequest$ { linkId: z.string().optional(), externalId: z.string().optional(), interval: QueryParamInterval$.optional(), + start: z.string().optional(), + end: z.string().optional(), country: QueryParamCountry$.optional(), city: z.string().optional(), device: z.string().optional(), @@ -407,6 +421,8 @@ export namespace GetTimeseriesAnalyticsRequest$ { ...(v.linkId === undefined ? null : { linkId: v.linkId }), ...(v.externalId === undefined ? null : { externalId: v.externalId }), ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.start === undefined ? null : { start: v.start }), + ...(v.end === undefined ? null : { end: v.end }), ...(v.country === undefined ? null : { country: v.country }), ...(v.city === undefined ? null : { city: v.city }), ...(v.device === undefined ? null : { device: v.device }), @@ -426,6 +442,8 @@ export namespace GetTimeseriesAnalyticsRequest$ { linkId?: string | undefined; externalId?: string | undefined; interval?: QueryParamInterval | undefined; + start?: string | undefined; + end?: string | undefined; country?: QueryParamCountry | undefined; city?: string | undefined; device?: string | undefined; @@ -446,6 +464,8 @@ export namespace GetTimeseriesAnalyticsRequest$ { linkId: z.string().optional(), externalId: z.string().optional(), interval: QueryParamInterval$.optional(), + start: z.string().optional(), + end: z.string().optional(), country: QueryParamCountry$.optional(), city: z.string().optional(), device: z.string().optional(), @@ -464,6 +484,8 @@ export namespace GetTimeseriesAnalyticsRequest$ { ...(v.linkId === undefined ? null : { linkId: v.linkId }), ...(v.externalId === undefined ? null : { externalId: v.externalId }), ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.start === undefined ? null : { start: v.start }), + ...(v.end === undefined ? null : { end: v.end }), ...(v.country === undefined ? null : { country: v.country }), ...(v.city === undefined ? null : { city: v.city }), ...(v.device === undefined ? null : { device: v.device }), diff --git a/src/models/operations/gettoplinks.ts b/src/models/operations/gettoplinks.ts index b988918..9415c02 100644 --- a/src/models/operations/gettoplinks.ts +++ b/src/models/operations/gettoplinks.ts @@ -5,7 +5,7 @@ import * as z from "zod"; /** - * The interval to retrieve analytics for. + * The interval to retrieve analytics for. Takes precedence over start and end. */ export const GetTopLinksQueryParamInterval = { Oneh: "1h", @@ -13,10 +13,12 @@ export const GetTopLinksQueryParamInterval = { Sevend: "7d", Thirtyd: "30d", Ninetyd: "90d", + Ytd: "ytd", + Oney: "1y", All: "all", } as const; /** - * The interval to retrieve analytics for. + * The interval to retrieve analytics for. Takes precedence over start and end. */ export type GetTopLinksQueryParamInterval = (typeof GetTopLinksQueryParamInterval)[keyof typeof GetTopLinksQueryParamInterval]; @@ -300,9 +302,17 @@ export type GetTopLinksRequest = { */ externalId?: string | undefined; /** - * The interval to retrieve analytics for. + * The interval to retrieve analytics for. Takes precedence over start and end. */ interval?: GetTopLinksQueryParamInterval | undefined; + /** + * The start date and time when to retrieve analytics from. + */ + start?: string | undefined; + /** + * The end date and time when to retrieve analytics from. If not provided, defaults to the current date. + */ + end?: string | undefined; /** * The country to retrieve analytics for. */ @@ -372,6 +382,8 @@ export namespace GetTopLinksRequest$ { linkId?: string | undefined; externalId?: string | undefined; interval?: GetTopLinksQueryParamInterval | undefined; + start?: string | undefined; + end?: string | undefined; country?: GetTopLinksQueryParamCountry | undefined; city?: string | undefined; device?: string | undefined; @@ -391,6 +403,8 @@ export namespace GetTopLinksRequest$ { linkId: z.string().optional(), externalId: z.string().optional(), interval: GetTopLinksQueryParamInterval$.optional(), + start: z.string().optional(), + end: z.string().optional(), country: GetTopLinksQueryParamCountry$.optional(), city: z.string().optional(), device: z.string().optional(), @@ -409,6 +423,8 @@ export namespace GetTopLinksRequest$ { ...(v.linkId === undefined ? null : { linkId: v.linkId }), ...(v.externalId === undefined ? null : { externalId: v.externalId }), ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.start === undefined ? null : { start: v.start }), + ...(v.end === undefined ? null : { end: v.end }), ...(v.country === undefined ? null : { country: v.country }), ...(v.city === undefined ? null : { city: v.city }), ...(v.device === undefined ? null : { device: v.device }), @@ -428,6 +444,8 @@ export namespace GetTopLinksRequest$ { linkId?: string | undefined; externalId?: string | undefined; interval?: GetTopLinksQueryParamInterval | undefined; + start?: string | undefined; + end?: string | undefined; country?: GetTopLinksQueryParamCountry | undefined; city?: string | undefined; device?: string | undefined; @@ -447,6 +465,8 @@ export namespace GetTopLinksRequest$ { linkId: z.string().optional(), externalId: z.string().optional(), interval: GetTopLinksQueryParamInterval$.optional(), + start: z.string().optional(), + end: z.string().optional(), country: GetTopLinksQueryParamCountry$.optional(), city: z.string().optional(), device: z.string().optional(), @@ -465,6 +485,8 @@ export namespace GetTopLinksRequest$ { ...(v.linkId === undefined ? null : { linkId: v.linkId }), ...(v.externalId === undefined ? null : { externalId: v.externalId }), ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.start === undefined ? null : { start: v.start }), + ...(v.end === undefined ? null : { end: v.end }), ...(v.country === undefined ? null : { country: v.country }), ...(v.city === undefined ? null : { city: v.city }), ...(v.device === undefined ? null : { device: v.device }), diff --git a/src/models/operations/gettopurls.ts b/src/models/operations/gettopurls.ts index 0d57ea4..497b465 100644 --- a/src/models/operations/gettopurls.ts +++ b/src/models/operations/gettopurls.ts @@ -5,7 +5,7 @@ import * as z from "zod"; /** - * The interval to retrieve analytics for. + * The interval to retrieve analytics for. Takes precedence over start and end. */ export const GetTopURLsQueryParamInterval = { Oneh: "1h", @@ -13,10 +13,12 @@ export const GetTopURLsQueryParamInterval = { Sevend: "7d", Thirtyd: "30d", Ninetyd: "90d", + Ytd: "ytd", + Oney: "1y", All: "all", } as const; /** - * The interval to retrieve analytics for. + * The interval to retrieve analytics for. Takes precedence over start and end. */ export type GetTopURLsQueryParamInterval = (typeof GetTopURLsQueryParamInterval)[keyof typeof GetTopURLsQueryParamInterval]; @@ -300,9 +302,17 @@ export type GetTopURLsRequest = { */ externalId?: string | undefined; /** - * The interval to retrieve analytics for. + * The interval to retrieve analytics for. Takes precedence over start and end. */ interval?: GetTopURLsQueryParamInterval | undefined; + /** + * The start date and time when to retrieve analytics from. + */ + start?: string | undefined; + /** + * The end date and time when to retrieve analytics from. If not provided, defaults to the current date. + */ + end?: string | undefined; /** * The country to retrieve analytics for. */ @@ -372,6 +382,8 @@ export namespace GetTopURLsRequest$ { linkId?: string | undefined; externalId?: string | undefined; interval?: GetTopURLsQueryParamInterval | undefined; + start?: string | undefined; + end?: string | undefined; country?: GetTopURLsQueryParamCountry | undefined; city?: string | undefined; device?: string | undefined; @@ -391,6 +403,8 @@ export namespace GetTopURLsRequest$ { linkId: z.string().optional(), externalId: z.string().optional(), interval: GetTopURLsQueryParamInterval$.optional(), + start: z.string().optional(), + end: z.string().optional(), country: GetTopURLsQueryParamCountry$.optional(), city: z.string().optional(), device: z.string().optional(), @@ -409,6 +423,8 @@ export namespace GetTopURLsRequest$ { ...(v.linkId === undefined ? null : { linkId: v.linkId }), ...(v.externalId === undefined ? null : { externalId: v.externalId }), ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.start === undefined ? null : { start: v.start }), + ...(v.end === undefined ? null : { end: v.end }), ...(v.country === undefined ? null : { country: v.country }), ...(v.city === undefined ? null : { city: v.city }), ...(v.device === undefined ? null : { device: v.device }), @@ -428,6 +444,8 @@ export namespace GetTopURLsRequest$ { linkId?: string | undefined; externalId?: string | undefined; interval?: GetTopURLsQueryParamInterval | undefined; + start?: string | undefined; + end?: string | undefined; country?: GetTopURLsQueryParamCountry | undefined; city?: string | undefined; device?: string | undefined; @@ -447,6 +465,8 @@ export namespace GetTopURLsRequest$ { linkId: z.string().optional(), externalId: z.string().optional(), interval: GetTopURLsQueryParamInterval$.optional(), + start: z.string().optional(), + end: z.string().optional(), country: GetTopURLsQueryParamCountry$.optional(), city: z.string().optional(), device: z.string().optional(), @@ -465,6 +485,8 @@ export namespace GetTopURLsRequest$ { ...(v.linkId === undefined ? null : { linkId: v.linkId }), ...(v.externalId === undefined ? null : { externalId: v.externalId }), ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.start === undefined ? null : { start: v.start }), + ...(v.end === undefined ? null : { end: v.end }), ...(v.country === undefined ? null : { country: v.country }), ...(v.city === undefined ? null : { city: v.city }), ...(v.device === undefined ? null : { device: v.device }), diff --git a/src/models/operations/index.ts b/src/models/operations/index.ts index 78f82a1..5f98d33 100644 --- a/src/models/operations/index.ts +++ b/src/models/operations/index.ts @@ -31,3 +31,4 @@ export * from "./setprimarydomain"; export * from "./transferdomain"; export * from "./updatedomain"; export * from "./updatelink"; +export * from "./upsertlink"; diff --git a/src/models/operations/upsertlink.ts b/src/models/operations/upsertlink.ts new file mode 100644 index 0000000..fb08dd1 --- /dev/null +++ b/src/models/operations/upsertlink.ts @@ -0,0 +1,2076 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * The unique IDs of the tags assigned to the short link. + */ +export type UpsertLinkTagIds = string | Array; + +/** + * The unique name of the tags assigned to the short link (case insensitive). + */ +export type UpsertLinkTagNames = string | Array; + +/** + * Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. + */ +export type UpsertLinkGeo = { + af?: string | undefined; + al?: string | undefined; + dz?: string | undefined; + as?: string | undefined; + ad?: string | undefined; + ao?: string | undefined; + ai?: string | undefined; + aq?: string | undefined; + ag?: string | undefined; + ar?: string | undefined; + am?: string | undefined; + aw?: string | undefined; + au?: string | undefined; + at?: string | undefined; + az?: string | undefined; + bs?: string | undefined; + bh?: string | undefined; + bd?: string | undefined; + bb?: string | undefined; + by?: string | undefined; + be?: string | undefined; + bz?: string | undefined; + bj?: string | undefined; + bm?: string | undefined; + bt?: string | undefined; + bo?: string | undefined; + ba?: string | undefined; + bw?: string | undefined; + bv?: string | undefined; + br?: string | undefined; + io?: string | undefined; + bn?: string | undefined; + bg?: string | undefined; + bf?: string | undefined; + bi?: string | undefined; + kh?: string | undefined; + cm?: string | undefined; + ca?: string | undefined; + cv?: string | undefined; + ky?: string | undefined; + cf?: string | undefined; + td?: string | undefined; + cl?: string | undefined; + cn?: string | undefined; + cx?: string | undefined; + cc?: string | undefined; + co?: string | undefined; + km?: string | undefined; + cg?: string | undefined; + cd?: string | undefined; + ck?: string | undefined; + cr?: string | undefined; + ci?: string | undefined; + hr?: string | undefined; + cu?: string | undefined; + cy?: string | undefined; + cz?: string | undefined; + dk?: string | undefined; + dj?: string | undefined; + dm?: string | undefined; + do?: string | undefined; + ec?: string | undefined; + eg?: string | undefined; + sv?: string | undefined; + gq?: string | undefined; + er?: string | undefined; + ee?: string | undefined; + et?: string | undefined; + fk?: string | undefined; + fo?: string | undefined; + fj?: string | undefined; + fi?: string | undefined; + fr?: string | undefined; + gf?: string | undefined; + pf?: string | undefined; + tf?: string | undefined; + ga?: string | undefined; + gm?: string | undefined; + ge?: string | undefined; + de?: string | undefined; + gh?: string | undefined; + gi?: string | undefined; + gr?: string | undefined; + gl?: string | undefined; + gd?: string | undefined; + gp?: string | undefined; + gu?: string | undefined; + gt?: string | undefined; + gn?: string | undefined; + gw?: string | undefined; + gy?: string | undefined; + ht?: string | undefined; + hm?: string | undefined; + va?: string | undefined; + hn?: string | undefined; + hk?: string | undefined; + hu?: string | undefined; + is?: string | undefined; + in?: string | undefined; + id?: string | undefined; + ir?: string | undefined; + iq?: string | undefined; + ie?: string | undefined; + il?: string | undefined; + it?: string | undefined; + jm?: string | undefined; + jp?: string | undefined; + jo?: string | undefined; + kz?: string | undefined; + ke?: string | undefined; + ki?: string | undefined; + kp?: string | undefined; + kr?: string | undefined; + kw?: string | undefined; + kg?: string | undefined; + la?: string | undefined; + lv?: string | undefined; + lb?: string | undefined; + ls?: string | undefined; + lr?: string | undefined; + ly?: string | undefined; + li?: string | undefined; + lt?: string | undefined; + lu?: string | undefined; + mo?: string | undefined; + mg?: string | undefined; + mw?: string | undefined; + my?: string | undefined; + mv?: string | undefined; + ml?: string | undefined; + mt?: string | undefined; + mh?: string | undefined; + mq?: string | undefined; + mr?: string | undefined; + mu?: string | undefined; + yt?: string | undefined; + mx?: string | undefined; + fm?: string | undefined; + md?: string | undefined; + mc?: string | undefined; + mn?: string | undefined; + ms?: string | undefined; + ma?: string | undefined; + mz?: string | undefined; + mm?: string | undefined; + na?: string | undefined; + nr?: string | undefined; + np?: string | undefined; + nl?: string | undefined; + nc?: string | undefined; + nz?: string | undefined; + ni?: string | undefined; + ne?: string | undefined; + ng?: string | undefined; + nu?: string | undefined; + nf?: string | undefined; + mk?: string | undefined; + mp?: string | undefined; + no?: string | undefined; + om?: string | undefined; + pk?: string | undefined; + pw?: string | undefined; + ps?: string | undefined; + pa?: string | undefined; + pg?: string | undefined; + py?: string | undefined; + pe?: string | undefined; + ph?: string | undefined; + pn?: string | undefined; + pl?: string | undefined; + pt?: string | undefined; + pr?: string | undefined; + qa?: string | undefined; + re?: string | undefined; + ro?: string | undefined; + ru?: string | undefined; + rw?: string | undefined; + sh?: string | undefined; + kn?: string | undefined; + lc?: string | undefined; + pm?: string | undefined; + vc?: string | undefined; + ws?: string | undefined; + sm?: string | undefined; + st?: string | undefined; + sa?: string | undefined; + sn?: string | undefined; + sc?: string | undefined; + sl?: string | undefined; + sg?: string | undefined; + sk?: string | undefined; + si?: string | undefined; + sb?: string | undefined; + so?: string | undefined; + za?: string | undefined; + gs?: string | undefined; + es?: string | undefined; + lk?: string | undefined; + sd?: string | undefined; + sr?: string | undefined; + sj?: string | undefined; + sz?: string | undefined; + se?: string | undefined; + ch?: string | undefined; + sy?: string | undefined; + tw?: string | undefined; + tj?: string | undefined; + tz?: string | undefined; + th?: string | undefined; + tl?: string | undefined; + tg?: string | undefined; + tk?: string | undefined; + to?: string | undefined; + tt?: string | undefined; + tn?: string | undefined; + tr?: string | undefined; + tm?: string | undefined; + tc?: string | undefined; + tv?: string | undefined; + ug?: string | undefined; + ua?: string | undefined; + ae?: string | undefined; + gb?: string | undefined; + us?: string | undefined; + um?: string | undefined; + uy?: string | undefined; + uz?: string | undefined; + vu?: string | undefined; + ve?: string | undefined; + vn?: string | undefined; + vg?: string | undefined; + vi?: string | undefined; + wf?: string | undefined; + eh?: string | undefined; + ye?: string | undefined; + zm?: string | undefined; + zw?: string | undefined; + ax?: string | undefined; + bq?: string | undefined; + cw?: string | undefined; + gg?: string | undefined; + im?: string | undefined; + je?: string | undefined; + me?: string | undefined; + bl?: string | undefined; + mf?: string | undefined; + rs?: string | undefined; + sx?: string | undefined; + ss?: string | undefined; + xk?: string | undefined; +}; + +export type UpsertLinkRequestBody = { + /** + * The destination URL of the short link. + */ + url: string; + /** + * The domain of the short link. If not provided, the primary domain for the workspace will be used (or `dub.sh` if the workspace has no domains). + */ + domain?: string | undefined; + /** + * The short link slug. If not provided, a random 7-character slug will be generated. + */ + key?: string | undefined; + /** + * This is the ID of the link in your database. If set, it can be used to identify the link in the future. Must be prefixed with `ext_` when passed as a query parameter. + */ + externalId?: string | null | undefined; + /** + * The prefix of the short link slug for randomly-generated keys (e.g. if prefix is `/c/`, generated keys will be in the `/c/:key` format). Will be ignored if `key` is provided. + */ + prefix?: string | undefined; + /** + * Whether the short link is archived. + */ + archived?: boolean | undefined; + /** + * Whether the short link's stats are publicly accessible. + */ + publicStats?: boolean | undefined; + /** + * The unique ID of the tag assigned to the short link. This field is deprecated – use `tagIds` instead. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + tagId?: string | null | undefined; + /** + * The unique IDs of the tags assigned to the short link. + */ + tagIds?: string | Array | undefined; + /** + * The unique name of the tags assigned to the short link (case insensitive). + */ + tagNames?: string | Array | undefined; + /** + * The comments for the short link. + */ + comments?: string | null | undefined; + /** + * The date and time when the short link will expire at. + */ + expiresAt?: string | null | undefined; + /** + * The URL to redirect to when the short link has expired. + */ + expiredUrl?: string | null | undefined; + /** + * The password required to access the destination URL of the short link. + */ + password?: string | null | undefined; + /** + * Whether the short link uses Custom Social Media Cards feature. + */ + proxy?: boolean | undefined; + /** + * The title of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + */ + title?: string | null | undefined; + /** + * The description of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + */ + description?: string | null | undefined; + /** + * The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + */ + image?: string | null | undefined; + /** + * Whether the short link uses link cloaking. + */ + rewrite?: boolean | undefined; + /** + * The iOS destination URL for the short link for iOS device targeting. + */ + ios?: string | null | undefined; + /** + * The Android destination URL for the short link for Android device targeting. + */ + android?: string | null | undefined; + /** + * Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. + */ + geo?: UpsertLinkGeo | null | undefined; +}; + +/** @internal */ +export namespace UpsertLinkTagIds$ { + export type Inbound = string | Array; + + export type Outbound = string | Array; + export const inboundSchema: z.ZodType = z.union([ + z.string(), + z.array(z.string()), + ]); + export const outboundSchema: z.ZodType = z.union([ + z.string(), + z.array(z.string()), + ]); +} + +/** @internal */ +export namespace UpsertLinkTagNames$ { + export type Inbound = string | Array; + + export type Outbound = string | Array; + export const inboundSchema: z.ZodType = z.union([ + z.string(), + z.array(z.string()), + ]); + export const outboundSchema: z.ZodType = z.union([ + z.string(), + z.array(z.string()), + ]); +} + +/** @internal */ +export namespace UpsertLinkGeo$ { + export type Inbound = { + AF?: string | undefined; + AL?: string | undefined; + DZ?: string | undefined; + AS?: string | undefined; + AD?: string | undefined; + AO?: string | undefined; + AI?: string | undefined; + AQ?: string | undefined; + AG?: string | undefined; + AR?: string | undefined; + AM?: string | undefined; + AW?: string | undefined; + AU?: string | undefined; + AT?: string | undefined; + AZ?: string | undefined; + BS?: string | undefined; + BH?: string | undefined; + BD?: string | undefined; + BB?: string | undefined; + BY?: string | undefined; + BE?: string | undefined; + BZ?: string | undefined; + BJ?: string | undefined; + BM?: string | undefined; + BT?: string | undefined; + BO?: string | undefined; + BA?: string | undefined; + BW?: string | undefined; + BV?: string | undefined; + BR?: string | undefined; + IO?: string | undefined; + BN?: string | undefined; + BG?: string | undefined; + BF?: string | undefined; + BI?: string | undefined; + KH?: string | undefined; + CM?: string | undefined; + CA?: string | undefined; + CV?: string | undefined; + KY?: string | undefined; + CF?: string | undefined; + TD?: string | undefined; + CL?: string | undefined; + CN?: string | undefined; + CX?: string | undefined; + CC?: string | undefined; + CO?: string | undefined; + KM?: string | undefined; + CG?: string | undefined; + CD?: string | undefined; + CK?: string | undefined; + CR?: string | undefined; + CI?: string | undefined; + HR?: string | undefined; + CU?: string | undefined; + CY?: string | undefined; + CZ?: string | undefined; + DK?: string | undefined; + DJ?: string | undefined; + DM?: string | undefined; + DO?: string | undefined; + EC?: string | undefined; + EG?: string | undefined; + SV?: string | undefined; + GQ?: string | undefined; + ER?: string | undefined; + EE?: string | undefined; + ET?: string | undefined; + FK?: string | undefined; + FO?: string | undefined; + FJ?: string | undefined; + FI?: string | undefined; + FR?: string | undefined; + GF?: string | undefined; + PF?: string | undefined; + TF?: string | undefined; + GA?: string | undefined; + GM?: string | undefined; + GE?: string | undefined; + DE?: string | undefined; + GH?: string | undefined; + GI?: string | undefined; + GR?: string | undefined; + GL?: string | undefined; + GD?: string | undefined; + GP?: string | undefined; + GU?: string | undefined; + GT?: string | undefined; + GN?: string | undefined; + GW?: string | undefined; + GY?: string | undefined; + HT?: string | undefined; + HM?: string | undefined; + VA?: string | undefined; + HN?: string | undefined; + HK?: string | undefined; + HU?: string | undefined; + IS?: string | undefined; + IN?: string | undefined; + ID?: string | undefined; + IR?: string | undefined; + IQ?: string | undefined; + IE?: string | undefined; + IL?: string | undefined; + IT?: string | undefined; + JM?: string | undefined; + JP?: string | undefined; + JO?: string | undefined; + KZ?: string | undefined; + KE?: string | undefined; + KI?: string | undefined; + KP?: string | undefined; + KR?: string | undefined; + KW?: string | undefined; + KG?: string | undefined; + LA?: string | undefined; + LV?: string | undefined; + LB?: string | undefined; + LS?: string | undefined; + LR?: string | undefined; + LY?: string | undefined; + LI?: string | undefined; + LT?: string | undefined; + LU?: string | undefined; + MO?: string | undefined; + MG?: string | undefined; + MW?: string | undefined; + MY?: string | undefined; + MV?: string | undefined; + ML?: string | undefined; + MT?: string | undefined; + MH?: string | undefined; + MQ?: string | undefined; + MR?: string | undefined; + MU?: string | undefined; + YT?: string | undefined; + MX?: string | undefined; + FM?: string | undefined; + MD?: string | undefined; + MC?: string | undefined; + MN?: string | undefined; + MS?: string | undefined; + MA?: string | undefined; + MZ?: string | undefined; + MM?: string | undefined; + NA?: string | undefined; + NR?: string | undefined; + NP?: string | undefined; + NL?: string | undefined; + NC?: string | undefined; + NZ?: string | undefined; + NI?: string | undefined; + NE?: string | undefined; + NG?: string | undefined; + NU?: string | undefined; + NF?: string | undefined; + MK?: string | undefined; + MP?: string | undefined; + NO?: string | undefined; + OM?: string | undefined; + PK?: string | undefined; + PW?: string | undefined; + PS?: string | undefined; + PA?: string | undefined; + PG?: string | undefined; + PY?: string | undefined; + PE?: string | undefined; + PH?: string | undefined; + PN?: string | undefined; + PL?: string | undefined; + PT?: string | undefined; + PR?: string | undefined; + QA?: string | undefined; + RE?: string | undefined; + RO?: string | undefined; + RU?: string | undefined; + RW?: string | undefined; + SH?: string | undefined; + KN?: string | undefined; + LC?: string | undefined; + PM?: string | undefined; + VC?: string | undefined; + WS?: string | undefined; + SM?: string | undefined; + ST?: string | undefined; + SA?: string | undefined; + SN?: string | undefined; + SC?: string | undefined; + SL?: string | undefined; + SG?: string | undefined; + SK?: string | undefined; + SI?: string | undefined; + SB?: string | undefined; + SO?: string | undefined; + ZA?: string | undefined; + GS?: string | undefined; + ES?: string | undefined; + LK?: string | undefined; + SD?: string | undefined; + SR?: string | undefined; + SJ?: string | undefined; + SZ?: string | undefined; + SE?: string | undefined; + CH?: string | undefined; + SY?: string | undefined; + TW?: string | undefined; + TJ?: string | undefined; + TZ?: string | undefined; + TH?: string | undefined; + TL?: string | undefined; + TG?: string | undefined; + TK?: string | undefined; + TO?: string | undefined; + TT?: string | undefined; + TN?: string | undefined; + TR?: string | undefined; + TM?: string | undefined; + TC?: string | undefined; + TV?: string | undefined; + UG?: string | undefined; + UA?: string | undefined; + AE?: string | undefined; + GB?: string | undefined; + US?: string | undefined; + UM?: string | undefined; + UY?: string | undefined; + UZ?: string | undefined; + VU?: string | undefined; + VE?: string | undefined; + VN?: string | undefined; + VG?: string | undefined; + VI?: string | undefined; + WF?: string | undefined; + EH?: string | undefined; + YE?: string | undefined; + ZM?: string | undefined; + ZW?: string | undefined; + AX?: string | undefined; + BQ?: string | undefined; + CW?: string | undefined; + GG?: string | undefined; + IM?: string | undefined; + JE?: string | undefined; + ME?: string | undefined; + BL?: string | undefined; + MF?: string | undefined; + RS?: string | undefined; + SX?: string | undefined; + SS?: string | undefined; + XK?: string | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + AF: z.string().optional(), + AL: z.string().optional(), + DZ: z.string().optional(), + AS: z.string().optional(), + AD: z.string().optional(), + AO: z.string().optional(), + AI: z.string().optional(), + AQ: z.string().optional(), + AG: z.string().optional(), + AR: z.string().optional(), + AM: z.string().optional(), + AW: z.string().optional(), + AU: z.string().optional(), + AT: z.string().optional(), + AZ: z.string().optional(), + BS: z.string().optional(), + BH: z.string().optional(), + BD: z.string().optional(), + BB: z.string().optional(), + BY: z.string().optional(), + BE: z.string().optional(), + BZ: z.string().optional(), + BJ: z.string().optional(), + BM: z.string().optional(), + BT: z.string().optional(), + BO: z.string().optional(), + BA: z.string().optional(), + BW: z.string().optional(), + BV: z.string().optional(), + BR: z.string().optional(), + IO: z.string().optional(), + BN: z.string().optional(), + BG: z.string().optional(), + BF: z.string().optional(), + BI: z.string().optional(), + KH: z.string().optional(), + CM: z.string().optional(), + CA: z.string().optional(), + CV: z.string().optional(), + KY: z.string().optional(), + CF: z.string().optional(), + TD: z.string().optional(), + CL: z.string().optional(), + CN: z.string().optional(), + CX: z.string().optional(), + CC: z.string().optional(), + CO: z.string().optional(), + KM: z.string().optional(), + CG: z.string().optional(), + CD: z.string().optional(), + CK: z.string().optional(), + CR: z.string().optional(), + CI: z.string().optional(), + HR: z.string().optional(), + CU: z.string().optional(), + CY: z.string().optional(), + CZ: z.string().optional(), + DK: z.string().optional(), + DJ: z.string().optional(), + DM: z.string().optional(), + DO: z.string().optional(), + EC: z.string().optional(), + EG: z.string().optional(), + SV: z.string().optional(), + GQ: z.string().optional(), + ER: z.string().optional(), + EE: z.string().optional(), + ET: z.string().optional(), + FK: z.string().optional(), + FO: z.string().optional(), + FJ: z.string().optional(), + FI: z.string().optional(), + FR: z.string().optional(), + GF: z.string().optional(), + PF: z.string().optional(), + TF: z.string().optional(), + GA: z.string().optional(), + GM: z.string().optional(), + GE: z.string().optional(), + DE: z.string().optional(), + GH: z.string().optional(), + GI: z.string().optional(), + GR: z.string().optional(), + GL: z.string().optional(), + GD: z.string().optional(), + GP: z.string().optional(), + GU: z.string().optional(), + GT: z.string().optional(), + GN: z.string().optional(), + GW: z.string().optional(), + GY: z.string().optional(), + HT: z.string().optional(), + HM: z.string().optional(), + VA: z.string().optional(), + HN: z.string().optional(), + HK: z.string().optional(), + HU: z.string().optional(), + IS: z.string().optional(), + IN: z.string().optional(), + ID: z.string().optional(), + IR: z.string().optional(), + IQ: z.string().optional(), + IE: z.string().optional(), + IL: z.string().optional(), + IT: z.string().optional(), + JM: z.string().optional(), + JP: z.string().optional(), + JO: z.string().optional(), + KZ: z.string().optional(), + KE: z.string().optional(), + KI: z.string().optional(), + KP: z.string().optional(), + KR: z.string().optional(), + KW: z.string().optional(), + KG: z.string().optional(), + LA: z.string().optional(), + LV: z.string().optional(), + LB: z.string().optional(), + LS: z.string().optional(), + LR: z.string().optional(), + LY: z.string().optional(), + LI: z.string().optional(), + LT: z.string().optional(), + LU: z.string().optional(), + MO: z.string().optional(), + MG: z.string().optional(), + MW: z.string().optional(), + MY: z.string().optional(), + MV: z.string().optional(), + ML: z.string().optional(), + MT: z.string().optional(), + MH: z.string().optional(), + MQ: z.string().optional(), + MR: z.string().optional(), + MU: z.string().optional(), + YT: z.string().optional(), + MX: z.string().optional(), + FM: z.string().optional(), + MD: z.string().optional(), + MC: z.string().optional(), + MN: z.string().optional(), + MS: z.string().optional(), + MA: z.string().optional(), + MZ: z.string().optional(), + MM: z.string().optional(), + NA: z.string().optional(), + NR: z.string().optional(), + NP: z.string().optional(), + NL: z.string().optional(), + NC: z.string().optional(), + NZ: z.string().optional(), + NI: z.string().optional(), + NE: z.string().optional(), + NG: z.string().optional(), + NU: z.string().optional(), + NF: z.string().optional(), + MK: z.string().optional(), + MP: z.string().optional(), + NO: z.string().optional(), + OM: z.string().optional(), + PK: z.string().optional(), + PW: z.string().optional(), + PS: z.string().optional(), + PA: z.string().optional(), + PG: z.string().optional(), + PY: z.string().optional(), + PE: z.string().optional(), + PH: z.string().optional(), + PN: z.string().optional(), + PL: z.string().optional(), + PT: z.string().optional(), + PR: z.string().optional(), + QA: z.string().optional(), + RE: z.string().optional(), + RO: z.string().optional(), + RU: z.string().optional(), + RW: z.string().optional(), + SH: z.string().optional(), + KN: z.string().optional(), + LC: z.string().optional(), + PM: z.string().optional(), + VC: z.string().optional(), + WS: z.string().optional(), + SM: z.string().optional(), + ST: z.string().optional(), + SA: z.string().optional(), + SN: z.string().optional(), + SC: z.string().optional(), + SL: z.string().optional(), + SG: z.string().optional(), + SK: z.string().optional(), + SI: z.string().optional(), + SB: z.string().optional(), + SO: z.string().optional(), + ZA: z.string().optional(), + GS: z.string().optional(), + ES: z.string().optional(), + LK: z.string().optional(), + SD: z.string().optional(), + SR: z.string().optional(), + SJ: z.string().optional(), + SZ: z.string().optional(), + SE: z.string().optional(), + CH: z.string().optional(), + SY: z.string().optional(), + TW: z.string().optional(), + TJ: z.string().optional(), + TZ: z.string().optional(), + TH: z.string().optional(), + TL: z.string().optional(), + TG: z.string().optional(), + TK: z.string().optional(), + TO: z.string().optional(), + TT: z.string().optional(), + TN: z.string().optional(), + TR: z.string().optional(), + TM: z.string().optional(), + TC: z.string().optional(), + TV: z.string().optional(), + UG: z.string().optional(), + UA: z.string().optional(), + AE: z.string().optional(), + GB: z.string().optional(), + US: z.string().optional(), + UM: z.string().optional(), + UY: z.string().optional(), + UZ: z.string().optional(), + VU: z.string().optional(), + VE: z.string().optional(), + VN: z.string().optional(), + VG: z.string().optional(), + VI: z.string().optional(), + WF: z.string().optional(), + EH: z.string().optional(), + YE: z.string().optional(), + ZM: z.string().optional(), + ZW: z.string().optional(), + AX: z.string().optional(), + BQ: z.string().optional(), + CW: z.string().optional(), + GG: z.string().optional(), + IM: z.string().optional(), + JE: z.string().optional(), + ME: z.string().optional(), + BL: z.string().optional(), + MF: z.string().optional(), + RS: z.string().optional(), + SX: z.string().optional(), + SS: z.string().optional(), + XK: z.string().optional(), + }) + .transform((v) => { + return { + ...(v.AF === undefined ? null : { af: v.AF }), + ...(v.AL === undefined ? null : { al: v.AL }), + ...(v.DZ === undefined ? null : { dz: v.DZ }), + ...(v.AS === undefined ? null : { as: v.AS }), + ...(v.AD === undefined ? null : { ad: v.AD }), + ...(v.AO === undefined ? null : { ao: v.AO }), + ...(v.AI === undefined ? null : { ai: v.AI }), + ...(v.AQ === undefined ? null : { aq: v.AQ }), + ...(v.AG === undefined ? null : { ag: v.AG }), + ...(v.AR === undefined ? null : { ar: v.AR }), + ...(v.AM === undefined ? null : { am: v.AM }), + ...(v.AW === undefined ? null : { aw: v.AW }), + ...(v.AU === undefined ? null : { au: v.AU }), + ...(v.AT === undefined ? null : { at: v.AT }), + ...(v.AZ === undefined ? null : { az: v.AZ }), + ...(v.BS === undefined ? null : { bs: v.BS }), + ...(v.BH === undefined ? null : { bh: v.BH }), + ...(v.BD === undefined ? null : { bd: v.BD }), + ...(v.BB === undefined ? null : { bb: v.BB }), + ...(v.BY === undefined ? null : { by: v.BY }), + ...(v.BE === undefined ? null : { be: v.BE }), + ...(v.BZ === undefined ? null : { bz: v.BZ }), + ...(v.BJ === undefined ? null : { bj: v.BJ }), + ...(v.BM === undefined ? null : { bm: v.BM }), + ...(v.BT === undefined ? null : { bt: v.BT }), + ...(v.BO === undefined ? null : { bo: v.BO }), + ...(v.BA === undefined ? null : { ba: v.BA }), + ...(v.BW === undefined ? null : { bw: v.BW }), + ...(v.BV === undefined ? null : { bv: v.BV }), + ...(v.BR === undefined ? null : { br: v.BR }), + ...(v.IO === undefined ? null : { io: v.IO }), + ...(v.BN === undefined ? null : { bn: v.BN }), + ...(v.BG === undefined ? null : { bg: v.BG }), + ...(v.BF === undefined ? null : { bf: v.BF }), + ...(v.BI === undefined ? null : { bi: v.BI }), + ...(v.KH === undefined ? null : { kh: v.KH }), + ...(v.CM === undefined ? null : { cm: v.CM }), + ...(v.CA === undefined ? null : { ca: v.CA }), + ...(v.CV === undefined ? null : { cv: v.CV }), + ...(v.KY === undefined ? null : { ky: v.KY }), + ...(v.CF === undefined ? null : { cf: v.CF }), + ...(v.TD === undefined ? null : { td: v.TD }), + ...(v.CL === undefined ? null : { cl: v.CL }), + ...(v.CN === undefined ? null : { cn: v.CN }), + ...(v.CX === undefined ? null : { cx: v.CX }), + ...(v.CC === undefined ? null : { cc: v.CC }), + ...(v.CO === undefined ? null : { co: v.CO }), + ...(v.KM === undefined ? null : { km: v.KM }), + ...(v.CG === undefined ? null : { cg: v.CG }), + ...(v.CD === undefined ? null : { cd: v.CD }), + ...(v.CK === undefined ? null : { ck: v.CK }), + ...(v.CR === undefined ? null : { cr: v.CR }), + ...(v.CI === undefined ? null : { ci: v.CI }), + ...(v.HR === undefined ? null : { hr: v.HR }), + ...(v.CU === undefined ? null : { cu: v.CU }), + ...(v.CY === undefined ? null : { cy: v.CY }), + ...(v.CZ === undefined ? null : { cz: v.CZ }), + ...(v.DK === undefined ? null : { dk: v.DK }), + ...(v.DJ === undefined ? null : { dj: v.DJ }), + ...(v.DM === undefined ? null : { dm: v.DM }), + ...(v.DO === undefined ? null : { do: v.DO }), + ...(v.EC === undefined ? null : { ec: v.EC }), + ...(v.EG === undefined ? null : { eg: v.EG }), + ...(v.SV === undefined ? null : { sv: v.SV }), + ...(v.GQ === undefined ? null : { gq: v.GQ }), + ...(v.ER === undefined ? null : { er: v.ER }), + ...(v.EE === undefined ? null : { ee: v.EE }), + ...(v.ET === undefined ? null : { et: v.ET }), + ...(v.FK === undefined ? null : { fk: v.FK }), + ...(v.FO === undefined ? null : { fo: v.FO }), + ...(v.FJ === undefined ? null : { fj: v.FJ }), + ...(v.FI === undefined ? null : { fi: v.FI }), + ...(v.FR === undefined ? null : { fr: v.FR }), + ...(v.GF === undefined ? null : { gf: v.GF }), + ...(v.PF === undefined ? null : { pf: v.PF }), + ...(v.TF === undefined ? null : { tf: v.TF }), + ...(v.GA === undefined ? null : { ga: v.GA }), + ...(v.GM === undefined ? null : { gm: v.GM }), + ...(v.GE === undefined ? null : { ge: v.GE }), + ...(v.DE === undefined ? null : { de: v.DE }), + ...(v.GH === undefined ? null : { gh: v.GH }), + ...(v.GI === undefined ? null : { gi: v.GI }), + ...(v.GR === undefined ? null : { gr: v.GR }), + ...(v.GL === undefined ? null : { gl: v.GL }), + ...(v.GD === undefined ? null : { gd: v.GD }), + ...(v.GP === undefined ? null : { gp: v.GP }), + ...(v.GU === undefined ? null : { gu: v.GU }), + ...(v.GT === undefined ? null : { gt: v.GT }), + ...(v.GN === undefined ? null : { gn: v.GN }), + ...(v.GW === undefined ? null : { gw: v.GW }), + ...(v.GY === undefined ? null : { gy: v.GY }), + ...(v.HT === undefined ? null : { ht: v.HT }), + ...(v.HM === undefined ? null : { hm: v.HM }), + ...(v.VA === undefined ? null : { va: v.VA }), + ...(v.HN === undefined ? null : { hn: v.HN }), + ...(v.HK === undefined ? null : { hk: v.HK }), + ...(v.HU === undefined ? null : { hu: v.HU }), + ...(v.IS === undefined ? null : { is: v.IS }), + ...(v.IN === undefined ? null : { in: v.IN }), + ...(v.ID === undefined ? null : { id: v.ID }), + ...(v.IR === undefined ? null : { ir: v.IR }), + ...(v.IQ === undefined ? null : { iq: v.IQ }), + ...(v.IE === undefined ? null : { ie: v.IE }), + ...(v.IL === undefined ? null : { il: v.IL }), + ...(v.IT === undefined ? null : { it: v.IT }), + ...(v.JM === undefined ? null : { jm: v.JM }), + ...(v.JP === undefined ? null : { jp: v.JP }), + ...(v.JO === undefined ? null : { jo: v.JO }), + ...(v.KZ === undefined ? null : { kz: v.KZ }), + ...(v.KE === undefined ? null : { ke: v.KE }), + ...(v.KI === undefined ? null : { ki: v.KI }), + ...(v.KP === undefined ? null : { kp: v.KP }), + ...(v.KR === undefined ? null : { kr: v.KR }), + ...(v.KW === undefined ? null : { kw: v.KW }), + ...(v.KG === undefined ? null : { kg: v.KG }), + ...(v.LA === undefined ? null : { la: v.LA }), + ...(v.LV === undefined ? null : { lv: v.LV }), + ...(v.LB === undefined ? null : { lb: v.LB }), + ...(v.LS === undefined ? null : { ls: v.LS }), + ...(v.LR === undefined ? null : { lr: v.LR }), + ...(v.LY === undefined ? null : { ly: v.LY }), + ...(v.LI === undefined ? null : { li: v.LI }), + ...(v.LT === undefined ? null : { lt: v.LT }), + ...(v.LU === undefined ? null : { lu: v.LU }), + ...(v.MO === undefined ? null : { mo: v.MO }), + ...(v.MG === undefined ? null : { mg: v.MG }), + ...(v.MW === undefined ? null : { mw: v.MW }), + ...(v.MY === undefined ? null : { my: v.MY }), + ...(v.MV === undefined ? null : { mv: v.MV }), + ...(v.ML === undefined ? null : { ml: v.ML }), + ...(v.MT === undefined ? null : { mt: v.MT }), + ...(v.MH === undefined ? null : { mh: v.MH }), + ...(v.MQ === undefined ? null : { mq: v.MQ }), + ...(v.MR === undefined ? null : { mr: v.MR }), + ...(v.MU === undefined ? null : { mu: v.MU }), + ...(v.YT === undefined ? null : { yt: v.YT }), + ...(v.MX === undefined ? null : { mx: v.MX }), + ...(v.FM === undefined ? null : { fm: v.FM }), + ...(v.MD === undefined ? null : { md: v.MD }), + ...(v.MC === undefined ? null : { mc: v.MC }), + ...(v.MN === undefined ? null : { mn: v.MN }), + ...(v.MS === undefined ? null : { ms: v.MS }), + ...(v.MA === undefined ? null : { ma: v.MA }), + ...(v.MZ === undefined ? null : { mz: v.MZ }), + ...(v.MM === undefined ? null : { mm: v.MM }), + ...(v.NA === undefined ? null : { na: v.NA }), + ...(v.NR === undefined ? null : { nr: v.NR }), + ...(v.NP === undefined ? null : { np: v.NP }), + ...(v.NL === undefined ? null : { nl: v.NL }), + ...(v.NC === undefined ? null : { nc: v.NC }), + ...(v.NZ === undefined ? null : { nz: v.NZ }), + ...(v.NI === undefined ? null : { ni: v.NI }), + ...(v.NE === undefined ? null : { ne: v.NE }), + ...(v.NG === undefined ? null : { ng: v.NG }), + ...(v.NU === undefined ? null : { nu: v.NU }), + ...(v.NF === undefined ? null : { nf: v.NF }), + ...(v.MK === undefined ? null : { mk: v.MK }), + ...(v.MP === undefined ? null : { mp: v.MP }), + ...(v.NO === undefined ? null : { no: v.NO }), + ...(v.OM === undefined ? null : { om: v.OM }), + ...(v.PK === undefined ? null : { pk: v.PK }), + ...(v.PW === undefined ? null : { pw: v.PW }), + ...(v.PS === undefined ? null : { ps: v.PS }), + ...(v.PA === undefined ? null : { pa: v.PA }), + ...(v.PG === undefined ? null : { pg: v.PG }), + ...(v.PY === undefined ? null : { py: v.PY }), + ...(v.PE === undefined ? null : { pe: v.PE }), + ...(v.PH === undefined ? null : { ph: v.PH }), + ...(v.PN === undefined ? null : { pn: v.PN }), + ...(v.PL === undefined ? null : { pl: v.PL }), + ...(v.PT === undefined ? null : { pt: v.PT }), + ...(v.PR === undefined ? null : { pr: v.PR }), + ...(v.QA === undefined ? null : { qa: v.QA }), + ...(v.RE === undefined ? null : { re: v.RE }), + ...(v.RO === undefined ? null : { ro: v.RO }), + ...(v.RU === undefined ? null : { ru: v.RU }), + ...(v.RW === undefined ? null : { rw: v.RW }), + ...(v.SH === undefined ? null : { sh: v.SH }), + ...(v.KN === undefined ? null : { kn: v.KN }), + ...(v.LC === undefined ? null : { lc: v.LC }), + ...(v.PM === undefined ? null : { pm: v.PM }), + ...(v.VC === undefined ? null : { vc: v.VC }), + ...(v.WS === undefined ? null : { ws: v.WS }), + ...(v.SM === undefined ? null : { sm: v.SM }), + ...(v.ST === undefined ? null : { st: v.ST }), + ...(v.SA === undefined ? null : { sa: v.SA }), + ...(v.SN === undefined ? null : { sn: v.SN }), + ...(v.SC === undefined ? null : { sc: v.SC }), + ...(v.SL === undefined ? null : { sl: v.SL }), + ...(v.SG === undefined ? null : { sg: v.SG }), + ...(v.SK === undefined ? null : { sk: v.SK }), + ...(v.SI === undefined ? null : { si: v.SI }), + ...(v.SB === undefined ? null : { sb: v.SB }), + ...(v.SO === undefined ? null : { so: v.SO }), + ...(v.ZA === undefined ? null : { za: v.ZA }), + ...(v.GS === undefined ? null : { gs: v.GS }), + ...(v.ES === undefined ? null : { es: v.ES }), + ...(v.LK === undefined ? null : { lk: v.LK }), + ...(v.SD === undefined ? null : { sd: v.SD }), + ...(v.SR === undefined ? null : { sr: v.SR }), + ...(v.SJ === undefined ? null : { sj: v.SJ }), + ...(v.SZ === undefined ? null : { sz: v.SZ }), + ...(v.SE === undefined ? null : { se: v.SE }), + ...(v.CH === undefined ? null : { ch: v.CH }), + ...(v.SY === undefined ? null : { sy: v.SY }), + ...(v.TW === undefined ? null : { tw: v.TW }), + ...(v.TJ === undefined ? null : { tj: v.TJ }), + ...(v.TZ === undefined ? null : { tz: v.TZ }), + ...(v.TH === undefined ? null : { th: v.TH }), + ...(v.TL === undefined ? null : { tl: v.TL }), + ...(v.TG === undefined ? null : { tg: v.TG }), + ...(v.TK === undefined ? null : { tk: v.TK }), + ...(v.TO === undefined ? null : { to: v.TO }), + ...(v.TT === undefined ? null : { tt: v.TT }), + ...(v.TN === undefined ? null : { tn: v.TN }), + ...(v.TR === undefined ? null : { tr: v.TR }), + ...(v.TM === undefined ? null : { tm: v.TM }), + ...(v.TC === undefined ? null : { tc: v.TC }), + ...(v.TV === undefined ? null : { tv: v.TV }), + ...(v.UG === undefined ? null : { ug: v.UG }), + ...(v.UA === undefined ? null : { ua: v.UA }), + ...(v.AE === undefined ? null : { ae: v.AE }), + ...(v.GB === undefined ? null : { gb: v.GB }), + ...(v.US === undefined ? null : { us: v.US }), + ...(v.UM === undefined ? null : { um: v.UM }), + ...(v.UY === undefined ? null : { uy: v.UY }), + ...(v.UZ === undefined ? null : { uz: v.UZ }), + ...(v.VU === undefined ? null : { vu: v.VU }), + ...(v.VE === undefined ? null : { ve: v.VE }), + ...(v.VN === undefined ? null : { vn: v.VN }), + ...(v.VG === undefined ? null : { vg: v.VG }), + ...(v.VI === undefined ? null : { vi: v.VI }), + ...(v.WF === undefined ? null : { wf: v.WF }), + ...(v.EH === undefined ? null : { eh: v.EH }), + ...(v.YE === undefined ? null : { ye: v.YE }), + ...(v.ZM === undefined ? null : { zm: v.ZM }), + ...(v.ZW === undefined ? null : { zw: v.ZW }), + ...(v.AX === undefined ? null : { ax: v.AX }), + ...(v.BQ === undefined ? null : { bq: v.BQ }), + ...(v.CW === undefined ? null : { cw: v.CW }), + ...(v.GG === undefined ? null : { gg: v.GG }), + ...(v.IM === undefined ? null : { im: v.IM }), + ...(v.JE === undefined ? null : { je: v.JE }), + ...(v.ME === undefined ? null : { me: v.ME }), + ...(v.BL === undefined ? null : { bl: v.BL }), + ...(v.MF === undefined ? null : { mf: v.MF }), + ...(v.RS === undefined ? null : { rs: v.RS }), + ...(v.SX === undefined ? null : { sx: v.SX }), + ...(v.SS === undefined ? null : { ss: v.SS }), + ...(v.XK === undefined ? null : { xk: v.XK }), + }; + }); + + export type Outbound = { + AF?: string | undefined; + AL?: string | undefined; + DZ?: string | undefined; + AS?: string | undefined; + AD?: string | undefined; + AO?: string | undefined; + AI?: string | undefined; + AQ?: string | undefined; + AG?: string | undefined; + AR?: string | undefined; + AM?: string | undefined; + AW?: string | undefined; + AU?: string | undefined; + AT?: string | undefined; + AZ?: string | undefined; + BS?: string | undefined; + BH?: string | undefined; + BD?: string | undefined; + BB?: string | undefined; + BY?: string | undefined; + BE?: string | undefined; + BZ?: string | undefined; + BJ?: string | undefined; + BM?: string | undefined; + BT?: string | undefined; + BO?: string | undefined; + BA?: string | undefined; + BW?: string | undefined; + BV?: string | undefined; + BR?: string | undefined; + IO?: string | undefined; + BN?: string | undefined; + BG?: string | undefined; + BF?: string | undefined; + BI?: string | undefined; + KH?: string | undefined; + CM?: string | undefined; + CA?: string | undefined; + CV?: string | undefined; + KY?: string | undefined; + CF?: string | undefined; + TD?: string | undefined; + CL?: string | undefined; + CN?: string | undefined; + CX?: string | undefined; + CC?: string | undefined; + CO?: string | undefined; + KM?: string | undefined; + CG?: string | undefined; + CD?: string | undefined; + CK?: string | undefined; + CR?: string | undefined; + CI?: string | undefined; + HR?: string | undefined; + CU?: string | undefined; + CY?: string | undefined; + CZ?: string | undefined; + DK?: string | undefined; + DJ?: string | undefined; + DM?: string | undefined; + DO?: string | undefined; + EC?: string | undefined; + EG?: string | undefined; + SV?: string | undefined; + GQ?: string | undefined; + ER?: string | undefined; + EE?: string | undefined; + ET?: string | undefined; + FK?: string | undefined; + FO?: string | undefined; + FJ?: string | undefined; + FI?: string | undefined; + FR?: string | undefined; + GF?: string | undefined; + PF?: string | undefined; + TF?: string | undefined; + GA?: string | undefined; + GM?: string | undefined; + GE?: string | undefined; + DE?: string | undefined; + GH?: string | undefined; + GI?: string | undefined; + GR?: string | undefined; + GL?: string | undefined; + GD?: string | undefined; + GP?: string | undefined; + GU?: string | undefined; + GT?: string | undefined; + GN?: string | undefined; + GW?: string | undefined; + GY?: string | undefined; + HT?: string | undefined; + HM?: string | undefined; + VA?: string | undefined; + HN?: string | undefined; + HK?: string | undefined; + HU?: string | undefined; + IS?: string | undefined; + IN?: string | undefined; + ID?: string | undefined; + IR?: string | undefined; + IQ?: string | undefined; + IE?: string | undefined; + IL?: string | undefined; + IT?: string | undefined; + JM?: string | undefined; + JP?: string | undefined; + JO?: string | undefined; + KZ?: string | undefined; + KE?: string | undefined; + KI?: string | undefined; + KP?: string | undefined; + KR?: string | undefined; + KW?: string | undefined; + KG?: string | undefined; + LA?: string | undefined; + LV?: string | undefined; + LB?: string | undefined; + LS?: string | undefined; + LR?: string | undefined; + LY?: string | undefined; + LI?: string | undefined; + LT?: string | undefined; + LU?: string | undefined; + MO?: string | undefined; + MG?: string | undefined; + MW?: string | undefined; + MY?: string | undefined; + MV?: string | undefined; + ML?: string | undefined; + MT?: string | undefined; + MH?: string | undefined; + MQ?: string | undefined; + MR?: string | undefined; + MU?: string | undefined; + YT?: string | undefined; + MX?: string | undefined; + FM?: string | undefined; + MD?: string | undefined; + MC?: string | undefined; + MN?: string | undefined; + MS?: string | undefined; + MA?: string | undefined; + MZ?: string | undefined; + MM?: string | undefined; + NA?: string | undefined; + NR?: string | undefined; + NP?: string | undefined; + NL?: string | undefined; + NC?: string | undefined; + NZ?: string | undefined; + NI?: string | undefined; + NE?: string | undefined; + NG?: string | undefined; + NU?: string | undefined; + NF?: string | undefined; + MK?: string | undefined; + MP?: string | undefined; + NO?: string | undefined; + OM?: string | undefined; + PK?: string | undefined; + PW?: string | undefined; + PS?: string | undefined; + PA?: string | undefined; + PG?: string | undefined; + PY?: string | undefined; + PE?: string | undefined; + PH?: string | undefined; + PN?: string | undefined; + PL?: string | undefined; + PT?: string | undefined; + PR?: string | undefined; + QA?: string | undefined; + RE?: string | undefined; + RO?: string | undefined; + RU?: string | undefined; + RW?: string | undefined; + SH?: string | undefined; + KN?: string | undefined; + LC?: string | undefined; + PM?: string | undefined; + VC?: string | undefined; + WS?: string | undefined; + SM?: string | undefined; + ST?: string | undefined; + SA?: string | undefined; + SN?: string | undefined; + SC?: string | undefined; + SL?: string | undefined; + SG?: string | undefined; + SK?: string | undefined; + SI?: string | undefined; + SB?: string | undefined; + SO?: string | undefined; + ZA?: string | undefined; + GS?: string | undefined; + ES?: string | undefined; + LK?: string | undefined; + SD?: string | undefined; + SR?: string | undefined; + SJ?: string | undefined; + SZ?: string | undefined; + SE?: string | undefined; + CH?: string | undefined; + SY?: string | undefined; + TW?: string | undefined; + TJ?: string | undefined; + TZ?: string | undefined; + TH?: string | undefined; + TL?: string | undefined; + TG?: string | undefined; + TK?: string | undefined; + TO?: string | undefined; + TT?: string | undefined; + TN?: string | undefined; + TR?: string | undefined; + TM?: string | undefined; + TC?: string | undefined; + TV?: string | undefined; + UG?: string | undefined; + UA?: string | undefined; + AE?: string | undefined; + GB?: string | undefined; + US?: string | undefined; + UM?: string | undefined; + UY?: string | undefined; + UZ?: string | undefined; + VU?: string | undefined; + VE?: string | undefined; + VN?: string | undefined; + VG?: string | undefined; + VI?: string | undefined; + WF?: string | undefined; + EH?: string | undefined; + YE?: string | undefined; + ZM?: string | undefined; + ZW?: string | undefined; + AX?: string | undefined; + BQ?: string | undefined; + CW?: string | undefined; + GG?: string | undefined; + IM?: string | undefined; + JE?: string | undefined; + ME?: string | undefined; + BL?: string | undefined; + MF?: string | undefined; + RS?: string | undefined; + SX?: string | undefined; + SS?: string | undefined; + XK?: string | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + af: z.string().optional(), + al: z.string().optional(), + dz: z.string().optional(), + as: z.string().optional(), + ad: z.string().optional(), + ao: z.string().optional(), + ai: z.string().optional(), + aq: z.string().optional(), + ag: z.string().optional(), + ar: z.string().optional(), + am: z.string().optional(), + aw: z.string().optional(), + au: z.string().optional(), + at: z.string().optional(), + az: z.string().optional(), + bs: z.string().optional(), + bh: z.string().optional(), + bd: z.string().optional(), + bb: z.string().optional(), + by: z.string().optional(), + be: z.string().optional(), + bz: z.string().optional(), + bj: z.string().optional(), + bm: z.string().optional(), + bt: z.string().optional(), + bo: z.string().optional(), + ba: z.string().optional(), + bw: z.string().optional(), + bv: z.string().optional(), + br: z.string().optional(), + io: z.string().optional(), + bn: z.string().optional(), + bg: z.string().optional(), + bf: z.string().optional(), + bi: z.string().optional(), + kh: z.string().optional(), + cm: z.string().optional(), + ca: z.string().optional(), + cv: z.string().optional(), + ky: z.string().optional(), + cf: z.string().optional(), + td: z.string().optional(), + cl: z.string().optional(), + cn: z.string().optional(), + cx: z.string().optional(), + cc: z.string().optional(), + co: z.string().optional(), + km: z.string().optional(), + cg: z.string().optional(), + cd: z.string().optional(), + ck: z.string().optional(), + cr: z.string().optional(), + ci: z.string().optional(), + hr: z.string().optional(), + cu: z.string().optional(), + cy: z.string().optional(), + cz: z.string().optional(), + dk: z.string().optional(), + dj: z.string().optional(), + dm: z.string().optional(), + do: z.string().optional(), + ec: z.string().optional(), + eg: z.string().optional(), + sv: z.string().optional(), + gq: z.string().optional(), + er: z.string().optional(), + ee: z.string().optional(), + et: z.string().optional(), + fk: z.string().optional(), + fo: z.string().optional(), + fj: z.string().optional(), + fi: z.string().optional(), + fr: z.string().optional(), + gf: z.string().optional(), + pf: z.string().optional(), + tf: z.string().optional(), + ga: z.string().optional(), + gm: z.string().optional(), + ge: z.string().optional(), + de: z.string().optional(), + gh: z.string().optional(), + gi: z.string().optional(), + gr: z.string().optional(), + gl: z.string().optional(), + gd: z.string().optional(), + gp: z.string().optional(), + gu: z.string().optional(), + gt: z.string().optional(), + gn: z.string().optional(), + gw: z.string().optional(), + gy: z.string().optional(), + ht: z.string().optional(), + hm: z.string().optional(), + va: z.string().optional(), + hn: z.string().optional(), + hk: z.string().optional(), + hu: z.string().optional(), + is: z.string().optional(), + in: z.string().optional(), + id: z.string().optional(), + ir: z.string().optional(), + iq: z.string().optional(), + ie: z.string().optional(), + il: z.string().optional(), + it: z.string().optional(), + jm: z.string().optional(), + jp: z.string().optional(), + jo: z.string().optional(), + kz: z.string().optional(), + ke: z.string().optional(), + ki: z.string().optional(), + kp: z.string().optional(), + kr: z.string().optional(), + kw: z.string().optional(), + kg: z.string().optional(), + la: z.string().optional(), + lv: z.string().optional(), + lb: z.string().optional(), + ls: z.string().optional(), + lr: z.string().optional(), + ly: z.string().optional(), + li: z.string().optional(), + lt: z.string().optional(), + lu: z.string().optional(), + mo: z.string().optional(), + mg: z.string().optional(), + mw: z.string().optional(), + my: z.string().optional(), + mv: z.string().optional(), + ml: z.string().optional(), + mt: z.string().optional(), + mh: z.string().optional(), + mq: z.string().optional(), + mr: z.string().optional(), + mu: z.string().optional(), + yt: z.string().optional(), + mx: z.string().optional(), + fm: z.string().optional(), + md: z.string().optional(), + mc: z.string().optional(), + mn: z.string().optional(), + ms: z.string().optional(), + ma: z.string().optional(), + mz: z.string().optional(), + mm: z.string().optional(), + na: z.string().optional(), + nr: z.string().optional(), + np: z.string().optional(), + nl: z.string().optional(), + nc: z.string().optional(), + nz: z.string().optional(), + ni: z.string().optional(), + ne: z.string().optional(), + ng: z.string().optional(), + nu: z.string().optional(), + nf: z.string().optional(), + mk: z.string().optional(), + mp: z.string().optional(), + no: z.string().optional(), + om: z.string().optional(), + pk: z.string().optional(), + pw: z.string().optional(), + ps: z.string().optional(), + pa: z.string().optional(), + pg: z.string().optional(), + py: z.string().optional(), + pe: z.string().optional(), + ph: z.string().optional(), + pn: z.string().optional(), + pl: z.string().optional(), + pt: z.string().optional(), + pr: z.string().optional(), + qa: z.string().optional(), + re: z.string().optional(), + ro: z.string().optional(), + ru: z.string().optional(), + rw: z.string().optional(), + sh: z.string().optional(), + kn: z.string().optional(), + lc: z.string().optional(), + pm: z.string().optional(), + vc: z.string().optional(), + ws: z.string().optional(), + sm: z.string().optional(), + st: z.string().optional(), + sa: z.string().optional(), + sn: z.string().optional(), + sc: z.string().optional(), + sl: z.string().optional(), + sg: z.string().optional(), + sk: z.string().optional(), + si: z.string().optional(), + sb: z.string().optional(), + so: z.string().optional(), + za: z.string().optional(), + gs: z.string().optional(), + es: z.string().optional(), + lk: z.string().optional(), + sd: z.string().optional(), + sr: z.string().optional(), + sj: z.string().optional(), + sz: z.string().optional(), + se: z.string().optional(), + ch: z.string().optional(), + sy: z.string().optional(), + tw: z.string().optional(), + tj: z.string().optional(), + tz: z.string().optional(), + th: z.string().optional(), + tl: z.string().optional(), + tg: z.string().optional(), + tk: z.string().optional(), + to: z.string().optional(), + tt: z.string().optional(), + tn: z.string().optional(), + tr: z.string().optional(), + tm: z.string().optional(), + tc: z.string().optional(), + tv: z.string().optional(), + ug: z.string().optional(), + ua: z.string().optional(), + ae: z.string().optional(), + gb: z.string().optional(), + us: z.string().optional(), + um: z.string().optional(), + uy: z.string().optional(), + uz: z.string().optional(), + vu: z.string().optional(), + ve: z.string().optional(), + vn: z.string().optional(), + vg: z.string().optional(), + vi: z.string().optional(), + wf: z.string().optional(), + eh: z.string().optional(), + ye: z.string().optional(), + zm: z.string().optional(), + zw: z.string().optional(), + ax: z.string().optional(), + bq: z.string().optional(), + cw: z.string().optional(), + gg: z.string().optional(), + im: z.string().optional(), + je: z.string().optional(), + me: z.string().optional(), + bl: z.string().optional(), + mf: z.string().optional(), + rs: z.string().optional(), + sx: z.string().optional(), + ss: z.string().optional(), + xk: z.string().optional(), + }) + .transform((v) => { + return { + ...(v.af === undefined ? null : { AF: v.af }), + ...(v.al === undefined ? null : { AL: v.al }), + ...(v.dz === undefined ? null : { DZ: v.dz }), + ...(v.as === undefined ? null : { AS: v.as }), + ...(v.ad === undefined ? null : { AD: v.ad }), + ...(v.ao === undefined ? null : { AO: v.ao }), + ...(v.ai === undefined ? null : { AI: v.ai }), + ...(v.aq === undefined ? null : { AQ: v.aq }), + ...(v.ag === undefined ? null : { AG: v.ag }), + ...(v.ar === undefined ? null : { AR: v.ar }), + ...(v.am === undefined ? null : { AM: v.am }), + ...(v.aw === undefined ? null : { AW: v.aw }), + ...(v.au === undefined ? null : { AU: v.au }), + ...(v.at === undefined ? null : { AT: v.at }), + ...(v.az === undefined ? null : { AZ: v.az }), + ...(v.bs === undefined ? null : { BS: v.bs }), + ...(v.bh === undefined ? null : { BH: v.bh }), + ...(v.bd === undefined ? null : { BD: v.bd }), + ...(v.bb === undefined ? null : { BB: v.bb }), + ...(v.by === undefined ? null : { BY: v.by }), + ...(v.be === undefined ? null : { BE: v.be }), + ...(v.bz === undefined ? null : { BZ: v.bz }), + ...(v.bj === undefined ? null : { BJ: v.bj }), + ...(v.bm === undefined ? null : { BM: v.bm }), + ...(v.bt === undefined ? null : { BT: v.bt }), + ...(v.bo === undefined ? null : { BO: v.bo }), + ...(v.ba === undefined ? null : { BA: v.ba }), + ...(v.bw === undefined ? null : { BW: v.bw }), + ...(v.bv === undefined ? null : { BV: v.bv }), + ...(v.br === undefined ? null : { BR: v.br }), + ...(v.io === undefined ? null : { IO: v.io }), + ...(v.bn === undefined ? null : { BN: v.bn }), + ...(v.bg === undefined ? null : { BG: v.bg }), + ...(v.bf === undefined ? null : { BF: v.bf }), + ...(v.bi === undefined ? null : { BI: v.bi }), + ...(v.kh === undefined ? null : { KH: v.kh }), + ...(v.cm === undefined ? null : { CM: v.cm }), + ...(v.ca === undefined ? null : { CA: v.ca }), + ...(v.cv === undefined ? null : { CV: v.cv }), + ...(v.ky === undefined ? null : { KY: v.ky }), + ...(v.cf === undefined ? null : { CF: v.cf }), + ...(v.td === undefined ? null : { TD: v.td }), + ...(v.cl === undefined ? null : { CL: v.cl }), + ...(v.cn === undefined ? null : { CN: v.cn }), + ...(v.cx === undefined ? null : { CX: v.cx }), + ...(v.cc === undefined ? null : { CC: v.cc }), + ...(v.co === undefined ? null : { CO: v.co }), + ...(v.km === undefined ? null : { KM: v.km }), + ...(v.cg === undefined ? null : { CG: v.cg }), + ...(v.cd === undefined ? null : { CD: v.cd }), + ...(v.ck === undefined ? null : { CK: v.ck }), + ...(v.cr === undefined ? null : { CR: v.cr }), + ...(v.ci === undefined ? null : { CI: v.ci }), + ...(v.hr === undefined ? null : { HR: v.hr }), + ...(v.cu === undefined ? null : { CU: v.cu }), + ...(v.cy === undefined ? null : { CY: v.cy }), + ...(v.cz === undefined ? null : { CZ: v.cz }), + ...(v.dk === undefined ? null : { DK: v.dk }), + ...(v.dj === undefined ? null : { DJ: v.dj }), + ...(v.dm === undefined ? null : { DM: v.dm }), + ...(v.do === undefined ? null : { DO: v.do }), + ...(v.ec === undefined ? null : { EC: v.ec }), + ...(v.eg === undefined ? null : { EG: v.eg }), + ...(v.sv === undefined ? null : { SV: v.sv }), + ...(v.gq === undefined ? null : { GQ: v.gq }), + ...(v.er === undefined ? null : { ER: v.er }), + ...(v.ee === undefined ? null : { EE: v.ee }), + ...(v.et === undefined ? null : { ET: v.et }), + ...(v.fk === undefined ? null : { FK: v.fk }), + ...(v.fo === undefined ? null : { FO: v.fo }), + ...(v.fj === undefined ? null : { FJ: v.fj }), + ...(v.fi === undefined ? null : { FI: v.fi }), + ...(v.fr === undefined ? null : { FR: v.fr }), + ...(v.gf === undefined ? null : { GF: v.gf }), + ...(v.pf === undefined ? null : { PF: v.pf }), + ...(v.tf === undefined ? null : { TF: v.tf }), + ...(v.ga === undefined ? null : { GA: v.ga }), + ...(v.gm === undefined ? null : { GM: v.gm }), + ...(v.ge === undefined ? null : { GE: v.ge }), + ...(v.de === undefined ? null : { DE: v.de }), + ...(v.gh === undefined ? null : { GH: v.gh }), + ...(v.gi === undefined ? null : { GI: v.gi }), + ...(v.gr === undefined ? null : { GR: v.gr }), + ...(v.gl === undefined ? null : { GL: v.gl }), + ...(v.gd === undefined ? null : { GD: v.gd }), + ...(v.gp === undefined ? null : { GP: v.gp }), + ...(v.gu === undefined ? null : { GU: v.gu }), + ...(v.gt === undefined ? null : { GT: v.gt }), + ...(v.gn === undefined ? null : { GN: v.gn }), + ...(v.gw === undefined ? null : { GW: v.gw }), + ...(v.gy === undefined ? null : { GY: v.gy }), + ...(v.ht === undefined ? null : { HT: v.ht }), + ...(v.hm === undefined ? null : { HM: v.hm }), + ...(v.va === undefined ? null : { VA: v.va }), + ...(v.hn === undefined ? null : { HN: v.hn }), + ...(v.hk === undefined ? null : { HK: v.hk }), + ...(v.hu === undefined ? null : { HU: v.hu }), + ...(v.is === undefined ? null : { IS: v.is }), + ...(v.in === undefined ? null : { IN: v.in }), + ...(v.id === undefined ? null : { ID: v.id }), + ...(v.ir === undefined ? null : { IR: v.ir }), + ...(v.iq === undefined ? null : { IQ: v.iq }), + ...(v.ie === undefined ? null : { IE: v.ie }), + ...(v.il === undefined ? null : { IL: v.il }), + ...(v.it === undefined ? null : { IT: v.it }), + ...(v.jm === undefined ? null : { JM: v.jm }), + ...(v.jp === undefined ? null : { JP: v.jp }), + ...(v.jo === undefined ? null : { JO: v.jo }), + ...(v.kz === undefined ? null : { KZ: v.kz }), + ...(v.ke === undefined ? null : { KE: v.ke }), + ...(v.ki === undefined ? null : { KI: v.ki }), + ...(v.kp === undefined ? null : { KP: v.kp }), + ...(v.kr === undefined ? null : { KR: v.kr }), + ...(v.kw === undefined ? null : { KW: v.kw }), + ...(v.kg === undefined ? null : { KG: v.kg }), + ...(v.la === undefined ? null : { LA: v.la }), + ...(v.lv === undefined ? null : { LV: v.lv }), + ...(v.lb === undefined ? null : { LB: v.lb }), + ...(v.ls === undefined ? null : { LS: v.ls }), + ...(v.lr === undefined ? null : { LR: v.lr }), + ...(v.ly === undefined ? null : { LY: v.ly }), + ...(v.li === undefined ? null : { LI: v.li }), + ...(v.lt === undefined ? null : { LT: v.lt }), + ...(v.lu === undefined ? null : { LU: v.lu }), + ...(v.mo === undefined ? null : { MO: v.mo }), + ...(v.mg === undefined ? null : { MG: v.mg }), + ...(v.mw === undefined ? null : { MW: v.mw }), + ...(v.my === undefined ? null : { MY: v.my }), + ...(v.mv === undefined ? null : { MV: v.mv }), + ...(v.ml === undefined ? null : { ML: v.ml }), + ...(v.mt === undefined ? null : { MT: v.mt }), + ...(v.mh === undefined ? null : { MH: v.mh }), + ...(v.mq === undefined ? null : { MQ: v.mq }), + ...(v.mr === undefined ? null : { MR: v.mr }), + ...(v.mu === undefined ? null : { MU: v.mu }), + ...(v.yt === undefined ? null : { YT: v.yt }), + ...(v.mx === undefined ? null : { MX: v.mx }), + ...(v.fm === undefined ? null : { FM: v.fm }), + ...(v.md === undefined ? null : { MD: v.md }), + ...(v.mc === undefined ? null : { MC: v.mc }), + ...(v.mn === undefined ? null : { MN: v.mn }), + ...(v.ms === undefined ? null : { MS: v.ms }), + ...(v.ma === undefined ? null : { MA: v.ma }), + ...(v.mz === undefined ? null : { MZ: v.mz }), + ...(v.mm === undefined ? null : { MM: v.mm }), + ...(v.na === undefined ? null : { NA: v.na }), + ...(v.nr === undefined ? null : { NR: v.nr }), + ...(v.np === undefined ? null : { NP: v.np }), + ...(v.nl === undefined ? null : { NL: v.nl }), + ...(v.nc === undefined ? null : { NC: v.nc }), + ...(v.nz === undefined ? null : { NZ: v.nz }), + ...(v.ni === undefined ? null : { NI: v.ni }), + ...(v.ne === undefined ? null : { NE: v.ne }), + ...(v.ng === undefined ? null : { NG: v.ng }), + ...(v.nu === undefined ? null : { NU: v.nu }), + ...(v.nf === undefined ? null : { NF: v.nf }), + ...(v.mk === undefined ? null : { MK: v.mk }), + ...(v.mp === undefined ? null : { MP: v.mp }), + ...(v.no === undefined ? null : { NO: v.no }), + ...(v.om === undefined ? null : { OM: v.om }), + ...(v.pk === undefined ? null : { PK: v.pk }), + ...(v.pw === undefined ? null : { PW: v.pw }), + ...(v.ps === undefined ? null : { PS: v.ps }), + ...(v.pa === undefined ? null : { PA: v.pa }), + ...(v.pg === undefined ? null : { PG: v.pg }), + ...(v.py === undefined ? null : { PY: v.py }), + ...(v.pe === undefined ? null : { PE: v.pe }), + ...(v.ph === undefined ? null : { PH: v.ph }), + ...(v.pn === undefined ? null : { PN: v.pn }), + ...(v.pl === undefined ? null : { PL: v.pl }), + ...(v.pt === undefined ? null : { PT: v.pt }), + ...(v.pr === undefined ? null : { PR: v.pr }), + ...(v.qa === undefined ? null : { QA: v.qa }), + ...(v.re === undefined ? null : { RE: v.re }), + ...(v.ro === undefined ? null : { RO: v.ro }), + ...(v.ru === undefined ? null : { RU: v.ru }), + ...(v.rw === undefined ? null : { RW: v.rw }), + ...(v.sh === undefined ? null : { SH: v.sh }), + ...(v.kn === undefined ? null : { KN: v.kn }), + ...(v.lc === undefined ? null : { LC: v.lc }), + ...(v.pm === undefined ? null : { PM: v.pm }), + ...(v.vc === undefined ? null : { VC: v.vc }), + ...(v.ws === undefined ? null : { WS: v.ws }), + ...(v.sm === undefined ? null : { SM: v.sm }), + ...(v.st === undefined ? null : { ST: v.st }), + ...(v.sa === undefined ? null : { SA: v.sa }), + ...(v.sn === undefined ? null : { SN: v.sn }), + ...(v.sc === undefined ? null : { SC: v.sc }), + ...(v.sl === undefined ? null : { SL: v.sl }), + ...(v.sg === undefined ? null : { SG: v.sg }), + ...(v.sk === undefined ? null : { SK: v.sk }), + ...(v.si === undefined ? null : { SI: v.si }), + ...(v.sb === undefined ? null : { SB: v.sb }), + ...(v.so === undefined ? null : { SO: v.so }), + ...(v.za === undefined ? null : { ZA: v.za }), + ...(v.gs === undefined ? null : { GS: v.gs }), + ...(v.es === undefined ? null : { ES: v.es }), + ...(v.lk === undefined ? null : { LK: v.lk }), + ...(v.sd === undefined ? null : { SD: v.sd }), + ...(v.sr === undefined ? null : { SR: v.sr }), + ...(v.sj === undefined ? null : { SJ: v.sj }), + ...(v.sz === undefined ? null : { SZ: v.sz }), + ...(v.se === undefined ? null : { SE: v.se }), + ...(v.ch === undefined ? null : { CH: v.ch }), + ...(v.sy === undefined ? null : { SY: v.sy }), + ...(v.tw === undefined ? null : { TW: v.tw }), + ...(v.tj === undefined ? null : { TJ: v.tj }), + ...(v.tz === undefined ? null : { TZ: v.tz }), + ...(v.th === undefined ? null : { TH: v.th }), + ...(v.tl === undefined ? null : { TL: v.tl }), + ...(v.tg === undefined ? null : { TG: v.tg }), + ...(v.tk === undefined ? null : { TK: v.tk }), + ...(v.to === undefined ? null : { TO: v.to }), + ...(v.tt === undefined ? null : { TT: v.tt }), + ...(v.tn === undefined ? null : { TN: v.tn }), + ...(v.tr === undefined ? null : { TR: v.tr }), + ...(v.tm === undefined ? null : { TM: v.tm }), + ...(v.tc === undefined ? null : { TC: v.tc }), + ...(v.tv === undefined ? null : { TV: v.tv }), + ...(v.ug === undefined ? null : { UG: v.ug }), + ...(v.ua === undefined ? null : { UA: v.ua }), + ...(v.ae === undefined ? null : { AE: v.ae }), + ...(v.gb === undefined ? null : { GB: v.gb }), + ...(v.us === undefined ? null : { US: v.us }), + ...(v.um === undefined ? null : { UM: v.um }), + ...(v.uy === undefined ? null : { UY: v.uy }), + ...(v.uz === undefined ? null : { UZ: v.uz }), + ...(v.vu === undefined ? null : { VU: v.vu }), + ...(v.ve === undefined ? null : { VE: v.ve }), + ...(v.vn === undefined ? null : { VN: v.vn }), + ...(v.vg === undefined ? null : { VG: v.vg }), + ...(v.vi === undefined ? null : { VI: v.vi }), + ...(v.wf === undefined ? null : { WF: v.wf }), + ...(v.eh === undefined ? null : { EH: v.eh }), + ...(v.ye === undefined ? null : { YE: v.ye }), + ...(v.zm === undefined ? null : { ZM: v.zm }), + ...(v.zw === undefined ? null : { ZW: v.zw }), + ...(v.ax === undefined ? null : { AX: v.ax }), + ...(v.bq === undefined ? null : { BQ: v.bq }), + ...(v.cw === undefined ? null : { CW: v.cw }), + ...(v.gg === undefined ? null : { GG: v.gg }), + ...(v.im === undefined ? null : { IM: v.im }), + ...(v.je === undefined ? null : { JE: v.je }), + ...(v.me === undefined ? null : { ME: v.me }), + ...(v.bl === undefined ? null : { BL: v.bl }), + ...(v.mf === undefined ? null : { MF: v.mf }), + ...(v.rs === undefined ? null : { RS: v.rs }), + ...(v.sx === undefined ? null : { SX: v.sx }), + ...(v.ss === undefined ? null : { SS: v.ss }), + ...(v.xk === undefined ? null : { XK: v.xk }), + }; + }); +} + +/** @internal */ +export namespace UpsertLinkRequestBody$ { + export type Inbound = { + url: string; + domain?: string | undefined; + key?: string | undefined; + externalId?: string | null | undefined; + prefix?: string | undefined; + archived?: boolean | undefined; + publicStats?: boolean | undefined; + tagId?: string | null | undefined; + tagIds?: string | Array | undefined; + tagNames?: string | Array | undefined; + comments?: string | null | undefined; + expiresAt?: string | null | undefined; + expiredUrl?: string | null | undefined; + password?: string | null | undefined; + proxy?: boolean | undefined; + title?: string | null | undefined; + description?: string | null | undefined; + image?: string | null | undefined; + rewrite?: boolean | undefined; + ios?: string | null | undefined; + android?: string | null | undefined; + geo?: UpsertLinkGeo$.Inbound | null | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + url: z.string(), + domain: z.string().optional(), + key: z.string().optional(), + externalId: z.nullable(z.string()).optional(), + prefix: z.string().optional(), + archived: z.boolean().default(false), + publicStats: z.boolean().default(false), + tagId: z.nullable(z.string()).optional(), + tagIds: z.union([z.string(), z.array(z.string())]).optional(), + tagNames: z.union([z.string(), z.array(z.string())]).optional(), + comments: z.nullable(z.string()).optional(), + expiresAt: z.nullable(z.string()).optional(), + expiredUrl: z.nullable(z.string()).optional(), + password: z.nullable(z.string()).optional(), + proxy: z.boolean().default(false), + title: z.nullable(z.string()).optional(), + description: z.nullable(z.string()).optional(), + image: z.nullable(z.string()).optional(), + rewrite: z.boolean().default(false), + ios: z.nullable(z.string()).optional(), + android: z.nullable(z.string()).optional(), + geo: z.nullable(z.lazy(() => UpsertLinkGeo$.inboundSchema)).optional(), + }) + .transform((v) => { + return { + url: v.url, + ...(v.domain === undefined ? null : { domain: v.domain }), + ...(v.key === undefined ? null : { key: v.key }), + ...(v.externalId === undefined ? null : { externalId: v.externalId }), + ...(v.prefix === undefined ? null : { prefix: v.prefix }), + archived: v.archived, + publicStats: v.publicStats, + ...(v.tagId === undefined ? null : { tagId: v.tagId }), + ...(v.tagIds === undefined ? null : { tagIds: v.tagIds }), + ...(v.tagNames === undefined ? null : { tagNames: v.tagNames }), + ...(v.comments === undefined ? null : { comments: v.comments }), + ...(v.expiresAt === undefined ? null : { expiresAt: v.expiresAt }), + ...(v.expiredUrl === undefined ? null : { expiredUrl: v.expiredUrl }), + ...(v.password === undefined ? null : { password: v.password }), + proxy: v.proxy, + ...(v.title === undefined ? null : { title: v.title }), + ...(v.description === undefined ? null : { description: v.description }), + ...(v.image === undefined ? null : { image: v.image }), + rewrite: v.rewrite, + ...(v.ios === undefined ? null : { ios: v.ios }), + ...(v.android === undefined ? null : { android: v.android }), + ...(v.geo === undefined ? null : { geo: v.geo }), + }; + }); + + export type Outbound = { + url: string; + domain?: string | undefined; + key?: string | undefined; + externalId?: string | null | undefined; + prefix?: string | undefined; + archived: boolean; + publicStats: boolean; + tagId?: string | null | undefined; + tagIds?: string | Array | undefined; + tagNames?: string | Array | undefined; + comments?: string | null | undefined; + expiresAt?: string | null | undefined; + expiredUrl?: string | null | undefined; + password?: string | null | undefined; + proxy: boolean; + title?: string | null | undefined; + description?: string | null | undefined; + image?: string | null | undefined; + rewrite: boolean; + ios?: string | null | undefined; + android?: string | null | undefined; + geo?: UpsertLinkGeo$.Outbound | null | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + url: z.string(), + domain: z.string().optional(), + key: z.string().optional(), + externalId: z.nullable(z.string()).optional(), + prefix: z.string().optional(), + archived: z.boolean().default(false), + publicStats: z.boolean().default(false), + tagId: z.nullable(z.string()).optional(), + tagIds: z.union([z.string(), z.array(z.string())]).optional(), + tagNames: z.union([z.string(), z.array(z.string())]).optional(), + comments: z.nullable(z.string()).optional(), + expiresAt: z.nullable(z.string()).optional(), + expiredUrl: z.nullable(z.string()).optional(), + password: z.nullable(z.string()).optional(), + proxy: z.boolean().default(false), + title: z.nullable(z.string()).optional(), + description: z.nullable(z.string()).optional(), + image: z.nullable(z.string()).optional(), + rewrite: z.boolean().default(false), + ios: z.nullable(z.string()).optional(), + android: z.nullable(z.string()).optional(), + geo: z.nullable(z.lazy(() => UpsertLinkGeo$.outboundSchema)).optional(), + }) + .transform((v) => { + return { + url: v.url, + ...(v.domain === undefined ? null : { domain: v.domain }), + ...(v.key === undefined ? null : { key: v.key }), + ...(v.externalId === undefined ? null : { externalId: v.externalId }), + ...(v.prefix === undefined ? null : { prefix: v.prefix }), + archived: v.archived, + publicStats: v.publicStats, + ...(v.tagId === undefined ? null : { tagId: v.tagId }), + ...(v.tagIds === undefined ? null : { tagIds: v.tagIds }), + ...(v.tagNames === undefined ? null : { tagNames: v.tagNames }), + ...(v.comments === undefined ? null : { comments: v.comments }), + ...(v.expiresAt === undefined ? null : { expiresAt: v.expiresAt }), + ...(v.expiredUrl === undefined ? null : { expiredUrl: v.expiredUrl }), + ...(v.password === undefined ? null : { password: v.password }), + proxy: v.proxy, + ...(v.title === undefined ? null : { title: v.title }), + ...(v.description === undefined ? null : { description: v.description }), + ...(v.image === undefined ? null : { image: v.image }), + rewrite: v.rewrite, + ...(v.ios === undefined ? null : { ios: v.ios }), + ...(v.android === undefined ? null : { android: v.android }), + ...(v.geo === undefined ? null : { geo: v.geo }), + }; + }); +} diff --git a/src/sdk/analytics.ts b/src/sdk/analytics.ts index 42bde43..9d20101 100644 --- a/src/sdk/analytics.ts +++ b/src/sdk/analytics.ts @@ -75,6 +75,7 @@ export class Analytics extends ClientSDK { }), enc$.encodeForm("device", payload$.device, { explode: true, charEncoding: "percent" }), enc$.encodeForm("domain", payload$.domain, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("end", payload$.end, { explode: true, charEncoding: "percent" }), enc$.encodeForm("externalId", payload$.externalId, { explode: true, charEncoding: "percent", @@ -96,6 +97,7 @@ export class Analytics extends ClientSDK { charEncoding: "percent", }), enc$.encodeForm("root", payload$.root, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("start", payload$.start, { explode: true, charEncoding: "percent" }), enc$.encodeForm("tagId", payload$.tagId, { explode: true, charEncoding: "percent" }), enc$.encodeForm("url", payload$.url, { explode: true, charEncoding: "percent" }), enc$.encodeForm("workspaceId", this.options$.workspaceId, { @@ -332,6 +334,7 @@ export class Analytics extends ClientSDK { }), enc$.encodeForm("device", payload$.device, { explode: true, charEncoding: "percent" }), enc$.encodeForm("domain", payload$.domain, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("end", payload$.end, { explode: true, charEncoding: "percent" }), enc$.encodeForm("externalId", payload$.externalId, { explode: true, charEncoding: "percent", @@ -353,6 +356,7 @@ export class Analytics extends ClientSDK { charEncoding: "percent", }), enc$.encodeForm("root", payload$.root, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("start", payload$.start, { explode: true, charEncoding: "percent" }), enc$.encodeForm("tagId", payload$.tagId, { explode: true, charEncoding: "percent" }), enc$.encodeForm("url", payload$.url, { explode: true, charEncoding: "percent" }), enc$.encodeForm("workspaceId", this.options$.workspaceId, { @@ -589,6 +593,7 @@ export class Analytics extends ClientSDK { }), enc$.encodeForm("device", payload$.device, { explode: true, charEncoding: "percent" }), enc$.encodeForm("domain", payload$.domain, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("end", payload$.end, { explode: true, charEncoding: "percent" }), enc$.encodeForm("externalId", payload$.externalId, { explode: true, charEncoding: "percent", @@ -610,6 +615,7 @@ export class Analytics extends ClientSDK { charEncoding: "percent", }), enc$.encodeForm("root", payload$.root, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("start", payload$.start, { explode: true, charEncoding: "percent" }), enc$.encodeForm("tagId", payload$.tagId, { explode: true, charEncoding: "percent" }), enc$.encodeForm("url", payload$.url, { explode: true, charEncoding: "percent" }), enc$.encodeForm("workspaceId", this.options$.workspaceId, { @@ -848,6 +854,7 @@ export class Analytics extends ClientSDK { }), enc$.encodeForm("device", payload$.device, { explode: true, charEncoding: "percent" }), enc$.encodeForm("domain", payload$.domain, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("end", payload$.end, { explode: true, charEncoding: "percent" }), enc$.encodeForm("externalId", payload$.externalId, { explode: true, charEncoding: "percent", @@ -869,6 +876,7 @@ export class Analytics extends ClientSDK { charEncoding: "percent", }), enc$.encodeForm("root", payload$.root, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("start", payload$.start, { explode: true, charEncoding: "percent" }), enc$.encodeForm("tagId", payload$.tagId, { explode: true, charEncoding: "percent" }), enc$.encodeForm("url", payload$.url, { explode: true, charEncoding: "percent" }), enc$.encodeForm("workspaceId", this.options$.workspaceId, { @@ -1107,6 +1115,7 @@ export class Analytics extends ClientSDK { }), enc$.encodeForm("device", payload$.device, { explode: true, charEncoding: "percent" }), enc$.encodeForm("domain", payload$.domain, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("end", payload$.end, { explode: true, charEncoding: "percent" }), enc$.encodeForm("externalId", payload$.externalId, { explode: true, charEncoding: "percent", @@ -1128,6 +1137,7 @@ export class Analytics extends ClientSDK { charEncoding: "percent", }), enc$.encodeForm("root", payload$.root, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("start", payload$.start, { explode: true, charEncoding: "percent" }), enc$.encodeForm("tagId", payload$.tagId, { explode: true, charEncoding: "percent" }), enc$.encodeForm("url", payload$.url, { explode: true, charEncoding: "percent" }), enc$.encodeForm("workspaceId", this.options$.workspaceId, { @@ -1366,6 +1376,7 @@ export class Analytics extends ClientSDK { }), enc$.encodeForm("device", payload$.device, { explode: true, charEncoding: "percent" }), enc$.encodeForm("domain", payload$.domain, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("end", payload$.end, { explode: true, charEncoding: "percent" }), enc$.encodeForm("externalId", payload$.externalId, { explode: true, charEncoding: "percent", @@ -1387,6 +1398,7 @@ export class Analytics extends ClientSDK { charEncoding: "percent", }), enc$.encodeForm("root", payload$.root, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("start", payload$.start, { explode: true, charEncoding: "percent" }), enc$.encodeForm("tagId", payload$.tagId, { explode: true, charEncoding: "percent" }), enc$.encodeForm("url", payload$.url, { explode: true, charEncoding: "percent" }), enc$.encodeForm("workspaceId", this.options$.workspaceId, { @@ -1625,6 +1637,7 @@ export class Analytics extends ClientSDK { }), enc$.encodeForm("device", payload$.device, { explode: true, charEncoding: "percent" }), enc$.encodeForm("domain", payload$.domain, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("end", payload$.end, { explode: true, charEncoding: "percent" }), enc$.encodeForm("externalId", payload$.externalId, { explode: true, charEncoding: "percent", @@ -1646,6 +1659,7 @@ export class Analytics extends ClientSDK { charEncoding: "percent", }), enc$.encodeForm("root", payload$.root, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("start", payload$.start, { explode: true, charEncoding: "percent" }), enc$.encodeForm("tagId", payload$.tagId, { explode: true, charEncoding: "percent" }), enc$.encodeForm("url", payload$.url, { explode: true, charEncoding: "percent" }), enc$.encodeForm("workspaceId", this.options$.workspaceId, { @@ -1884,6 +1898,7 @@ export class Analytics extends ClientSDK { }), enc$.encodeForm("device", payload$.device, { explode: true, charEncoding: "percent" }), enc$.encodeForm("domain", payload$.domain, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("end", payload$.end, { explode: true, charEncoding: "percent" }), enc$.encodeForm("externalId", payload$.externalId, { explode: true, charEncoding: "percent", @@ -1905,6 +1920,7 @@ export class Analytics extends ClientSDK { charEncoding: "percent", }), enc$.encodeForm("root", payload$.root, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("start", payload$.start, { explode: true, charEncoding: "percent" }), enc$.encodeForm("tagId", payload$.tagId, { explode: true, charEncoding: "percent" }), enc$.encodeForm("url", payload$.url, { explode: true, charEncoding: "percent" }), enc$.encodeForm("workspaceId", this.options$.workspaceId, { @@ -2143,6 +2159,7 @@ export class Analytics extends ClientSDK { }), enc$.encodeForm("device", payload$.device, { explode: true, charEncoding: "percent" }), enc$.encodeForm("domain", payload$.domain, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("end", payload$.end, { explode: true, charEncoding: "percent" }), enc$.encodeForm("externalId", payload$.externalId, { explode: true, charEncoding: "percent", @@ -2164,6 +2181,7 @@ export class Analytics extends ClientSDK { charEncoding: "percent", }), enc$.encodeForm("root", payload$.root, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("start", payload$.start, { explode: true, charEncoding: "percent" }), enc$.encodeForm("tagId", payload$.tagId, { explode: true, charEncoding: "percent" }), enc$.encodeForm("url", payload$.url, { explode: true, charEncoding: "percent" }), enc$.encodeForm("workspaceId", this.options$.workspaceId, { @@ -2400,6 +2418,7 @@ export class Analytics extends ClientSDK { }), enc$.encodeForm("device", payload$.device, { explode: true, charEncoding: "percent" }), enc$.encodeForm("domain", payload$.domain, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("end", payload$.end, { explode: true, charEncoding: "percent" }), enc$.encodeForm("externalId", payload$.externalId, { explode: true, charEncoding: "percent", @@ -2421,6 +2440,7 @@ export class Analytics extends ClientSDK { charEncoding: "percent", }), enc$.encodeForm("root", payload$.root, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("start", payload$.start, { explode: true, charEncoding: "percent" }), enc$.encodeForm("tagId", payload$.tagId, { explode: true, charEncoding: "percent" }), enc$.encodeForm("url", payload$.url, { explode: true, charEncoding: "percent" }), enc$.encodeForm("workspaceId", this.options$.workspaceId, { diff --git a/src/sdk/links.ts b/src/sdk/links.ts index 1bac145..4cefa0f 100644 --- a/src/sdk/links.ts +++ b/src/sdk/links.ts @@ -1236,7 +1236,7 @@ export class Links extends ClientSDK { * Update a link * * @remarks - * Update a link for the authenticated workspace. + * Update a link for the authenticated workspace. If there's no change, returns as is. */ async update( linkId: string, @@ -1698,4 +1698,233 @@ export class Links extends ClientSDK { ); } } + + /** + * Upsert a link + * + * @remarks + * Upsert a link for the authenticated workspace by its URL. If a link with the same URL already exists, returns as is if there's no change, or update it. Otherwise, a new link will be created. + */ + async upsert( + request?: operations.UpsertLinkRequestBody | undefined, + options?: RequestOptions + ): Promise { + const input$ = request; + const headers$ = new Headers(); + headers$.set("user-agent", SDK_METADATA.userAgent); + headers$.set("Content-Type", "application/json"); + headers$.set("Accept", "application/json"); + + const payload$ = schemas$.parse( + input$, + (value$) => operations.UpsertLinkRequestBody$.outboundSchema.optional().parse(value$), + "Input validation failed" + ); + const body$ = + payload$ === undefined ? null : enc$.encodeJSON("body", payload$, { explode: true }); + + const path$ = this.templateURLComponent("/links/upsert")(); + + const query$ = [ + enc$.encodeForm("projectSlug", this.options$.projectSlug, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("workspaceId", this.options$.workspaceId, { + explode: true, + charEncoding: "percent", + }), + ] + .filter(Boolean) + .join("&"); + + let security$; + if (typeof this.options$.token === "function") { + security$ = { token: await this.options$.token() }; + } else if (this.options$.token) { + security$ = { token: this.options$.token }; + } else { + security$ = {}; + } + const context = { + operationID: "upsertLink", + oAuth2Scopes: [], + securitySource: this.options$.token, + }; + const securitySettings$ = this.resolveGlobalSecurity(security$); + + const doOptions = { + context, + errorCodes: [ + "400", + "401", + "403", + "404", + "409", + "410", + "422", + "429", + "4XX", + "500", + "5XX", + ], + }; + const request$ = this.createRequest$( + context, + { + security: securitySettings$, + method: "PUT", + path: path$, + headers: headers$, + query: query$, + body: body$, + }, + options + ); + + const response = await this.do$(request$, doOptions); + + const responseFields$ = { + HttpMeta: { + Response: response, + Request: request$, + }, + }; + + if (this.matchResponse(response, 200, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return components.LinkSchema$.inboundSchema.parse(val$); + }, + "Response validation failed" + ); + return result; + } else if (this.matchResponse(response, 400, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.BadRequest$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 401, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.Unauthorized$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 403, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.Forbidden$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 404, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.NotFound$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 409, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.Conflict$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 410, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.InviteExpired$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 422, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.UnprocessableEntity$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 429, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.RateLimitExceeded$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 500, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.InternalServerError$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else { + const responseBody = await response.text(); + throw new errors.SDKError( + "Unexpected API response status or content-type", + response, + responseBody + ); + } + } } diff --git a/src/sdk/qrcodes.ts b/src/sdk/qrcodes.ts index b9d7437..24052ff 100644 --- a/src/sdk/qrcodes.ts +++ b/src/sdk/qrcodes.ts @@ -45,11 +45,8 @@ export class QRCodes extends ClientSDK { * @remarks * Retrieve a QR code for a link. */ - async get( - request?: operations.GetQRCodeRequest | undefined, - options?: RequestOptions - ): Promise { - const input$ = typeof request === "undefined" ? {} : request; + async get(request: operations.GetQRCodeRequest, options?: RequestOptions): Promise { + const input$ = request; const headers$ = new Headers(); headers$.set("user-agent", SDK_METADATA.userAgent); headers$.set("Accept", "image/png");