tripletex_ruby_client 1.0.1 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b69e7add3456228c30e690950535736d34972fb8081e11dd8dcd4e40151fe59
4
- data.tar.gz: adfe14b241185dea42c3bd93baa05553015e6b34660ce2c7ee661f2bc8d72989
3
+ metadata.gz: b9a7a3f094603d87532918aa23f1b605f4cd679ddab97da6b92256e6358770e6
4
+ data.tar.gz: f10bde3d91816dda8faf0cfd1f52c858f71e27c06c099582060bda8944cea7ce
5
5
  SHA512:
6
- metadata.gz: 5563214873ea8c72214486b9ecaff17ddb2990b024ae582a7e897f363cb5054f990bdf394b8fe91469770f0b5f730917adbf3f9b5d34f2ebd87b8ec04a22dd3a
7
- data.tar.gz: ab3712d5467a78cc4169f15c0fea48bdf9de5e73064470d0e62898742984f0c321377d477d88e1b5250e934283dd07fc1d95d5faeb8ac9cd53a73e5f1e869723
6
+ metadata.gz: b8dcddb6fc5fbc35d492ee2fac9b0bc440e10d9863c891683186e8bc5c5a6c1612822167648dc00f358936082e015045fc5691ba1e6947d14bc4df2364aa10fa
7
+ data.tar.gz: 63842cda91fbb9718cb7507e941770cca4d2ec099f845260412c03e1c4a8f64d3292b2fa801862132f855d99437465f15b84f1708401fa9f382b8dea0511bf70
data/README.md CHANGED
@@ -1,13 +1,11 @@
1
- # tripletex_ruby_client
1
+ # Tripletex API Ruby Client
2
2
 
3
- TripletexRubyClient - the Ruby gem for the Tripletex API
3
+ TripletexRubyClient - the Ruby gem for the Tripletex API, at the courtesy of Rubynor AS.
4
4
 
5
- This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
5
+ This was built using swagger-codegen first, from [https://tripletex.no/v2-docs/](https://tripletex.no/v2-docs/)
6
+ and it needed change in config and auth to work for us.
6
7
 
7
- - API version: 2.69.5
8
- - Package version: 1.0.0
9
- - Build package: io.swagger.codegen.languages.RubyClientCodegen
10
- For more information, please visit [https://github.com/Tripletex/tripletex-api2](https://github.com/Tripletex/tripletex-api2)
8
+ We can't see how the other tripletex ruby client gems work, but this is working for us.
11
9
 
12
10
  ## Installation
13
11
 
@@ -53,30 +51,14 @@ Please follow the [installation](#installation) procedure and then run the follo
53
51
  # Load the gem
54
52
  require 'tripletex_ruby_client'
55
53
 
56
- # Setup authorization
57
54
  # # Setup authorization - as autogenerated by swagger-codegen
58
55
  # TripletexRubyClient.configure do |config|
59
56
  # # Configure HTTP basic authorization: tokenAuthScheme
60
57
  # config.username = 'YOUR USERNAME'
61
58
  # config.password = 'YOUR PASSWORD'
62
59
  # end
63
- # Setup authorization
64
- #
65
- TripletexRubyClient.configure do |config|
66
- # Configure HTTP basic authorization: tokenAuthScheme
67
- config.consumer_token = ENV["TT_CONSUMER_TOKEN"]
68
- config.employee_token = ENV["TT_EMPLOYEE_TOKEN"]
69
- config.host = Rails.env.production? ? 'https://tripletex.no' : 'https://api.tripletex.io'
70
- config.token_expiration_time = Rails.env.production? ? 1.month : 1.day
71
- end
72
- # # Setup authorization - as autogenerated by swagger-codegen
73
- # TripletexRubyClient.configure do |config|
74
- # # Configure HTTP basic authorization: tokenAuthScheme
75
- # config.username = 'YOUR USERNAME'
76
- # config.password = 'YOUR PASSWORD'
77
- # end
78
- # Setup authorization
79
- #
60
+ # Setup authorization
61
+
80
62
  TripletexRubyClient.configure do |config|
81
63
  # Configure HTTP basic authorization: tokenAuthScheme
82
64
  config.consumer_token = ENV["TT_CONSUMER_TOKEN"]
@@ -103,6 +85,15 @@ end
103
85
 
104
86
  ```
105
87
 
88
+ ## Swagger Codegen
89
+
90
+ This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
91
+
92
+ - API version: 2.69.5
93
+ - Package version: 1.0.0
94
+ - Build package: io.swagger.codegen.languages.RubyClientCodegen
95
+ For more information, please visit [https://github.com/Tripletex/tripletex-api2](https://github.com/Tripletex/tripletex-api2)
96
+
106
97
  ## Documentation for API Endpoints
107
98
 
108
99
  All URIs are relative to *https://tripletex.no/v2*
@@ -1,7 +1,7 @@
1
1
  =begin
2
2
  #Tripletex API
3
3
 
4
- ### Usage - **Download the spec** [swagger.json](/v2/swagger.json) file, it is a [OpenAPI Specification](https://github.com/OAI/OpenAPI-Specification). - **Generating a client** can easily be done using tools like [swagger-codegen](https://github.com/swagger-api/swagger-codegen) or other that accepts [OpenAPI Specification](https://github.com/OAI/OpenAPI-Specification) specs. - For swagger codegen it is recommended to use the flag: **--removeOperationIdPrefix**. Unique operation ids are about to be introduced to the spec, and this ensures forward compatibility - and results in less verbose generated code. ## Overview - Partial resource updating is done using the `PUT` method with optional fields instead of the `PATCH` method. - **Actions** or **commands** are represented in our RESTful path with a prefixed `:`. Example: `/v2/hours/123/:approve`. - **Summaries** or **aggregated** results are represented in our RESTful path with a prefixed `>`. Example: `/v2/hours/>thisWeeksBillables`. - **Request ID** is a key found in all responses in the header with the name `x-tlx-request-id`. For validation and error responses it is also in the response body. If additional log information is absolutely necessary, our support division can locate the key value. - **version** This is a revision number found on all persisted resources. If included, it will prevent your PUT/POST from overriding any updates to the resource since your GET. - **Date** follows the **[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)** standard, meaning the format `YYYY-MM-DD`. - **DateTime** follows the **[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)** standard, meaning the format `YYYY-MM-DDThh:mm:ss`. - **Searching** is done by entering values in the optional fields for each API call. The values fall into the following categories: range, in, exact and like. - **Missing fields** or even **no response data** can occur because result objects and fields are filtered on authorization. - **See [GitHub](https://github.com/Tripletex/tripletex-api2) for more documentation, examples, changelog and more.** - **See [FAQ](https://tripletex.no/execute/docViewer?articleId=906&language=0) for additional information.** ## Authentication - **Tokens:** The Tripletex API uses 3 different tokens - **consumerToken** is a token provided to the consumer by Tripletex after the API 2.0 registration is completed. - **employeeToken** is a token created by an administrator in your Tripletex account via the user settings and the tab \"API access\". Each employee token must be given a set of entitlements. [Read more here.](https://tripletex.no/execute/docViewer?articleId=1505&languageId=0) - **sessionToken** is the token from `/token/session/:create` which requires a consumerToken and an employeeToken created with the same consumer token, but not an authentication header. - **Authentication** is done via [Basic access authentication](https://en.wikipedia.org/wiki/Basic_access_authentication) - **username** is used to specify what company to access. - `0` or blank means the company of the employee. - Any other value means accountant clients. Use `/company/>withLoginAccess` to get a list of those. - **password** is the **sessionToken**. - If you need to create the header yourself use `Authorization: Basic <encoded token>` where `encoded token` is the string `<target company id or 0>:<your session token>` Base64 encoded. ## Tags - `[BETA]` This is a beta endpoint and can be subject to change. - `[DEPRECATED]` Deprecated means that we intend to remove/change this feature or capability in a future \"major\" API release. We therefore discourage all use of this feature/capability. ## Fields Use the `fields` parameter to specify which fields should be returned. This also supports fields from sub elements, done via `<field>(<subResourceFields>)`. `*` means all fields for that resource. Example values: - `project,activity,hours` returns `{project:..., activity:...., hours:...}`. - just `project` returns `\"project\" : { \"id\": 12345, \"url\": \"tripletex.no/v2/projects/12345\" }`. - `project(*)` returns `\"project\" : { \"id\": 12345 \"name\":\"ProjectName\" \"number.....startDate\": \"2013-01-07\" }`. - `project(name)` returns `\"project\" : { \"name\":\"ProjectName\" }`. - All resources and some subResources : `*,activity(name),employee(*)`. ## Sorting Use the `sorting` parameter to specify sorting. It takes a comma separated list, where a `-` prefix denotes descending. You can sort by sub object with the following format: `<field>.<subObjectField>`. Example values: - `date` - `project.name` - `project.name, -date` ## Changes To get the changes for a resource, `changes` have to be explicitly specified as part of the `fields` parameter, e.g. `*,changes`. There are currently two types of change available: - `CREATE` for when the resource was created - `UPDATE` for when the resource was updated **NOTE** > For objects created prior to October 24th 2018 the list may be incomplete, but will always contain the CREATE and the last change (if the object has been changed after creation). ## Rate limiting Rate limiting is performed on the API calls for an employee for each API consumer. Status regarding the rate limit is returned as headers: - `X-Rate-Limit-Limit` - The number of allowed requests in the current period. - `X-Rate-Limit-Remaining` - The number of remaining requests. - `X-Rate-Limit-Reset` - The number of seconds left in the current period. Once the rate limit is hit, all requests will return HTTP status code `429` for the remainder of the current period. ## Response envelope #### Multiple values ```json { \"fullResultSize\": ###, // {number} [DEPRECATED] \"from\": ###, // {number} Paging starting from \"count\": ###, // {number} Paging count \"versionDigest\": \"###\", // {string} Hash of full result, null if no result \"values\": [...{...object...},{...object...},{...object...}...] } ``` #### Single value ```json { \"value\": {...single object...} } ``` ## WebHook envelope ```json { \"subscriptionId\": ###, // Subscription id \"event\": \"object.verb\", // As listed from /v2/event/ \"id\": ###, // Id of object this event is for \"value\": {... single object, null if object.deleted ...} } ``` ## Error/warning envelope ```json { \"status\": ###, // {number} HTTP status code \"code\": #####, // {number} internal status code of event \"message\": \"###\", // {string} Basic feedback message in your language \"link\": \"###\", // {string} Link to doc \"developerMessage\": \"###\", // {string} More technical message \"validationMessages\": [ // {array} List of validation messages, can be null { \"field\": \"###\", // {string} Name of field \"message\": \"###\" // {string} Validation message for field } ], \"requestId\": \"###\" // {string} Same as x-tlx-request-id } ``` ## Status codes / Error codes - **200 OK** - **201 Created** - From POSTs that create something new. - **204 No Content** - When there is no answer, ex: \"/:anAction\" or DELETE. - **400 Bad request** - - **4000** Bad Request Exception - **11000** Illegal Filter Exception - **12000** Path Param Exception - **24000** Cryptography Exception - **401 Unauthorized** - When authentication is required and has failed or has not yet been provided - **3000** Authentication Exception - **403 Forbidden** - When AuthorisationManager says no. - **9000** Security Exception - **404 Not Found** - For resources that does not exist. - **6000** Not Found Exception - **409 Conflict** - Such as an edit conflict between multiple simultaneous updates - **7000** Object Exists Exception - **8000** Revision Exception - **10000** Locked Exception - **14000** Duplicate entry - **422 Bad Request** - For Required fields or things like malformed payload. - **15000** Value Validation Exception - **16000** Mapping Exception - **17000** Sorting Exception - **18000** Validation Exception - **21000** Param Exception - **22000** Invalid JSON Exception - **23000** Result Set Too Large Exception - **429 Too Many Requests** - Request rate limit hit - **500 Internal Error** - Unexpected condition was encountered and no more specific message is suitable - **1000** Exception
4
+ ### Usage - **Download the spec** [swagger.json](/v2/swagger.json) file, it is a [OpenAPI Specification](https://github.com/OAI/OpenAPI-Specification). - **Generating a client** can easily be done using tools like [swagger-codegen](https://github.com/swagger-api/swagger-codegen) or other that accepts [OpenAPI Specification](https://github.com/OAI/OpenAPI-Specification) specs. - For swagger codegen it is recommended to use the flag: **--removeOperationIdPrefix**. Unique operation ids are about to be introduced to the spec, and this ensures forward compatibility - and results in less verbose generated code. ## Overview - Partial resource updating is done using the `PUT` method with optional fields instead of the `PATCH` method. - **Actions** or **commands** are represented in our RESTful path with a prefixed `:`. Example: `/v2/hours/123/:approve`. - **Summaries** or **aggregated** results are represented in our RESTful path with a prefixed `>`. Example: `/v2/hours/>thisWeeksBillables`. - **Request ID** is a key found in all responses in the header with the name `x-tlx-request-id`. For validation and error responses it is also in the response body. If additional log information is absolutely necessary, our support division can locate the key value. - **version** This is a revision number found on all persisted resources. If included, it will prevent your PUT/POST from overriding any updates to the resource since your GET. - **Date** follows the **[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)** standard, meaning the format `YYYY-MM-DD`. - **DateTime** follows the **[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)** standard, meaning the format `YYYY-MM-DDThh:mm:ss`. - **Searching** is done by entering values in the optional fields for each API call. The values fall into the following categories: range, in, exact and like. - **Missing fields** or even **no response data** can occur because result objects and fields are filtered on authorization. - **See [GitHub](https://github.com/Tripletex/tripletex-api2) for more documentation, examples, changelog and more.** - **See [FAQ](https://tripletex.no/execute/docViewer?articleId=906&language=0) for additional information.** ## Authentication - **Tokens:** The Tripletex API uses 3 different tokens - **consumerToken** is a token provided to the consumer by Tripletex after the API 2.0 registration is completed. - **employeeToken** is a token created by an administrator in your Tripletex account via the user settings and the tab \"API access\". Each employee token must be given a set of entitlements. [Read more here.](https://tripletex.no/execute/docViewer?articleId=1505&languageId=0) - **sessionToken** is the token from `/token/session/:create` which requires a consumerToken and an employeeToken created with the same consumer token, but not an authentication header. - **Authentication** is done via [Basic access authentication](https://en.wikipedia.org/wiki/Basic_access_authentication) - **username** is used to specify what company to access. - `0` or blank means the company of the employee. - Any other value means accountant clients. Use `/company/>withLoginAccess` to get a list of those. - **password** is the **sessionToken**. - If you need to create the header yourself use `Authorization: Basic <encoded token>` where `encoded token` is the string `<target company id or 0>:<your session token>` Base64 encoded. ## Tags - `[BETA]` This is a beta endpoint and can be subject to change. - `[DEPRECATED]` Deprecated means that we intend to remove/change this feature or capability in a future \"major\" API release. We therefore discourage all use of this feature/capability. ## Fields Use the `fields` parameter to specify which fields should be returned. This also supports fields from sub elements, done via `<field>(<subResourceFields>)`. `*` means all fields for that resource. Example values: - `project,activity,hours` returns `{project:..., activity:...., hours:...}`. - just `project` returns `\"project\" : { \"id\": 12345, \"url\": \"tripletex.no/v2/projects/12345\" }`. - `project(*)` returns `\"project\" : { \"id\": 12345 \"name\":\"ProjectName\" \"number.....startDate\": \"2013-01-07\" }`. - `project(name)` returns `\"project\" : { \"name\":\"ProjectName\" }`. - All resources and some subResources : `*,activity(name),employee(*)`. ## Sorting Use the `sorting` parameter to specify sorting. It takes a comma separated list, where a `-` prefix denotes descending. You can sort by sub object with the following format: `<field>.<subObjectField>`. Example values: - `date` - `project.name` - `project.name, -date` ## Changes To get the changes for a resource, `changes` have to be explicitly specified as part of the `fields` parameter, e.g. `*,changes`. There are currently two types of change available: - `CREATE` for when the resource was created - `UPDATE` for when the resource was updated **NOTE** > For objects created prior to October 24th 2018 the list may be incomplete, but will always contain the CREATE and the last change (if the object has been changed after creation). ## Rate limiting Rate limiting is performed on the API calls for an employee for each API consumer. Status regarding the rate limit is returned as headers: - `X-Rate-Limit-Limit` - The number of allowed requests in the current period. - `X-Rate-Limit-Remaining` - The number of remaining requests. - `X-Rate-Limit-Reset` - The number of seconds left in the current period. Once the rate limit is hit, all requests will return HTTP status code `429` for the remainder of the current period. ## Response envelope #### Multiple values ```json { \"fullResultSize\": ###, // {number} [DEPRECATED] \"from\": ###, // {number} Paging starting from \"count\": ###, // {number} Paging count \"versionDigest\": \"###\", // {string} Hash of full result, null if no result \"values\": [...{...object...},{...object...},{...object...}...] } ``` #### Single value ```json { \"value\": {...single object...} } ``` ## WebHook envelope ```json { \"subscriptionId\": ###, // Subscription id \"event\": \"object.verb\", // As listed from /v2/event/ \"id\": ###, // Id of object this event is for \"value\": {... single object, null if object.deleted ...} } ``` ## Error/warning envelope ```json { \"status\": ###, // {number} HTTP status code \"code\": #####, // {number} internal status code of event \"message\": \"###\", // {string} Basic feedback message in your language \"link\": \"###\", // {string} Link to doc \"developerMessage\": \"###\", // {string} More technical message \"validationMessages\": [ // {array} List of validation messages, can be null { \"field\": \"###\", // {string} Name of field \"message\": \"###\" // {string} Validation message for field } ], \"requestId\": \"###\" // {string} Same as x-tlx-request-id } ``` ## Status codes / Error codes - **200 OK** - **201 Created** - From POSTs that create something new. - **204 No Content** - When there is no answer, ex: \"/:anAction\" or DELETE. - **400 Bad request** - - **4000** Bad Request Exception - **11000** Illegal Filter Exception - **12000** Path Param Exception - **24000** Cryptography Exception - **401 Unauthorized** - When authentication is required and has failed or has not yet been provided - **3000** Authentication Exception - **403 Forbidden** - When AuthorisationManager says no. - **9000** Security Exception - **404 Not Found** - For resources that does not exist. - **6000** Not Found Exception - **409 Conflict** - Such as an edit conflict between multiple simultaneous updates - **7000** Object Exists Exception - **8000** Revision Exception - **10000** Locked Exception - **14000** Duplicate entry - **422 Bad Request** - For Required fields or things like malformed payload. - **15000** Value Validation Exception - **16000** Mapping Exception - **17000** Sorting Exception - **18000** Validation Exception - **21000** Param Exception - **22000** Invalid JSON Exception - **23000** Result Set Too Large Exception - **429 Too Many Requests** - Request rate limit hit - **500 Internal Error** - Unexpected condition was encountered and no more specific message is suitable - **1000** Exception
5
5
 
6
6
  OpenAPI spec version: 2.69.5
7
7
 
@@ -34,5 +34,13 @@ module TripletexRubyClient
34
34
  super arg
35
35
  end
36
36
  end
37
+
38
+ def to_s
39
+ #Need to see the result in the output!
40
+ self.instance_variables.reduce({}) do |h, attribute|
41
+ h[attribute]= self.instance_variable_get(attribute)
42
+ h
43
+ end.to_s
44
+ end
37
45
  end
38
46
  end
@@ -1,7 +1,7 @@
1
1
  =begin
2
2
  #Tripletex API
3
3
 
4
- ### Usage - **Download the spec** [swagger.json](/v2/swagger.json) file, it is a [OpenAPI Specification](https://github.com/OAI/OpenAPI-Specification). - **Generating a client** can easily be done using tools like [swagger-codegen](https://github.com/swagger-api/swagger-codegen) or other that accepts [OpenAPI Specification](https://github.com/OAI/OpenAPI-Specification) specs. - For swagger codegen it is recommended to use the flag: **--removeOperationIdPrefix**. Unique operation ids are about to be introduced to the spec, and this ensures forward compatibility - and results in less verbose generated code. ## Overview - Partial resource updating is done using the `PUT` method with optional fields instead of the `PATCH` method. - **Actions** or **commands** are represented in our RESTful path with a prefixed `:`. Example: `/v2/hours/123/:approve`. - **Summaries** or **aggregated** results are represented in our RESTful path with a prefixed `>`. Example: `/v2/hours/>thisWeeksBillables`. - **Request ID** is a key found in all responses in the header with the name `x-tlx-request-id`. For validation and error responses it is also in the response body. If additional log information is absolutely necessary, our support division can locate the key value. - **version** This is a revision number found on all persisted resources. If included, it will prevent your PUT/POST from overriding any updates to the resource since your GET. - **Date** follows the **[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)** standard, meaning the format `YYYY-MM-DD`. - **DateTime** follows the **[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)** standard, meaning the format `YYYY-MM-DDThh:mm:ss`. - **Searching** is done by entering values in the optional fields for each API call. The values fall into the following categories: range, in, exact and like. - **Missing fields** or even **no response data** can occur because result objects and fields are filtered on authorization. - **See [GitHub](https://github.com/Tripletex/tripletex-api2) for more documentation, examples, changelog and more.** - **See [FAQ](https://tripletex.no/execute/docViewer?articleId=906&language=0) for additional information.** ## Authentication - **Tokens:** The Tripletex API uses 3 different tokens - **consumerToken** is a token provided to the consumer by Tripletex after the API 2.0 registration is completed. - **employeeToken** is a token created by an administrator in your Tripletex account via the user settings and the tab \"API access\". Each employee token must be given a set of entitlements. [Read more here.](https://tripletex.no/execute/docViewer?articleId=1505&languageId=0) - **sessionToken** is the token from `/token/session/:create` which requires a consumerToken and an employeeToken created with the same consumer token, but not an authentication header. - **Authentication** is done via [Basic access authentication](https://en.wikipedia.org/wiki/Basic_access_authentication) - **username** is used to specify what company to access. - `0` or blank means the company of the employee. - Any other value means accountant clients. Use `/company/>withLoginAccess` to get a list of those. - **password** is the **sessionToken**. - If you need to create the header yourself use `Authorization: Basic <encoded token>` where `encoded token` is the string `<target company id or 0>:<your session token>` Base64 encoded. ## Tags - `[BETA]` This is a beta endpoint and can be subject to change. - `[DEPRECATED]` Deprecated means that we intend to remove/change this feature or capability in a future \"major\" API release. We therefore discourage all use of this feature/capability. ## Fields Use the `fields` parameter to specify which fields should be returned. This also supports fields from sub elements, done via `<field>(<subResourceFields>)`. `*` means all fields for that resource. Example values: - `project,activity,hours` returns `{project:..., activity:...., hours:...}`. - just `project` returns `\"project\" : { \"id\": 12345, \"url\": \"tripletex.no/v2/projects/12345\" }`. - `project(*)` returns `\"project\" : { \"id\": 12345 \"name\":\"ProjectName\" \"number.....startDate\": \"2013-01-07\" }`. - `project(name)` returns `\"project\" : { \"name\":\"ProjectName\" }`. - All resources and some subResources : `*,activity(name),employee(*)`. ## Sorting Use the `sorting` parameter to specify sorting. It takes a comma separated list, where a `-` prefix denotes descending. You can sort by sub object with the following format: `<field>.<subObjectField>`. Example values: - `date` - `project.name` - `project.name, -date` ## Changes To get the changes for a resource, `changes` have to be explicitly specified as part of the `fields` parameter, e.g. `*,changes`. There are currently two types of change available: - `CREATE` for when the resource was created - `UPDATE` for when the resource was updated **NOTE** > For objects created prior to October 24th 2018 the list may be incomplete, but will always contain the CREATE and the last change (if the object has been changed after creation). ## Rate limiting Rate limiting is performed on the API calls for an employee for each API consumer. Status regarding the rate limit is returned as headers: - `X-Rate-Limit-Limit` - The number of allowed requests in the current period. - `X-Rate-Limit-Remaining` - The number of remaining requests. - `X-Rate-Limit-Reset` - The number of seconds left in the current period. Once the rate limit is hit, all requests will return HTTP status code `429` for the remainder of the current period. ## Response envelope #### Multiple values ```json { \"fullResultSize\": ###, // {number} [DEPRECATED] \"from\": ###, // {number} Paging starting from \"count\": ###, // {number} Paging count \"versionDigest\": \"###\", // {string} Hash of full result, null if no result \"values\": [...{...object...},{...object...},{...object...}...] } ``` #### Single value ```json { \"value\": {...single object...} } ``` ## WebHook envelope ```json { \"subscriptionId\": ###, // Subscription id \"event\": \"object.verb\", // As listed from /v2/event/ \"id\": ###, // Id of object this event is for \"value\": {... single object, null if object.deleted ...} } ``` ## Error/warning envelope ```json { \"status\": ###, // {number} HTTP status code \"code\": #####, // {number} internal status code of event \"message\": \"###\", // {string} Basic feedback message in your language \"link\": \"###\", // {string} Link to doc \"developerMessage\": \"###\", // {string} More technical message \"validationMessages\": [ // {array} List of validation messages, can be null { \"field\": \"###\", // {string} Name of field \"message\": \"###\" // {string} Validation message for field } ], \"requestId\": \"###\" // {string} Same as x-tlx-request-id } ``` ## Status codes / Error codes - **200 OK** - **201 Created** - From POSTs that create something new. - **204 No Content** - When there is no answer, ex: \"/:anAction\" or DELETE. - **400 Bad request** - - **4000** Bad Request Exception - **11000** Illegal Filter Exception - **12000** Path Param Exception - **24000** Cryptography Exception - **401 Unauthorized** - When authentication is required and has failed or has not yet been provided - **3000** Authentication Exception - **403 Forbidden** - When AuthorisationManager says no. - **9000** Security Exception - **404 Not Found** - For resources that does not exist. - **6000** Not Found Exception - **409 Conflict** - Such as an edit conflict between multiple simultaneous updates - **7000** Object Exists Exception - **8000** Revision Exception - **10000** Locked Exception - **14000** Duplicate entry - **422 Bad Request** - For Required fields or things like malformed payload. - **15000** Value Validation Exception - **16000** Mapping Exception - **17000** Sorting Exception - **18000** Validation Exception - **21000** Param Exception - **22000** Invalid JSON Exception - **23000** Result Set Too Large Exception - **429 Too Many Requests** - Request rate limit hit - **500 Internal Error** - Unexpected condition was encountered and no more specific message is suitable - **1000** Exception
4
+ ### Usage - **Download the spec** [swagger.json](/v2/swagger.json) file, it is a [OpenAPI Specification](https://github.com/OAI/OpenAPI-Specification). - **Generating a client** can easily be done using tools like [swagger-codegen](https://github.com/swagger-api/swagger-codegen) or other that accepts [OpenAPI Specification](https://github.com/OAI/OpenAPI-Specification) specs. - For swagger codegen it is recommended to use the flag: **--removeOperationIdPrefix**. Unique operation ids are about to be introduced to the spec, and this ensures forward compatibility - and results in less verbose generated code. ## Overview - Partial resource updating is done using the `PUT` method with optional fields instead of the `PATCH` method. - **Actions** or **commands** are represented in our RESTful path with a prefixed `:`. Example: `/v2/hours/123/:approve`. - **Summaries** or **aggregated** results are represented in our RESTful path with a prefixed `>`. Example: `/v2/hours/>thisWeeksBillables`. - **Request ID** is a key found in all responses in the header with the name `x-tlx-request-id`. For validation and error responses it is also in the response body. If additional log information is absolutely necessary, our support division can locate the key value. - **version** This is a revision number found on all persisted resources. If included, it will prevent your PUT/POST from overriding any updates to the resource since your GET. - **Date** follows the **[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)** standard, meaning the format `YYYY-MM-DD`. - **DateTime** follows the **[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)** standard, meaning the format `YYYY-MM-DDThh:mm:ss`. - **Searching** is done by entering values in the optional fields for each API call. The values fall into the following categories: range, in, exact and like. - **Missing fields** or even **no response data** can occur because result objects and fields are filtered on authorization. - **See [GitHub](https://github.com/Tripletex/tripletex-api2) for more documentation, examples, changelog and more.** - **See [FAQ](https://tripletex.no/execute/docViewer?articleId=906&language=0) for additional information.** ## Authentication - **Tokens:** The Tripletex API uses 3 different tokens - **consumerToken** is a token provided to the consumer by Tripletex after the API 2.0 registration is completed. - **employeeToken** is a token created by an administrator in your Tripletex account via the user settings and the tab \"API access\". Each employee token must be given a set of entitlements. [Read more here.](https://tripletex.no/execute/docViewer?articleId=1505&languageId=0) - **sessionToken** is the token from `/token/session/:create` which requires a consumerToken and an employeeToken created with the same consumer token, but not an authentication header. - **Authentication** is done via [Basic access authentication](https://en.wikipedia.org/wiki/Basic_access_authentication) - **username** is used to specify what company to access. - `0` or blank means the company of the employee. - Any other value means accountant clients. Use `/company/>withLoginAccess` to get a list of those. - **password** is the **sessionToken**. - If you need to create the header yourself use `Authorization: Basic <encoded token>` where `encoded token` is the string `<target company id or 0>:<your session token>` Base64 encoded. ## Tags - `[BETA]` This is a beta endpoint and can be subject to change. - `[DEPRECATED]` Deprecated means that we intend to remove/change this feature or capability in a future \"major\" API release. We therefore discourage all use of this feature/capability. ## Fields Use the `fields` parameter to specify which fields should be returned. This also supports fields from sub elements, done via `<field>(<subResourceFields>)`. `*` means all fields for that resource. Example values: - `project,activity,hours` returns `{project:..., activity:...., hours:...}`. - just `project` returns `\"project\" : { \"id\": 12345, \"url\": \"tripletex.no/v2/projects/12345\" }`. - `project(*)` returns `\"project\" : { \"id\": 12345 \"name\":\"ProjectName\" \"number.....startDate\": \"2013-01-07\" }`. - `project(name)` returns `\"project\" : { \"name\":\"ProjectName\" }`. - All resources and some subResources : `*,activity(name),employee(*)`. ## Sorting Use the `sorting` parameter to specify sorting. It takes a comma separated list, where a `-` prefix denotes descending. You can sort by sub object with the following format: `<field>.<subObjectField>`. Example values: - `date` - `project.name` - `project.name, -date` ## Changes To get the changes for a resource, `changes` have to be explicitly specified as part of the `fields` parameter, e.g. `*,changes`. There are currently two types of change available: - `CREATE` for when the resource was created - `UPDATE` for when the resource was updated **NOTE** > For objects created prior to October 24th 2018 the list may be incomplete, but will always contain the CREATE and the last change (if the object has been changed after creation). ## Rate limiting Rate limiting is performed on the API calls for an employee for each API consumer. Status regarding the rate limit is returned as headers: - `X-Rate-Limit-Limit` - The number of allowed requests in the current period. - `X-Rate-Limit-Remaining` - The number of remaining requests. - `X-Rate-Limit-Reset` - The number of seconds left in the current period. Once the rate limit is hit, all requests will return HTTP status code `429` for the remainder of the current period. ## Response envelope #### Multiple values ```json { \"fullResultSize\": ###, // {number} [DEPRECATED] \"from\": ###, // {number} Paging starting from \"count\": ###, // {number} Paging count \"versionDigest\": \"###\", // {string} Hash of full result, null if no result \"values\": [...{...object...},{...object...},{...object...}...] } ``` #### Single value ```json { \"value\": {...single object...} } ``` ## WebHook envelope ```json { \"subscriptionId\": ###, // Subscription id \"event\": \"object.verb\", // As listed from /v2/event/ \"id\": ###, // Id of object this event is for \"value\": {... single object, null if object.deleted ...} } ``` ## Error/warning envelope ```json { \"status\": ###, // {number} HTTP status code \"code\": #####, // {number} internal status code of event \"message\": \"###\", // {string} Basic feedback message in your language \"link\": \"###\", // {string} Link to doc \"developerMessage\": \"###\", // {string} More technical message \"validationMessages\": [ // {array} List of validation messages, can be null { \"field\": \"###\", // {string} Name of field \"message\": \"###\" // {string} Validation message for field } ], \"requestId\": \"###\" // {string} Same as x-tlx-request-id } ``` ## Status codes / Error codes - **200 OK** - **201 Created** - From POSTs that create something new. - **204 No Content** - When there is no answer, ex: \"/:anAction\" or DELETE. - **400 Bad request** - - **4000** Bad Request Exception - **11000** Illegal Filter Exception - **12000** Path Param Exception - **24000** Cryptography Exception - **401 Unauthorized** - When authentication is required and has failed or has not yet been provided - **3000** Authentication Exception - **403 Forbidden** - When AuthorisationManager says no. - **9000** Security Exception - **404 Not Found** - For resources that does not exist. - **6000** Not Found Exception - **409 Conflict** - Such as an edit conflict between multiple simultaneous updates - **7000** Object Exists Exception - **8000** Revision Exception - **10000** Locked Exception - **14000** Duplicate entry - **422 Bad Request** - For Required fields or things like malformed payload. - **15000** Value Validation Exception - **16000** Mapping Exception - **17000** Sorting Exception - **18000** Validation Exception - **21000** Param Exception - **22000** Invalid JSON Exception - **23000** Result Set Too Large Exception - **429 Too Many Requests** - Request rate limit hit - **500 Internal Error** - Unexpected condition was encountered and no more specific message is suitable - **1000** Exception
5
5
 
6
6
  OpenAPI spec version: 2.69.5
7
7
 
@@ -13,7 +13,7 @@ Swagger Codegen version: 2.4.24
13
13
  require 'date'
14
14
 
15
15
  module TripletexRubyClient
16
- class ApiError
16
+ class REMOVEApiError
17
17
  attr_accessor :status
18
18
 
19
19
  attr_accessor :code
@@ -11,5 +11,5 @@ Swagger Codegen version: 2.4.24
11
11
  =end
12
12
 
13
13
  module TripletexRubyClient
14
- VERSION = '1.0.1'
14
+ VERSION = '1.0.3'
15
15
  end
@@ -32,7 +32,7 @@ require 'tripletex_ruby_client/models/altinn_company_module'
32
32
  require 'tripletex_ruby_client/models/altinn_instance'
33
33
  require 'tripletex_ruby_client/models/annual_account'
34
34
  require 'tripletex_ruby_client/models/api_consumer'
35
- require 'tripletex_ruby_client/models/api_error'
35
+ # require 'tripletex_ruby_client/models/api_error' # wtf is this over-shadower of the real ApiError class?
36
36
  require 'tripletex_ruby_client/models/api_validation_message'
37
37
  require 'tripletex_ruby_client/models/app_specific'
38
38
  require 'tripletex_ruby_client/models/approve_response_dto'
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tripletex_ruby_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Swagger-Codegen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-15 00:00:00.000000000 Z
11
+ date: 2021-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -1287,6 +1287,7 @@ files:
1287
1287
  - lib/tripletex_ruby_client/api_error.rb
1288
1288
  - lib/tripletex_ruby_client/configuration.rb
1289
1289
  - lib/tripletex_ruby_client/configuration_monkey_path.rb
1290
+ - lib/tripletex_ruby_client/models/REMOVEapi_error.rb
1290
1291
  - lib/tripletex_ruby_client/models/accommodation_allowance.rb
1291
1292
  - lib/tripletex_ruby_client/models/account.rb
1292
1293
  - lib/tripletex_ruby_client/models/accounting_period.rb
@@ -1298,7 +1299,6 @@ files:
1298
1299
  - lib/tripletex_ruby_client/models/altinn_instance.rb
1299
1300
  - lib/tripletex_ruby_client/models/annual_account.rb
1300
1301
  - lib/tripletex_ruby_client/models/api_consumer.rb
1301
- - lib/tripletex_ruby_client/models/api_error.rb
1302
1302
  - lib/tripletex_ruby_client/models/api_validation_message.rb
1303
1303
  - lib/tripletex_ruby_client/models/app_specific.rb
1304
1304
  - lib/tripletex_ruby_client/models/approve_response_dto.rb
@@ -2825,6 +2825,7 @@ files:
2825
2825
  - spec/models/ztl_onboarding_spec.rb
2826
2826
  - spec/spec_helper.rb
2827
2827
  - tripletex-swagger-config.json
2828
+ - tripletex_ruby_client-1.0.1.gem
2828
2829
  - tripletex_ruby_client.gemspec
2829
2830
  homepage: https://github.com/swagger-api/swagger-codegen
2830
2831
  licenses:
@@ -2845,7 +2846,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
2845
2846
  - !ruby/object:Gem::Version
2846
2847
  version: '0'
2847
2848
  requirements: []
2848
- rubygems_version: 3.1.3
2849
+ rubygems_version: 3.2.15
2849
2850
  signing_key:
2850
2851
  specification_version: 4
2851
2852
  summary: Tripletex API Ruby Gem