From 67c0a9d03d26df1d52c20c6ff5611bfcf51b967b Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 10 Sep 2026 17:18:36 +0000 Subject: [PATCH 1/2] Sync OpenAPI specification 1.0.1 --- spec/openapi.yaml | 52 +++++++++++------------------------------------ 1 file changed, 12 insertions(+), 40 deletions(-) diff --git a/spec/openapi.yaml b/spec/openapi.yaml index 948647f..39d9259 100644 --- a/spec/openapi.yaml +++ b/spec/openapi.yaml @@ -10,7 +10,7 @@ info: license: name: Apache 2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html - version: 1.0.0 + version: 1.0.1 servers: - url: https://api.timr.com/v1/ @@ -276,50 +276,22 @@ paths: "422": $ref: '#/components/responses/UnprocessableContent' - /users/{id}/working-time-accounts/{date}: - get: - operationId: getUserWorkingTimeAccounts - tags: - - Time Account - summary: Get a User's working time accounts - description: Returns the User's working time account balances as of the given day. - parameters: - - name: id - in: path - description: ID of the User. - required: true - example: 074e7048-9097-11eb-a8b3-0242ac130003 - schema: - type: string - - name: date - in: path - description: Day to return the balances for. - required: true - example: 2026-07-16 - schema: - type: string - format: date - description: last balancing date - example: 2023-03-28 - responses: - "200": - description: The User's working time account balances on the given day. - content: - application/json: - schema: - $ref: '#/components/schemas/Accounts' - "403": - $ref: '#/components/responses/Forbidden' - "404": - $ref: '#/components/responses/NotFound' - /users/{id}/accounts/{date}: get: operationId: getUserAccounts tags: - Time Account summary: Get a User's accounts - description: Returns all of the User's account balances as of the given day, including overtime and surcharge accounts. + description: |- + Returns all of the User's account balances as of the specified date. The calculation starts from the **most recent balance before or on the specified date**. If the specified date is itself a balance date, the stored balance is returned unchanged. + + If the specified date does not fall on a balance date, timr uses the **most recent balance before the specified date** as the starting point and recalculates the account balances up to the requested date using the recorded actual times and the applicable target working time. + + **Important:** The target working time is calculated using the User's **currently assigned Work Schedule Model**, not necessarily the model that was assigned on the requested historical date. + + If the User's Work Schedule Model has changed, this endpoint should therefore only be used with dates **on or after the most recent Work Schedule Model change**. Requests for earlier dates may return incorrect target working times and therefore incorrect account balances. + + `last_balance_date` identifies the balance entry preceding the returned period, including when the requested date is itself a balance date. It is null for the initialization date itself. parameters: - name: id in: path @@ -4723,7 +4695,7 @@ components: nullable: true type: string format: date - description: date of last balance + description: The balance entry the figures continue from, always before the requested day. Null only for the initialization date itself. example: 2023-03-28 time_account: nullable: true From cd095d61b228f6bf2392761a5cf1af81d9d96b3c Mon Sep 17 00:00:00 2001 From: Bernhard Danecker Date: Thu, 15 Oct 2026 16:31:37 +0200 Subject: [PATCH 2/2] Regenerate SDKs for OpenAPI specification 1.0.1 --- .../Timr.Api/Endpoints/TimeAccountApi.cs | 455 +----------------- sdk/dotnet/Timr.Api/Model/Accounts.cs | 6 +- .../com/timr/api/apis/TimeAccountApi.java | 100 +--- .../java/com/timr/api/models/Accounts.java | 2 +- .../com/timr/api/apis/TimeAccountApi.java | 65 +-- .../java/com/timr/api/models/Accounts.java | 2 +- .../com/timr/api/apis/TimeAccountApi.kt | 80 +-- .../kotlin/com/timr/api/models/Accounts.kt | 4 +- sdk/python/timr_api/api/time_account_api.py | 290 +---------- sdk/python/timr_api/configuration.py | 2 +- sdk/python/timr_api/models/accounts.py | 2 +- sdk/swift/TimrApi/APIs/TimeAccountAPI.swift | 52 +- sdk/swift/TimrApi/Models/Accounts.swift | 2 +- .../src/apis/TimeAccountApi.ts | 84 +--- sdk/typescript-fetch/src/models/Accounts.ts | 2 +- 15 files changed, 29 insertions(+), 1119 deletions(-) diff --git a/sdk/dotnet/Timr.Api/Endpoints/TimeAccountApi.cs b/sdk/dotnet/Timr.Api/Endpoints/TimeAccountApi.cs index 0a46438..aeb76f6 100644 --- a/sdk/dotnet/Timr.Api/Endpoints/TimeAccountApi.cs +++ b/sdk/dotnet/Timr.Api/Endpoints/TimeAccountApi.cs @@ -42,7 +42,7 @@ public interface ITimeAccountApi : IApi /// Get a User's accounts /// /// - /// Returns all of the User's account balances as of the given day, including overtime and surcharge accounts. + /// Returns all of the User's account balances as of the specified date. The calculation starts from the **most recent balance before or on the specified date**. If the specified date is itself a balance date, the stored balance is returned unchanged. If the specified date does not fall on a balance date, timr uses the **most recent balance before the specified date** as the starting point and recalculates the account balances up to the requested date using the recorded actual times and the applicable target working time. **Important:** The target working time is calculated using the User's **currently assigned Work Schedule Model**, not necessarily the model that was assigned on the requested historical date. If the User's Work Schedule Model has changed, this endpoint should therefore only be used with dates **on or after the most recent Work Schedule Model change**. Requests for earlier dates may return incorrect target working times and therefore incorrect account balances. `last_balance_date` identifies the balance entry preceding the returned period, including when the requested date is itself a balance date. It is null for the initialization date itself. /// /// Thrown when fails to make API call /// ID of the User. @@ -55,38 +55,13 @@ public interface ITimeAccountApi : IApi /// Get a User's accounts /// /// - /// Returns all of the User's account balances as of the given day, including overtime and surcharge accounts. + /// Returns all of the User's account balances as of the specified date. The calculation starts from the **most recent balance before or on the specified date**. If the specified date is itself a balance date, the stored balance is returned unchanged. If the specified date does not fall on a balance date, timr uses the **most recent balance before the specified date** as the starting point and recalculates the account balances up to the requested date using the recorded actual times and the applicable target working time. **Important:** The target working time is calculated using the User's **currently assigned Work Schedule Model**, not necessarily the model that was assigned on the requested historical date. If the User's Work Schedule Model has changed, this endpoint should therefore only be used with dates **on or after the most recent Work Schedule Model change**. Requests for earlier dates may return incorrect target working times and therefore incorrect account balances. `last_balance_date` identifies the balance entry preceding the returned period, including when the requested date is itself a balance date. It is null for the initialization date itself. /// /// ID of the User. /// Day to return the balances for. /// Cancellation Token to cancel the request. /// <?> Task GetUserAccountsOrDefaultAsync(string id, DateOnly date, System.Threading.CancellationToken cancellationToken = default); - - /// - /// Get a User's working time accounts - /// - /// - /// Returns the User's working time account balances as of the given day. - /// - /// Thrown when fails to make API call - /// ID of the User. - /// Day to return the balances for. - /// Cancellation Token to cancel the request. - /// <> - Task GetUserWorkingTimeAccountsAsync(string id, DateOnly date, System.Threading.CancellationToken cancellationToken = default); - - /// - /// Get a User's working time accounts - /// - /// - /// Returns the User's working time account balances as of the given day. - /// - /// ID of the User. - /// Day to return the balances for. - /// Cancellation Token to cancel the request. - /// <?> - Task GetUserWorkingTimeAccountsOrDefaultAsync(string id, DateOnly date, System.Threading.CancellationToken cancellationToken = default); } /// @@ -113,30 +88,6 @@ public interface IGetUserAccountsApiResponse : Timr.Api.Client.IApiResponse, IOk bool IsNotFound { get; } } - /// - /// The - /// - public interface IGetUserWorkingTimeAccountsApiResponse : Timr.Api.Client.IApiResponse, IOk, IForbidden, INotFound - { - /// - /// Returns true if the response is 200 Ok - /// - /// - bool IsOk { get; } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - bool IsForbidden { get; } - - /// - /// Returns true if the response is 404 NotFound - /// - /// - bool IsNotFound { get; } - } - /// /// Represents a collection of functions to interact with the API endpoints /// @@ -161,26 +112,6 @@ internal void ExecuteOnErrorGetUserAccounts(Exception exception) { OnErrorGetUserAccounts?.Invoke(this, new ExceptionEventArgs(exception)); } - - /// - /// The event raised after the server response - /// - public event EventHandler? OnGetUserWorkingTimeAccounts; - - /// - /// The event raised after an error querying the server - /// - public event EventHandler? OnErrorGetUserWorkingTimeAccounts; - - internal void ExecuteOnGetUserWorkingTimeAccounts(TimeAccountApi.GetUserWorkingTimeAccountsApiResponse apiResponse) - { - OnGetUserWorkingTimeAccounts?.Invoke(this, new ApiResponseEventArgs(apiResponse)); - } - - internal void ExecuteOnErrorGetUserWorkingTimeAccounts(Exception exception) - { - OnErrorGetUserWorkingTimeAccounts?.Invoke(this, new ExceptionEventArgs(exception)); - } } /// @@ -288,7 +219,7 @@ private void OnErrorGetUserAccountsDefaultImplementation(Exception exceptionLoca partial void OnErrorGetUserAccounts(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string id, DateOnly date); /// - /// Get a User's accounts Returns all of the User's account balances as of the given day, including overtime and surcharge accounts. + /// Get a User's accounts Returns all of the User's account balances as of the specified date. The calculation starts from the **most recent balance before or on the specified date**. If the specified date is itself a balance date, the stored balance is returned unchanged. If the specified date does not fall on a balance date, timr uses the **most recent balance before the specified date** as the starting point and recalculates the account balances up to the requested date using the recorded actual times and the applicable target working time. **Important:** The target working time is calculated using the User's **currently assigned Work Schedule Model**, not necessarily the model that was assigned on the requested historical date. If the User's Work Schedule Model has changed, this endpoint should therefore only be used with dates **on or after the most recent Work Schedule Model change**. Requests for earlier dates may return incorrect target working times and therefore incorrect account balances. `last_balance_date` identifies the balance entry preceding the returned period, including when the requested date is itself a balance date. It is null for the initialization date itself. /// /// ID of the User. /// Day to return the balances for. @@ -307,7 +238,7 @@ private void OnErrorGetUserAccountsDefaultImplementation(Exception exceptionLoca } /// - /// Get a User's accounts Returns all of the User's account balances as of the given day, including overtime and surcharge accounts. + /// Get a User's accounts Returns all of the User's account balances as of the specified date. The calculation starts from the **most recent balance before or on the specified date**. If the specified date is itself a balance date, the stored balance is returned unchanged. If the specified date does not fall on a balance date, timr uses the **most recent balance before the specified date** as the starting point and recalculates the account balances up to the requested date using the recorded actual times and the applicable target working time. **Important:** The target working time is calculated using the User's **currently assigned Work Schedule Model**, not necessarily the model that was assigned on the requested historical date. If the User's Work Schedule Model has changed, this endpoint should therefore only be used with dates **on or after the most recent Work Schedule Model change**. Requests for earlier dates may return incorrect target working times and therefore incorrect account balances. `last_balance_date` identifies the balance entry preceding the returned period, including when the requested date is itself a balance date. It is null for the initialization date itself. /// /// Thrown when fails to make API call /// ID of the User. @@ -601,383 +532,5 @@ private void OnDeserializationErrorDefaultImplementation(Exception exception, Ht partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); } - - partial void FormatGetUserWorkingTimeAccounts(ref string id, ref DateOnly date); - - /// - /// Validates the request parameters - /// - /// - /// - private void ValidateGetUserWorkingTimeAccounts(string id) - { - if (id == null) - throw new ArgumentNullException(nameof(id)); - } - - /// - /// Processes the server response - /// - /// - /// - /// - private void AfterGetUserWorkingTimeAccountsDefaultImplementation(IGetUserWorkingTimeAccountsApiResponse apiResponseLocalVar, string id, DateOnly date) - { - bool suppressDefaultLog = false; - AfterGetUserWorkingTimeAccounts(ref suppressDefaultLog, apiResponseLocalVar, id, date); - if (!suppressDefaultLog) - Logger.LogInformation(RestLogEvents.ApiRequestCompleted, "{0,-9} | {1} | {2}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); - } - - /// - /// Processes the server response - /// - /// - /// - /// - /// - partial void AfterGetUserWorkingTimeAccounts(ref bool suppressDefaultLog, IGetUserWorkingTimeAccountsApiResponse apiResponseLocalVar, string id, DateOnly date); - - /// - /// Logs exceptions that occur while retrieving the server response - /// - /// - /// - /// - /// - /// - private void OnErrorGetUserWorkingTimeAccountsDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string id, DateOnly date) - { - bool suppressDefaultLogLocalVar = false; - OnErrorGetUserWorkingTimeAccounts(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, id, date); - if (!suppressDefaultLogLocalVar) - Logger.LogError(RestLogEvents.ApiRequestFailed, exceptionLocalVar, "An error occurred while sending the request to the server."); - } - - /// - /// A partial method that gives developers a way to provide customized exception handling - /// - /// - /// - /// - /// - /// - /// - partial void OnErrorGetUserWorkingTimeAccounts(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string id, DateOnly date); - - /// - /// Get a User's working time accounts Returns the User's working time account balances as of the given day. - /// - /// ID of the User. - /// Day to return the balances for. - /// Cancellation Token to cancel the request. - /// <> - public async Task GetUserWorkingTimeAccountsOrDefaultAsync(string id, DateOnly date, System.Threading.CancellationToken cancellationToken = default) - { - try - { - return await GetUserWorkingTimeAccountsAsync(id, date, cancellationToken).ConfigureAwait(false); - } - catch (Exception) - { - return null; - } - } - - /// - /// Get a User's working time accounts Returns the User's working time account balances as of the given day. - /// - /// Thrown when fails to make API call - /// ID of the User. - /// Day to return the balances for. - /// Cancellation Token to cancel the request. - /// <> - public async Task GetUserWorkingTimeAccountsAsync(string id, DateOnly date, System.Threading.CancellationToken cancellationToken = default) - { - UriBuilder uriBuilderLocalVar = new UriBuilder(); - - try - { - ValidateGetUserWorkingTimeAccounts(id); - - FormatGetUserWorkingTimeAccounts(ref id, ref date); - - using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) - { - uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; - uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; - uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilderLocalVar.Path = HttpClient.BaseAddress.AbsolutePath == "/" - ? "/users/{id}/working-time-accounts/{date}" - : string.Concat(HttpClient.BaseAddress.AbsolutePath.TrimEnd('/'), "/users/{id}/working-time-accounts/{date}"); - uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Bid%7D", Uri.EscapeDataString(id.ToString())); - uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Bdate%7D", Uri.EscapeDataString(date.ToString())); - - List tokenBaseLocalVars = new List(); - httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - - OAuthToken oauthTokenLocalVar1 = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - - tokenBaseLocalVars.Add(oauthTokenLocalVar1); - - oauthTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); - - OAuthToken oauthTokenLocalVar2 = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - - tokenBaseLocalVars.Add(oauthTokenLocalVar2); - - oauthTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar, ""); - - string[] acceptLocalVars = new string[] { - "application/json", - "application/problem+json" - }; - - IEnumerable acceptHeaderValuesLocalVar = ClientUtils.SelectHeaderAcceptArray(acceptLocalVars); - - foreach (var acceptLocalVar in acceptHeaderValuesLocalVar) - httpRequestMessageLocalVar.Headers.Accept.Add(acceptLocalVar); - - httpRequestMessageLocalVar.Method = HttpMethod.Get; - - DateTime requestedAtLocalVar = DateTime.UtcNow; - - using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) - { - GetUserWorkingTimeAccountsApiResponse apiResponseLocalVar; - - switch ((int)httpResponseMessageLocalVar.StatusCode) { - default: { - string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - apiResponseLocalVar = new(Logger, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/users/{id}/working-time-accounts/{date}", requestedAtLocalVar, _jsonSerializerOptions); - - break; - } - } - - AfterGetUserWorkingTimeAccountsDefaultImplementation(apiResponseLocalVar, id, date); - - Events.ExecuteOnGetUserWorkingTimeAccounts(apiResponseLocalVar); - - if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) - tokenBaseLocalVar.BeginRateLimit(); - - return apiResponseLocalVar; - } - } - } - catch(Exception e) - { - OnErrorGetUserWorkingTimeAccountsDefaultImplementation(e, "/users/{id}/working-time-accounts/{date}", uriBuilderLocalVar.Path, id, date); - Events.ExecuteOnErrorGetUserWorkingTimeAccounts(e); - throw; - } - } - - /// - /// The - /// - public partial class GetUserWorkingTimeAccountsApiResponse : Timr.Api.Client.ApiResponse, IGetUserWorkingTimeAccountsApiResponse - { - /// - /// The logger - /// - public ILogger Logger { get; } - - /// - /// The - /// - /// - /// - /// - /// - /// - /// - /// - public GetUserWorkingTimeAccountsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) - { - Logger = logger; - OnCreated(httpRequestMessage, httpResponseMessage); - } - - /// - /// The - /// - /// - /// - /// - /// - /// - /// - /// - public GetUserWorkingTimeAccountsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, System.IO.Stream contentStream, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, contentStream, path, requestedAt, jsonSerializerOptions) - { - Logger = logger; - OnCreated(httpRequestMessage, httpResponseMessage); - } - - partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); - - /// - /// Returns true if the response is 200 Ok - /// - /// - public bool IsOk => 200 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 200 Ok - /// - /// - public Timr.Api.Model.Accounts? Ok() - { - bool suppressDefault = false; - Timr.Api.Model.Accounts? result = null; - OnOk(ref suppressDefault, ref result); - if (!suppressDefault) - result = DefaultOk(); - return result; - } - - private Timr.Api.Model.Accounts? DefaultOk() - { - // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead - return IsOk - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : null; - } - - partial void OnOk(ref bool suppressDefault, ref Timr.Api.Model.Accounts? result); - - /// - /// Returns true if the response is 200 Ok and the deserialized response is not null - /// - /// - /// - public bool TryOk([NotNullWhen(true)]out Timr.Api.Model.Accounts? result) - { - result = null; - - try - { - result = Ok(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); - } - - return result != null; - } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - public bool IsForbidden => 403 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 403 Forbidden - /// - /// - public Timr.Api.Model.Error? Forbidden() - { - bool suppressDefault = false; - Timr.Api.Model.Error? result = null; - OnForbidden(ref suppressDefault, ref result); - if (!suppressDefault) - result = DefaultForbidden(); - return result; - } - - private Timr.Api.Model.Error? DefaultForbidden() - { - // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead - return IsForbidden - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : null; - } - - partial void OnForbidden(ref bool suppressDefault, ref Timr.Api.Model.Error? result); - - /// - /// Returns true if the response is 403 Forbidden and the deserialized response is not null - /// - /// - /// - public bool TryForbidden([NotNullWhen(true)]out Timr.Api.Model.Error? result) - { - result = null; - - try - { - result = Forbidden(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); - } - - return result != null; - } - - /// - /// Returns true if the response is 404 NotFound - /// - /// - public bool IsNotFound => 404 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 404 NotFound - /// - /// - public Timr.Api.Model.Error? NotFound() - { - bool suppressDefault = false; - Timr.Api.Model.Error? result = null; - OnNotFound(ref suppressDefault, ref result); - if (!suppressDefault) - result = DefaultNotFound(); - return result; - } - - private Timr.Api.Model.Error? DefaultNotFound() - { - // NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead - return IsNotFound - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : null; - } - - partial void OnNotFound(ref bool suppressDefault, ref Timr.Api.Model.Error? result); - - /// - /// Returns true if the response is 404 NotFound and the deserialized response is not null - /// - /// - /// - public bool TryNotFound([NotNullWhen(true)]out Timr.Api.Model.Error? result) - { - result = null; - - try - { - result = NotFound(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)404); - } - - return result != null; - } - - private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) - { - bool suppressDefaultLog = false; - OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); - if (!suppressDefaultLog) - Logger.LogError(RestLogEvents.ApiDeserializationFailed, exception, "An error occurred while deserializing the {code} response.", httpStatusCode); - } - - partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); - } } } diff --git a/sdk/dotnet/Timr.Api/Model/Accounts.cs b/sdk/dotnet/Timr.Api/Model/Accounts.cs index 1b582d5..11e5d80 100644 --- a/sdk/dotnet/Timr.Api/Model/Accounts.cs +++ b/sdk/dotnet/Timr.Api/Model/Accounts.cs @@ -33,7 +33,7 @@ public partial class Accounts : IValidatableObject /// /// Initializes a new instance of the class. /// - /// date of last balance + /// The balance entry the figures continue from, always before the requested day. Null only for the initialization date itself. /// timeAccount /// overtimeSurchargeAccounts /// vacationAccount @@ -50,9 +50,9 @@ public Accounts(DateOnly? lastBalanceDate = default, Option timeAc partial void OnCreated(); /// - /// date of last balance + /// The balance entry the figures continue from, always before the requested day. Null only for the initialization date itself. /// - /// date of last balance + /// The balance entry the figures continue from, always before the requested day. Null only for the initialization date itself. [JsonPropertyName("last_balance_date")] public DateOnly? LastBalanceDate { get; set; } diff --git a/sdk/java-restclient/src/main/java/com/timr/api/apis/TimeAccountApi.java b/sdk/java-restclient/src/main/java/com/timr/api/apis/TimeAccountApi.java index 82bde3e..5e290e2 100644 --- a/sdk/java-restclient/src/main/java/com/timr/api/apis/TimeAccountApi.java +++ b/sdk/java-restclient/src/main/java/com/timr/api/apis/TimeAccountApi.java @@ -48,7 +48,7 @@ public void setApiClient(ApiClient apiClient) { /** * Get a User's accounts - * Returns all of the User's account balances as of the given day, including overtime and surcharge accounts. + * Returns all of the User's account balances as of the specified date. The calculation starts from the **most recent balance before or on the specified date**. If the specified date is itself a balance date, the stored balance is returned unchanged. If the specified date does not fall on a balance date, timr uses the **most recent balance before the specified date** as the starting point and recalculates the account balances up to the requested date using the recorded actual times and the applicable target working time. **Important:** The target working time is calculated using the User's **currently assigned Work Schedule Model**, not necessarily the model that was assigned on the requested historical date. If the User's Work Schedule Model has changed, this endpoint should therefore only be used with dates **on or after the most recent Work Schedule Model change**. Requests for earlier dates may return incorrect target working times and therefore incorrect account balances. `last_balance_date` identifies the balance entry preceding the returned period, including when the requested date is itself a balance date. It is null for the initialization date itself. *

200 - The User's account balances on the given day. *

403 - Forbidden *

404 - Not Found @@ -93,7 +93,7 @@ private ResponseSpec getUserAccountsRequestCreation(String id, LocalDate date) t /** * Get a User's accounts - * Returns all of the User's account balances as of the given day, including overtime and surcharge accounts. + * Returns all of the User's account balances as of the specified date. The calculation starts from the **most recent balance before or on the specified date**. If the specified date is itself a balance date, the stored balance is returned unchanged. If the specified date does not fall on a balance date, timr uses the **most recent balance before the specified date** as the starting point and recalculates the account balances up to the requested date using the recorded actual times and the applicable target working time. **Important:** The target working time is calculated using the User's **currently assigned Work Schedule Model**, not necessarily the model that was assigned on the requested historical date. If the User's Work Schedule Model has changed, this endpoint should therefore only be used with dates **on or after the most recent Work Schedule Model change**. Requests for earlier dates may return incorrect target working times and therefore incorrect account balances. `last_balance_date` identifies the balance entry preceding the returned period, including when the requested date is itself a balance date. It is null for the initialization date itself. *

200 - The User's account balances on the given day. *

403 - Forbidden *

404 - Not Found @@ -109,7 +109,7 @@ public Accounts getUserAccounts(String id, LocalDate date) throws RestClientResp /** * Get a User's accounts - * Returns all of the User's account balances as of the given day, including overtime and surcharge accounts. + * Returns all of the User's account balances as of the specified date. The calculation starts from the **most recent balance before or on the specified date**. If the specified date is itself a balance date, the stored balance is returned unchanged. If the specified date does not fall on a balance date, timr uses the **most recent balance before the specified date** as the starting point and recalculates the account balances up to the requested date using the recorded actual times and the applicable target working time. **Important:** The target working time is calculated using the User's **currently assigned Work Schedule Model**, not necessarily the model that was assigned on the requested historical date. If the User's Work Schedule Model has changed, this endpoint should therefore only be used with dates **on or after the most recent Work Schedule Model change**. Requests for earlier dates may return incorrect target working times and therefore incorrect account balances. `last_balance_date` identifies the balance entry preceding the returned period, including when the requested date is itself a balance date. It is null for the initialization date itself. *

200 - The User's account balances on the given day. *

403 - Forbidden *

404 - Not Found @@ -125,7 +125,7 @@ public ResponseEntity getUserAccountsWithHttpInfo(String id, LocalDate /** * Get a User's accounts - * Returns all of the User's account balances as of the given day, including overtime and surcharge accounts. + * Returns all of the User's account balances as of the specified date. The calculation starts from the **most recent balance before or on the specified date**. If the specified date is itself a balance date, the stored balance is returned unchanged. If the specified date does not fall on a balance date, timr uses the **most recent balance before the specified date** as the starting point and recalculates the account balances up to the requested date using the recorded actual times and the applicable target working time. **Important:** The target working time is calculated using the User's **currently assigned Work Schedule Model**, not necessarily the model that was assigned on the requested historical date. If the User's Work Schedule Model has changed, this endpoint should therefore only be used with dates **on or after the most recent Work Schedule Model change**. Requests for earlier dates may return incorrect target working times and therefore incorrect account balances. `last_balance_date` identifies the balance entry preceding the returned period, including when the requested date is itself a balance date. It is null for the initialization date itself. *

200 - The User's account balances on the given day. *

403 - Forbidden *

404 - Not Found @@ -137,96 +137,4 @@ public ResponseEntity getUserAccountsWithHttpInfo(String id, LocalDate public ResponseSpec getUserAccountsWithResponseSpec(String id, LocalDate date) throws RestClientResponseException { return getUserAccountsRequestCreation(id, date); } - - /** - * Get a User's working time accounts - * Returns the User's working time account balances as of the given day. - *

200 - The User's working time account balances on the given day. - *

403 - Forbidden - *

404 - Not Found - * @param id ID of the User. - * @param date Day to return the balances for. - * @return Accounts - * @throws RestClientResponseException if an error occurs while attempting to invoke the API - */ - private ResponseSpec getUserWorkingTimeAccountsRequestCreation(String id, LocalDate date) throws RestClientResponseException { - Object postBody = null; - // verify the required parameter 'id' is set - if (id == null) { - throw new RestClientResponseException("Missing the required parameter 'id' when calling getUserWorkingTimeAccounts", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); - } - // verify the required parameter 'date' is set - if (date == null) { - throw new RestClientResponseException("Missing the required parameter 'date' when calling getUserWorkingTimeAccounts", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); - } - // create path and map variables - final Map pathParams = new HashMap<>(); - - pathParams.put("id", id); - pathParams.put("date", date); - - final MultiValueMap localVarQueryParams = new LinkedMultiValueMap<>(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); - final MultiValueMap formParams = new LinkedMultiValueMap<>(); - - final String[] localVarAccepts = { - "application/json", "application/problem+json" - }; - final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "OAuth2", "OAuth2" }; - - ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; - return apiClient.invokeAPI("/users/{id}/working-time-accounts/{date}", HttpMethod.GET, pathParams, localVarQueryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } - - /** - * Get a User's working time accounts - * Returns the User's working time account balances as of the given day. - *

200 - The User's working time account balances on the given day. - *

403 - Forbidden - *

404 - Not Found - * @param id ID of the User. - * @param date Day to return the balances for. - * @return Accounts - * @throws RestClientResponseException if an error occurs while attempting to invoke the API - */ - public Accounts getUserWorkingTimeAccounts(String id, LocalDate date) throws RestClientResponseException { - ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; - return getUserWorkingTimeAccountsRequestCreation(id, date).body(localVarReturnType); - } - - /** - * Get a User's working time accounts - * Returns the User's working time account balances as of the given day. - *

200 - The User's working time account balances on the given day. - *

403 - Forbidden - *

404 - Not Found - * @param id ID of the User. - * @param date Day to return the balances for. - * @return ResponseEntity<Accounts> - * @throws RestClientResponseException if an error occurs while attempting to invoke the API - */ - public ResponseEntity getUserWorkingTimeAccountsWithHttpInfo(String id, LocalDate date) throws RestClientResponseException { - ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; - return getUserWorkingTimeAccountsRequestCreation(id, date).toEntity(localVarReturnType); - } - - /** - * Get a User's working time accounts - * Returns the User's working time account balances as of the given day. - *

200 - The User's working time account balances on the given day. - *

403 - Forbidden - *

404 - Not Found - * @param id ID of the User. - * @param date Day to return the balances for. - * @return ResponseSpec - * @throws RestClientResponseException if an error occurs while attempting to invoke the API - */ - public ResponseSpec getUserWorkingTimeAccountsWithResponseSpec(String id, LocalDate date) throws RestClientResponseException { - return getUserWorkingTimeAccountsRequestCreation(id, date); - } } diff --git a/sdk/java-restclient/src/main/java/com/timr/api/models/Accounts.java b/sdk/java-restclient/src/main/java/com/timr/api/models/Accounts.java index aec232a..df1fa02 100644 --- a/sdk/java-restclient/src/main/java/com/timr/api/models/Accounts.java +++ b/sdk/java-restclient/src/main/java/com/timr/api/models/Accounts.java @@ -74,7 +74,7 @@ public Accounts lastBalanceDate(@Nullable LocalDate lastBalanceDate) { } /** - * date of last balance + * The balance entry the figures continue from, always before the requested day. Null only for the initialization date itself. * @return lastBalanceDate */ diff --git a/sdk/java-resttemplate/src/main/java/com/timr/api/apis/TimeAccountApi.java b/sdk/java-resttemplate/src/main/java/com/timr/api/apis/TimeAccountApi.java index 5116acd..1a38b80 100644 --- a/sdk/java-resttemplate/src/main/java/com/timr/api/apis/TimeAccountApi.java +++ b/sdk/java-resttemplate/src/main/java/com/timr/api/apis/TimeAccountApi.java @@ -43,7 +43,7 @@ public TimeAccountApi(ApiClient apiClient) { /** * Get a User's accounts - * Returns all of the User's account balances as of the given day, including overtime and surcharge accounts. + * Returns all of the User's account balances as of the specified date. The calculation starts from the **most recent balance before or on the specified date**. If the specified date is itself a balance date, the stored balance is returned unchanged. If the specified date does not fall on a balance date, timr uses the **most recent balance before the specified date** as the starting point and recalculates the account balances up to the requested date using the recorded actual times and the applicable target working time. **Important:** The target working time is calculated using the User's **currently assigned Work Schedule Model**, not necessarily the model that was assigned on the requested historical date. If the User's Work Schedule Model has changed, this endpoint should therefore only be used with dates **on or after the most recent Work Schedule Model change**. Requests for earlier dates may return incorrect target working times and therefore incorrect account balances. `last_balance_date` identifies the balance entry preceding the returned period, including when the requested date is itself a balance date. It is null for the initialization date itself. *

200 - The User's account balances on the given day. *

403 - Forbidden *

404 - Not Found @@ -58,7 +58,7 @@ public Accounts getUserAccounts(@jakarta.annotation.Nonnull String id, @jakarta. /** * Get a User's accounts - * Returns all of the User's account balances as of the given day, including overtime and surcharge accounts. + * Returns all of the User's account balances as of the specified date. The calculation starts from the **most recent balance before or on the specified date**. If the specified date is itself a balance date, the stored balance is returned unchanged. If the specified date does not fall on a balance date, timr uses the **most recent balance before the specified date** as the starting point and recalculates the account balances up to the requested date using the recorded actual times and the applicable target working time. **Important:** The target working time is calculated using the User's **currently assigned Work Schedule Model**, not necessarily the model that was assigned on the requested historical date. If the User's Work Schedule Model has changed, this endpoint should therefore only be used with dates **on or after the most recent Work Schedule Model change**. Requests for earlier dates may return incorrect target working times and therefore incorrect account balances. `last_balance_date` identifies the balance entry preceding the returned period, including when the requested date is itself a balance date. It is null for the initialization date itself. *

200 - The User's account balances on the given day. *

403 - Forbidden *

404 - Not Found @@ -102,67 +102,6 @@ public ResponseEntity getUserAccountsWithHttpInfo(@jakarta.annotation. ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI("/users/{id}/accounts/{date}", HttpMethod.GET, uriVariables, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } - /** - * Get a User's working time accounts - * Returns the User's working time account balances as of the given day. - *

200 - The User's working time account balances on the given day. - *

403 - Forbidden - *

404 - Not Found - * @param id ID of the User. (required) - * @param date Day to return the balances for. (required) - * @return Accounts - * @throws RestClientException if an error occurs while attempting to invoke the API - */ - public Accounts getUserWorkingTimeAccounts(@jakarta.annotation.Nonnull String id, @jakarta.annotation.Nonnull LocalDate date) throws RestClientException { - return getUserWorkingTimeAccountsWithHttpInfo(id, date).getBody(); - } - - /** - * Get a User's working time accounts - * Returns the User's working time account balances as of the given day. - *

200 - The User's working time account balances on the given day. - *

403 - Forbidden - *

404 - Not Found - * @param id ID of the User. (required) - * @param date Day to return the balances for. (required) - * @return ResponseEntity<Accounts> - * @throws RestClientException if an error occurs while attempting to invoke the API - */ - public ResponseEntity getUserWorkingTimeAccountsWithHttpInfo(@jakarta.annotation.Nonnull String id, @jakarta.annotation.Nonnull LocalDate date) throws RestClientException { - Object localVarPostBody = null; - - // verify the required parameter 'id' is set - if (id == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'id' when calling getUserWorkingTimeAccounts"); - } - - // verify the required parameter 'date' is set - if (date == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'date' when calling getUserWorkingTimeAccounts"); - } - - // create path and map variables - final Map uriVariables = new HashMap(); - uriVariables.put("id", id); - uriVariables.put("date", date); - - final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); - final HttpHeaders localVarHeaderParams = new HttpHeaders(); - final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); - final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); - - final String[] localVarAccepts = { - "application/json", "application/problem+json" - }; - final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "OAuth2", "OAuth2" }; - - ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI("/users/{id}/working-time-accounts/{date}", HttpMethod.GET, uriVariables, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); - } @Override public ResponseEntity invokeAPI(String url, HttpMethod method, Object request, ParameterizedTypeReference returnType) throws RestClientException { diff --git a/sdk/java-resttemplate/src/main/java/com/timr/api/models/Accounts.java b/sdk/java-resttemplate/src/main/java/com/timr/api/models/Accounts.java index 34319d1..a012e0d 100644 --- a/sdk/java-resttemplate/src/main/java/com/timr/api/models/Accounts.java +++ b/sdk/java-resttemplate/src/main/java/com/timr/api/models/Accounts.java @@ -73,7 +73,7 @@ public Accounts lastBalanceDate(@jakarta.annotation.Nullable LocalDate lastBalan } /** - * date of last balance + * The balance entry the figures continue from, always before the requested day. Null only for the initialization date itself. * @return lastBalanceDate */ @jakarta.annotation.Nullable diff --git a/sdk/kotlin-okhttp/src/main/kotlin/com/timr/api/apis/TimeAccountApi.kt b/sdk/kotlin-okhttp/src/main/kotlin/com/timr/api/apis/TimeAccountApi.kt index 8a12b84..df635e2 100644 --- a/sdk/kotlin-okhttp/src/main/kotlin/com/timr/api/apis/TimeAccountApi.kt +++ b/sdk/kotlin-okhttp/src/main/kotlin/com/timr/api/apis/TimeAccountApi.kt @@ -59,7 +59,7 @@ open class TimeAccountApi(basePath: kotlin.String = defaultBasePath, client: Cal /** * GET /users/{id}/accounts/{date} * Get a User's accounts - * Returns all of the User's account balances as of the given day, including overtime and surcharge accounts. + * Returns all of the User's account balances as of the specified date. The calculation starts from the **most recent balance before or on the specified date**. If the specified date is itself a balance date, the stored balance is returned unchanged. If the specified date does not fall on a balance date, timr uses the **most recent balance before the specified date** as the starting point and recalculates the account balances up to the requested date using the recorded actual times and the applicable target working time. **Important:** The target working time is calculated using the User's **currently assigned Work Schedule Model**, not necessarily the model that was assigned on the requested historical date. If the User's Work Schedule Model has changed, this endpoint should therefore only be used with dates **on or after the most recent Work Schedule Model change**. Requests for earlier dates may return incorrect target working times and therefore incorrect account balances. `last_balance_date` identifies the balance entry preceding the returned period, including when the requested date is itself a balance date. It is null for the initialization date itself. * @param id ID of the User. * @param date Day to return the balances for. * @return Accounts @@ -92,7 +92,7 @@ open class TimeAccountApi(basePath: kotlin.String = defaultBasePath, client: Cal /** * GET /users/{id}/accounts/{date} * Get a User's accounts - * Returns all of the User's account balances as of the given day, including overtime and surcharge accounts. + * Returns all of the User's account balances as of the specified date. The calculation starts from the **most recent balance before or on the specified date**. If the specified date is itself a balance date, the stored balance is returned unchanged. If the specified date does not fall on a balance date, timr uses the **most recent balance before the specified date** as the starting point and recalculates the account balances up to the requested date using the recorded actual times and the applicable target working time. **Important:** The target working time is calculated using the User's **currently assigned Work Schedule Model**, not necessarily the model that was assigned on the requested historical date. If the User's Work Schedule Model has changed, this endpoint should therefore only be used with dates **on or after the most recent Work Schedule Model change**. Requests for earlier dates may return incorrect target working times and therefore incorrect account balances. `last_balance_date` identifies the balance entry preceding the returned period, including when the requested date is itself a balance date. It is null for the initialization date itself. * @param id ID of the User. * @param date Day to return the balances for. * @return ApiResponse @@ -132,82 +132,6 @@ open class TimeAccountApi(basePath: kotlin.String = defaultBasePath, client: Cal ) } - /** - * GET /users/{id}/working-time-accounts/{date} - * Get a User's working time accounts - * Returns the User's working time account balances as of the given day. - * @param id ID of the User. - * @param date Day to return the balances for. - * @return Accounts - * @throws IllegalStateException If the request is not correctly configured - * @throws IOException Rethrows the OkHttp execute method exception - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun getUserWorkingTimeAccounts(id: kotlin.String, date: java.time.LocalDate) : Accounts = withContext(Dispatchers.IO) { - val localVarResponse = getUserWorkingTimeAccountsWithHttpInfo(id = id, date = date) - - return@withContext when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Accounts - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()} ${localVarError.body}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * GET /users/{id}/working-time-accounts/{date} - * Get a User's working time accounts - * Returns the User's working time account balances as of the given day. - * @param id ID of the User. - * @param date Day to return the balances for. - * @return ApiResponse - * @throws IllegalStateException If the request is not correctly configured - * @throws IOException Rethrows the OkHttp execute method exception - */ - @Suppress("UNCHECKED_CAST") - @Throws(IllegalStateException::class, IOException::class) - suspend fun getUserWorkingTimeAccountsWithHttpInfo(id: kotlin.String, date: java.time.LocalDate) : ApiResponse = withContext(Dispatchers.IO) { - val localVariableConfig = getUserWorkingTimeAccountsRequestConfig(id = id, date = date) - - return@withContext request( - localVariableConfig - ) - } - - /** - * To obtain the request config of the operation getUserWorkingTimeAccounts - * - * @param id ID of the User. - * @param date Day to return the balances for. - * @return RequestConfig - */ - fun getUserWorkingTimeAccountsRequestConfig(id: kotlin.String, date: java.time.LocalDate) : RequestConfig { - val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - localVariableHeaders["Accept"] = "application/json, application/problem+json" - - return RequestConfig( - method = RequestMethod.GET, - path = "/users/{id}/working-time-accounts/{date}".replace("{"+"id"+"}", encodeURIComponent(id.toString())).replace("{"+"date"+"}", encodeURIComponent(date.toString())), - query = localVariableQuery, - headers = localVariableHeaders, - requiresAuthentication = true, - body = localVariableBody - ) - } - private fun encodeURIComponent(uriComponent: kotlin.String): kotlin.String = HttpUrl.Builder().scheme("http").host("localhost").addPathSegment(uriComponent).build().encodedPathSegments[0] diff --git a/sdk/kotlin-okhttp/src/main/kotlin/com/timr/api/models/Accounts.kt b/sdk/kotlin-okhttp/src/main/kotlin/com/timr/api/models/Accounts.kt index a936f8a..be1cdd4 100644 --- a/sdk/kotlin-okhttp/src/main/kotlin/com/timr/api/models/Accounts.kt +++ b/sdk/kotlin-okhttp/src/main/kotlin/com/timr/api/models/Accounts.kt @@ -32,7 +32,7 @@ import com.google.gson.annotations.SerializedName /** * * - * @param lastBalanceDate date of last balance + * @param lastBalanceDate The balance entry the figures continue from, always before the requested day. Null only for the initialization date itself. * @param timeAccount * @param overtimeSurchargeAccounts * @param vacationAccount @@ -41,7 +41,7 @@ import com.google.gson.annotations.SerializedName data class Accounts ( - /* date of last balance */ + /* The balance entry the figures continue from, always before the requested day. Null only for the initialization date itself. */ @SerializedName("last_balance_date") val lastBalanceDate: java.time.LocalDate?, diff --git a/sdk/python/timr_api/api/time_account_api.py b/sdk/python/timr_api/api/time_account_api.py index cd78eed..545b735 100644 --- a/sdk/python/timr_api/api/time_account_api.py +++ b/sdk/python/timr_api/api/time_account_api.py @@ -58,7 +58,7 @@ def get_user_accounts( ) -> Accounts: """Get a User's accounts - Returns all of the User's account balances as of the given day, including overtime and surcharge accounts. + Returns all of the User's account balances as of the specified date. The calculation starts from the **most recent balance before or on the specified date**. If the specified date is itself a balance date, the stored balance is returned unchanged. If the specified date does not fall on a balance date, timr uses the **most recent balance before the specified date** as the starting point and recalculates the account balances up to the requested date using the recorded actual times and the applicable target working time. **Important:** The target working time is calculated using the User's **currently assigned Work Schedule Model**, not necessarily the model that was assigned on the requested historical date. If the User's Work Schedule Model has changed, this endpoint should therefore only be used with dates **on or after the most recent Work Schedule Model change**. Requests for earlier dates may return incorrect target working times and therefore incorrect account balances. `last_balance_date` identifies the balance entry preceding the returned period, including when the requested date is itself a balance date. It is null for the initialization date itself. :param id: ID of the User. (required) :type id: str @@ -131,7 +131,7 @@ def get_user_accounts_with_http_info( ) -> ApiResponse[Accounts]: """Get a User's accounts - Returns all of the User's account balances as of the given day, including overtime and surcharge accounts. + Returns all of the User's account balances as of the specified date. The calculation starts from the **most recent balance before or on the specified date**. If the specified date is itself a balance date, the stored balance is returned unchanged. If the specified date does not fall on a balance date, timr uses the **most recent balance before the specified date** as the starting point and recalculates the account balances up to the requested date using the recorded actual times and the applicable target working time. **Important:** The target working time is calculated using the User's **currently assigned Work Schedule Model**, not necessarily the model that was assigned on the requested historical date. If the User's Work Schedule Model has changed, this endpoint should therefore only be used with dates **on or after the most recent Work Schedule Model change**. Requests for earlier dates may return incorrect target working times and therefore incorrect account balances. `last_balance_date` identifies the balance entry preceding the returned period, including when the requested date is itself a balance date. It is null for the initialization date itself. :param id: ID of the User. (required) :type id: str @@ -204,7 +204,7 @@ def get_user_accounts_without_preload_content( ) -> RESTResponseType: """Get a User's accounts - Returns all of the User's account balances as of the given day, including overtime and surcharge accounts. + Returns all of the User's account balances as of the specified date. The calculation starts from the **most recent balance before or on the specified date**. If the specified date is itself a balance date, the stored balance is returned unchanged. If the specified date does not fall on a balance date, timr uses the **most recent balance before the specified date** as the starting point and recalculates the account balances up to the requested date using the recorded actual times and the applicable target working time. **Important:** The target working time is calculated using the User's **currently assigned Work Schedule Model**, not necessarily the model that was assigned on the requested historical date. If the User's Work Schedule Model has changed, this endpoint should therefore only be used with dates **on or after the most recent Work Schedule Model change**. Requests for earlier dates may return incorrect target working times and therefore incorrect account balances. `last_balance_date` identifies the balance entry preceding the returned period, including when the requested date is itself a balance date. It is null for the initialization date itself. :param id: ID of the User. (required) :type id: str @@ -320,287 +320,3 @@ def _get_user_accounts_serialize( ) - - - @validate_call - def get_user_working_time_accounts( - self, - id: Annotated[StrictStr, Field(description="ID of the User.")], - var_date: Annotated[date, Field(description="Day to return the balances for.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Accounts: - """Get a User's working time accounts - - Returns the User's working time account balances as of the given day. - - :param id: ID of the User. (required) - :type id: str - :param var_date: Day to return the balances for. (required) - :type var_date: date - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_user_working_time_accounts_serialize( - id=id, - var_date=var_date, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Accounts", - '403': "Error", - '404': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def get_user_working_time_accounts_with_http_info( - self, - id: Annotated[StrictStr, Field(description="ID of the User.")], - var_date: Annotated[date, Field(description="Day to return the balances for.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Accounts]: - """Get a User's working time accounts - - Returns the User's working time account balances as of the given day. - - :param id: ID of the User. (required) - :type id: str - :param var_date: Day to return the balances for. (required) - :type var_date: date - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_user_working_time_accounts_serialize( - id=id, - var_date=var_date, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Accounts", - '403': "Error", - '404': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def get_user_working_time_accounts_without_preload_content( - self, - id: Annotated[StrictStr, Field(description="ID of the User.")], - var_date: Annotated[date, Field(description="Day to return the balances for.")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get a User's working time accounts - - Returns the User's working time account balances as of the given day. - - :param id: ID of the User. (required) - :type id: str - :param var_date: Day to return the balances for. (required) - :type var_date: date - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_user_working_time_accounts_serialize( - id=id, - var_date=var_date, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Accounts", - '403': "Error", - '404': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_user_working_time_accounts_serialize( - self, - id, - var_date, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if id is not None: - _path_params['id'] = id - if var_date is not None: - _path_params['date'] = var_date - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json', - 'application/problem+json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'OAuth2', - 'OAuth2' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/users/{id}/working-time-accounts/{date}', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - diff --git a/sdk/python/timr_api/configuration.py b/sdk/python/timr_api/configuration.py index e0d0e24..d48217f 100644 --- a/sdk/python/timr_api/configuration.py +++ b/sdk/python/timr_api/configuration.py @@ -569,7 +569,7 @@ def to_debug_report(self) -> str: return "Python SDK Debug Report:\n"\ "OS: {env}\n"\ "Python Version: {pyversion}\n"\ - "Version of the API: 1.0.0\n"\ + "Version of the API: 1.0.1\n"\ "SDK Package Version: 2.0.0".\ format(env=sys.platform, pyversion=sys.version) diff --git a/sdk/python/timr_api/models/accounts.py b/sdk/python/timr_api/models/accounts.py index 117ce8c..d3b7434 100644 --- a/sdk/python/timr_api/models/accounts.py +++ b/sdk/python/timr_api/models/accounts.py @@ -31,7 +31,7 @@ class Accounts(BaseModel): """ Accounts """ # noqa: E501 - last_balance_date: Optional[date] = Field(description="date of last balance") + last_balance_date: Optional[date] = Field(description="The balance entry the figures continue from, always before the requested day. Null only for the initialization date itself.") time_account: Optional[TimeAccount] = None overtime_surcharge_accounts: Optional[List[OvertimeSurchargeAccounts]] = None vacation_account: Optional[VacationAccount] = None diff --git a/sdk/swift/TimrApi/APIs/TimeAccountAPI.swift b/sdk/swift/TimrApi/APIs/TimeAccountAPI.swift index 870b0a5..714dccd 100644 --- a/sdk/swift/TimrApi/APIs/TimeAccountAPI.swift +++ b/sdk/swift/TimrApi/APIs/TimeAccountAPI.swift @@ -27,7 +27,7 @@ open class TimeAccountAPI { /** Get a User's accounts - GET /users/{id}/accounts/{date} - - Returns all of the User's account balances as of the given day, including overtime and surcharge accounts. + - Returns all of the User's account balances as of the specified date. The calculation starts from the **most recent balance before or on the specified date**. If the specified date is itself a balance date, the stored balance is returned unchanged. If the specified date does not fall on a balance date, timr uses the **most recent balance before the specified date** as the starting point and recalculates the account balances up to the requested date using the recorded actual times and the applicable target working time. **Important:** The target working time is calculated using the User's **currently assigned Work Schedule Model**, not necessarily the model that was assigned on the requested historical date. If the User's Work Schedule Model has changed, this endpoint should therefore only be used with dates **on or after the most recent Work Schedule Model change**. Requests for earlier dates may return incorrect target working times and therefore incorrect account balances. `last_balance_date` identifies the balance entry preceding the returned period, including when the requested date is itself a balance date. It is null for the initialization date itself. - OAuth: - type: oauth2 - name: OAuth2 @@ -61,54 +61,4 @@ open class TimeAccountAPI { return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true) } - - /** - Get a User's working time accounts - - - parameter id: (path) ID of the User. - - parameter date: (path) Day to return the balances for. - - returns: Accounts - */ - @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func getUserWorkingTimeAccounts(id: String, date: Date) async throws -> Accounts { - return try await getUserWorkingTimeAccountsWithRequestBuilder(id: id, date: date).execute().body - } - - /** - Get a User's working time accounts - - GET /users/{id}/working-time-accounts/{date} - - Returns the User's working time account balances as of the given day. - - OAuth: - - type: oauth2 - - name: OAuth2 - - OAuth: - - type: oauth2 - - name: OAuth2 - - parameter id: (path) ID of the User. - - parameter date: (path) Day to return the balances for. - - returns: RequestBuilder - */ - open class func getUserWorkingTimeAccountsWithRequestBuilder(id: String, date: Date) -> RequestBuilder { - var localVariablePath = "/users/{id}/working-time-accounts/{date}" - let idPreEscape = "\(APIHelper.mapValueToPathItem(id))" - let idPostEscape = idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - localVariablePath = localVariablePath.replacingOccurrences(of: "{id}", with: idPostEscape, options: .literal, range: nil) - let datePreEscape = "\(APIHelper.mapValueToPathItem(date))" - let datePostEscape = datePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - localVariablePath = localVariablePath.replacingOccurrences(of: "{date}", with: datePostEscape, options: .literal, range: nil) - let localVariableURLString = TimrAPI.basePath + localVariablePath - let localVariableParameters: [String: Any]? = nil - - let localVariableUrlComponents = URLComponents(string: localVariableURLString) - - let localVariableNillableHeaders: [String: Any?] = [ - : - ] - - let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) - - let localVariableRequestBuilder: RequestBuilder.Type = TimrAPI.requestBuilderFactory.getBuilder() - - return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true) - } } diff --git a/sdk/swift/TimrApi/Models/Accounts.swift b/sdk/swift/TimrApi/Models/Accounts.swift index f5926c9..154db8f 100644 --- a/sdk/swift/TimrApi/Models/Accounts.swift +++ b/sdk/swift/TimrApi/Models/Accounts.swift @@ -12,7 +12,7 @@ import AnyCodable public struct Accounts: Codable, JSONEncodable, Hashable { - /** date of last balance */ + /** The balance entry the figures continue from, always before the requested day. Null only for the initialization date itself. */ public var lastBalanceDate: Date? public var timeAccount: TimeAccount? public var overtimeSurchargeAccounts: [OvertimeSurchargeAccounts]? diff --git a/sdk/typescript-fetch/src/apis/TimeAccountApi.ts b/sdk/typescript-fetch/src/apis/TimeAccountApi.ts index 523afaf..5895282 100644 --- a/sdk/typescript-fetch/src/apis/TimeAccountApi.ts +++ b/sdk/typescript-fetch/src/apis/TimeAccountApi.ts @@ -33,17 +33,6 @@ export interface GetUserAccountsRequest { date: Date; } -export interface GetUserWorkingTimeAccountsRequest { - /** - * ID of the User. - */ - id: string; - /** - * Day to return the balances for. - */ - date: Date; -} - /** * */ @@ -99,7 +88,7 @@ export class TimeAccountApi extends runtime.BaseAPI { } /** - * Returns all of the User\'s account balances as of the given day, including overtime and surcharge accounts. + * Returns all of the User\'s account balances as of the specified date. The calculation starts from the **most recent balance before or on the specified date**. If the specified date is itself a balance date, the stored balance is returned unchanged. If the specified date does not fall on a balance date, timr uses the **most recent balance before the specified date** as the starting point and recalculates the account balances up to the requested date using the recorded actual times and the applicable target working time. **Important:** The target working time is calculated using the User\'s **currently assigned Work Schedule Model**, not necessarily the model that was assigned on the requested historical date. If the User\'s Work Schedule Model has changed, this endpoint should therefore only be used with dates **on or after the most recent Work Schedule Model change**. Requests for earlier dates may return incorrect target working times and therefore incorrect account balances. `last_balance_date` identifies the balance entry preceding the returned period, including when the requested date is itself a balance date. It is null for the initialization date itself. * Get a User\'s accounts */ async getUserAccountsRaw(requestParameters: GetUserAccountsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { @@ -110,7 +99,7 @@ export class TimeAccountApi extends runtime.BaseAPI { } /** - * Returns all of the User\'s account balances as of the given day, including overtime and surcharge accounts. + * Returns all of the User\'s account balances as of the specified date. The calculation starts from the **most recent balance before or on the specified date**. If the specified date is itself a balance date, the stored balance is returned unchanged. If the specified date does not fall on a balance date, timr uses the **most recent balance before the specified date** as the starting point and recalculates the account balances up to the requested date using the recorded actual times and the applicable target working time. **Important:** The target working time is calculated using the User\'s **currently assigned Work Schedule Model**, not necessarily the model that was assigned on the requested historical date. If the User\'s Work Schedule Model has changed, this endpoint should therefore only be used with dates **on or after the most recent Work Schedule Model change**. Requests for earlier dates may return incorrect target working times and therefore incorrect account balances. `last_balance_date` identifies the balance entry preceding the returned period, including when the requested date is itself a balance date. It is null for the initialization date itself. * Get a User\'s accounts */ async getUserAccounts(id: string, date: Date, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { @@ -118,73 +107,4 @@ export class TimeAccountApi extends runtime.BaseAPI { return await response.value(); } - /** - * Creates request options for getUserWorkingTimeAccounts without sending the request - */ - async getUserWorkingTimeAccountsRequestOpts(requestParameters: GetUserWorkingTimeAccountsRequest): Promise { - if (requestParameters['id'] == null) { - throw new runtime.RequiredError( - 'id', - 'Required parameter "id" was null or undefined when calling getUserWorkingTimeAccounts().' - ); - } - - if (requestParameters['date'] == null) { - throw new runtime.RequiredError( - 'date', - 'Required parameter "date" was null or undefined when calling getUserWorkingTimeAccounts().' - ); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.accessToken) { - // oauth required - headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); - } - - if (this.configuration && this.configuration.accessToken) { - // oauth required - headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); - } - - - let urlPath = `/users/{id}/working-time-accounts/{date}`; - urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id']))); - if (requestParameters['date'] instanceof Date) { - urlPath = urlPath.replace('{date}', encodeURIComponent(runtime.serializeDate(requestParameters['date']))); - } else { - urlPath = urlPath.replace('{date}', encodeURIComponent(String(requestParameters['date']))); - } - - return { - path: urlPath, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }; - } - - /** - * Returns the User\'s working time account balances as of the given day. - * Get a User\'s working time accounts - */ - async getUserWorkingTimeAccountsRaw(requestParameters: GetUserWorkingTimeAccountsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const requestOptions = await this.getUserWorkingTimeAccountsRequestOpts(requestParameters); - const response = await this.request(requestOptions, initOverrides); - - return new runtime.JSONApiResponse(response, (jsonValue) => AccountsFromJSON(jsonValue)); - } - - /** - * Returns the User\'s working time account balances as of the given day. - * Get a User\'s working time accounts - */ - async getUserWorkingTimeAccounts(id: string, date: Date, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.getUserWorkingTimeAccountsRaw({ id: id, date: date, }, initOverrides); - return await response.value(); - } - } diff --git a/sdk/typescript-fetch/src/models/Accounts.ts b/sdk/typescript-fetch/src/models/Accounts.ts index 5c2d90c..0053119 100644 --- a/sdk/typescript-fetch/src/models/Accounts.ts +++ b/sdk/typescript-fetch/src/models/Accounts.ts @@ -41,7 +41,7 @@ import { */ export interface Accounts { /** - * date of last balance + * The balance entry the figures continue from, always before the requested day. Null only for the initialization date itself. */ lastBalanceDate: Date | null; /**