diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 4517c05..7d932e1 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -5,8 +5,8 @@ management: docVersion: 1.0.0 speakeasyVersion: 1.286.0 generationVersion: 2.326.3 - releaseVersion: 0.1.8 - configChecksum: 173058f2fa10a0204e8588ee8245a2ab + releaseVersion: 0.1.9 + configChecksum: 804fe5269ba412bff73d4706ac012430 repoURL: https://github.com/unkeyed/unkey-go.git installationURL: https://github.com/unkeyed/unkey-go features: diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 695c848..256a626 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -12,7 +12,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: true go: - version: 0.1.8 + version: 0.1.9 additionalDependencies: {} clientServerStatusCodesAsErrors: true flattenGlobalSecurity: true diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 387b53b..820f1f6 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.286.0 sources: openapi.json: sourceNamespace: openapi-json - sourceRevisionDigest: sha256:1d2e7fcc77fec09e058c9d92c1bae2ec714a24bd26d287fb9e6f144edd7d6366 - sourceBlobDigest: sha256:b14b191758a80b98c783547d814e979d08a8423d60b506c1453f3e2e14e9f59e + sourceRevisionDigest: sha256:ac05bb0f5c3a362720650d5dacb4c16503a78f8b0aaebd6d9525fb27869028b2 + sourceBlobDigest: sha256:f0cdc501f15708ac39aefbdeb32553e5ce6a19b4dc32f7e3976c1b91b53eb6ba tags: - latest - main @@ -11,8 +11,8 @@ targets: go: source: openapi.json sourceNamespace: openapi-json - sourceRevisionDigest: sha256:1d2e7fcc77fec09e058c9d92c1bae2ec714a24bd26d287fb9e6f144edd7d6366 - sourceBlobDigest: sha256:b14b191758a80b98c783547d814e979d08a8423d60b506c1453f3e2e14e9f59e + sourceRevisionDigest: sha256:ac05bb0f5c3a362720650d5dacb4c16503a78f8b0aaebd6d9525fb27869028b2 + sourceBlobDigest: sha256:f0cdc501f15708ac39aefbdeb32553e5ce6a19b4dc32f7e3976c1b91b53eb6ba outLocation: /github/workspace/repo workflow: workflowVersion: 1.0.0 diff --git a/RELEASES.md b/RELEASES.md index 85a4c41..1a297f0 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -18,4 +18,14 @@ Based on: ### Generated - [go v0.1.8] . ### Releases -- [Go v0.1.8] https://github.com/unkeyed/unkey-go/releases/tag/v0.1.8 - . \ No newline at end of file +- [Go v0.1.8] https://github.com/unkeyed/unkey-go/releases/tag/v0.1.8 - . + +## 2024-05-11 17:06:27 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.286.0 (2.326.3) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v0.1.9] . +### Releases +- [Go v0.1.9] https://github.com/unkeyed/unkey-go/releases/tag/v0.1.9 - . \ No newline at end of file diff --git a/codeSamples.yaml b/codeSamples.yaml index d8b9c70..493bce9 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -3,105 +3,105 @@ info: title: CodeSamples overlay for go target version: 0.0.0 actions: - - target: $["paths"]["/v1/apis.getApi"]["get"] + - target: $["paths"]["/v1/apis.listKeys"]["get"] update: "x-codeSamples": - "lang": "go" - "label": "getApi" - "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey/models/components\"\n\t\"github.com/unkeyed/unkey\"\n\t\"github.com/unkeyed/unkey/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkey.New(\n unkey.WithSecurity(\"\"),\n )\n\n request := operations.GetAPIRequest{\n APIID: \"api_1234\",\n }\n \n ctx := context.Background()\n res, err := s.GetAPI(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - - target: $["paths"]["/v1/ratelimits.limit"]["post"] + "label": "listKeys" + "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey/models/components\"\n\t\"github.com/unkeyed/unkey\"\n\t\"github.com/unkeyed/unkey/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkey.New(\n unkey.WithSecurity(\"\"),\n )\n\n request := operations.ListKeysRequest{\n APIID: \"api_1234\",\n Limit: unkey.Int64(100),\n }\n \n ctx := context.Background()\n res, err := s.ListKeys(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" + - target: $["paths"]["/v1/keys"]["post"] update: "x-codeSamples": - "lang": "go" - "label": "limit" - "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey/models/components\"\n\t\"github.com/unkeyed/unkey\"\n\t\"github.com/unkeyed/unkey/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkey.New(\n unkey.WithSecurity(\"\"),\n )\n\n request := operations.LimitRequestBody{\n Namespace: unkey.String(\"email.outbound\"),\n Identifier: \"user_123\",\n Limit: 10,\n Duration: 60000,\n Cost: unkey.Int64(2),\n Resources: []operations.Resources{\n operations.Resources{\n Type: \"project\",\n ID: \"p_123\",\n Name: unkey.String(\"dub\"),\n },\n },\n }\n \n ctx := context.Background()\n res, err := s.Limit(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - - target: $["paths"]["/v1/keys/verify"]["post"] + "label": "createKey" + "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey/models/components\"\n\t\"github.com/unkeyed/unkey\"\n\t\"github.com/unkeyed/unkey/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkey.New(\n unkey.WithSecurity(\"\"),\n )\n\n request := operations.DeprecatedCreateKeyRequestBody{\n APIID: \"api_123\",\n Name: unkey.String(\"my key\"),\n OwnerID: unkey.String(\"team_123\"),\n Meta: map[string]interface{}{\n \"billingTier\": \"PRO\",\n \"trialEnds\": \"2023-06-16T17:16:37.161Z\",\n },\n Expires: unkey.Int64(1623869797161),\n Remaining: unkey.Int64(1000),\n Ratelimit: &operations.DeprecatedCreateKeyRatelimit{\n Type: operations.DeprecatedCreateKeyTypeFast.ToPointer(),\n Limit: 10,\n RefillRate: 1,\n RefillInterval: 60,\n },\n }\n \n ctx := context.Background()\n res, err := s.DeprecatedCreateKey(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" + - target: $["paths"]["/v1/keys.verifyKey"]["post"] update: "x-codeSamples": - "lang": "go" "label": "verifyKey" - "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey/models/components\"\n\t\"github.com/unkeyed/unkey\"\n\t\"github.com/unkeyed/unkey/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkey.New(\n unkey.WithSecurity(\"\"),\n )\n\n request := operations.DeprecatedVerifyKeyRequestBody{\n APIID: unkey.String(\"api_1234\"),\n Key: \"sk_1234\",\n }\n \n ctx := context.Background()\n res, err := s.DeprecatedVerifyKey(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - - target: $["paths"]["/v1/apis/{apiId}/keys"]["get"] + "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey/models/components\"\n\t\"github.com/unkeyed/unkey\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkey.New(\n unkey.WithSecurity(\"\"),\n )\n\n request := components.V1KeysVerifyKeyRequest{\n APIID: unkey.String(\"api_1234\"),\n Key: \"sk_1234\",\n Authorization: &components.Authorization{\n Permissions: &components.Permissions{},\n },\n }\n \n ctx := context.Background()\n res, err := s.VerifyKey(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" + - target: $["paths"]["/v1/apis.getApi"]["get"] update: "x-codeSamples": - "lang": "go" - "label": "listKeys" - "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey/models/components\"\n\t\"github.com/unkeyed/unkey\"\n\t\"github.com/unkeyed/unkey/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkey.New(\n unkey.WithSecurity(\"\"),\n )\n\n request := operations.DeprecatedListKeysRequest{\n APIID: \"api_1234\",\n Limit: unkey.Int64(100),\n }\n \n ctx := context.Background()\n res, err := s.DeprecatedListKeys(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - - target: $["paths"]["/v1/liveness"]["get"] + "label": "getApi" + "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey/models/components\"\n\t\"github.com/unkeyed/unkey\"\n\t\"github.com/unkeyed/unkey/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkey.New(\n unkey.WithSecurity(\"\"),\n )\n\n request := operations.GetAPIRequest{\n APIID: \"api_1234\",\n }\n \n ctx := context.Background()\n res, err := s.GetAPI(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" + - target: $["paths"]["/v1/keys.getVerifications"]["get"] update: "x-codeSamples": - "lang": "go" - "label": "liveness" - "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey/models/components\"\n\t\"github.com/unkeyed/unkey\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkey.New(\n unkey.WithSecurity(\"\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.V1Liveness(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - - target: $["paths"]["/v1/keys.updateKey"]["post"] + "label": "getVerifications" + "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey/models/components\"\n\t\"github.com/unkeyed/unkey\"\n\t\"github.com/unkeyed/unkey/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkey.New(\n unkey.WithSecurity(\"\"),\n )\n\n request := operations.GetVerificationsRequest{\n KeyID: unkey.String(\"key_1234\"),\n OwnerID: unkey.String(\"chronark\"),\n Start: unkey.Int64(1620000000000),\n End: unkey.Int64(1620000000000),\n Granularity: operations.GranularityDay.ToPointer(),\n }\n \n ctx := context.Background()\n res, err := s.GetVerifications(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" + - target: $["paths"]["/v1/ratelimits.limit"]["post"] update: "x-codeSamples": - "lang": "go" - "label": "updateKey" - "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey/models/components\"\n\t\"github.com/unkeyed/unkey\"\n\t\"github.com/unkeyed/unkey/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkey.New(\n unkey.WithSecurity(\"\"),\n )\n\n request := operations.UpdateKeyRequestBody{\n KeyID: \"key_123\",\n Name: unkey.String(\"Customer X\"),\n OwnerID: unkey.String(\"user_123\"),\n Meta: map[string]interface{}{\n \"roles\": \"\",\n \"stripeCustomerId\": \"cus_1234\",\n },\n Expires: unkey.Float64(0),\n Ratelimit: &operations.UpdateKeyRatelimit{\n Type: operations.UpdateKeyTypeFast,\n Limit: 10,\n RefillRate: 1,\n RefillInterval: 60,\n },\n Remaining: unkey.Float64(1000),\n Refill: &operations.UpdateKeyRefill{\n Interval: operations.UpdateKeyIntervalDaily,\n Amount: 100,\n },\n Enabled: unkey.Bool(true),\n }\n \n ctx := context.Background()\n res, err := s.UpdateKey(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - - target: $["paths"]["/v1/apis.listKeys"]["get"] + "label": "limit" + "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey/models/components\"\n\t\"github.com/unkeyed/unkey\"\n\t\"github.com/unkeyed/unkey/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkey.New(\n unkey.WithSecurity(\"\"),\n )\n\n request := operations.LimitRequestBody{\n Namespace: unkey.String(\"email.outbound\"),\n Identifier: \"user_123\",\n Limit: 10,\n Duration: 60000,\n Cost: unkey.Int64(2),\n Resources: []operations.Resources{\n operations.Resources{\n Type: \"project\",\n ID: \"p_123\",\n Name: unkey.String(\"dub\"),\n },\n },\n }\n \n ctx := context.Background()\n res, err := s.Limit(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" + - target: $["paths"]["/v1/apis.createApi"]["post"] update: "x-codeSamples": - "lang": "go" - "label": "listKeys" - "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey/models/components\"\n\t\"github.com/unkeyed/unkey\"\n\t\"github.com/unkeyed/unkey/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkey.New(\n unkey.WithSecurity(\"\"),\n )\n\n request := operations.ListKeysRequest{\n APIID: \"api_1234\",\n Limit: unkey.Int64(100),\n }\n \n ctx := context.Background()\n res, err := s.ListKeys(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - - target: $["paths"]["/v1/keys"]["post"] + "label": "createApi" + "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey/models/components\"\n\t\"github.com/unkeyed/unkey\"\n\t\"github.com/unkeyed/unkey/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkey.New(\n unkey.WithSecurity(\"\"),\n )\n\n request := operations.CreateAPIRequestBody{\n Name: \"my-api\",\n }\n \n ctx := context.Background()\n res, err := s.CreateAPI(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" + - target: $["paths"]["/v1/keys.createKey"]["post"] update: "x-codeSamples": - "lang": "go" "label": "createKey" - "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey/models/components\"\n\t\"github.com/unkeyed/unkey\"\n\t\"github.com/unkeyed/unkey/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkey.New(\n unkey.WithSecurity(\"\"),\n )\n\n request := operations.DeprecatedCreateKeyRequestBody{\n APIID: \"api_123\",\n Name: unkey.String(\"my key\"),\n OwnerID: unkey.String(\"team_123\"),\n Meta: map[string]interface{}{\n \"billingTier\": \"PRO\",\n \"trialEnds\": \"2023-06-16T17:16:37.161Z\",\n },\n Expires: unkey.Int64(1623869797161),\n Remaining: unkey.Int64(1000),\n Ratelimit: &operations.DeprecatedCreateKeyRatelimit{\n Type: operations.DeprecatedCreateKeyTypeFast.ToPointer(),\n Limit: 10,\n RefillRate: 1,\n RefillInterval: 60,\n },\n }\n \n ctx := context.Background()\n res, err := s.DeprecatedCreateKey(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - - target: $["paths"]["/v1/keys.getKey"]["get"] - update: - "x-codeSamples": - - "lang": "go" - "label": "getKey" - "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey/models/components\"\n\t\"github.com/unkeyed/unkey\"\n\t\"github.com/unkeyed/unkey/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkey.New(\n unkey.WithSecurity(\"\"),\n )\n\n request := operations.GetKeyRequest{\n KeyID: \"key_1234\",\n }\n \n ctx := context.Background()\n res, err := s.GetKey(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - - target: $["paths"]["/v1/keys.verifyKey"]["post"] - update: - "x-codeSamples": - - "lang": "go" - "label": "verifyKey" - "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey/models/components\"\n\t\"github.com/unkeyed/unkey\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkey.New(\n unkey.WithSecurity(\"\"),\n )\n\n request := components.V1KeysVerifyKeyRequest{\n APIID: unkey.String(\"api_1234\"),\n Key: \"sk_1234\",\n Authorization: &components.Authorization{\n Permissions: &components.Permissions{},\n },\n }\n \n ctx := context.Background()\n res, err := s.VerifyKey(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" + "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey/models/components\"\n\t\"github.com/unkeyed/unkey\"\n\t\"github.com/unkeyed/unkey/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkey.New(\n unkey.WithSecurity(\"\"),\n )\n\n request := operations.CreateKeyRequestBody{\n APIID: \"api_123\",\n Name: unkey.String(\"my key\"),\n OwnerID: unkey.String(\"team_123\"),\n Meta: map[string]interface{}{\n \"billingTier\": \"PRO\",\n \"trialEnds\": \"2023-06-16T17:16:37.161Z\",\n },\n Roles: []string{\n \"admin\",\n \"finance\",\n },\n Expires: unkey.Int64(1623869797161),\n Remaining: unkey.Int64(1000),\n Refill: &operations.Refill{\n Interval: operations.IntervalDaily,\n Amount: 100,\n },\n Ratelimit: &operations.Ratelimit{\n Type: operations.TypeFast.ToPointer(),\n Limit: 10,\n RefillRate: 1,\n RefillInterval: 60,\n },\n Enabled: unkey.Bool(false),\n }\n \n ctx := context.Background()\n res, err := s.CreateKey(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - target: $["paths"]["/v1/keys.updateRemaining"]["post"] update: "x-codeSamples": - "lang": "go" "label": "updateRemaining" "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey/models/components\"\n\t\"github.com/unkeyed/unkey\"\n\t\"github.com/unkeyed/unkey/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkey.New(\n unkey.WithSecurity(\"\"),\n )\n\n request := operations.UpdateRemainingRequestBody{\n KeyID: \"key_123\",\n Op: operations.OpSet,\n Value: unkey.Int64(1),\n }\n \n ctx := context.Background()\n res, err := s.UpdateRemaining(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - - target: $["paths"]["/v1/keys.getVerifications"]["get"] + - target: $["paths"]["/v1/keys.getKey"]["get"] update: "x-codeSamples": - "lang": "go" - "label": "getVerifications" - "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey/models/components\"\n\t\"github.com/unkeyed/unkey\"\n\t\"github.com/unkeyed/unkey/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkey.New(\n unkey.WithSecurity(\"\"),\n )\n\n request := operations.GetVerificationsRequest{\n KeyID: unkey.String(\"key_1234\"),\n OwnerID: unkey.String(\"chronark\"),\n Start: unkey.Int64(1620000000000),\n End: unkey.Int64(1620000000000),\n Granularity: operations.GranularityDay.ToPointer(),\n }\n \n ctx := context.Background()\n res, err := s.GetVerifications(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" + "label": "getKey" + "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey/models/components\"\n\t\"github.com/unkeyed/unkey\"\n\t\"github.com/unkeyed/unkey/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkey.New(\n unkey.WithSecurity(\"\"),\n )\n\n request := operations.GetKeyRequest{\n KeyID: \"key_1234\",\n }\n \n ctx := context.Background()\n res, err := s.GetKey(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" + - target: $["paths"]["/v1/keys.deleteKey"]["post"] + update: + "x-codeSamples": + - "lang": "go" + "label": "deleteKey" + "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey/models/components\"\n\t\"github.com/unkeyed/unkey\"\n\t\"github.com/unkeyed/unkey/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkey.New(\n unkey.WithSecurity(\"\"),\n )\n\n request := operations.DeleteKeyRequestBody{\n KeyID: \"key_1234\",\n }\n \n ctx := context.Background()\n res, err := s.DeleteKey(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - target: $["paths"]["/v1/migrations.createKeys"]["post"] update: "x-codeSamples": - "lang": "go" "label": "createKeys" "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey/models/components\"\n\t\"github.com/unkeyed/unkey\"\n\t\"github.com/unkeyed/unkey/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkey.New(\n unkey.WithSecurity(\"\"),\n )\n\n request := []operations.RequestBody{\n operations.RequestBody{\n APIID: \"api_123\",\n Name: unkey.String(\"my key\"),\n Hash: operations.Hash{\n Value: \"\",\n Variant: operations.VariantSha256Base64,\n },\n Start: unkey.String(\"unkey_32kq\"),\n OwnerID: unkey.String(\"team_123\"),\n Meta: map[string]interface{}{\n \"billingTier\": \"PRO\",\n \"trialEnds\": \"2023-06-16T17:16:37.161Z\",\n },\n Roles: []string{\n \"admin\",\n \"finance\",\n },\n Expires: unkey.Int64(1623869797161),\n Remaining: unkey.Int64(1000),\n Refill: &operations.V1MigrationsCreateKeysRefill{\n Interval: operations.V1MigrationsCreateKeysIntervalDaily,\n Amount: 100,\n },\n Ratelimit: &operations.V1MigrationsCreateKeysRatelimit{\n Type: operations.V1MigrationsCreateKeysTypeFast.ToPointer(),\n Limit: 10,\n RefillRate: 1,\n RefillInterval: 60,\n },\n Enabled: unkey.Bool(false),\n },\n }\n \n ctx := context.Background()\n res, err := s.V1MigrationsCreateKeys(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - - target: $["paths"]["/v1/apis.createApi"]["post"] + - target: $["paths"]["/v1/liveness"]["get"] update: "x-codeSamples": - "lang": "go" - "label": "createApi" - "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey/models/components\"\n\t\"github.com/unkeyed/unkey\"\n\t\"github.com/unkeyed/unkey/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkey.New(\n unkey.WithSecurity(\"\"),\n )\n\n request := operations.CreateAPIRequestBody{\n Name: \"my-api\",\n }\n \n ctx := context.Background()\n res, err := s.CreateAPI(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" + "label": "liveness" + "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey/models/components\"\n\t\"github.com/unkeyed/unkey\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkey.New(\n unkey.WithSecurity(\"\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.V1Liveness(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" + - target: $["paths"]["/v1/keys.updateKey"]["post"] + update: + "x-codeSamples": + - "lang": "go" + "label": "updateKey" + "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey/models/components\"\n\t\"github.com/unkeyed/unkey\"\n\t\"github.com/unkeyed/unkey/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkey.New(\n unkey.WithSecurity(\"\"),\n )\n\n request := operations.UpdateKeyRequestBody{\n KeyID: \"key_123\",\n Name: unkey.String(\"Customer X\"),\n OwnerID: unkey.String(\"user_123\"),\n Meta: map[string]interface{}{\n \"roles\": \"\",\n \"stripeCustomerId\": \"cus_1234\",\n },\n Expires: unkey.Float64(0),\n Ratelimit: &operations.UpdateKeyRatelimit{\n Type: operations.UpdateKeyTypeFast,\n Limit: 10,\n RefillRate: 1,\n RefillInterval: 60,\n },\n Remaining: unkey.Float64(1000),\n Refill: &operations.UpdateKeyRefill{\n Interval: operations.UpdateKeyIntervalDaily,\n Amount: 100,\n },\n Enabled: unkey.Bool(true),\n }\n \n ctx := context.Background()\n res, err := s.UpdateKey(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - target: $["paths"]["/v1/apis.deleteApi"]["post"] update: "x-codeSamples": - "lang": "go" "label": "deleteApi" "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey/models/components\"\n\t\"github.com/unkeyed/unkey\"\n\t\"github.com/unkeyed/unkey/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkey.New(\n unkey.WithSecurity(\"\"),\n )\n\n request := operations.DeleteAPIRequestBody{\n APIID: \"api_1234\",\n }\n \n ctx := context.Background()\n res, err := s.DeleteAPI(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - - target: $["paths"]["/v1/keys.deleteKey"]["post"] + - target: $["paths"]["/v1/keys/verify"]["post"] update: "x-codeSamples": - "lang": "go" - "label": "deleteKey" - "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey/models/components\"\n\t\"github.com/unkeyed/unkey\"\n\t\"github.com/unkeyed/unkey/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkey.New(\n unkey.WithSecurity(\"\"),\n )\n\n request := operations.DeleteKeyRequestBody{\n KeyID: \"key_1234\",\n }\n \n ctx := context.Background()\n res, err := s.DeleteKey(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - - target: $["paths"]["/v1/keys.createKey"]["post"] + "label": "verifyKey" + "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey/models/components\"\n\t\"github.com/unkeyed/unkey\"\n\t\"github.com/unkeyed/unkey/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkey.New(\n unkey.WithSecurity(\"\"),\n )\n\n request := operations.DeprecatedVerifyKeyRequestBody{\n APIID: unkey.String(\"api_1234\"),\n Key: \"sk_1234\",\n }\n \n ctx := context.Background()\n res, err := s.DeprecatedVerifyKey(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" + - target: $["paths"]["/v1/apis/{apiId}/keys"]["get"] update: "x-codeSamples": - "lang": "go" - "label": "createKey" - "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey/models/components\"\n\t\"github.com/unkeyed/unkey\"\n\t\"github.com/unkeyed/unkey/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkey.New(\n unkey.WithSecurity(\"\"),\n )\n\n request := operations.CreateKeyRequestBody{\n APIID: \"api_123\",\n Name: unkey.String(\"my key\"),\n OwnerID: unkey.String(\"team_123\"),\n Meta: map[string]interface{}{\n \"billingTier\": \"PRO\",\n \"trialEnds\": \"2023-06-16T17:16:37.161Z\",\n },\n Roles: []string{\n \"admin\",\n \"finance\",\n },\n Expires: unkey.Int64(1623869797161),\n Remaining: unkey.Int64(1000),\n Refill: &operations.Refill{\n Interval: operations.IntervalDaily,\n Amount: 100,\n },\n Ratelimit: &operations.Ratelimit{\n Type: operations.TypeFast.ToPointer(),\n Limit: 10,\n RefillRate: 1,\n RefillInterval: 60,\n },\n Enabled: unkey.Bool(false),\n }\n \n ctx := context.Background()\n res, err := s.CreateKey(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" + "label": "listKeys" + "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey/models/components\"\n\t\"github.com/unkeyed/unkey\"\n\t\"github.com/unkeyed/unkey/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkey.New(\n unkey.WithSecurity(\"\"),\n )\n\n request := operations.DeprecatedListKeysRequest{\n APIID: \"api_1234\",\n Limit: unkey.Int64(100),\n }\n \n ctx := context.Background()\n res, err := s.DeprecatedListKeys(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" diff --git a/unkey.go b/unkey.go index 9e0bd2b..5b2458b 100644 --- a/unkey.go +++ b/unkey.go @@ -151,9 +151,9 @@ func New(opts ...SDKOption) *Unkey { sdkConfiguration: sdkConfiguration{ Language: "go", OpenAPIDocVersion: "1.0.0", - SDKVersion: "0.1.8", + SDKVersion: "0.1.9", GenVersion: "2.326.3", - UserAgent: "speakeasy-sdk/go 0.1.8 2.326.3 1.0.0 github.com/unkeyed/unkey", + UserAgent: "speakeasy-sdk/go 0.1.9 2.326.3 1.0.0 github.com/unkeyed/unkey", Hooks: hooks.New(), }, }