Skip to content

Commit

Permalink
Merge pull request #82 from dubinc/speakeasy-sdk-regen-1728174200
Browse files Browse the repository at this point in the history
chore: 🐝 Update Specs - Merge Code Samples Into OpenAPI Spec
  • Loading branch information
steven-tey authored Oct 6, 2024
2 parents 1e153ea + b769e49 commit 1645b43
Show file tree
Hide file tree
Showing 2 changed files with 138 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
speakeasyVersion: 1.409.0
speakeasyVersion: 1.410.0
sources:
merge-code-samples-into-spec:
sourceNamespace: merge-code-samples-into-spec
sourceRevisionDigest: sha256:51d524a97d8f67c5ce9b3d5fa56c6c90ef18992929e2346314793a46e1ef9444
sourceBlobDigest: sha256:91de63a155930da8cd3fada625ca9c7d9ccba37836b6a62eb435c7123a6872de
sourceRevisionDigest: sha256:883746dc43cf13c1fa863f496be1f8f38d26fa3375d519704673e17e23384c4d
sourceBlobDigest: sha256:65f76a242333b295a989324cba95138f923b9740884dcb03227972f89a740235
tags:
- latest
- main
Expand Down
145 changes: 135 additions & 10 deletions openapi-with-code-samples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1331,7 +1331,7 @@ paths:
parameters:
- in: "query"
name: "event"
description: "The type of event to retrieve analytics for. Defaults to 'clicks'."
description: "The type of event to retrieve analytics for. Defaults to `clicks`."
schema:
type: "string"
enum:
Expand All @@ -1340,10 +1340,10 @@ paths:
- "sales"
- "composite"
default: "clicks"
description: "The type of event to retrieve analytics for. Defaults to 'clicks'."
description: "The type of event to retrieve analytics for. Defaults to `clicks`."
- in: "query"
name: "groupBy"
description: "The parameter to group the analytics data points by. Defaults to 'count' if undefined."
description: "The parameter to group the analytics data points by. Defaults to `count` if undefined. Note that `trigger` is deprecated (use `triggers` instead), but kept for backwards compatibility."
schema:
type: "string"
enum:
Expand All @@ -1355,13 +1355,14 @@ paths:
- "devices"
- "browsers"
- "os"
- "trigger"
- "triggers"
- "referers"
- "referer_urls"
- "top_links"
- "top_urls"
- "trigger"
default: "count"
description: "The parameter to group the analytics data points by. Defaults to 'count' if undefined."
description: "The parameter to group the analytics data points by. Defaults to `count` if undefined. Note that `trigger` is deprecated (use `triggers` instead), but kept for backwards compatibility."
- in: "query"
name: "domain"
description: "The domain to filter analytics for."
Expand Down Expand Up @@ -1457,6 +1458,15 @@ paths:
type: "string"
description: "The OS to retrieve analytics for."
example: "Windows"
- in: "query"
name: "trigger"
description: "The trigger to retrieve analytics for. If undefined, return both QR and link clicks."
schema:
type: "string"
enum:
- "qr"
- "link"
description: "The trigger to retrieve analytics for. If undefined, return both QR and link clicks."
- in: "query"
name: "referer"
description: "The referer to retrieve analytics for."
Expand Down Expand Up @@ -1485,10 +1495,11 @@ paths:
description: "The tag ID to retrieve analytics for."
- in: "query"
name: "qr"
description: "Filter for QR code scans. If true, filter for QR codes only. If false, filter for links only. If undefined, return both."
description: "Deprecated. Use the `trigger` field instead. Filter for QR code scans. If true, filter for QR codes only. If false, filter for links only. If undefined, return both."
schema:
type: "boolean"
description: "Filter for QR code scans. If true, filter for QR codes only. If false, filter for links only. If undefined, return both."
description: "Deprecated. Use the `trigger` field instead. Filter for QR code scans. If true, filter for QR codes only. If false, filter for links only. If undefined, return both."
deprecated: true
- in: "query"
name: "root"
description: "Filter for root domains. If true, filter for domains only. If false, filter for links only. If undefined, return both."
Expand All @@ -1506,6 +1517,9 @@ paths:
- type: "array"
items: {"$ref": "#/components/schemas/AnalyticsTimeseries"}
title: "AnalyticsTimeseries"
- type: "array"
items: {"$ref": "#/components/schemas/AnalyticsContinents"}
title: "AnalyticsContinents"
- type: "array"
items: {"$ref": "#/components/schemas/AnalyticsCountries"}
title: "AnalyticsCountries"
Expand All @@ -1521,9 +1535,15 @@ paths:
- type: "array"
items: {"$ref": "#/components/schemas/AnalyticsOS"}
title: "AnalyticsOS"
- type: "array"
items: {"$ref": "#/components/schemas/AnalyticsTriggers"}
title: "AnalyticsTriggers"
- type: "array"
items: {"$ref": "#/components/schemas/AnalyticsReferers"}
title: "AnalyticsReferers"
- type: "array"
items: {"$ref": "#/components/schemas/AnalyticsRefererUrls"}
title: "AnalyticsRefererUrls"
- type: "array"
items: {"$ref": "#/components/schemas/AnalyticsTopLinks"}
title: "AnalyticsTopLinks"
Expand Down Expand Up @@ -1657,6 +1677,15 @@ paths:
type: "string"
description: "The OS to retrieve analytics for."
example: "Windows"
- in: "query"
name: "trigger"
description: "The trigger to retrieve analytics for. If undefined, return both QR and link clicks."
schema:
type: "string"
enum:
- "qr"
- "link"
description: "The trigger to retrieve analytics for. If undefined, return both QR and link clicks."
- in: "query"
name: "referer"
description: "The referer to retrieve analytics for."
Expand Down Expand Up @@ -1685,10 +1714,11 @@ paths:
description: "The tag ID to retrieve analytics for."
- in: "query"
name: "qr"
description: "Filter for QR code scans. If true, filter for QR codes only. If false, filter for links only. If undefined, return both."
description: "Deprecated. Use the `trigger` field instead. Filter for QR code scans. If true, filter for QR codes only. If false, filter for links only. If undefined, return both."
schema:
type: "boolean"
description: "Filter for QR code scans. If true, filter for QR codes only. If false, filter for links only. If undefined, return both."
description: "Deprecated. Use the `trigger` field instead. Filter for QR code scans. If true, filter for QR codes only. If false, filter for links only. If undefined, return both."
deprecated: true
- in: "query"
name: "root"
description: "Filter for root domains. If true, filter for domains only. If false, filter for links only. If undefined, return both."
Expand Down Expand Up @@ -2068,7 +2098,7 @@ paths:
operationId: "listDomains"
x-speakeasy-name-override: "list"
x-speakeasy-pagination: {"type": "offsetLimit", "inputs": [{"name": "page", "in": "parameters", "type": "page"}, {"name": "pageSize", "in": "parameters", "type": "limit"}], "outputs": {"results": "$"}}
x-codeSamples: [{"lang": "typescript", "label": "listDomains", "source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.domains.list();\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();"}, {"lang": "go", "label": "listDomains", "source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"github.com/dubinc/dub-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Domains.List(ctx, operations.ListDomainsRequest{\n Page: dubgo.Float64(1),\n PageSize: dubgo.Float64(50),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n for {\n // handle items\n \n res, err = res.Next()\n \n if err != nil {\n // handle error\n }\n \n if res == nil {\n break\n }\n }\n \n }\n}"}, {"lang": "ruby", "label": "listDomains", "source": "require 'dub'\n\n\ns = ::OpenApiSDK::Dub.new\ns.config_security(\n ::OpenApiSDK::Shared::Security.new(\n token: \"DUB_API_KEY\",\n )\n)\n\n\nreq = ::OpenApiSDK::Operations::ListDomainsRequest.new(\n page: 1.0,\n page_size: 50.0,\n)\n \nres = s.domains.list(req)\n\nif ! res.domain_schemas.nil?\n # handle response\nend"}, {"lang": "php", "label": "listDomains", "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse Dub;\n\n$security = 'DUB_API_KEY';\n\n$sdk = Dub\\Dub::builder()->setSecurity($security)->build();\n\n\n\n$response = $sdk->domains->list(\n archived: false,\n search: '<value>',\n page: 1,\n pageSize: 50\n\n);\n\nif ($response->domainSchemas !== null) {\n // handle response\n}"}, {lang: python, label: listDomains, source: "from dub import Dub\n\ns = Dub(\n token=\"DUB_API_KEY\",\n)\n\nres = s.domains.list(request={\n \"page\": 1,\n \"page_size\": 50,\n})\n\nif res is not None:\n while True:\n # handle items\n\n res = res.next()\n if res is None:\n break"}, {"lang": "java", "source": "OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n .url(\"https://api.dub.co/domains\")\n .get()\n .addHeader(\"accept\", \"application/json\")\n .addHeader(\"authorization\", \"Bearer MY_TOKEN\")\n .build();\n\nResponse response = client.newCall(request).execute();"}]
x-codeSamples: [{"lang": "typescript", "label": "listDomains", "source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.domains.list();\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();"}, {"lang": "go", "label": "listDomains", "source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"github.com/dubinc/dub-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Domains.List(ctx, operations.ListDomainsRequest{\n Page: dubgo.Float64(1),\n PageSize: dubgo.Float64(50),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n for {\n // handle items\n \n res, err = res.Next()\n \n if err != nil {\n // handle error\n }\n \n if res == nil {\n break\n }\n }\n \n }\n}"}, {"lang": "ruby", "label": "listDomains", "source": "require 'dub'\n\n\ns = ::OpenApiSDK::Dub.new\ns.config_security(\n ::OpenApiSDK::Shared::Security.new(\n token: \"DUB_API_KEY\",\n )\n)\n\n\nreq = ::OpenApiSDK::Operations::ListDomainsRequest.new(\n page: 1.0,\n page_size: 50.0,\n)\n \nres = s.domains.list(req)\n\nif ! res.domain_schemas.nil?\n # handle response\nend"}, {"lang": "php", "label": "listDomains", "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse Dub;\n\n$security = 'DUB_API_KEY';\n\n$sdk = Dub\\Dub::builder()->setSecurity($security)->build();\n\n\n\n$response = $sdk->domains->list(\n archived: true,\n search: '<value>',\n page: 1,\n pageSize: 50\n\n);\n\nif ($response->domainSchemas !== null) {\n // handle response\n}"}, {lang: python, label: listDomains, source: "from dub import Dub\n\ns = Dub(\n token=\"DUB_API_KEY\",\n)\n\nres = s.domains.list(request={\n \"page\": 1,\n \"page_size\": 50,\n})\n\nif res is not None:\n while True:\n # handle items\n\n res = res.next()\n if res is None:\n break"}, {"lang": "java", "source": "OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n .url(\"https://api.dub.co/domains\")\n .get()\n .addHeader(\"accept\", \"application/json\")\n .addHeader(\"authorization\", \"Bearer MY_TOKEN\")\n .build();\n\nResponse response = client.newCall(request).execute();"}]
summary: "Retrieve a list of domains"
description: "Retrieve a list of domains associated with the authenticated workspace."
tags:
Expand Down Expand Up @@ -4636,6 +4666,42 @@ components:
- "leads"
- "sales"
- "saleAmount"
"AnalyticsContinents":
type: "object"
properties:
"continent":
type: "string"
enum:
- "AF"
- "AN"
- "AS"
- "EU"
- "NA"
- "OC"
- "SA"
description: "The 2-letter ISO 3166-1 code representing the continent associated with the location of the user."
"clicks":
type: "number"
description: "The number of clicks from this continent"
default: 0
"leads":
type: "number"
description: "The number of leads from this continent"
default: 0
"sales":
type: "number"
description: "The number of sales from this continent"
default: 0
"saleAmount":
type: "number"
description: "The total amount of sales from this continent, in cents"
default: 0
required:
- "continent"
- "clicks"
- "leads"
- "sales"
- "saleAmount"
"AnalyticsCountries":
type: "object"
properties:
Expand Down Expand Up @@ -5288,6 +5354,37 @@ components:
- "leads"
- "sales"
- "saleAmount"
"AnalyticsTriggers":
type: "object"
properties:
"trigger":
type: "string"
enum:
- "qr"
- "link"
description: "The type of trigger method: link click or QR scan"
"clicks":
type: "number"
description: "The number of clicks from this trigger method"
default: 0
"leads":
type: "number"
description: "The number of leads from this trigger method"
default: 0
"sales":
type: "number"
description: "The number of sales from this trigger method"
default: 0
"saleAmount":
type: "number"
description: "The total amount of sales from this trigger method, in cents"
default: 0
required:
- "trigger"
- "clicks"
- "leads"
- "sales"
- "saleAmount"
"AnalyticsReferers":
type: "object"
properties:
Expand Down Expand Up @@ -5316,6 +5413,34 @@ components:
- "leads"
- "sales"
- "saleAmount"
"AnalyticsRefererUrls":
type: "object"
properties:
"refererUrl":
type: "string"
description: "The full URL of the referer. If unknown, this will be `(direct)`"
"clicks":
type: "number"
description: "The number of clicks from this referer to this URL"
default: 0
"leads":
type: "number"
description: "The number of leads from this referer to this URL"
default: 0
"sales":
type: "number"
description: "The number of sales from this referer to this URL"
default: 0
"saleAmount":
type: "number"
description: "The total amount of sales from this referer to this URL, in cents"
default: 0
required:
- "refererUrl"
- "clicks"
- "leads"
- "sales"
- "saleAmount"
"AnalyticsTopLinks":
type: "object"
properties:
Expand Down

0 comments on commit 1645b43

Please sign in to comment.