diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index a79202b..42d8c20 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: 2.0.0 id: 4fc4737a-135f-4840-8e6d-42a2b2a2884b management: - docChecksum: f56588fc2d036bcae3411872cb7a4f6b + docChecksum: 957bade817085c900e9e156fe28f22de docVersion: 1.0.0 - speakeasyVersion: 1.422.1 - generationVersion: 2.438.15 - releaseVersion: 0.9.5 - configChecksum: 2ed914345363c8de34fb47a258642372 + speakeasyVersion: 1.424.0 + generationVersion: 2.445.1 + releaseVersion: 0.10.0 + configChecksum: f05f5642b3717c2fef64128e2da1d736 repoURL: https://github.com/unkeyed/unkey-go.git installationURL: https://github.com/unkeyed/unkey-go features: go: additionalDependencies: 0.1.0 constsAndDefaults: 0.1.6 - core: 3.5.13 + core: 3.5.14 defaultEnabledRetries: 0.2.0 deprecations: 2.81.1 envVarSecurityUsage: 0.3.1 @@ -28,6 +28,7 @@ features: responseFormat: 0.1.2 retries: 2.83.0 sdkHooks: 0.1.0 + tests: 0.6.0 unions: 2.85.9 generatedFiles: - .gitattributes @@ -333,7 +334,7 @@ examples: keyId: "key_1234" responses: "200": - application/json: {"id": "key_1234", "start": "sk_5j1", "workspaceId": "ws_1234", "apiId": "api_1234", "name": "Customer X", "ownerId": "user_123", "meta": {"roles": ["admin", "user"], "stripeCustomerId": "cus_1234"}, "createdAt": 0, "updatedAt": 0, "expires": 0, "remaining": 1000, "refill": {"interval": "daily", "amount": 100, "lastRefillAt": 100}, "ratelimit": {"async": true, "limit": 10, "duration": 60}, "roles": ["admin", "finance"], "permissions": ["domain.dns.create_record", "finance.read_receipt"], "enabled": true} + application/json: {"id": "key_1234", "start": "sk_5j1", "workspaceId": "ws_1234", "apiId": "api_1234", "name": "Customer X", "ownerId": "user_123", "meta": {"roles": ["admin", "user"], "stripeCustomerId": "cus_1234"}, "createdAt": 0, "updatedAt": 0, "expires": 0, "remaining": 1000, "refill": {"interval": "daily", "amount": 100, "refillDay": 15, "lastRefillAt": 100}, "ratelimit": {"async": true, "limit": 10, "duration": 60}, "roles": ["admin", "finance"], "permissions": ["domain.dns.create_record", "finance.read_receipt"], "enabled": true} "400": application/json: {"error": {"code": "BAD_REQUEST", "docs": "https://unkey.dev/docs/api-reference/errors/code/BAD_REQUEST", "message": "", "requestId": "req_1234"}} "401": @@ -371,7 +372,7 @@ examples: createKey: speakeasy-default-create-key: requestBody: - application/json: {"apiId": "api_123", "name": "my key", "externalId": "team_123", "meta": {"billingTier": "PRO", "trialEnds": "2023-06-16T17:16:37.161Z"}, "roles": ["admin", "finance"], "permissions": ["domains.create_record", "say_hello"], "expires": 1623869797161, "remaining": 1000, "refill": {"interval": "daily", "amount": 100}, "ratelimit": {"type": "fast", "limit": 10, "duration": 60000}, "enabled": false} + application/json: {"apiId": "api_123", "name": "my key", "externalId": "team_123", "meta": {"billingTier": "PRO", "trialEnds": "2023-06-16T17:16:37.161Z"}, "roles": ["admin", "finance"], "permissions": ["domains.create_record", "say_hello"], "expires": 1623869797161, "remaining": 1000, "refill": {"interval": "monthly", "amount": 100, "refillDay": 15}, "ratelimit": {"type": "fast", "limit": 10, "duration": 60000}, "enabled": false} responses: "200": application/json: {"keyId": "key_123", "key": "prefix_xxxxxxxxx"} @@ -652,7 +653,7 @@ examples: limit: 100 responses: "200": - application/json: {"keys": [{"id": "key_1234", "start": "sk_5j1", "workspaceId": "ws_1234", "apiId": "api_1234", "name": "Customer X", "ownerId": "user_123", "meta": {"roles": ["admin", "user"], "stripeCustomerId": "cus_1234"}, "createdAt": 0, "updatedAt": 0, "expires": 0, "remaining": 1000, "refill": {"interval": "daily", "amount": 100, "lastRefillAt": 100}, "ratelimit": {"async": true, "limit": 10, "duration": 60}, "roles": ["admin", "finance"], "permissions": ["domain.dns.create_record", "finance.read_receipt"], "enabled": true}, {"id": "key_1234", "start": "sk_5j1", "workspaceId": "ws_1234", "apiId": "api_1234", "name": "Customer X", "ownerId": "user_123", "meta": {"roles": ["admin", "user"], "stripeCustomerId": "cus_1234"}, "createdAt": 0, "updatedAt": 0, "expires": 0, "remaining": 1000, "refill": {"interval": "daily", "amount": 100, "lastRefillAt": 100}, "ratelimit": {"async": true, "limit": 10, "duration": 60}, "roles": ["admin", "finance"], "permissions": ["domain.dns.create_record", "finance.read_receipt"], "enabled": true}], "cursor": "eyJrZXkiOiJrZXlfMTIzNCJ9", "total": 688970} + application/json: {"keys": [{"id": "key_1234", "start": "sk_5j1", "workspaceId": "ws_1234", "apiId": "api_1234", "name": "Customer X", "ownerId": "user_123", "meta": {"roles": ["admin", "user"], "stripeCustomerId": "cus_1234"}, "createdAt": 0, "updatedAt": 0, "expires": 0, "remaining": 1000, "refill": {"interval": "daily", "amount": 100, "refillDay": 15, "lastRefillAt": 100}, "ratelimit": {"async": true, "limit": 10, "duration": 60}, "roles": ["admin", "finance"], "permissions": ["domain.dns.create_record", "finance.read_receipt"], "enabled": true}, {"id": "key_1234", "start": "sk_5j1", "workspaceId": "ws_1234", "apiId": "api_1234", "name": "Customer X", "ownerId": "user_123", "meta": {"roles": ["admin", "user"], "stripeCustomerId": "cus_1234"}, "createdAt": 0, "updatedAt": 0, "expires": 0, "remaining": 1000, "refill": {"interval": "daily", "amount": 100, "refillDay": 15, "lastRefillAt": 100}, "ratelimit": {"async": true, "limit": 10, "duration": 60}, "roles": ["admin", "finance"], "permissions": ["domain.dns.create_record", "finance.read_receipt"], "enabled": true}], "cursor": "eyJrZXkiOiJrZXlfMTIzNCJ9", "total": 688970} "400": application/json: {"error": {"code": "BAD_REQUEST", "docs": "https://unkey.dev/docs/api-reference/errors/code/BAD_REQUEST", "message": "", "requestId": "req_1234"}} "401": diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 6565458..4c5f0c2 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -12,7 +12,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: true go: - version: 0.9.5 + version: 0.10.0 additionalDependencies: {} allowUnknownFieldsInWeakUnions: false clientServerStatusCodesAsErrors: true diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 74e6c06..7fb0de2 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.422.1 +speakeasyVersion: 1.424.0 sources: openapi.json: sourceNamespace: openapi-json - sourceRevisionDigest: sha256:83052d10b562ee373d66b562b62e25ef9cc1b75b88c8fef8e05b48c99efb53d0 - sourceBlobDigest: sha256:43668944807ad4c9cb429c37c516be26fe2a14b9165957d22d277e6eee6ed55c + sourceRevisionDigest: sha256:5b4d353e01dd74e0ac9a8b521d71e5c97ffe1a654d77d3d8036b2e783bd08612 + sourceBlobDigest: sha256:f03ba20fc32a90e85dacb81cd6f3b52c07e2a8a3dabda2f7186120b67c4d94ef tags: - latest - main @@ -11,10 +11,10 @@ targets: go: source: openapi.json sourceNamespace: openapi-json - sourceRevisionDigest: sha256:83052d10b562ee373d66b562b62e25ef9cc1b75b88c8fef8e05b48c99efb53d0 - sourceBlobDigest: sha256:43668944807ad4c9cb429c37c516be26fe2a14b9165957d22d277e6eee6ed55c + sourceRevisionDigest: sha256:5b4d353e01dd74e0ac9a8b521d71e5c97ffe1a654d77d3d8036b2e783bd08612 + sourceBlobDigest: sha256:f03ba20fc32a90e85dacb81cd6f3b52c07e2a8a3dabda2f7186120b67c4d94ef codeSamplesNamespace: openapi-json-code-samples - codeSamplesRevisionDigest: sha256:6120e6bd38b7b13362ae9167c517e492d8afb26c9ca537184ce393ee4b8aa23f + codeSamplesRevisionDigest: sha256:4df0c16b687b1fbf319e382a23a0398699310d4173f21f3a4dfec5f6f7abb2e9 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 9c3a8d2..a164296 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,6 @@ * [Server Selection](#server-selection) * [Custom HTTP Client](#custom-http-client) * [Authentication](#authentication) -* [Special Types](#special-types) @@ -371,12 +370,6 @@ func main() { ``` - -## Special Types - - - - ## Retries diff --git a/RELEASES.md b/RELEASES.md index 483eb98..d5ee4f2 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -258,4 +258,14 @@ Based on: ### Generated - [go v0.9.5] . ### Releases -- [Go v0.9.5] https://github.com/unkeyed/unkey-go/releases/tag/v0.9.5 - . \ No newline at end of file +- [Go v0.9.5] https://github.com/unkeyed/unkey-go/releases/tag/v0.9.5 - . + +## 2024-11-03 00:32:48 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.424.0 (2.445.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v0.10.0] . +### Releases +- [Go v0.10.0] https://github.com/unkeyed/unkey-go/releases/tag/v0.10.0 - . \ No newline at end of file diff --git a/docs/models/components/interval.md b/docs/models/components/interval.md index 452959e..c523c66 100644 --- a/docs/models/components/interval.md +++ b/docs/models/components/interval.md @@ -1,6 +1,6 @@ # Interval -Determines the rate at which verifications will be refilled. +Determines the rate at which verifications will be refilled. When 'daily' is set for 'interval' 'refillDay' will be set to null. ## Values diff --git a/docs/models/components/key.md b/docs/models/components/key.md index 7699b93..149cc71 100644 --- a/docs/models/components/key.md +++ b/docs/models/components/key.md @@ -16,7 +16,7 @@ | `UpdatedAt` | **int64* | :heavy_minus_sign: | The unix timestamp in milliseconds when the key was last updated | 0 | | `Expires` | **int64* | :heavy_minus_sign: | The unix timestamp in milliseconds when the key will expire. If this field is null or undefined, the key is not expiring. | 0 | | `Remaining` | **int64* | :heavy_minus_sign: | The number of requests that can be made with this key before it becomes invalid. If this field is null or undefined, the key has no request limit. | 1000 | -| `Refill` | [*components.Refill](../../models/components/refill.md) | :heavy_minus_sign: | Unkey allows you to refill remaining verifications on a key on a regular interval. | {
"interval": "daily",
"amount": 10
} | +| `Refill` | [*components.Refill](../../models/components/refill.md) | :heavy_minus_sign: | Unkey allows you to refill remaining verifications on a key on a regular interval. | {
"interval": "monthly",
"amount": 10,
"refillDay": 10
} | | `Ratelimit` | [*components.Ratelimit](../../models/components/ratelimit.md) | :heavy_minus_sign: | Unkey comes with per-key ratelimiting out of the box. | {
"async": true,
"limit": 10,
"duration": 60
} | | `Roles` | []*string* | :heavy_minus_sign: | All roles this key belongs to | [
"admin",
"finance"
] | | `Permissions` | []*string* | :heavy_minus_sign: | All permissions this key has | [
"domain.dns.create_record",
"finance.read_receipt"
] | diff --git a/docs/models/components/refill.md b/docs/models/components/refill.md index cc3beaa..a3e6176 100644 --- a/docs/models/components/refill.md +++ b/docs/models/components/refill.md @@ -5,8 +5,9 @@ Unkey allows you to refill remaining verifications on a key on a regular interva ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | -| `Interval` | [components.Interval](../../models/components/interval.md) | :heavy_check_mark: | Determines the rate at which verifications will be refilled. | daily | -| `Amount` | *int64* | :heavy_check_mark: | Resets `remaining` to this value every interval. | 100 | -| `LastRefillAt` | **int64* | :heavy_minus_sign: | The unix timestamp in miliseconds when the key was last refilled. | 100 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Interval` | [components.Interval](../../models/components/interval.md) | :heavy_check_mark: | Determines the rate at which verifications will be refilled. When 'daily' is set for 'interval' 'refillDay' will be set to null. | daily | +| `Amount` | *int64* | :heavy_check_mark: | Resets `remaining` to this value every interval. | 100 | +| `RefillDay` | **float64* | :heavy_minus_sign: | The day verifications will refill each month, when interval is set to 'monthly'. Value is not zero-indexed making 1 the first day of the month. If left blank it will default to the first day of the month. When 'daily' is set for 'interval' 'refillDay' will be set to null. | 15 | +| `LastRefillAt` | **int64* | :heavy_minus_sign: | The unix timestamp in miliseconds when the key was last refilled. | 100 | \ No newline at end of file diff --git a/docs/models/operations/createkeyrequestbody.md b/docs/models/operations/createkeyrequestbody.md index 68cfc03..547ba6f 100644 --- a/docs/models/operations/createkeyrequestbody.md +++ b/docs/models/operations/createkeyrequestbody.md @@ -16,7 +16,7 @@ | `Permissions` | []*string* | :heavy_minus_sign: | A list of permissions that this key should have. If the permission does not exist, an error is thrown | [
"domains.create_record",
"say_hello"
] | | `Expires` | **int64* | :heavy_minus_sign: | You can auto expire keys by providing a unix timestamp in milliseconds. Once Keys expire they will automatically be disabled and are no longer valid unless you enable them again. | 1623869797161 | | `Remaining` | **int64* | :heavy_minus_sign: | You can limit the number of requests a key can make. Once a key reaches 0 remaining requests, it will automatically be disabled and is no longer valid unless you update it.

[Learn more](https://unkey.dev/docs/features/remaining) | 1000 | -| `Refill` | [*operations.Refill](../../models/operations/refill.md) | :heavy_minus_sign: | Unkey enables you to refill verifications for each key at regular intervals. | {
"interval": "daily",
"amount": 100
} | +| `Refill` | [*operations.Refill](../../models/operations/refill.md) | :heavy_minus_sign: | Unkey enables you to refill verifications for each key at regular intervals. | {
"interval": "monthly",
"amount": 100,
"refillDay": 15
} | | `Ratelimit` | [*operations.Ratelimit](../../models/operations/ratelimit.md) | :heavy_minus_sign: | Unkey comes with per-key fixed-window ratelimiting out of the box. | {
"type": "fast",
"limit": 10,
"duration": 60000
} | | `Enabled` | **bool* | :heavy_minus_sign: | Sets if key is enabled or disabled. Disabled keys are not valid. | false | | `Recoverable` | **bool* | :heavy_minus_sign: | You may want to show keys again later. While we do not recommend this, we leave this option open for you.

In addition to storing the key's hash, recoverable keys are stored in an encrypted vault, allowing you to retrieve and display the plaintext later.

https://www.unkey.com/docs/security/recovering-keys for more information. | | diff --git a/docs/models/operations/refill.md b/docs/models/operations/refill.md index b94bf6e..800486d 100644 --- a/docs/models/operations/refill.md +++ b/docs/models/operations/refill.md @@ -5,7 +5,8 @@ Unkey enables you to refill verifications for each key at regular intervals. ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `Interval` | [operations.Interval](../../models/operations/interval.md) | :heavy_check_mark: | Unkey will automatically refill verifications at the set interval. | -| `Amount` | *int64* | :heavy_check_mark: | The number of verifications to refill for each occurrence is determined individually for each key. | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Interval` | [operations.Interval](../../models/operations/interval.md) | :heavy_check_mark: | Unkey will automatically refill verifications at the set interval. | +| `Amount` | *int64* | :heavy_check_mark: | The number of verifications to refill for each occurrence is determined individually for each key. | +| `RefillDay` | **float64* | :heavy_minus_sign: | The day of the month, when we will refill the remaining verifications. To refill on the 15th of each month, set 'refillDay': 15.
If the day does not exist, for example you specified the 30th and it's february, we will refill them on the last day of the month instead. | \ No newline at end of file diff --git a/docs/models/operations/updatekeyrefill.md b/docs/models/operations/updatekeyrefill.md index e641c30..47f3f0f 100644 --- a/docs/models/operations/updatekeyrefill.md +++ b/docs/models/operations/updatekeyrefill.md @@ -8,4 +8,5 @@ Unkey enables you to refill verifications for each key at regular intervals. | Field | Type | Required | Description | | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `Interval` | [operations.UpdateKeyInterval](../../models/operations/updatekeyinterval.md) | :heavy_check_mark: | Unkey will automatically refill verifications at the set interval. If null is used the refill functionality will be removed from the key. | -| `Amount` | *int64* | :heavy_check_mark: | The amount of verifications to refill for each occurrence is determined individually for each key. | \ No newline at end of file +| `Amount` | *int64* | :heavy_check_mark: | The amount of verifications to refill for each occurrence is determined individually for each key. | +| `RefillDay` | **float64* | :heavy_minus_sign: | The day verifications will refill each month, when interval is set to 'monthly' | \ No newline at end of file diff --git a/docs/models/operations/v1migrationscreatekeysrefill.md b/docs/models/operations/v1migrationscreatekeysrefill.md index 2f89e3e..8064458 100644 --- a/docs/models/operations/v1migrationscreatekeysrefill.md +++ b/docs/models/operations/v1migrationscreatekeysrefill.md @@ -8,4 +8,5 @@ Unkey enables you to refill verifications for each key at regular intervals. | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | | `Interval` | [operations.V1MigrationsCreateKeysInterval](../../models/operations/v1migrationscreatekeysinterval.md) | :heavy_check_mark: | Unkey will automatically refill verifications at the set interval. | -| `Amount` | *int64* | :heavy_check_mark: | The number of verifications to refill for each occurrence is determined individually for each key. | \ No newline at end of file +| `Amount` | *int64* | :heavy_check_mark: | The number of verifications to refill for each occurrence is determined individually for each key. | +| `RefillDay` | **float64* | :heavy_minus_sign: | The day verifications will refill each month, when interval is set to 'monthly' | \ No newline at end of file diff --git a/docs/models/operations/v1migrationsenqueuekeysrefill.md b/docs/models/operations/v1migrationsenqueuekeysrefill.md index ca8276e..8b4f3d8 100644 --- a/docs/models/operations/v1migrationsenqueuekeysrefill.md +++ b/docs/models/operations/v1migrationsenqueuekeysrefill.md @@ -8,4 +8,5 @@ Unkey enables you to refill verifications for each key at regular intervals. | Field | Type | Required | Description | | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | | `Interval` | [operations.V1MigrationsEnqueueKeysInterval](../../models/operations/v1migrationsenqueuekeysinterval.md) | :heavy_check_mark: | Unkey will automatically refill verifications at the set interval. | -| `Amount` | *int64* | :heavy_check_mark: | The number of verifications to refill for each occurrence is determined individually for each key. | \ No newline at end of file +| `Amount` | *int64* | :heavy_check_mark: | The number of verifications to refill for each occurrence is determined individually for each key. | +| `RefillDay` | **float64* | :heavy_minus_sign: | The day verifications will refill each month, when interval is set to 'monthly' | \ No newline at end of file diff --git a/docs/sdks/keys/README.md b/docs/sdks/keys/README.md index 28d00a4..81a4f28 100644 --- a/docs/sdks/keys/README.md +++ b/docs/sdks/keys/README.md @@ -230,8 +230,9 @@ func main() { Expires: unkeygo.Int64(1623869797161), Remaining: unkeygo.Int64(1000), Refill: &operations.Refill{ - Interval: operations.IntervalDaily, + Interval: operations.IntervalMonthly, Amount: 100, + RefillDay: unkeygo.Float64(15), }, Ratelimit: &operations.Ratelimit{ Type: operations.TypeFast.ToPointer(), diff --git a/models/components/key.go b/models/components/key.go index b855c28..9e07ada 100644 --- a/models/components/key.go +++ b/models/components/key.go @@ -5,9 +5,10 @@ package components import ( "encoding/json" "fmt" + "github.com/unkeyed/unkey-go/internal/utils" ) -// Interval - Determines the rate at which verifications will be refilled. +// Interval - Determines the rate at which verifications will be refilled. When 'daily' is set for 'interval' 'refillDay' will be set to null. type Interval string const ( @@ -36,14 +37,27 @@ func (e *Interval) UnmarshalJSON(data []byte) error { // Refill - Unkey allows you to refill remaining verifications on a key on a regular interval. type Refill struct { - // Determines the rate at which verifications will be refilled. + // Determines the rate at which verifications will be refilled. When 'daily' is set for 'interval' 'refillDay' will be set to null. Interval Interval `json:"interval"` // Resets `remaining` to this value every interval. Amount int64 `json:"amount"` + // The day verifications will refill each month, when interval is set to 'monthly'. Value is not zero-indexed making 1 the first day of the month. If left blank it will default to the first day of the month. When 'daily' is set for 'interval' 'refillDay' will be set to null. + RefillDay *float64 `default:"1" json:"refillDay"` // The unix timestamp in miliseconds when the key was last refilled. LastRefillAt *int64 `json:"lastRefillAt,omitempty"` } +func (r Refill) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *Refill) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, false); err != nil { + return err + } + return nil +} + func (o *Refill) GetInterval() Interval { if o == nil { return Interval("") @@ -58,6 +72,13 @@ func (o *Refill) GetAmount() int64 { return o.Amount } +func (o *Refill) GetRefillDay() *float64 { + if o == nil { + return nil + } + return o.RefillDay +} + func (o *Refill) GetLastRefillAt() *int64 { if o == nil { return nil diff --git a/models/operations/createkey.go b/models/operations/createkey.go index 797795d..08ddefa 100644 --- a/models/operations/createkey.go +++ b/models/operations/createkey.go @@ -42,6 +42,9 @@ type Refill struct { Interval Interval `json:"interval"` // The number of verifications to refill for each occurrence is determined individually for each key. Amount int64 `json:"amount"` + // The day of the month, when we will refill the remaining verifications. To refill on the 15th of each month, set 'refillDay': 15. + // If the day does not exist, for example you specified the 30th and it's february, we will refill them on the last day of the month instead. + RefillDay *float64 `json:"refillDay,omitempty"` } func (o *Refill) GetInterval() Interval { @@ -58,6 +61,13 @@ func (o *Refill) GetAmount() int64 { return o.Amount } +func (o *Refill) GetRefillDay() *float64 { + if o == nil { + return nil + } + return o.RefillDay +} + // Type - Deprecated, use `async`. Fast ratelimiting doesn't add latency, while consistent ratelimiting is more accurate. // // https://unkey.dev/docs/features/ratelimiting - Learn more diff --git a/models/operations/updatekey.go b/models/operations/updatekey.go index 851efd4..04ccdf5 100644 --- a/models/operations/updatekey.go +++ b/models/operations/updatekey.go @@ -153,6 +153,8 @@ type UpdateKeyRefill struct { Interval UpdateKeyInterval `json:"interval"` // The amount of verifications to refill for each occurrence is determined individually for each key. Amount int64 `json:"amount"` + // The day verifications will refill each month, when interval is set to 'monthly' + RefillDay *float64 `json:"refillDay,omitempty"` } func (o *UpdateKeyRefill) GetInterval() UpdateKeyInterval { @@ -169,6 +171,13 @@ func (o *UpdateKeyRefill) GetAmount() int64 { return o.Amount } +func (o *UpdateKeyRefill) GetRefillDay() *float64 { + if o == nil { + return nil + } + return o.RefillDay +} + type Roles struct { // The id of the role. Provide either `id` or `name`. If both are provided `id` is used. ID *string `json:"id,omitempty"` diff --git a/models/operations/v1migrationscreatekeys.go b/models/operations/v1migrationscreatekeys.go index a1eeaa5..573662c 100644 --- a/models/operations/v1migrationscreatekeys.go +++ b/models/operations/v1migrationscreatekeys.go @@ -88,6 +88,8 @@ type V1MigrationsCreateKeysRefill struct { Interval V1MigrationsCreateKeysInterval `json:"interval"` // The number of verifications to refill for each occurrence is determined individually for each key. Amount int64 `json:"amount"` + // The day verifications will refill each month, when interval is set to 'monthly' + RefillDay *float64 `json:"refillDay,omitempty"` } func (o *V1MigrationsCreateKeysRefill) GetInterval() V1MigrationsCreateKeysInterval { @@ -104,6 +106,13 @@ func (o *V1MigrationsCreateKeysRefill) GetAmount() int64 { return o.Amount } +func (o *V1MigrationsCreateKeysRefill) GetRefillDay() *float64 { + if o == nil { + return nil + } + return o.RefillDay +} + // V1MigrationsCreateKeysType - Fast ratelimiting doesn't add latency, while consistent ratelimiting is more accurate. // // https://unkey.dev/docs/features/ratelimiting - Learn more diff --git a/models/operations/v1migrationsenqueuekeys.go b/models/operations/v1migrationsenqueuekeys.go index ebf82ce..8f14cfa 100644 --- a/models/operations/v1migrationsenqueuekeys.go +++ b/models/operations/v1migrationsenqueuekeys.go @@ -88,6 +88,8 @@ type V1MigrationsEnqueueKeysRefill struct { Interval V1MigrationsEnqueueKeysInterval `json:"interval"` // The number of verifications to refill for each occurrence is determined individually for each key. Amount int64 `json:"amount"` + // The day verifications will refill each month, when interval is set to 'monthly' + RefillDay *float64 `json:"refillDay,omitempty"` } func (o *V1MigrationsEnqueueKeysRefill) GetInterval() V1MigrationsEnqueueKeysInterval { @@ -104,6 +106,13 @@ func (o *V1MigrationsEnqueueKeysRefill) GetAmount() int64 { return o.Amount } +func (o *V1MigrationsEnqueueKeysRefill) GetRefillDay() *float64 { + if o == nil { + return nil + } + return o.RefillDay +} + // V1MigrationsEnqueueKeysType - Deprecated, use `async`. Fast ratelimiting doesn't add latency, while consistent ratelimiting is more accurate. // // https://unkey.dev/docs/features/ratelimiting - Learn more diff --git a/unkey.go b/unkey.go index 8736328..bee8ff4 100644 --- a/unkey.go +++ b/unkey.go @@ -154,9 +154,9 @@ func New(opts ...SDKOption) *Unkey { sdkConfiguration: sdkConfiguration{ Language: "go", OpenAPIDocVersion: "1.0.0", - SDKVersion: "0.9.5", - GenVersion: "2.438.15", - UserAgent: "speakeasy-sdk/go 0.9.5 2.438.15 1.0.0 github.com/unkeyed/unkey-go", + SDKVersion: "0.10.0", + GenVersion: "2.445.1", + UserAgent: "speakeasy-sdk/go 0.10.0 2.445.1 1.0.0 github.com/unkeyed/unkey-go", Hooks: hooks.New(), }, }