diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index c59877e..1916306 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.6 - configChecksum: 53ee7feb83f83f284a66d7f183f775a7 + releaseVersion: 0.1.7 + configChecksum: 4a72b63bb002af1bd70f729c9f85815d 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 de353cc..13f3f9e 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -12,7 +12,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: true go: - version: 0.1.6 + version: 0.1.7 additionalDependencies: {} clientServerStatusCodesAsErrors: true flattenGlobalSecurity: true @@ -28,5 +28,5 @@ go: maxMethodParams: 0 methodArguments: require-security-and-request outputModelSuffix: output - packageName: github.com/unkeyed/unkey-go + packageName: github.com/unkeyed/unkey responseFormat: flat diff --git a/README.md b/README.md index 976c0ad..6af46bd 100644 --- a/README.md +++ b/README.md @@ -18,15 +18,15 @@ package main import ( "context" - unkeygo "github.com/unkeyed/unkey-go" - "github.com/unkeyed/unkey-go/models/components" - "github.com/unkeyed/unkey-go/models/operations" + "github.com/unkeyed/unkey" + "github.com/unkeyed/unkey/models/components" + "github.com/unkeyed/unkey/models/operations" "log" ) func main() { - s := unkeygo.New( - unkeygo.WithSecurity(""), + s := unkey.New( + unkey.WithSecurity(""), ) request := operations.CreateAPIRequestBody{ @@ -109,16 +109,16 @@ package main import ( "context" "errors" - unkeygo "github.com/unkeyed/unkey-go" - "github.com/unkeyed/unkey-go/models/components" - "github.com/unkeyed/unkey-go/models/operations" - "github.com/unkeyed/unkey-go/models/sdkerrors" + "github.com/unkeyed/unkey" + "github.com/unkeyed/unkey/models/components" + "github.com/unkeyed/unkey/models/operations" + "github.com/unkeyed/unkey/models/sdkerrors" "log" ) func main() { - s := unkeygo.New( - unkeygo.WithSecurity(""), + s := unkey.New( + unkey.WithSecurity(""), ) request := operations.CreateAPIRequestBody{ @@ -200,16 +200,16 @@ package main import ( "context" - unkeygo "github.com/unkeyed/unkey-go" - "github.com/unkeyed/unkey-go/models/components" - "github.com/unkeyed/unkey-go/models/operations" + "github.com/unkeyed/unkey" + "github.com/unkeyed/unkey/models/components" + "github.com/unkeyed/unkey/models/operations" "log" ) func main() { - s := unkeygo.New( - unkeygo.WithServerIndex(0), - unkeygo.WithSecurity(""), + s := unkey.New( + unkey.WithServerIndex(0), + unkey.WithSecurity(""), ) request := operations.CreateAPIRequestBody{ @@ -237,16 +237,16 @@ package main import ( "context" - unkeygo "github.com/unkeyed/unkey-go" - "github.com/unkeyed/unkey-go/models/components" - "github.com/unkeyed/unkey-go/models/operations" + "github.com/unkeyed/unkey" + "github.com/unkeyed/unkey/models/components" + "github.com/unkeyed/unkey/models/operations" "log" ) func main() { - s := unkeygo.New( - unkeygo.WithServerURL("https://api.unkey.dev"), - unkeygo.WithSecurity(""), + s := unkey.New( + unkey.WithServerURL("https://api.unkey.dev"), + unkey.WithSecurity(""), ) request := operations.CreateAPIRequestBody{ @@ -312,14 +312,14 @@ package main import ( "context" - unkeygo "github.com/unkeyed/unkey-go" - "github.com/unkeyed/unkey-go/models/operations" + "github.com/unkeyed/unkey" + "github.com/unkeyed/unkey/models/operations" "log" ) func main() { - s := unkeygo.New( - unkeygo.WithSecurity(""), + s := unkey.New( + unkey.WithSecurity(""), ) request := operations.CreateAPIRequestBody{ diff --git a/USAGE.md b/USAGE.md index 05040c2..fca2a59 100644 --- a/USAGE.md +++ b/USAGE.md @@ -4,15 +4,15 @@ package main import ( "context" - unkeygo "github.com/unkeyed/unkey-go" - "github.com/unkeyed/unkey-go/models/components" - "github.com/unkeyed/unkey-go/models/operations" + "github.com/unkeyed/unkey" + "github.com/unkeyed/unkey/models/components" + "github.com/unkeyed/unkey/models/operations" "log" ) func main() { - s := unkeygo.New( - unkeygo.WithSecurity(""), + s := unkey.New( + unkey.WithSecurity(""), ) request := operations.CreateAPIRequestBody{ diff --git a/apis.go b/apis.go index 3daa8ec..93daf7f 100644 --- a/apis.go +++ b/apis.go @@ -1,15 +1,15 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package unkeygo +package unkey import ( "bytes" "context" "fmt" - "github.com/unkeyed/unkey-go/internal/hooks" - "github.com/unkeyed/unkey-go/internal/utils" - "github.com/unkeyed/unkey-go/models/operations" - "github.com/unkeyed/unkey-go/models/sdkerrors" + "github.com/unkeyed/unkey/internal/hooks" + "github.com/unkeyed/unkey/internal/utils" + "github.com/unkeyed/unkey/models/operations" + "github.com/unkeyed/unkey/models/sdkerrors" "io" "net/http" "net/url" diff --git a/codeSamples.yaml b/codeSamples.yaml index 5ab2cd9..2979008 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/{apiId}/keys"]["get"] + - target: $["paths"]["/v1/keys.updateRemaining"]["post"] update: "x-codeSamples": - "lang": "go" - "label": "listKeys" - "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey-go/models/components\"\n\tunkeygo \"github.com/unkeyed/unkey-go\"\n\t\"github.com/unkeyed/unkey-go/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkeygo.New(\n unkeygo.WithSecurity(\"\"),\n )\n\n request := operations.DeprecatedListKeysRequest{\n APIID: \"api_1234\",\n Limit: unkeygo.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/keys.verifyKey"]["post"] + "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"] update: "x-codeSamples": - "lang": "go" - "label": "verifyKey" - "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey-go/models/components\"\n\tunkeygo \"github.com/unkeyed/unkey-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkeygo.New(\n unkeygo.WithSecurity(\"\"),\n )\n\n request := components.V1KeysVerifyKeyRequest{\n APIID: unkeygo.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/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/keys/verify"]["post"] update: "x-codeSamples": - "lang": "go" - "label": "updateKey" - "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey-go/models/components\"\n\tunkeygo \"github.com/unkeyed/unkey-go\"\n\t\"github.com/unkeyed/unkey-go/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkeygo.New(\n unkeygo.WithSecurity(\"\"),\n )\n\n request := operations.UpdateKeyRequestBody{\n KeyID: \"key_123\",\n Name: unkeygo.String(\"Customer X\"),\n OwnerID: unkeygo.String(\"user_123\"),\n Meta: map[string]interface{}{\n \"roles\": \"\",\n \"stripeCustomerId\": \"cus_1234\",\n },\n Expires: unkeygo.Float64(0),\n Ratelimit: &operations.UpdateKeyRatelimit{\n Type: operations.UpdateKeyTypeFast,\n Limit: 10,\n RefillRate: 1,\n RefillInterval: 60,\n },\n Remaining: unkeygo.Float64(1000),\n Refill: &operations.UpdateKeyRefill{\n Interval: operations.UpdateKeyIntervalDaily,\n Amount: 100,\n },\n Enabled: unkeygo.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.getApi"]["get"] + "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": "getApi" - "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey-go/models/components\"\n\tunkeygo \"github.com/unkeyed/unkey-go\"\n\t\"github.com/unkeyed/unkey-go/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkeygo.New(\n unkeygo.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.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/keys.deleteKey"]["post"] update: "x-codeSamples": - "lang": "go" - "label": "limit" - "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey-go/models/components\"\n\tunkeygo \"github.com/unkeyed/unkey-go\"\n\t\"github.com/unkeyed/unkey-go/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkeygo.New(\n unkeygo.WithSecurity(\"\"),\n )\n\n request := operations.LimitRequestBody{\n Namespace: unkeygo.String(\"email.outbound\"),\n Identifier: \"user_123\",\n Limit: 10,\n Duration: 60000,\n Cost: unkeygo.Int64(2),\n Resources: []operations.Resources{\n operations.Resources{\n Type: \"project\",\n ID: \"p_123\",\n Name: unkeygo.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"] + "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.updateKey"]["post"] update: "x-codeSamples": - "lang": "go" - "label": "createApi" - "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey-go/models/components\"\n\tunkeygo \"github.com/unkeyed/unkey-go\"\n\t\"github.com/unkeyed/unkey-go/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkeygo.New(\n unkeygo.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": "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/keys"]["post"] update: "x-codeSamples": - "lang": "go" "label": "createKey" - "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey-go/models/components\"\n\tunkeygo \"github.com/unkeyed/unkey-go\"\n\t\"github.com/unkeyed/unkey-go/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkeygo.New(\n unkeygo.WithSecurity(\"\"),\n )\n\n request := operations.DeprecatedCreateKeyRequestBody{\n APIID: \"api_123\",\n Name: unkeygo.String(\"my key\"),\n OwnerID: unkeygo.String(\"team_123\"),\n Meta: map[string]interface{}{\n \"billingTier\": \"PRO\",\n \"trialEnds\": \"2023-06-16T17:16:37.161Z\",\n },\n Expires: unkeygo.Int64(1623869797161),\n Remaining: unkeygo.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.createKey"]["post"] + "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": "createKey" - "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey-go/models/components\"\n\tunkeygo \"github.com/unkeyed/unkey-go\"\n\t\"github.com/unkeyed/unkey-go/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkeygo.New(\n unkeygo.WithSecurity(\"\"),\n )\n\n request := operations.CreateKeyRequestBody{\n APIID: \"api_123\",\n Name: unkeygo.String(\"my key\"),\n OwnerID: unkeygo.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: unkeygo.Int64(1623869797161),\n Remaining: unkeygo.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: unkeygo.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.getVerifications"]["get"] + "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/ratelimits.limit"]["post"] update: "x-codeSamples": - "lang": "go" - "label": "getVerifications" - "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey-go/models/components\"\n\tunkeygo \"github.com/unkeyed/unkey-go\"\n\t\"github.com/unkeyed/unkey-go/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkeygo.New(\n unkeygo.WithSecurity(\"\"),\n )\n\n request := operations.GetVerificationsRequest{\n KeyID: unkeygo.String(\"key_1234\"),\n OwnerID: unkeygo.String(\"chronark\"),\n Start: unkeygo.Int64(1620000000000),\n End: unkeygo.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/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/migrations.createKeys"]["post"] update: "x-codeSamples": - "lang": "go" - "label": "listKeys" - "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey-go/models/components\"\n\tunkeygo \"github.com/unkeyed/unkey-go\"\n\t\"github.com/unkeyed/unkey-go/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkeygo.New(\n unkeygo.WithSecurity(\"\"),\n )\n\n request := operations.ListKeysRequest{\n APIID: \"api_1234\",\n Limit: unkeygo.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/apis.deleteApi"]["post"] + "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/keys.verifyKey"]["post"] update: "x-codeSamples": - "lang": "go" - "label": "deleteApi" - "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey-go/models/components\"\n\tunkeygo \"github.com/unkeyed/unkey-go\"\n\t\"github.com/unkeyed/unkey-go/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkeygo.New(\n unkeygo.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/verify"]["post"] + "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}" + - target: $["paths"]["/v1/apis.getApi"]["get"] update: "x-codeSamples": - "lang": "go" - "label": "verifyKey" - "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey-go/models/components\"\n\tunkeygo \"github.com/unkeyed/unkey-go\"\n\t\"github.com/unkeyed/unkey-go/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkeygo.New(\n unkeygo.WithSecurity(\"\"),\n )\n\n request := operations.DeprecatedVerifyKeyRequestBody{\n APIID: unkeygo.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/keys.getKey"]["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/apis.listKeys"]["get"] update: "x-codeSamples": - "lang": "go" - "label": "getKey" - "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey-go/models/components\"\n\tunkeygo \"github.com/unkeyed/unkey-go\"\n\t\"github.com/unkeyed/unkey-go/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkeygo.New(\n unkeygo.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"] + "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/apis.createApi"]["post"] update: "x-codeSamples": - "lang": "go" - "label": "deleteKey" - "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey-go/models/components\"\n\tunkeygo \"github.com/unkeyed/unkey-go\"\n\t\"github.com/unkeyed/unkey-go/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkeygo.New(\n unkeygo.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.updateRemaining"]["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/apis.deleteApi"]["post"] update: "x-codeSamples": - "lang": "go" - "label": "updateRemaining" - "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey-go/models/components\"\n\tunkeygo \"github.com/unkeyed/unkey-go\"\n\t\"github.com/unkeyed/unkey-go/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkeygo.New(\n unkeygo.WithSecurity(\"\"),\n )\n\n request := operations.UpdateRemainingRequestBody{\n KeyID: \"key_123\",\n Op: operations.OpSet,\n Value: unkeygo.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}" + "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/liveness"]["get"] update: "x-codeSamples": - "lang": "go" "label": "liveness" - "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey-go/models/components\"\n\tunkeygo \"github.com/unkeyed/unkey-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkeygo.New(\n unkeygo.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/migrations.createKeys"]["post"] + "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.createKey"]["post"] update: "x-codeSamples": - "lang": "go" - "label": "createKeys" - "source": "package main\n\nimport(\n\t\"github.com/unkeyed/unkey-go/models/components\"\n\tunkeygo \"github.com/unkeyed/unkey-go\"\n\t\"github.com/unkeyed/unkey-go/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := unkeygo.New(\n unkeygo.WithSecurity(\"\"),\n )\n\n request := []operations.RequestBody{\n operations.RequestBody{\n APIID: \"api_123\",\n Name: unkeygo.String(\"my key\"),\n Hash: operations.Hash{\n Value: \"\",\n Variant: operations.VariantSha256Base64,\n },\n Start: unkeygo.String(\"unkey_32kq\"),\n OwnerID: unkeygo.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: unkeygo.Int64(1623869797161),\n Remaining: unkeygo.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: unkeygo.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}" + "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}" diff --git a/docs/sdks/apis/README.md b/docs/sdks/apis/README.md index 8294df9..e54ce08 100644 --- a/docs/sdks/apis/README.md +++ b/docs/sdks/apis/README.md @@ -14,16 +14,16 @@ package main import( - "github.com/unkeyed/unkey-go/models/components" - unkeygo "github.com/unkeyed/unkey-go" - "github.com/unkeyed/unkey-go/models/operations" + "github.com/unkeyed/unkey/models/components" + "github.com/unkeyed/unkey" + "github.com/unkeyed/unkey/models/operations" "context" "log" ) func main() { - s := unkeygo.New( - unkeygo.WithSecurity(""), + s := unkey.New( + unkey.WithSecurity(""), ) request := operations.GetAPIRequest{ @@ -71,21 +71,21 @@ func main() { package main import( - "github.com/unkeyed/unkey-go/models/components" - unkeygo "github.com/unkeyed/unkey-go" - "github.com/unkeyed/unkey-go/models/operations" + "github.com/unkeyed/unkey/models/components" + "github.com/unkeyed/unkey" + "github.com/unkeyed/unkey/models/operations" "context" "log" ) func main() { - s := unkeygo.New( - unkeygo.WithSecurity(""), + s := unkey.New( + unkey.WithSecurity(""), ) request := operations.ListKeysRequest{ APIID: "api_1234", - Limit: unkeygo.Int64(100), + Limit: unkey.Int64(100), } ctx := context.Background() diff --git a/docs/sdks/keys/README.md b/docs/sdks/keys/README.md index 7200b47..e2b8946 100644 --- a/docs/sdks/keys/README.md +++ b/docs/sdks/keys/README.md @@ -19,16 +19,16 @@ package main import( - "github.com/unkeyed/unkey-go/models/components" - unkeygo "github.com/unkeyed/unkey-go" - "github.com/unkeyed/unkey-go/models/operations" + "github.com/unkeyed/unkey/models/components" + "github.com/unkeyed/unkey" + "github.com/unkeyed/unkey/models/operations" "context" "log" ) func main() { - s := unkeygo.New( - unkeygo.WithSecurity(""), + s := unkey.New( + unkey.WithSecurity(""), ) request := operations.GetKeyRequest{ @@ -76,16 +76,16 @@ func main() { package main import( - "github.com/unkeyed/unkey-go/models/components" - unkeygo "github.com/unkeyed/unkey-go" - "github.com/unkeyed/unkey-go/models/operations" + "github.com/unkeyed/unkey/models/components" + "github.com/unkeyed/unkey" + "github.com/unkeyed/unkey/models/operations" "context" "log" ) func main() { - s := unkeygo.New( - unkeygo.WithSecurity(""), + s := unkey.New( + unkey.WithSecurity(""), ) request := operations.DeleteKeyRequestBody{ @@ -133,22 +133,22 @@ func main() { package main import( - "github.com/unkeyed/unkey-go/models/components" - unkeygo "github.com/unkeyed/unkey-go" - "github.com/unkeyed/unkey-go/models/operations" + "github.com/unkeyed/unkey/models/components" + "github.com/unkeyed/unkey" + "github.com/unkeyed/unkey/models/operations" "context" "log" ) func main() { - s := unkeygo.New( - unkeygo.WithSecurity(""), + s := unkey.New( + unkey.WithSecurity(""), ) request := operations.CreateKeyRequestBody{ APIID: "api_123", - Name: unkeygo.String("my key"), - OwnerID: unkeygo.String("team_123"), + Name: unkey.String("my key"), + OwnerID: unkey.String("team_123"), Meta: map[string]interface{}{ "billingTier": "PRO", "trialEnds": "2023-06-16T17:16:37.161Z", @@ -157,8 +157,8 @@ func main() { "admin", "finance", }, - Expires: unkeygo.Int64(1623869797161), - Remaining: unkeygo.Int64(1000), + Expires: unkey.Int64(1623869797161), + Remaining: unkey.Int64(1000), Refill: &operations.Refill{ Interval: operations.IntervalDaily, Amount: 100, @@ -169,7 +169,7 @@ func main() { RefillRate: 1, RefillInterval: 60, }, - Enabled: unkeygo.Bool(false), + Enabled: unkey.Bool(false), } ctx := context.Background() @@ -213,19 +213,19 @@ func main() { package main import( - "github.com/unkeyed/unkey-go/models/components" - unkeygo "github.com/unkeyed/unkey-go" + "github.com/unkeyed/unkey/models/components" + "github.com/unkeyed/unkey" "context" "log" ) func main() { - s := unkeygo.New( - unkeygo.WithSecurity(""), + s := unkey.New( + unkey.WithSecurity(""), ) request := components.V1KeysVerifyKeyRequest{ - APIID: unkeygo.String("api_1234"), + APIID: unkey.String("api_1234"), Key: "sk_1234", Authorization: &components.Authorization{ Permissions: &components.Permissions{}, @@ -273,39 +273,39 @@ func main() { package main import( - "github.com/unkeyed/unkey-go/models/components" - unkeygo "github.com/unkeyed/unkey-go" - "github.com/unkeyed/unkey-go/models/operations" + "github.com/unkeyed/unkey/models/components" + "github.com/unkeyed/unkey" + "github.com/unkeyed/unkey/models/operations" "context" "log" ) func main() { - s := unkeygo.New( - unkeygo.WithSecurity(""), + s := unkey.New( + unkey.WithSecurity(""), ) request := operations.UpdateKeyRequestBody{ KeyID: "key_123", - Name: unkeygo.String("Customer X"), - OwnerID: unkeygo.String("user_123"), + Name: unkey.String("Customer X"), + OwnerID: unkey.String("user_123"), Meta: map[string]interface{}{ "roles": "", "stripeCustomerId": "cus_1234", }, - Expires: unkeygo.Float64(0), + Expires: unkey.Float64(0), Ratelimit: &operations.UpdateKeyRatelimit{ Type: operations.UpdateKeyTypeFast, Limit: 10, RefillRate: 1, RefillInterval: 60, }, - Remaining: unkeygo.Float64(1000), + Remaining: unkey.Float64(1000), Refill: &operations.UpdateKeyRefill{ Interval: operations.UpdateKeyIntervalDaily, Amount: 100, }, - Enabled: unkeygo.Bool(true), + Enabled: unkey.Bool(true), } ctx := context.Background() @@ -349,22 +349,22 @@ func main() { package main import( - "github.com/unkeyed/unkey-go/models/components" - unkeygo "github.com/unkeyed/unkey-go" - "github.com/unkeyed/unkey-go/models/operations" + "github.com/unkeyed/unkey/models/components" + "github.com/unkeyed/unkey" + "github.com/unkeyed/unkey/models/operations" "context" "log" ) func main() { - s := unkeygo.New( - unkeygo.WithSecurity(""), + s := unkey.New( + unkey.WithSecurity(""), ) request := operations.UpdateRemainingRequestBody{ KeyID: "key_123", Op: operations.OpSet, - Value: unkeygo.Int64(1), + Value: unkey.Int64(1), } ctx := context.Background() @@ -408,23 +408,23 @@ func main() { package main import( - "github.com/unkeyed/unkey-go/models/components" - unkeygo "github.com/unkeyed/unkey-go" - "github.com/unkeyed/unkey-go/models/operations" + "github.com/unkeyed/unkey/models/components" + "github.com/unkeyed/unkey" + "github.com/unkeyed/unkey/models/operations" "context" "log" ) func main() { - s := unkeygo.New( - unkeygo.WithSecurity(""), + s := unkey.New( + unkey.WithSecurity(""), ) request := operations.GetVerificationsRequest{ - KeyID: unkeygo.String("key_1234"), - OwnerID: unkeygo.String("chronark"), - Start: unkeygo.Int64(1620000000000), - End: unkeygo.Int64(1620000000000), + KeyID: unkey.String("key_1234"), + OwnerID: unkey.String("chronark"), + Start: unkey.Int64(1620000000000), + End: unkey.Int64(1620000000000), Granularity: operations.GranularityDay.ToPointer(), } diff --git a/docs/sdks/liveness/README.md b/docs/sdks/liveness/README.md index 1af45b5..0f3903a 100644 --- a/docs/sdks/liveness/README.md +++ b/docs/sdks/liveness/README.md @@ -13,15 +13,15 @@ package main import( - "github.com/unkeyed/unkey-go/models/components" - unkeygo "github.com/unkeyed/unkey-go" + "github.com/unkeyed/unkey/models/components" + "github.com/unkeyed/unkey" "context" "log" ) func main() { - s := unkeygo.New( - unkeygo.WithSecurity(""), + s := unkey.New( + unkey.WithSecurity(""), ) diff --git a/docs/sdks/migrations/README.md b/docs/sdks/migrations/README.md index d80e8d0..d5caa29 100644 --- a/docs/sdks/migrations/README.md +++ b/docs/sdks/migrations/README.md @@ -13,28 +13,28 @@ package main import( - "github.com/unkeyed/unkey-go/models/components" - unkeygo "github.com/unkeyed/unkey-go" - "github.com/unkeyed/unkey-go/models/operations" + "github.com/unkeyed/unkey/models/components" + "github.com/unkeyed/unkey" + "github.com/unkeyed/unkey/models/operations" "context" "log" ) func main() { - s := unkeygo.New( - unkeygo.WithSecurity(""), + s := unkey.New( + unkey.WithSecurity(""), ) request := []operations.RequestBody{ operations.RequestBody{ APIID: "api_123", - Name: unkeygo.String("my key"), + Name: unkey.String("my key"), Hash: operations.Hash{ Value: "", Variant: operations.VariantSha256Base64, }, - Start: unkeygo.String("unkey_32kq"), - OwnerID: unkeygo.String("team_123"), + Start: unkey.String("unkey_32kq"), + OwnerID: unkey.String("team_123"), Meta: map[string]interface{}{ "billingTier": "PRO", "trialEnds": "2023-06-16T17:16:37.161Z", @@ -43,8 +43,8 @@ func main() { "admin", "finance", }, - Expires: unkeygo.Int64(1623869797161), - Remaining: unkeygo.Int64(1000), + Expires: unkey.Int64(1623869797161), + Remaining: unkey.Int64(1000), Refill: &operations.V1MigrationsCreateKeysRefill{ Interval: operations.V1MigrationsCreateKeysIntervalDaily, Amount: 100, @@ -55,7 +55,7 @@ func main() { RefillRate: 1, RefillInterval: 60, }, - Enabled: unkeygo.Bool(false), + Enabled: unkey.Bool(false), }, } diff --git a/docs/sdks/ratelimits/README.md b/docs/sdks/ratelimits/README.md index 17987db..c491c72 100644 --- a/docs/sdks/ratelimits/README.md +++ b/docs/sdks/ratelimits/README.md @@ -13,29 +13,29 @@ package main import( - "github.com/unkeyed/unkey-go/models/components" - unkeygo "github.com/unkeyed/unkey-go" - "github.com/unkeyed/unkey-go/models/operations" + "github.com/unkeyed/unkey/models/components" + "github.com/unkeyed/unkey" + "github.com/unkeyed/unkey/models/operations" "context" "log" ) func main() { - s := unkeygo.New( - unkeygo.WithSecurity(""), + s := unkey.New( + unkey.WithSecurity(""), ) request := operations.LimitRequestBody{ - Namespace: unkeygo.String("email.outbound"), + Namespace: unkey.String("email.outbound"), Identifier: "user_123", Limit: 10, Duration: 60000, - Cost: unkeygo.Int64(2), + Cost: unkey.Int64(2), Resources: []operations.Resources{ operations.Resources{ Type: "project", ID: "p_123", - Name: unkeygo.String("dub"), + Name: unkey.String("dub"), }, }, } diff --git a/docs/sdks/unkey/README.md b/docs/sdks/unkey/README.md index 9676a9e..0210cec 100644 --- a/docs/sdks/unkey/README.md +++ b/docs/sdks/unkey/README.md @@ -19,16 +19,16 @@ package main import( - "github.com/unkeyed/unkey-go/models/components" - unkeygo "github.com/unkeyed/unkey-go" - "github.com/unkeyed/unkey-go/models/operations" + "github.com/unkeyed/unkey/models/components" + "github.com/unkeyed/unkey" + "github.com/unkeyed/unkey/models/operations" "context" "log" ) func main() { - s := unkeygo.New( - unkeygo.WithSecurity(""), + s := unkey.New( + unkey.WithSecurity(""), ) request := operations.CreateAPIRequestBody{ @@ -76,16 +76,16 @@ func main() { package main import( - "github.com/unkeyed/unkey-go/models/components" - unkeygo "github.com/unkeyed/unkey-go" - "github.com/unkeyed/unkey-go/models/operations" + "github.com/unkeyed/unkey/models/components" + "github.com/unkeyed/unkey" + "github.com/unkeyed/unkey/models/operations" "context" "log" ) func main() { - s := unkeygo.New( - unkeygo.WithSecurity(""), + s := unkey.New( + unkey.WithSecurity(""), ) request := operations.DeleteAPIRequestBody{ @@ -133,28 +133,28 @@ func main() { package main import( - "github.com/unkeyed/unkey-go/models/components" - unkeygo "github.com/unkeyed/unkey-go" - "github.com/unkeyed/unkey-go/models/operations" + "github.com/unkeyed/unkey/models/components" + "github.com/unkeyed/unkey" + "github.com/unkeyed/unkey/models/operations" "context" "log" ) func main() { - s := unkeygo.New( - unkeygo.WithSecurity(""), + s := unkey.New( + unkey.WithSecurity(""), ) request := operations.DeprecatedCreateKeyRequestBody{ APIID: "api_123", - Name: unkeygo.String("my key"), - OwnerID: unkeygo.String("team_123"), + Name: unkey.String("my key"), + OwnerID: unkey.String("team_123"), Meta: map[string]interface{}{ "billingTier": "PRO", "trialEnds": "2023-06-16T17:16:37.161Z", }, - Expires: unkeygo.Int64(1623869797161), - Remaining: unkeygo.Int64(1000), + Expires: unkey.Int64(1623869797161), + Remaining: unkey.Int64(1000), Ratelimit: &operations.DeprecatedCreateKeyRatelimit{ Type: operations.DeprecatedCreateKeyTypeFast.ToPointer(), Limit: 10, @@ -206,20 +206,20 @@ func main() { package main import( - "github.com/unkeyed/unkey-go/models/components" - unkeygo "github.com/unkeyed/unkey-go" - "github.com/unkeyed/unkey-go/models/operations" + "github.com/unkeyed/unkey/models/components" + "github.com/unkeyed/unkey" + "github.com/unkeyed/unkey/models/operations" "context" "log" ) func main() { - s := unkeygo.New( - unkeygo.WithSecurity(""), + s := unkey.New( + unkey.WithSecurity(""), ) request := operations.DeprecatedVerifyKeyRequestBody{ - APIID: unkeygo.String("api_1234"), + APIID: unkey.String("api_1234"), Key: "sk_1234", } @@ -264,21 +264,21 @@ func main() { package main import( - "github.com/unkeyed/unkey-go/models/components" - unkeygo "github.com/unkeyed/unkey-go" - "github.com/unkeyed/unkey-go/models/operations" + "github.com/unkeyed/unkey/models/components" + "github.com/unkeyed/unkey" + "github.com/unkeyed/unkey/models/operations" "context" "log" ) func main() { - s := unkeygo.New( - unkeygo.WithSecurity(""), + s := unkey.New( + unkey.WithSecurity(""), ) request := operations.DeprecatedListKeysRequest{ APIID: "api_1234", - Limit: unkeygo.Int64(100), + Limit: unkey.Int64(100), } ctx := context.Background() diff --git a/go.mod b/go.mod index ee5e9bf..423a560 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/unkeyed/unkey-go +module github.com/unkeyed/unkey go 1.20 diff --git a/internal/utils/form.go b/internal/utils/form.go index da69a53..646346f 100644 --- a/internal/utils/form.go +++ b/internal/utils/form.go @@ -12,7 +12,7 @@ import ( "github.com/ericlagergren/decimal" - "github.com/unkeyed/unkey-go/types" + "github.com/unkeyed/unkey/types" ) func populateForm(paramName string, explode bool, objType reflect.Type, objValue reflect.Value, delimiter string, getFieldName func(reflect.StructField) string) url.Values { diff --git a/internal/utils/json.go b/internal/utils/json.go index 9aac25a..3724aa0 100644 --- a/internal/utils/json.go +++ b/internal/utils/json.go @@ -13,7 +13,7 @@ import ( "time" "unsafe" - "github.com/unkeyed/unkey-go/types" + "github.com/unkeyed/unkey/types" "github.com/ericlagergren/decimal" ) diff --git a/internal/utils/pathparams.go b/internal/utils/pathparams.go index 78f6f11..563f054 100644 --- a/internal/utils/pathparams.go +++ b/internal/utils/pathparams.go @@ -13,7 +13,7 @@ import ( "github.com/ericlagergren/decimal" - "github.com/unkeyed/unkey-go/types" + "github.com/unkeyed/unkey/types" ) func GenerateURL(_ context.Context, serverURL, path string, pathParams interface{}, globals interface{}) (string, error) { diff --git a/keys.go b/keys.go index d3bee0b..9cf092c 100644 --- a/keys.go +++ b/keys.go @@ -1,16 +1,16 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package unkeygo +package unkey import ( "bytes" "context" "fmt" - "github.com/unkeyed/unkey-go/internal/hooks" - "github.com/unkeyed/unkey-go/internal/utils" - "github.com/unkeyed/unkey-go/models/components" - "github.com/unkeyed/unkey-go/models/operations" - "github.com/unkeyed/unkey-go/models/sdkerrors" + "github.com/unkeyed/unkey/internal/hooks" + "github.com/unkeyed/unkey/internal/utils" + "github.com/unkeyed/unkey/models/components" + "github.com/unkeyed/unkey/models/operations" + "github.com/unkeyed/unkey/models/sdkerrors" "io" "net/http" "net/url" diff --git a/liveness.go b/liveness.go index 3849830..c703194 100644 --- a/liveness.go +++ b/liveness.go @@ -1,15 +1,15 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package unkeygo +package unkey import ( "bytes" "context" "fmt" - "github.com/unkeyed/unkey-go/internal/hooks" - "github.com/unkeyed/unkey-go/internal/utils" - "github.com/unkeyed/unkey-go/models/operations" - "github.com/unkeyed/unkey-go/models/sdkerrors" + "github.com/unkeyed/unkey/internal/hooks" + "github.com/unkeyed/unkey/internal/utils" + "github.com/unkeyed/unkey/models/operations" + "github.com/unkeyed/unkey/models/sdkerrors" "io" "net/http" "net/url" diff --git a/migrations.go b/migrations.go index 1a0709e..b03d4e9 100644 --- a/migrations.go +++ b/migrations.go @@ -1,15 +1,15 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package unkeygo +package unkey import ( "bytes" "context" "fmt" - "github.com/unkeyed/unkey-go/internal/hooks" - "github.com/unkeyed/unkey-go/internal/utils" - "github.com/unkeyed/unkey-go/models/operations" - "github.com/unkeyed/unkey-go/models/sdkerrors" + "github.com/unkeyed/unkey/internal/hooks" + "github.com/unkeyed/unkey/internal/utils" + "github.com/unkeyed/unkey/models/operations" + "github.com/unkeyed/unkey/models/sdkerrors" "io" "net/http" "net/url" diff --git a/models/components/key.go b/models/components/key.go index c650bfd..403270a 100644 --- a/models/components/key.go +++ b/models/components/key.go @@ -5,7 +5,7 @@ package components import ( "encoding/json" "fmt" - "github.com/unkeyed/unkey-go/internal/utils" + "github.com/unkeyed/unkey/internal/utils" ) // Interval - Determines the rate at which verifications will be refilled. diff --git a/models/components/v1keysverifykeyrequest.go b/models/components/v1keysverifykeyrequest.go index dcbf9de..e4b6b5a 100644 --- a/models/components/v1keysverifykeyrequest.go +++ b/models/components/v1keysverifykeyrequest.go @@ -3,7 +3,7 @@ package components import ( - "github.com/unkeyed/unkey-go/internal/utils" + "github.com/unkeyed/unkey/internal/utils" ) // Permissions - A query for which permissions you require diff --git a/models/operations/createkey.go b/models/operations/createkey.go index ec33bfc..e6ad4a7 100644 --- a/models/operations/createkey.go +++ b/models/operations/createkey.go @@ -5,7 +5,7 @@ package operations import ( "encoding/json" "fmt" - "github.com/unkeyed/unkey-go/internal/utils" + "github.com/unkeyed/unkey/internal/utils" ) // Interval - Unkey will automatically refill verifications at the set interval. diff --git a/models/operations/deprecatedcreatekey.go b/models/operations/deprecatedcreatekey.go index 28c2b95..4ffeb9f 100644 --- a/models/operations/deprecatedcreatekey.go +++ b/models/operations/deprecatedcreatekey.go @@ -5,7 +5,7 @@ package operations import ( "encoding/json" "fmt" - "github.com/unkeyed/unkey-go/internal/utils" + "github.com/unkeyed/unkey/internal/utils" ) // DeprecatedCreateKeyType - Fast ratelimiting doesn't add latency, while consistent ratelimiting is more accurate. diff --git a/models/operations/deprecatedlistkeys.go b/models/operations/deprecatedlistkeys.go index c958b50..6d33582 100644 --- a/models/operations/deprecatedlistkeys.go +++ b/models/operations/deprecatedlistkeys.go @@ -3,8 +3,8 @@ package operations import ( - "github.com/unkeyed/unkey-go/internal/utils" - "github.com/unkeyed/unkey-go/models/components" + "github.com/unkeyed/unkey/internal/utils" + "github.com/unkeyed/unkey/models/components" ) type DeprecatedListKeysRequest struct { diff --git a/models/operations/getverifications.go b/models/operations/getverifications.go index ba5a918..1fd093d 100644 --- a/models/operations/getverifications.go +++ b/models/operations/getverifications.go @@ -5,7 +5,7 @@ package operations import ( "encoding/json" "fmt" - "github.com/unkeyed/unkey-go/internal/utils" + "github.com/unkeyed/unkey/internal/utils" ) // Granularity - The granularity of the usage data to fetch, currently only `day` is supported diff --git a/models/operations/limit.go b/models/operations/limit.go index c70e9e0..32c8674 100644 --- a/models/operations/limit.go +++ b/models/operations/limit.go @@ -3,7 +3,7 @@ package operations import ( - "github.com/unkeyed/unkey-go/internal/utils" + "github.com/unkeyed/unkey/internal/utils" ) type Resources struct { diff --git a/models/operations/listkeys.go b/models/operations/listkeys.go index 24a0d6b..b2184d6 100644 --- a/models/operations/listkeys.go +++ b/models/operations/listkeys.go @@ -3,8 +3,8 @@ package operations import ( - "github.com/unkeyed/unkey-go/internal/utils" - "github.com/unkeyed/unkey-go/models/components" + "github.com/unkeyed/unkey/internal/utils" + "github.com/unkeyed/unkey/models/components" ) type ListKeysRequest struct { diff --git a/models/operations/v1migrationscreatekeys.go b/models/operations/v1migrationscreatekeys.go index 408b9b4..efd6378 100644 --- a/models/operations/v1migrationscreatekeys.go +++ b/models/operations/v1migrationscreatekeys.go @@ -5,7 +5,7 @@ package operations import ( "encoding/json" "fmt" - "github.com/unkeyed/unkey-go/internal/utils" + "github.com/unkeyed/unkey/internal/utils" ) // Variant - The algorithm for hashing and encoding, currently only sha256 and base64 are supported diff --git a/ratelimits.go b/ratelimits.go index 71cd4d3..d393f08 100644 --- a/ratelimits.go +++ b/ratelimits.go @@ -1,15 +1,15 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package unkeygo +package unkey import ( "bytes" "context" "fmt" - "github.com/unkeyed/unkey-go/internal/hooks" - "github.com/unkeyed/unkey-go/internal/utils" - "github.com/unkeyed/unkey-go/models/operations" - "github.com/unkeyed/unkey-go/models/sdkerrors" + "github.com/unkeyed/unkey/internal/hooks" + "github.com/unkeyed/unkey/internal/utils" + "github.com/unkeyed/unkey/models/operations" + "github.com/unkeyed/unkey/models/sdkerrors" "io" "net/http" "net/url" diff --git a/unkey.go b/unkey.go index a231cc5..231f285 100644 --- a/unkey.go +++ b/unkey.go @@ -1,16 +1,16 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package unkeygo +package unkey import ( "bytes" "context" "fmt" - "github.com/unkeyed/unkey-go/internal/hooks" - "github.com/unkeyed/unkey-go/internal/utils" - "github.com/unkeyed/unkey-go/models/components" - "github.com/unkeyed/unkey-go/models/operations" - "github.com/unkeyed/unkey-go/models/sdkerrors" + "github.com/unkeyed/unkey/internal/hooks" + "github.com/unkeyed/unkey/internal/utils" + "github.com/unkeyed/unkey/models/components" + "github.com/unkeyed/unkey/models/operations" + "github.com/unkeyed/unkey/models/sdkerrors" "io" "net/http" "net/url" @@ -151,9 +151,9 @@ func New(opts ...SDKOption) *Unkey { sdkConfiguration: sdkConfiguration{ Language: "go", OpenAPIDocVersion: "1.0.0", - SDKVersion: "0.1.6", + SDKVersion: "0.1.7", GenVersion: "2.326.3", - UserAgent: "speakeasy-sdk/go 0.1.6 2.326.3 1.0.0 github.com/unkeyed/unkey-go", + UserAgent: "speakeasy-sdk/go 0.1.7 2.326.3 1.0.0 github.com/unkeyed/unkey", Hooks: hooks.New(), }, }