diff --git a/go/configuration/go-config.yml b/go/configuration/go-config.yml index 825c0dcf0..9e50c0f13 100755 --- a/go/configuration/go-config.yml +++ b/go/configuration/go-config.yml @@ -31,4 +31,4 @@ typeMappings: PropertyObject: string openapiNormalizer: - FILTER: 'tag:Executions|Flows|Namespaces|Triggers|Users|Groups|KV|Roles|ServiceAccount' \ No newline at end of file + FILTER: 'tag:Executions|Flows|Namespaces|Triggers|Users|Groups|KV|Roles|ServiceAccount|TestSuites' \ No newline at end of file diff --git a/go/go-sdk/.openapi-generator/FILES b/go/go-sdk/.openapi-generator/FILES index e83aefdf0..f1b8dcc13 100755 --- a/go/go-sdk/.openapi-generator/FILES +++ b/go/go-sdk/.openapi-generator/FILES @@ -9,6 +9,7 @@ api_kv.go api_namespaces.go api_roles.go api_service_account.go +api_test_suites.go api_triggers.go api_users.go client.go @@ -409,6 +410,7 @@ docs/TestSuiteControllerTestsLastResultResponse.md docs/TestSuiteRunResult.md docs/TestSuiteServiceRunByQueryRequest.md docs/TestSuiteServiceTestRunByQueryResult.md +docs/TestSuitesAPI.md docs/TheLabelsToPassToTheExecutionCreated.md docs/TimeWindow.md docs/Trigger.md diff --git a/go/go-sdk/README.md b/go/go-sdk/README.md index 5237a8e02..241bf2062 100755 --- a/go/go-sdk/README.md +++ b/go/go-sdk/README.md @@ -212,6 +212,20 @@ Class | Method | HTTP request | Description *ServiceAccountAPI* | [**ServiceAccount**](docs/ServiceAccountAPI.md#serviceaccount) | **Get** /api/v1/service-accounts/{id} | Get a service account *ServiceAccountAPI* | [**ServiceAccountForTenant**](docs/ServiceAccountAPI.md#serviceaccountfortenant) | **Get** /api/v1/{tenant}/service-accounts/{id} | Retrieve a service account *ServiceAccountAPI* | [**UpdateServiceAccount**](docs/ServiceAccountAPI.md#updateserviceaccount) | **Put** /api/v1/{tenant}/service-accounts/{id} | Update a user service account +*TestSuitesAPI* | [**CreateTestSuite**](docs/TestSuitesAPI.md#createtestsuite) | **Post** /api/v1/{tenant}/tests | Create a test from YAML source +*TestSuitesAPI* | [**DeleteTestSuite**](docs/TestSuitesAPI.md#deletetestsuite) | **Delete** /api/v1/{tenant}/tests/{namespace}/{id} | Delete a test +*TestSuitesAPI* | [**DeleteTestSuitesByIds**](docs/TestSuitesAPI.md#deletetestsuitesbyids) | **Delete** /api/v1/{tenant}/tests/by-ids | Delete multiple tests by id +*TestSuitesAPI* | [**DisableTestSuitesByIds**](docs/TestSuitesAPI.md#disabletestsuitesbyids) | **Post** /api/v1/{tenant}/tests/disable/by-ids | Disable multiple tests by id +*TestSuitesAPI* | [**EnableTestSuitesByIds**](docs/TestSuitesAPI.md#enabletestsuitesbyids) | **Post** /api/v1/{tenant}/tests/enable/by-ids | Enable multiple tests by id +*TestSuitesAPI* | [**RunTestSuite**](docs/TestSuitesAPI.md#runtestsuite) | **Post** /api/v1/{tenant}/tests/{namespace}/{id}/run | Run a full test +*TestSuitesAPI* | [**RunTestSuitesByQuery**](docs/TestSuitesAPI.md#runtestsuitesbyquery) | **Post** /api/v1/{tenant}/tests/run | Run multiple TestSuites by query +*TestSuitesAPI* | [**SearchTestSuites**](docs/TestSuitesAPI.md#searchtestsuites) | **Get** /api/v1/{tenant}/tests/search | Search for tests +*TestSuitesAPI* | [**SearchTestSuitesResults**](docs/TestSuitesAPI.md#searchtestsuitesresults) | **Get** /api/v1/{tenant}/tests/results/search | Search for tests results +*TestSuitesAPI* | [**TestResult**](docs/TestSuitesAPI.md#testresult) | **Get** /api/v1/{tenant}/tests/results/{id} | Get a test result +*TestSuitesAPI* | [**TestSuite**](docs/TestSuitesAPI.md#testsuite) | **Get** /api/v1/{tenant}/tests/{namespace}/{id} | Retrieve a test +*TestSuitesAPI* | [**TestsLastResult**](docs/TestSuitesAPI.md#testslastresult) | **Post** /api/v1/{tenant}/tests/results/search/last | Get tests last result +*TestSuitesAPI* | [**UpdateTestSuite**](docs/TestSuitesAPI.md#updatetestsuite) | **Put** /api/v1/{tenant}/tests/{namespace}/{id} | Update a test from YAML source +*TestSuitesAPI* | [**ValidateTestSuite**](docs/TestSuitesAPI.md#validatetestsuite) | **Post** /api/v1/{tenant}/tests/validate | Validate a test *TriggersAPI* | [**DeleteBackfill**](docs/TriggersAPI.md#deletebackfill) | **Post** /api/v1/{tenant}/triggers/backfill/delete | Delete a backfill *TriggersAPI* | [**DeleteBackfillByIds**](docs/TriggersAPI.md#deletebackfillbyids) | **Post** /api/v1/{tenant}/triggers/backfill/delete/by-triggers | Delete backfill for given triggers *TriggersAPI* | [**DeleteBackfillByQuery**](docs/TriggersAPI.md#deletebackfillbyquery) | **Post** /api/v1/{tenant}/triggers/backfill/delete/by-query | Delete backfill for given triggers diff --git a/go/go-sdk/api/openapi.yaml b/go/go-sdk/api/openapi.yaml index 98f6e513b..a73e52e8a 100755 --- a/go/go-sdk/api/openapi.yaml +++ b/go/go-sdk/api/openapi.yaml @@ -14043,7 +14043,7 @@ paths: summary: Create a test from YAML source tags: - TestSuites - x-internal: true + x-internal: false /api/v1/{tenant}/tests/by-ids: delete: description: Deletes a test by namespace and ID. Requires TEST permission with @@ -14073,7 +14073,7 @@ paths: summary: Delete multiple tests by id tags: - TestSuites - x-internal: true + x-internal: false /api/v1/{tenant}/tests/disable/by-ids: post: description: Disable a test by namespace and ID. Requires TEST permission with @@ -14103,7 +14103,7 @@ paths: summary: Disable multiple tests by id tags: - TestSuites - x-internal: true + x-internal: false /api/v1/{tenant}/tests/enable/by-ids: post: description: Enable a test by namespace and ID. Requires TEST permission with @@ -14133,7 +14133,7 @@ paths: summary: Enable multiple tests by id tags: - TestSuites - x-internal: true + x-internal: false /api/v1/{tenant}/tests/results/search: get: description: "with optional filtering by namespace, test suite ID and flow ID.\ @@ -14217,7 +14217,7 @@ paths: summary: Search for tests results tags: - TestSuites - x-internal: true + x-internal: false /api/v1/{tenant}/tests/results/search/last: post: description: Get multiple tests last result for a query. @@ -14246,7 +14246,7 @@ paths: summary: Get tests last result tags: - TestSuites - x-internal: true + x-internal: false /api/v1/{tenant}/tests/results/{id}: get: description: Get a test result once it was run. @@ -14277,7 +14277,7 @@ paths: summary: Get a test result tags: - TestSuites - x-internal: true + x-internal: false /api/v1/{tenant}/tests/run: post: description: Executes all TestSuites impacted by the specified filter. Requires @@ -14307,7 +14307,7 @@ paths: summary: Run multiple TestSuites by query tags: - TestSuites - x-internal: true + x-internal: false /api/v1/{tenant}/tests/search: get: description: Searches for tests with optional filtering by namespace and flow @@ -14391,7 +14391,7 @@ paths: summary: Search for tests tags: - TestSuites - x-internal: true + x-internal: false /api/v1/{tenant}/tests/validate: post: description: Validates a test YAML definition without persisting it. Returns @@ -14422,7 +14422,7 @@ paths: summary: Validate a test tags: - TestSuites - x-internal: true + x-internal: false /api/v1/{tenant}/tests/{namespace}/{id}: delete: description: Deletes a test by namespace and ID. Requires TEST permission with @@ -14462,7 +14462,7 @@ paths: summary: Delete a test tags: - TestSuites - x-internal: true + x-internal: false get: description: Retrieves a test by namespace and ID. Requires TEST permission with the READ action. @@ -14501,7 +14501,7 @@ paths: summary: Retrieve a test tags: - TestSuites - x-internal: true + x-internal: false put: description: Updates an existing test with a new YAML definition. Requires TEST permission with the UPDATE action. @@ -14547,7 +14547,7 @@ paths: summary: Update a test from YAML source tags: - TestSuites - x-internal: true + x-internal: false /api/v1/{tenant}/tests/{namespace}/{id}/run: post: description: Executes all test cases in the specified test. Requires TEST permission @@ -14592,7 +14592,7 @@ paths: summary: Run a full test tags: - TestSuites - x-internal: true + x-internal: false /api/v1/{tenant}/triggers: put: operationId: updateTrigger @@ -16258,6 +16258,60 @@ components: type: array type: object Assertion: + example: + isNotNull: + expression: expression + value: true + in: + expression: expression + value: + - value + - value + errorMessage: + expression: expression + value: value + equalTo: + expression: expression + value: "{}" + greaterThanOrEqualTo: + expression: expression + value: 0.8008281904610115 + description: + expression: expression + value: value + contains: + expression: expression + value: value + lessThan: + expression: expression + value: 0.8008281904610115 + isNull: + expression: expression + value: true + endsWith: + expression: expression + value: value + notIn: + expression: expression + value: + - value + - value + value: + expression: expression + value: "{}" + taskId: taskId + lessThanOrEqualTo: + expression: expression + value: 0.8008281904610115 + startsWith: + expression: expression + value: value + notEqualTo: + expression: expression + value: "{}" + greaterThan: + expression: expression + value: 0.8008281904610115 properties: value: $ref: "#/components/schemas/Property_Object_" @@ -16297,6 +16351,14 @@ components: - value type: object AssertionResult: + example: + actual: "{}" + expected: "{}" + errorMessage: errorMessage + description: description + operator: operator + taskId: taskId + isSuccess: true properties: operator: type: string @@ -16319,6 +16381,9 @@ components: - operator type: object AssertionRunError: + example: + details: details + message: message properties: message: type: string @@ -18066,6 +18131,63 @@ components: FilterExpression: type: object Fixtures: + example: + inputs: + key: "" + files: + key: files + trigger: + variables: + key: "{}" + id: id + type: type + tasks: + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value properties: inputs: additionalProperties: true @@ -23664,68 +23786,55 @@ components: - total type: object PagedResults_TestSuiteRunResult_: - properties: - results: - items: - $ref: "#/components/schemas/TestSuiteRunResult" - type: array - total: - format: int64 - type: integer - required: - - results - - total - type: object - PagedResults_TestSuite_: - properties: - results: - items: - $ref: "#/components/schemas/TestSuite" - type: array - total: - format: int64 - type: integer - required: - - results - - total - type: object - PagedResults_TriggerController.Triggers_: example: total: 0 results: - - triggerContext: - date: 2000-01-23T04:56:07.000+00:00 - workerId: workerId - nextExecutionDate: 2000-01-23T04:56:07.000+00:00 - stopAfter: - - CREATED - - CREATED - triggerId: triggerId - updatedDate: 2000-01-23T04:56:07.000+00:00 - executionId: executionId - tenantId: tenantId - namespace: namespace - backfill: "" - evaluateRunningDate: 2000-01-23T04:56:07.000+00:00 - disabled: false - flowId: flowId - abstractTrigger: - allowConcurrent: true - stopAfter: - - CREATED - - CREATED - description: description - type: type - logToFile: true - version: version - labels: - - The_labels_to_pass_to_the_execution_created_ - - The_labels_to_pass_to_the_execution_created_ - failOnTriggerError: true - assets: - expression: expression - value: - outputs: + - endDate: 2000-01-23T04:56:07.000+00:00 + namespace: namespace + id: id + testSuiteId: testSuiteId + state: ERROR + flowId: flowId + results: + - executionId: executionId + assertionResults: + - actual: "{}" + expected: "{}" + errorMessage: errorMessage + description: description + operator: operator + taskId: taskId + isSuccess: true + - actual: "{}" + expected: "{}" + errorMessage: errorMessage + description: description + operator: operator + taskId: taskId + isSuccess: true + testType: testType + testId: testId + state: null + url: https://openapi-generator.tech + errors: + - details: details + message: message + - details: details + message: message + fixtures: + inputs: + key: "" + files: + key: files + trigger: + variables: + key: "{}" + id: id + type: type + tasks: + - outputs: + key: "{}" + assets: - metadata: key: "{}" displayName: displayName @@ -23740,42 +23849,1093 @@ components: description: description id: id type: type - inputs: - - id: id + description: + expression: expression + value: value + id: id + state: null + value: value + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id type: type - - id: id + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id type: type - enableAuto: true - logLevel: null - disabled: false - id: id - workerGroup: - fallback: FAIL - key: key - conditions: - - type: type - - type: type - - triggerContext: - date: 2000-01-23T04:56:07.000+00:00 - workerId: workerId - nextExecutionDate: 2000-01-23T04:56:07.000+00:00 - stopAfter: - - CREATED - - CREATED - triggerId: triggerId - updatedDate: 2000-01-23T04:56:07.000+00:00 - executionId: executionId - tenantId: tenantId - namespace: namespace - backfill: "" - evaluateRunningDate: 2000-01-23T04:56:07.000+00:00 - disabled: false - flowId: flowId - abstractTrigger: - allowConcurrent: true - stopAfter: - - CREATED - - CREATED + description: + expression: expression + value: value + id: id + state: null + value: value + - executionId: executionId + assertionResults: + - actual: "{}" + expected: "{}" + errorMessage: errorMessage + description: description + operator: operator + taskId: taskId + isSuccess: true + - actual: "{}" + expected: "{}" + errorMessage: errorMessage + description: description + operator: operator + taskId: taskId + isSuccess: true + testType: testType + testId: testId + state: null + url: https://openapi-generator.tech + errors: + - details: details + message: message + - details: details + message: message + fixtures: + inputs: + key: "" + files: + key: files + trigger: + variables: + key: "{}" + id: id + type: type + tasks: + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + startDate: 2000-01-23T04:56:07.000+00:00 + - endDate: 2000-01-23T04:56:07.000+00:00 + namespace: namespace + id: id + testSuiteId: testSuiteId + state: ERROR + flowId: flowId + results: + - executionId: executionId + assertionResults: + - actual: "{}" + expected: "{}" + errorMessage: errorMessage + description: description + operator: operator + taskId: taskId + isSuccess: true + - actual: "{}" + expected: "{}" + errorMessage: errorMessage + description: description + operator: operator + taskId: taskId + isSuccess: true + testType: testType + testId: testId + state: null + url: https://openapi-generator.tech + errors: + - details: details + message: message + - details: details + message: message + fixtures: + inputs: + key: "" + files: + key: files + trigger: + variables: + key: "{}" + id: id + type: type + tasks: + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + - executionId: executionId + assertionResults: + - actual: "{}" + expected: "{}" + errorMessage: errorMessage + description: description + operator: operator + taskId: taskId + isSuccess: true + - actual: "{}" + expected: "{}" + errorMessage: errorMessage + description: description + operator: operator + taskId: taskId + isSuccess: true + testType: testType + testId: testId + state: null + url: https://openapi-generator.tech + errors: + - details: details + message: message + - details: details + message: message + fixtures: + inputs: + key: "" + files: + key: files + trigger: + variables: + key: "{}" + id: id + type: type + tasks: + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + startDate: 2000-01-23T04:56:07.000+00:00 + properties: + results: + items: + $ref: "#/components/schemas/TestSuiteRunResult" + type: array + total: + format: int64 + type: integer + required: + - results + - total + type: object + PagedResults_TestSuite_: + example: + total: 0 + results: + - deleted: true + testCases: + - description: description + disabled: true + id: id + assertions: + - isNotNull: + expression: expression + value: true + in: + expression: expression + value: + - value + - value + errorMessage: + expression: expression + value: value + equalTo: + expression: expression + value: "{}" + greaterThanOrEqualTo: + expression: expression + value: 0.8008281904610115 + description: + expression: expression + value: value + contains: + expression: expression + value: value + lessThan: + expression: expression + value: 0.8008281904610115 + isNull: + expression: expression + value: true + endsWith: + expression: expression + value: value + notIn: + expression: expression + value: + - value + - value + value: + expression: expression + value: "{}" + taskId: taskId + lessThanOrEqualTo: + expression: expression + value: 0.8008281904610115 + startsWith: + expression: expression + value: value + notEqualTo: + expression: expression + value: "{}" + greaterThan: + expression: expression + value: 0.8008281904610115 + - isNotNull: + expression: expression + value: true + in: + expression: expression + value: + - value + - value + errorMessage: + expression: expression + value: value + equalTo: + expression: expression + value: "{}" + greaterThanOrEqualTo: + expression: expression + value: 0.8008281904610115 + description: + expression: expression + value: value + contains: + expression: expression + value: value + lessThan: + expression: expression + value: 0.8008281904610115 + isNull: + expression: expression + value: true + endsWith: + expression: expression + value: value + notIn: + expression: expression + value: + - value + - value + value: + expression: expression + value: "{}" + taskId: taskId + lessThanOrEqualTo: + expression: expression + value: 0.8008281904610115 + startsWith: + expression: expression + value: value + notEqualTo: + expression: expression + value: "{}" + greaterThan: + expression: expression + value: 0.8008281904610115 + type: type + fixtures: + inputs: + key: "" + files: + key: files + trigger: + variables: + key: "{}" + id: id + type: type + tasks: + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + - description: description + disabled: true + id: id + assertions: + - isNotNull: + expression: expression + value: true + in: + expression: expression + value: + - value + - value + errorMessage: + expression: expression + value: value + equalTo: + expression: expression + value: "{}" + greaterThanOrEqualTo: + expression: expression + value: 0.8008281904610115 + description: + expression: expression + value: value + contains: + expression: expression + value: value + lessThan: + expression: expression + value: 0.8008281904610115 + isNull: + expression: expression + value: true + endsWith: + expression: expression + value: value + notIn: + expression: expression + value: + - value + - value + value: + expression: expression + value: "{}" + taskId: taskId + lessThanOrEqualTo: + expression: expression + value: 0.8008281904610115 + startsWith: + expression: expression + value: value + notEqualTo: + expression: expression + value: "{}" + greaterThan: + expression: expression + value: 0.8008281904610115 + - isNotNull: + expression: expression + value: true + in: + expression: expression + value: + - value + - value + errorMessage: + expression: expression + value: value + equalTo: + expression: expression + value: "{}" + greaterThanOrEqualTo: + expression: expression + value: 0.8008281904610115 + description: + expression: expression + value: value + contains: + expression: expression + value: value + lessThan: + expression: expression + value: 0.8008281904610115 + isNull: + expression: expression + value: true + endsWith: + expression: expression + value: value + notIn: + expression: expression + value: + - value + - value + value: + expression: expression + value: "{}" + taskId: taskId + lessThanOrEqualTo: + expression: expression + value: 0.8008281904610115 + startsWith: + expression: expression + value: value + notEqualTo: + expression: expression + value: "{}" + greaterThan: + expression: expression + value: 0.8008281904610115 + type: type + fixtures: + inputs: + key: "" + files: + key: files + trigger: + variables: + key: "{}" + id: id + type: type + tasks: + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + namespace: namespace + description: description + disabled: true + id: id + source: source + flowId: flowId + - deleted: true + testCases: + - description: description + disabled: true + id: id + assertions: + - isNotNull: + expression: expression + value: true + in: + expression: expression + value: + - value + - value + errorMessage: + expression: expression + value: value + equalTo: + expression: expression + value: "{}" + greaterThanOrEqualTo: + expression: expression + value: 0.8008281904610115 + description: + expression: expression + value: value + contains: + expression: expression + value: value + lessThan: + expression: expression + value: 0.8008281904610115 + isNull: + expression: expression + value: true + endsWith: + expression: expression + value: value + notIn: + expression: expression + value: + - value + - value + value: + expression: expression + value: "{}" + taskId: taskId + lessThanOrEqualTo: + expression: expression + value: 0.8008281904610115 + startsWith: + expression: expression + value: value + notEqualTo: + expression: expression + value: "{}" + greaterThan: + expression: expression + value: 0.8008281904610115 + - isNotNull: + expression: expression + value: true + in: + expression: expression + value: + - value + - value + errorMessage: + expression: expression + value: value + equalTo: + expression: expression + value: "{}" + greaterThanOrEqualTo: + expression: expression + value: 0.8008281904610115 + description: + expression: expression + value: value + contains: + expression: expression + value: value + lessThan: + expression: expression + value: 0.8008281904610115 + isNull: + expression: expression + value: true + endsWith: + expression: expression + value: value + notIn: + expression: expression + value: + - value + - value + value: + expression: expression + value: "{}" + taskId: taskId + lessThanOrEqualTo: + expression: expression + value: 0.8008281904610115 + startsWith: + expression: expression + value: value + notEqualTo: + expression: expression + value: "{}" + greaterThan: + expression: expression + value: 0.8008281904610115 + type: type + fixtures: + inputs: + key: "" + files: + key: files + trigger: + variables: + key: "{}" + id: id + type: type + tasks: + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + - description: description + disabled: true + id: id + assertions: + - isNotNull: + expression: expression + value: true + in: + expression: expression + value: + - value + - value + errorMessage: + expression: expression + value: value + equalTo: + expression: expression + value: "{}" + greaterThanOrEqualTo: + expression: expression + value: 0.8008281904610115 + description: + expression: expression + value: value + contains: + expression: expression + value: value + lessThan: + expression: expression + value: 0.8008281904610115 + isNull: + expression: expression + value: true + endsWith: + expression: expression + value: value + notIn: + expression: expression + value: + - value + - value + value: + expression: expression + value: "{}" + taskId: taskId + lessThanOrEqualTo: + expression: expression + value: 0.8008281904610115 + startsWith: + expression: expression + value: value + notEqualTo: + expression: expression + value: "{}" + greaterThan: + expression: expression + value: 0.8008281904610115 + - isNotNull: + expression: expression + value: true + in: + expression: expression + value: + - value + - value + errorMessage: + expression: expression + value: value + equalTo: + expression: expression + value: "{}" + greaterThanOrEqualTo: + expression: expression + value: 0.8008281904610115 + description: + expression: expression + value: value + contains: + expression: expression + value: value + lessThan: + expression: expression + value: 0.8008281904610115 + isNull: + expression: expression + value: true + endsWith: + expression: expression + value: value + notIn: + expression: expression + value: + - value + - value + value: + expression: expression + value: "{}" + taskId: taskId + lessThanOrEqualTo: + expression: expression + value: 0.8008281904610115 + startsWith: + expression: expression + value: value + notEqualTo: + expression: expression + value: "{}" + greaterThan: + expression: expression + value: 0.8008281904610115 + type: type + fixtures: + inputs: + key: "" + files: + key: files + trigger: + variables: + key: "{}" + id: id + type: type + tasks: + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + namespace: namespace + description: description + disabled: true + id: id + source: source + flowId: flowId + properties: + results: + items: + $ref: "#/components/schemas/TestSuite" + type: array + total: + format: int64 + type: integer + required: + - results + - total + type: object + PagedResults_TriggerController.Triggers_: + example: + total: 0 + results: + - triggerContext: + date: 2000-01-23T04:56:07.000+00:00 + workerId: workerId + nextExecutionDate: 2000-01-23T04:56:07.000+00:00 + stopAfter: + - CREATED + - CREATED + triggerId: triggerId + updatedDate: 2000-01-23T04:56:07.000+00:00 + executionId: executionId + tenantId: tenantId + namespace: namespace + backfill: "" + evaluateRunningDate: 2000-01-23T04:56:07.000+00:00 + disabled: false + flowId: flowId + abstractTrigger: + allowConcurrent: true + stopAfter: + - CREATED + - CREATED + description: description + type: type + logToFile: true + version: version + labels: + - The_labels_to_pass_to_the_execution_created_ + - The_labels_to_pass_to_the_execution_created_ + failOnTriggerError: true + assets: + expression: expression + value: + outputs: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + inputs: + - id: id + type: type + - id: id + type: type + enableAuto: true + logLevel: null + disabled: false + id: id + workerGroup: + fallback: FAIL + key: key + conditions: + - type: type + - type: type + - triggerContext: + date: 2000-01-23T04:56:07.000+00:00 + workerId: workerId + nextExecutionDate: 2000-01-23T04:56:07.000+00:00 + stopAfter: + - CREATED + - CREATED + triggerId: triggerId + updatedDate: 2000-01-23T04:56:07.000+00:00 + executionId: executionId + tenantId: tenantId + namespace: namespace + backfill: "" + evaluateRunningDate: 2000-01-23T04:56:07.000+00:00 + disabled: false + flowId: flowId + abstractTrigger: + allowConcurrent: true + stopAfter: + - CREATED + - CREATED description: description type: type logToFile: true @@ -24168,6 +25328,9 @@ components: $ref: "#/components/schemas/AssetsDeclaration" type: object Property_Boolean_: + example: + expression: expression + value: true oneOf: - type: object - type: string @@ -24178,6 +25341,9 @@ components: type: boolean type: object Property_Double_: + example: + expression: expression + value: 0.8008281904610115 oneOf: - type: object - type: string @@ -24202,6 +25368,11 @@ components: type: string type: object Property_List_String__: + example: + expression: expression + value: + - value + - value oneOf: - type: object - type: string @@ -24214,6 +25385,9 @@ components: type: array type: object Property_Object_: + example: + expression: expression + value: "{}" oneOf: - type: object - type: string @@ -25809,6 +26983,351 @@ components: - SKIPPED type: string TestSuite: + example: + deleted: true + testCases: + - description: description + disabled: true + id: id + assertions: + - isNotNull: + expression: expression + value: true + in: + expression: expression + value: + - value + - value + errorMessage: + expression: expression + value: value + equalTo: + expression: expression + value: "{}" + greaterThanOrEqualTo: + expression: expression + value: 0.8008281904610115 + description: + expression: expression + value: value + contains: + expression: expression + value: value + lessThan: + expression: expression + value: 0.8008281904610115 + isNull: + expression: expression + value: true + endsWith: + expression: expression + value: value + notIn: + expression: expression + value: + - value + - value + value: + expression: expression + value: "{}" + taskId: taskId + lessThanOrEqualTo: + expression: expression + value: 0.8008281904610115 + startsWith: + expression: expression + value: value + notEqualTo: + expression: expression + value: "{}" + greaterThan: + expression: expression + value: 0.8008281904610115 + - isNotNull: + expression: expression + value: true + in: + expression: expression + value: + - value + - value + errorMessage: + expression: expression + value: value + equalTo: + expression: expression + value: "{}" + greaterThanOrEqualTo: + expression: expression + value: 0.8008281904610115 + description: + expression: expression + value: value + contains: + expression: expression + value: value + lessThan: + expression: expression + value: 0.8008281904610115 + isNull: + expression: expression + value: true + endsWith: + expression: expression + value: value + notIn: + expression: expression + value: + - value + - value + value: + expression: expression + value: "{}" + taskId: taskId + lessThanOrEqualTo: + expression: expression + value: 0.8008281904610115 + startsWith: + expression: expression + value: value + notEqualTo: + expression: expression + value: "{}" + greaterThan: + expression: expression + value: 0.8008281904610115 + type: type + fixtures: + inputs: + key: "" + files: + key: files + trigger: + variables: + key: "{}" + id: id + type: type + tasks: + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + - description: description + disabled: true + id: id + assertions: + - isNotNull: + expression: expression + value: true + in: + expression: expression + value: + - value + - value + errorMessage: + expression: expression + value: value + equalTo: + expression: expression + value: "{}" + greaterThanOrEqualTo: + expression: expression + value: 0.8008281904610115 + description: + expression: expression + value: value + contains: + expression: expression + value: value + lessThan: + expression: expression + value: 0.8008281904610115 + isNull: + expression: expression + value: true + endsWith: + expression: expression + value: value + notIn: + expression: expression + value: + - value + - value + value: + expression: expression + value: "{}" + taskId: taskId + lessThanOrEqualTo: + expression: expression + value: 0.8008281904610115 + startsWith: + expression: expression + value: value + notEqualTo: + expression: expression + value: "{}" + greaterThan: + expression: expression + value: 0.8008281904610115 + - isNotNull: + expression: expression + value: true + in: + expression: expression + value: + - value + - value + errorMessage: + expression: expression + value: value + equalTo: + expression: expression + value: "{}" + greaterThanOrEqualTo: + expression: expression + value: 0.8008281904610115 + description: + expression: expression + value: value + contains: + expression: expression + value: value + lessThan: + expression: expression + value: 0.8008281904610115 + isNull: + expression: expression + value: true + endsWith: + expression: expression + value: value + notIn: + expression: expression + value: + - value + - value + value: + expression: expression + value: "{}" + taskId: taskId + lessThanOrEqualTo: + expression: expression + value: 0.8008281904610115 + startsWith: + expression: expression + value: value + notEqualTo: + expression: expression + value: "{}" + greaterThan: + expression: expression + value: 0.8008281904610115 + type: type + fixtures: + inputs: + key: "" + files: + key: files + trigger: + variables: + key: "{}" + id: id + type: type + tasks: + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + namespace: namespace + description: description + disabled: true + id: id + source: source + flowId: flowId properties: id: minLength: 1 @@ -25880,13 +27399,532 @@ components: - ids type: object TestSuiteController.TestsLastResultResponse: + example: + results: + - endDate: 2000-01-23T04:56:07.000+00:00 + namespace: namespace + id: id + testSuiteId: testSuiteId + state: ERROR + flowId: flowId + results: + - executionId: executionId + assertionResults: + - actual: "{}" + expected: "{}" + errorMessage: errorMessage + description: description + operator: operator + taskId: taskId + isSuccess: true + - actual: "{}" + expected: "{}" + errorMessage: errorMessage + description: description + operator: operator + taskId: taskId + isSuccess: true + testType: testType + testId: testId + state: null + url: https://openapi-generator.tech + errors: + - details: details + message: message + - details: details + message: message + fixtures: + inputs: + key: "" + files: + key: files + trigger: + variables: + key: "{}" + id: id + type: type + tasks: + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + - executionId: executionId + assertionResults: + - actual: "{}" + expected: "{}" + errorMessage: errorMessage + description: description + operator: operator + taskId: taskId + isSuccess: true + - actual: "{}" + expected: "{}" + errorMessage: errorMessage + description: description + operator: operator + taskId: taskId + isSuccess: true + testType: testType + testId: testId + state: null + url: https://openapi-generator.tech + errors: + - details: details + message: message + - details: details + message: message + fixtures: + inputs: + key: "" + files: + key: files + trigger: + variables: + key: "{}" + id: id + type: type + tasks: + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + startDate: 2000-01-23T04:56:07.000+00:00 + - endDate: 2000-01-23T04:56:07.000+00:00 + namespace: namespace + id: id + testSuiteId: testSuiteId + state: ERROR + flowId: flowId + results: + - executionId: executionId + assertionResults: + - actual: "{}" + expected: "{}" + errorMessage: errorMessage + description: description + operator: operator + taskId: taskId + isSuccess: true + - actual: "{}" + expected: "{}" + errorMessage: errorMessage + description: description + operator: operator + taskId: taskId + isSuccess: true + testType: testType + testId: testId + state: null + url: https://openapi-generator.tech + errors: + - details: details + message: message + - details: details + message: message + fixtures: + inputs: + key: "" + files: + key: files + trigger: + variables: + key: "{}" + id: id + type: type + tasks: + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + - executionId: executionId + assertionResults: + - actual: "{}" + expected: "{}" + errorMessage: errorMessage + description: description + operator: operator + taskId: taskId + isSuccess: true + - actual: "{}" + expected: "{}" + errorMessage: errorMessage + description: description + operator: operator + taskId: taskId + isSuccess: true + testType: testType + testId: testId + state: null + url: https://openapi-generator.tech + errors: + - details: details + message: message + - details: details + message: message + fixtures: + inputs: + key: "" + files: + key: files + trigger: + variables: + key: "{}" + id: id + type: type + tasks: + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + startDate: 2000-01-23T04:56:07.000+00:00 properties: results: - items: - $ref: "#/components/schemas/TestSuiteRunResult" - type: array - type: object - TestSuiteRunResult: + items: + $ref: "#/components/schemas/TestSuiteRunResult" + type: array + type: object + TestSuiteRunResult: + example: + endDate: 2000-01-23T04:56:07.000+00:00 + namespace: namespace + id: id + testSuiteId: testSuiteId + state: ERROR + flowId: flowId + results: + - executionId: executionId + assertionResults: + - actual: "{}" + expected: "{}" + errorMessage: errorMessage + description: description + operator: operator + taskId: taskId + isSuccess: true + - actual: "{}" + expected: "{}" + errorMessage: errorMessage + description: description + operator: operator + taskId: taskId + isSuccess: true + testType: testType + testId: testId + state: null + url: https://openapi-generator.tech + errors: + - details: details + message: message + - details: details + message: message + fixtures: + inputs: + key: "" + files: + key: files + trigger: + variables: + key: "{}" + id: id + type: type + tasks: + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + - executionId: executionId + assertionResults: + - actual: "{}" + expected: "{}" + errorMessage: errorMessage + description: description + operator: operator + taskId: taskId + isSuccess: true + - actual: "{}" + expected: "{}" + errorMessage: errorMessage + description: description + operator: operator + taskId: taskId + isSuccess: true + testType: testType + testId: testId + state: null + url: https://openapi-generator.tech + errors: + - details: details + message: message + - details: details + message: message + fixtures: + inputs: + key: "" + files: + key: files + trigger: + variables: + key: "{}" + id: id + type: type + tasks: + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + startDate: 2000-01-23T04:56:07.000+00:00 properties: id: type: string @@ -25918,6 +27956,10 @@ components: - testSuiteId type: object TestSuiteService.RunByQueryRequest: + example: + namespace: namespace + flowId: flowId + includeChildNamespaces: true properties: namespace: nullable: true @@ -25933,6 +27975,359 @@ components: - includeChildNamespaces type: object TestSuiteService.TestRunByQueryResult: + example: + tenantId: tenantId + numberOfTestSuitesToBeRun: 0 + numberOfTestCasesToBeRun: 6 + requestMade: + namespace: namespace + flowId: flowId + includeChildNamespaces: true + results: + - endDate: 2000-01-23T04:56:07.000+00:00 + namespace: namespace + id: id + testSuiteId: testSuiteId + state: ERROR + flowId: flowId + results: + - executionId: executionId + assertionResults: + - actual: "{}" + expected: "{}" + errorMessage: errorMessage + description: description + operator: operator + taskId: taskId + isSuccess: true + - actual: "{}" + expected: "{}" + errorMessage: errorMessage + description: description + operator: operator + taskId: taskId + isSuccess: true + testType: testType + testId: testId + state: null + url: https://openapi-generator.tech + errors: + - details: details + message: message + - details: details + message: message + fixtures: + inputs: + key: "" + files: + key: files + trigger: + variables: + key: "{}" + id: id + type: type + tasks: + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + - executionId: executionId + assertionResults: + - actual: "{}" + expected: "{}" + errorMessage: errorMessage + description: description + operator: operator + taskId: taskId + isSuccess: true + - actual: "{}" + expected: "{}" + errorMessage: errorMessage + description: description + operator: operator + taskId: taskId + isSuccess: true + testType: testType + testId: testId + state: null + url: https://openapi-generator.tech + errors: + - details: details + message: message + - details: details + message: message + fixtures: + inputs: + key: "" + files: + key: files + trigger: + variables: + key: "{}" + id: id + type: type + tasks: + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + startDate: 2000-01-23T04:56:07.000+00:00 + - endDate: 2000-01-23T04:56:07.000+00:00 + namespace: namespace + id: id + testSuiteId: testSuiteId + state: ERROR + flowId: flowId + results: + - executionId: executionId + assertionResults: + - actual: "{}" + expected: "{}" + errorMessage: errorMessage + description: description + operator: operator + taskId: taskId + isSuccess: true + - actual: "{}" + expected: "{}" + errorMessage: errorMessage + description: description + operator: operator + taskId: taskId + isSuccess: true + testType: testType + testId: testId + state: null + url: https://openapi-generator.tech + errors: + - details: details + message: message + - details: details + message: message + fixtures: + inputs: + key: "" + files: + key: files + trigger: + variables: + key: "{}" + id: id + type: type + tasks: + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + - executionId: executionId + assertionResults: + - actual: "{}" + expected: "{}" + errorMessage: errorMessage + description: description + operator: operator + taskId: taskId + isSuccess: true + - actual: "{}" + expected: "{}" + errorMessage: errorMessage + description: description + operator: operator + taskId: taskId + isSuccess: true + testType: testType + testId: testId + state: null + url: https://openapi-generator.tech + errors: + - details: details + message: message + - details: details + message: message + fixtures: + inputs: + key: "" + files: + key: files + trigger: + variables: + key: "{}" + id: id + type: type + tasks: + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + startDate: 2000-01-23T04:56:07.000+00:00 properties: requestMade: $ref: "#/components/schemas/TestSuiteService.RunByQueryRequest" @@ -26112,6 +28507,11 @@ components: $ref: "#/components/schemas/Trigger" type: object TriggerFixture: + example: + variables: + key: "{}" + id: id + type: type properties: id: type: string @@ -26148,6 +28548,175 @@ components: - EMAIL type: string UnitTest: + example: + description: description + disabled: true + id: id + assertions: + - isNotNull: + expression: expression + value: true + in: + expression: expression + value: + - value + - value + errorMessage: + expression: expression + value: value + equalTo: + expression: expression + value: "{}" + greaterThanOrEqualTo: + expression: expression + value: 0.8008281904610115 + description: + expression: expression + value: value + contains: + expression: expression + value: value + lessThan: + expression: expression + value: 0.8008281904610115 + isNull: + expression: expression + value: true + endsWith: + expression: expression + value: value + notIn: + expression: expression + value: + - value + - value + value: + expression: expression + value: "{}" + taskId: taskId + lessThanOrEqualTo: + expression: expression + value: 0.8008281904610115 + startsWith: + expression: expression + value: value + notEqualTo: + expression: expression + value: "{}" + greaterThan: + expression: expression + value: 0.8008281904610115 + - isNotNull: + expression: expression + value: true + in: + expression: expression + value: + - value + - value + errorMessage: + expression: expression + value: value + equalTo: + expression: expression + value: "{}" + greaterThanOrEqualTo: + expression: expression + value: 0.8008281904610115 + description: + expression: expression + value: value + contains: + expression: expression + value: value + lessThan: + expression: expression + value: 0.8008281904610115 + isNull: + expression: expression + value: true + endsWith: + expression: expression + value: value + notIn: + expression: expression + value: + - value + - value + value: + expression: expression + value: "{}" + taskId: taskId + lessThanOrEqualTo: + expression: expression + value: 0.8008281904610115 + startsWith: + expression: expression + value: value + notEqualTo: + expression: expression + value: "{}" + greaterThan: + expression: expression + value: 0.8008281904610115 + type: type + fixtures: + inputs: + key: "" + files: + key: files + trigger: + variables: + key: "{}" + id: id + type: type + tasks: + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value properties: id: type: string @@ -26169,6 +28738,89 @@ components: - type type: object UnitTestResult: + example: + executionId: executionId + assertionResults: + - actual: "{}" + expected: "{}" + errorMessage: errorMessage + description: description + operator: operator + taskId: taskId + isSuccess: true + - actual: "{}" + expected: "{}" + errorMessage: errorMessage + description: description + operator: operator + taskId: taskId + isSuccess: true + testType: testType + testId: testId + state: null + url: https://openapi-generator.tech + errors: + - details: details + message: message + - details: details + message: message + fixtures: + inputs: + key: "" + files: + key: files + trigger: + variables: + key: "{}" + id: id + type: type + tasks: + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value + - outputs: + key: "{}" + assets: + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + - metadata: + key: "{}" + displayName: displayName + namespace: namespace + description: description + id: id + type: type + description: + expression: expression + value: value + id: id + state: null + value: value properties: testId: type: string diff --git a/go/go-sdk/api_test_suites.go b/go/go-sdk/api_test_suites.go new file mode 100644 index 000000000..93892855b --- /dev/null +++ b/go/go-sdk/api_test_suites.go @@ -0,0 +1,1901 @@ +/* +Kestra EE + +All API operations, except for Superadmin-only endpoints, require a tenant identifier in the HTTP path.
Endpoints designated as Superadmin-only are not tenant-scoped. + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package kestra_api_client + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// TestSuitesAPIService TestSuitesAPI service +type TestSuitesAPIService service + +type ApiCreateTestSuiteRequest struct { + ctx context.Context + ApiService *TestSuitesAPIService + tenant string + body *string +} + +// The TestSuite source code +func (r ApiCreateTestSuiteRequest) Body(body string) ApiCreateTestSuiteRequest { + r.body = &body + return r +} + +func (r ApiCreateTestSuiteRequest) GetTenant() string { + return r.tenant +} +func (r ApiCreateTestSuiteRequest) GetBody() *string { + return r.body +} + +func (r ApiCreateTestSuiteRequest) Execute() (*TestSuite, *http.Response, error) { + return r.ApiService.CreateTestSuiteExecute(r) +} + +/* +CreateTestSuite Create a test from YAML source + +Creates a new test from a YAML definition. Requires TEST permission with the CREATE action. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param tenant + @return ApiCreateTestSuiteRequest +*/ +func (a *TestSuitesAPIService) CreateTestSuite(ctx context.Context, tenant string) ApiCreateTestSuiteRequest { + return ApiCreateTestSuiteRequest{ + ApiService: a, + ctx: ctx, + tenant: tenant, + } +} + +// Execute executes the request +// +// @return TestSuite +func (a *TestSuitesAPIService) CreateTestSuiteExecute(r ApiCreateTestSuiteRequest) (*TestSuite, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TestSuite + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TestSuitesAPIService.CreateTestSuite") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/{tenant}/tests" + localVarPath = strings.Replace(localVarPath, "{"+"tenant"+"}", url.PathEscape(parameterValueToString(r.tenant, "tenant")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/x-yaml"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteTestSuiteRequest struct { + ctx context.Context + ApiService *TestSuitesAPIService + namespace string + id string + tenant string +} + +func (r ApiDeleteTestSuiteRequest) GetNamespace() string { + return r.namespace +} +func (r ApiDeleteTestSuiteRequest) GetId() string { + return r.id +} +func (r ApiDeleteTestSuiteRequest) GetTenant() string { + return r.tenant +} + +func (r ApiDeleteTestSuiteRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.DeleteTestSuiteExecute(r) +} + +/* +DeleteTestSuite Delete a test + +Deletes a test by namespace and ID. Requires TEST permission with the DELETE action. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param namespace The TestSuite namespace + @param id The TestSuite ID + @param tenant + @return ApiDeleteTestSuiteRequest +*/ +func (a *TestSuitesAPIService) DeleteTestSuite(ctx context.Context, namespace string, id string, tenant string) ApiDeleteTestSuiteRequest { + return ApiDeleteTestSuiteRequest{ + ApiService: a, + ctx: ctx, + namespace: namespace, + id: id, + tenant: tenant, + } +} + +// Execute executes the request +// +// @return map[string]interface{} +func (a *TestSuitesAPIService) DeleteTestSuiteExecute(r ApiDeleteTestSuiteRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TestSuitesAPIService.DeleteTestSuite") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/{tenant}/tests/{namespace}/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"namespace"+"}", url.PathEscape(parameterValueToString(r.namespace, "namespace")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"tenant"+"}", url.PathEscape(parameterValueToString(r.tenant, "tenant")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteTestSuitesByIdsRequest struct { + ctx context.Context + ApiService *TestSuitesAPIService + tenant string + testSuiteControllerTestSuiteBulkRequest *TestSuiteControllerTestSuiteBulkRequest +} + +func (r ApiDeleteTestSuitesByIdsRequest) TestSuiteControllerTestSuiteBulkRequest(testSuiteControllerTestSuiteBulkRequest TestSuiteControllerTestSuiteBulkRequest) ApiDeleteTestSuitesByIdsRequest { + r.testSuiteControllerTestSuiteBulkRequest = &testSuiteControllerTestSuiteBulkRequest + return r +} + +func (r ApiDeleteTestSuitesByIdsRequest) GetTenant() string { + return r.tenant +} +func (r ApiDeleteTestSuitesByIdsRequest) GetTestSuiteControllerTestSuiteBulkRequest() *TestSuiteControllerTestSuiteBulkRequest { + return r.testSuiteControllerTestSuiteBulkRequest +} + +func (r ApiDeleteTestSuitesByIdsRequest) Execute() (*BulkResponse, *http.Response, error) { + return r.ApiService.DeleteTestSuitesByIdsExecute(r) +} + +/* +DeleteTestSuitesByIds Delete multiple tests by id + +Deletes a test by namespace and ID. Requires TEST permission with the DELETE action. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param tenant + @return ApiDeleteTestSuitesByIdsRequest +*/ +func (a *TestSuitesAPIService) DeleteTestSuitesByIds(ctx context.Context, tenant string) ApiDeleteTestSuitesByIdsRequest { + return ApiDeleteTestSuitesByIdsRequest{ + ApiService: a, + ctx: ctx, + tenant: tenant, + } +} + +// Execute executes the request +// +// @return BulkResponse +func (a *TestSuitesAPIService) DeleteTestSuitesByIdsExecute(r ApiDeleteTestSuitesByIdsRequest) (*BulkResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BulkResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TestSuitesAPIService.DeleteTestSuitesByIds") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/{tenant}/tests/by-ids" + localVarPath = strings.Replace(localVarPath, "{"+"tenant"+"}", url.PathEscape(parameterValueToString(r.tenant, "tenant")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.testSuiteControllerTestSuiteBulkRequest == nil { + return localVarReturnValue, nil, reportError("testSuiteControllerTestSuiteBulkRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.testSuiteControllerTestSuiteBulkRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDisableTestSuitesByIdsRequest struct { + ctx context.Context + ApiService *TestSuitesAPIService + tenant string + testSuiteControllerTestSuiteBulkRequest *TestSuiteControllerTestSuiteBulkRequest +} + +func (r ApiDisableTestSuitesByIdsRequest) TestSuiteControllerTestSuiteBulkRequest(testSuiteControllerTestSuiteBulkRequest TestSuiteControllerTestSuiteBulkRequest) ApiDisableTestSuitesByIdsRequest { + r.testSuiteControllerTestSuiteBulkRequest = &testSuiteControllerTestSuiteBulkRequest + return r +} + +func (r ApiDisableTestSuitesByIdsRequest) GetTenant() string { + return r.tenant +} +func (r ApiDisableTestSuitesByIdsRequest) GetTestSuiteControllerTestSuiteBulkRequest() *TestSuiteControllerTestSuiteBulkRequest { + return r.testSuiteControllerTestSuiteBulkRequest +} + +func (r ApiDisableTestSuitesByIdsRequest) Execute() (*BulkResponse, *http.Response, error) { + return r.ApiService.DisableTestSuitesByIdsExecute(r) +} + +/* +DisableTestSuitesByIds Disable multiple tests by id + +Disable a test by namespace and ID. Requires TEST permission with the UPDATE action. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param tenant + @return ApiDisableTestSuitesByIdsRequest +*/ +func (a *TestSuitesAPIService) DisableTestSuitesByIds(ctx context.Context, tenant string) ApiDisableTestSuitesByIdsRequest { + return ApiDisableTestSuitesByIdsRequest{ + ApiService: a, + ctx: ctx, + tenant: tenant, + } +} + +// Execute executes the request +// +// @return BulkResponse +func (a *TestSuitesAPIService) DisableTestSuitesByIdsExecute(r ApiDisableTestSuitesByIdsRequest) (*BulkResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BulkResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TestSuitesAPIService.DisableTestSuitesByIds") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/{tenant}/tests/disable/by-ids" + localVarPath = strings.Replace(localVarPath, "{"+"tenant"+"}", url.PathEscape(parameterValueToString(r.tenant, "tenant")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.testSuiteControllerTestSuiteBulkRequest == nil { + return localVarReturnValue, nil, reportError("testSuiteControllerTestSuiteBulkRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.testSuiteControllerTestSuiteBulkRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEnableTestSuitesByIdsRequest struct { + ctx context.Context + ApiService *TestSuitesAPIService + tenant string + testSuiteControllerTestSuiteBulkRequest *TestSuiteControllerTestSuiteBulkRequest +} + +func (r ApiEnableTestSuitesByIdsRequest) TestSuiteControllerTestSuiteBulkRequest(testSuiteControllerTestSuiteBulkRequest TestSuiteControllerTestSuiteBulkRequest) ApiEnableTestSuitesByIdsRequest { + r.testSuiteControllerTestSuiteBulkRequest = &testSuiteControllerTestSuiteBulkRequest + return r +} + +func (r ApiEnableTestSuitesByIdsRequest) GetTenant() string { + return r.tenant +} +func (r ApiEnableTestSuitesByIdsRequest) GetTestSuiteControllerTestSuiteBulkRequest() *TestSuiteControllerTestSuiteBulkRequest { + return r.testSuiteControllerTestSuiteBulkRequest +} + +func (r ApiEnableTestSuitesByIdsRequest) Execute() (*BulkResponse, *http.Response, error) { + return r.ApiService.EnableTestSuitesByIdsExecute(r) +} + +/* +EnableTestSuitesByIds Enable multiple tests by id + +Enable a test by namespace and ID. Requires TEST permission with the UPDATE action. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param tenant + @return ApiEnableTestSuitesByIdsRequest +*/ +func (a *TestSuitesAPIService) EnableTestSuitesByIds(ctx context.Context, tenant string) ApiEnableTestSuitesByIdsRequest { + return ApiEnableTestSuitesByIdsRequest{ + ApiService: a, + ctx: ctx, + tenant: tenant, + } +} + +// Execute executes the request +// +// @return BulkResponse +func (a *TestSuitesAPIService) EnableTestSuitesByIdsExecute(r ApiEnableTestSuitesByIdsRequest) (*BulkResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BulkResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TestSuitesAPIService.EnableTestSuitesByIds") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/{tenant}/tests/enable/by-ids" + localVarPath = strings.Replace(localVarPath, "{"+"tenant"+"}", url.PathEscape(parameterValueToString(r.tenant, "tenant")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.testSuiteControllerTestSuiteBulkRequest == nil { + return localVarReturnValue, nil, reportError("testSuiteControllerTestSuiteBulkRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.testSuiteControllerTestSuiteBulkRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRunTestSuiteRequest struct { + ctx context.Context + ApiService *TestSuitesAPIService + namespace string + id string + tenant string + testSuiteControllerRunRequest *TestSuiteControllerRunRequest +} + +func (r ApiRunTestSuiteRequest) TestSuiteControllerRunRequest(testSuiteControllerRunRequest TestSuiteControllerRunRequest) ApiRunTestSuiteRequest { + r.testSuiteControllerRunRequest = &testSuiteControllerRunRequest + return r +} + +func (r ApiRunTestSuiteRequest) GetNamespace() string { + return r.namespace +} +func (r ApiRunTestSuiteRequest) GetId() string { + return r.id +} +func (r ApiRunTestSuiteRequest) GetTenant() string { + return r.tenant +} +func (r ApiRunTestSuiteRequest) GetTestSuiteControllerRunRequest() *TestSuiteControllerRunRequest { + return r.testSuiteControllerRunRequest +} + +func (r ApiRunTestSuiteRequest) Execute() (*TestSuiteRunResult, *http.Response, error) { + return r.ApiService.RunTestSuiteExecute(r) +} + +/* +RunTestSuite Run a full test + +Executes all test cases in the specified test. Requires TEST permission with the CREATE action. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param namespace The TestSuite namespace + @param id The TestSuite ID + @param tenant + @return ApiRunTestSuiteRequest +*/ +func (a *TestSuitesAPIService) RunTestSuite(ctx context.Context, namespace string, id string, tenant string) ApiRunTestSuiteRequest { + return ApiRunTestSuiteRequest{ + ApiService: a, + ctx: ctx, + namespace: namespace, + id: id, + tenant: tenant, + } +} + +// Execute executes the request +// +// @return TestSuiteRunResult +func (a *TestSuitesAPIService) RunTestSuiteExecute(r ApiRunTestSuiteRequest) (*TestSuiteRunResult, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TestSuiteRunResult + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TestSuitesAPIService.RunTestSuite") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/{tenant}/tests/{namespace}/{id}/run" + localVarPath = strings.Replace(localVarPath, "{"+"namespace"+"}", url.PathEscape(parameterValueToString(r.namespace, "namespace")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"tenant"+"}", url.PathEscape(parameterValueToString(r.tenant, "tenant")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.testSuiteControllerRunRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRunTestSuitesByQueryRequest struct { + ctx context.Context + ApiService *TestSuitesAPIService + tenant string + testSuiteServiceRunByQueryRequest *TestSuiteServiceRunByQueryRequest +} + +func (r ApiRunTestSuitesByQueryRequest) TestSuiteServiceRunByQueryRequest(testSuiteServiceRunByQueryRequest TestSuiteServiceRunByQueryRequest) ApiRunTestSuitesByQueryRequest { + r.testSuiteServiceRunByQueryRequest = &testSuiteServiceRunByQueryRequest + return r +} + +func (r ApiRunTestSuitesByQueryRequest) GetTenant() string { + return r.tenant +} +func (r ApiRunTestSuitesByQueryRequest) GetTestSuiteServiceRunByQueryRequest() *TestSuiteServiceRunByQueryRequest { + return r.testSuiteServiceRunByQueryRequest +} + +func (r ApiRunTestSuitesByQueryRequest) Execute() (*TestSuiteServiceTestRunByQueryResult, *http.Response, error) { + return r.ApiService.RunTestSuitesByQueryExecute(r) +} + +/* +RunTestSuitesByQuery Run multiple TestSuites by query + +Executes all TestSuites impacted by the specified filter. Requires TEST permission with the CREATE action. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param tenant + @return ApiRunTestSuitesByQueryRequest +*/ +func (a *TestSuitesAPIService) RunTestSuitesByQuery(ctx context.Context, tenant string) ApiRunTestSuitesByQueryRequest { + return ApiRunTestSuitesByQueryRequest{ + ApiService: a, + ctx: ctx, + tenant: tenant, + } +} + +// Execute executes the request +// +// @return TestSuiteServiceTestRunByQueryResult +func (a *TestSuitesAPIService) RunTestSuitesByQueryExecute(r ApiRunTestSuitesByQueryRequest) (*TestSuiteServiceTestRunByQueryResult, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TestSuiteServiceTestRunByQueryResult + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TestSuitesAPIService.RunTestSuitesByQuery") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/{tenant}/tests/run" + localVarPath = strings.Replace(localVarPath, "{"+"tenant"+"}", url.PathEscape(parameterValueToString(r.tenant, "tenant")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.testSuiteServiceRunByQueryRequest == nil { + return localVarReturnValue, nil, reportError("testSuiteServiceRunByQueryRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.testSuiteServiceRunByQueryRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSearchTestSuitesRequest struct { + ctx context.Context + ApiService *TestSuitesAPIService + page *int32 + size *int32 + includeChildNamespaces *bool + tenant string + sort *[]string + namespace *string + flowId *string +} + +// The current page +func (r ApiSearchTestSuitesRequest) Page(page int32) ApiSearchTestSuitesRequest { + r.page = &page + return r +} + +// The current page size +func (r ApiSearchTestSuitesRequest) Size(size int32) ApiSearchTestSuitesRequest { + r.size = &size + return r +} + +// Include child namespaces in filter or not +func (r ApiSearchTestSuitesRequest) IncludeChildNamespaces(includeChildNamespaces bool) ApiSearchTestSuitesRequest { + r.includeChildNamespaces = &includeChildNamespaces + return r +} + +// The sort of current page +func (r ApiSearchTestSuitesRequest) Sort(sort []string) ApiSearchTestSuitesRequest { + r.sort = &sort + return r +} + +// The namespace to filter on +func (r ApiSearchTestSuitesRequest) Namespace(namespace string) ApiSearchTestSuitesRequest { + r.namespace = &namespace + return r +} + +// The flow id to filter on +func (r ApiSearchTestSuitesRequest) FlowId(flowId string) ApiSearchTestSuitesRequest { + r.flowId = &flowId + return r +} + +func (r ApiSearchTestSuitesRequest) GetPage() *int32 { + return r.page +} +func (r ApiSearchTestSuitesRequest) GetSize() *int32 { + return r.size +} +func (r ApiSearchTestSuitesRequest) GetIncludeChildNamespaces() *bool { + return r.includeChildNamespaces +} +func (r ApiSearchTestSuitesRequest) GetTenant() string { + return r.tenant +} +func (r ApiSearchTestSuitesRequest) GetSort() *[]string { + return r.sort +} +func (r ApiSearchTestSuitesRequest) GetNamespace() *string { + return r.namespace +} +func (r ApiSearchTestSuitesRequest) GetFlowId() *string { + return r.flowId +} + +func (r ApiSearchTestSuitesRequest) Execute() (*PagedResultsTestSuite, *http.Response, error) { + return r.ApiService.SearchTestSuitesExecute(r) +} + +/* +SearchTestSuites Search for tests + +Searches for tests with optional filtering by namespace and flow ID. Requires TEST permission with the READ action. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param tenant + @return ApiSearchTestSuitesRequest +*/ +func (a *TestSuitesAPIService) SearchTestSuites(ctx context.Context, tenant string) ApiSearchTestSuitesRequest { + return ApiSearchTestSuitesRequest{ + ApiService: a, + ctx: ctx, + tenant: tenant, + page: Ptr(int32(1)), + size: Ptr(int32(10)), + includeChildNamespaces: Ptr(bool(true)), + } +} + +// Execute executes the request +// +// @return PagedResultsTestSuite +func (a *TestSuitesAPIService) SearchTestSuitesExecute(r ApiSearchTestSuitesRequest) (*PagedResultsTestSuite, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PagedResultsTestSuite + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TestSuitesAPIService.SearchTestSuites") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/{tenant}/tests/search" + localVarPath = strings.Replace(localVarPath, "{"+"tenant"+"}", url.PathEscape(parameterValueToString(r.tenant, "tenant")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.page == nil { + return localVarReturnValue, nil, reportError("page is required and must be specified") + } + if *r.page < 1 { + return localVarReturnValue, nil, reportError("page must be greater than 1") + } + if r.size == nil { + return localVarReturnValue, nil, reportError("size is required and must be specified") + } + if *r.size < 1 { + return localVarReturnValue, nil, reportError("size must be greater than 1") + } + if r.includeChildNamespaces == nil { + return localVarReturnValue, nil, reportError("includeChildNamespaces is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "form", "") + if r.sort != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sort", r.sort, "form", "csv") + } + if r.namespace != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "namespace", r.namespace, "form", "") + } + if r.flowId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "flowId", r.flowId, "form", "") + } + parameterAddToHeaderOrQuery(localVarQueryParams, "includeChildNamespaces", r.includeChildNamespaces, "form", "") + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSearchTestSuitesResultsRequest struct { + ctx context.Context + ApiService *TestSuitesAPIService + page *int32 + size *int32 + tenant string + sort *[]string + testSuiteId *string + namespace *string + flowId *string +} + +// The current page +func (r ApiSearchTestSuitesResultsRequest) Page(page int32) ApiSearchTestSuitesResultsRequest { + r.page = &page + return r +} + +// The current page size +func (r ApiSearchTestSuitesResultsRequest) Size(size int32) ApiSearchTestSuitesResultsRequest { + r.size = &size + return r +} + +// The sort of current page +func (r ApiSearchTestSuitesResultsRequest) Sort(sort []string) ApiSearchTestSuitesResultsRequest { + r.sort = &sort + return r +} + +// The test suite id to filter on +func (r ApiSearchTestSuitesResultsRequest) TestSuiteId(testSuiteId string) ApiSearchTestSuitesResultsRequest { + r.testSuiteId = &testSuiteId + return r +} + +// The namespace to filter on +func (r ApiSearchTestSuitesResultsRequest) Namespace(namespace string) ApiSearchTestSuitesResultsRequest { + r.namespace = &namespace + return r +} + +// The flow id to filter on +func (r ApiSearchTestSuitesResultsRequest) FlowId(flowId string) ApiSearchTestSuitesResultsRequest { + r.flowId = &flowId + return r +} + +func (r ApiSearchTestSuitesResultsRequest) GetPage() *int32 { + return r.page +} +func (r ApiSearchTestSuitesResultsRequest) GetSize() *int32 { + return r.size +} +func (r ApiSearchTestSuitesResultsRequest) GetTenant() string { + return r.tenant +} +func (r ApiSearchTestSuitesResultsRequest) GetSort() *[]string { + return r.sort +} +func (r ApiSearchTestSuitesResultsRequest) GetTestSuiteId() *string { + return r.testSuiteId +} +func (r ApiSearchTestSuitesResultsRequest) GetNamespace() *string { + return r.namespace +} +func (r ApiSearchTestSuitesResultsRequest) GetFlowId() *string { + return r.flowId +} + +func (r ApiSearchTestSuitesResultsRequest) Execute() (*PagedResultsTestSuiteRunResult, *http.Response, error) { + return r.ApiService.SearchTestSuitesResultsExecute(r) +} + +/* +SearchTestSuitesResults Search for tests results + +with optional filtering by namespace, test suite ID and flow ID. Requires TEST permission with the READ action. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param tenant + @return ApiSearchTestSuitesResultsRequest +*/ +func (a *TestSuitesAPIService) SearchTestSuitesResults(ctx context.Context, tenant string) ApiSearchTestSuitesResultsRequest { + return ApiSearchTestSuitesResultsRequest{ + ApiService: a, + ctx: ctx, + tenant: tenant, + page: Ptr(int32(1)), + size: Ptr(int32(10)), + } +} + +// Execute executes the request +// +// @return PagedResultsTestSuiteRunResult +func (a *TestSuitesAPIService) SearchTestSuitesResultsExecute(r ApiSearchTestSuitesResultsRequest) (*PagedResultsTestSuiteRunResult, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PagedResultsTestSuiteRunResult + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TestSuitesAPIService.SearchTestSuitesResults") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/{tenant}/tests/results/search" + localVarPath = strings.Replace(localVarPath, "{"+"tenant"+"}", url.PathEscape(parameterValueToString(r.tenant, "tenant")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.page == nil { + return localVarReturnValue, nil, reportError("page is required and must be specified") + } + if *r.page < 1 { + return localVarReturnValue, nil, reportError("page must be greater than 1") + } + if r.size == nil { + return localVarReturnValue, nil, reportError("size is required and must be specified") + } + if *r.size < 1 { + return localVarReturnValue, nil, reportError("size must be greater than 1") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "form", "") + if r.sort != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sort", r.sort, "form", "csv") + } + if r.testSuiteId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "testSuiteId", r.testSuiteId, "form", "") + } + if r.namespace != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "namespace", r.namespace, "form", "") + } + if r.flowId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "flowId", r.flowId, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTestResultRequest struct { + ctx context.Context + ApiService *TestSuitesAPIService + id string + tenant string +} + +func (r ApiTestResultRequest) GetId() string { + return r.id +} +func (r ApiTestResultRequest) GetTenant() string { + return r.tenant +} + +func (r ApiTestResultRequest) Execute() (*TestSuiteRunResult, *http.Response, error) { + return r.ApiService.TestResultExecute(r) +} + +/* +TestResult Get a test result + +Get a test result once it was run. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id The test run ID + @param tenant + @return ApiTestResultRequest +*/ +func (a *TestSuitesAPIService) TestResult(ctx context.Context, id string, tenant string) ApiTestResultRequest { + return ApiTestResultRequest{ + ApiService: a, + ctx: ctx, + id: id, + tenant: tenant, + } +} + +// Execute executes the request +// +// @return TestSuiteRunResult +func (a *TestSuitesAPIService) TestResultExecute(r ApiTestResultRequest) (*TestSuiteRunResult, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TestSuiteRunResult + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TestSuitesAPIService.TestResult") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/{tenant}/tests/results/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"tenant"+"}", url.PathEscape(parameterValueToString(r.tenant, "tenant")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTestSuiteRequest struct { + ctx context.Context + ApiService *TestSuitesAPIService + namespace string + id string + tenant string +} + +func (r ApiTestSuiteRequest) GetNamespace() string { + return r.namespace +} +func (r ApiTestSuiteRequest) GetId() string { + return r.id +} +func (r ApiTestSuiteRequest) GetTenant() string { + return r.tenant +} + +func (r ApiTestSuiteRequest) Execute() (*TestSuite, *http.Response, error) { + return r.ApiService.TestSuiteExecute(r) +} + +/* +TestSuite Retrieve a test + +Retrieves a test by namespace and ID. Requires TEST permission with the READ action. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param namespace The TestSuite namespace + @param id The TestSuite ID + @param tenant + @return ApiTestSuiteRequest +*/ +func (a *TestSuitesAPIService) TestSuite(ctx context.Context, namespace string, id string, tenant string) ApiTestSuiteRequest { + return ApiTestSuiteRequest{ + ApiService: a, + ctx: ctx, + namespace: namespace, + id: id, + tenant: tenant, + } +} + +// Execute executes the request +// +// @return TestSuite +func (a *TestSuitesAPIService) TestSuiteExecute(r ApiTestSuiteRequest) (*TestSuite, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TestSuite + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TestSuitesAPIService.TestSuite") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/{tenant}/tests/{namespace}/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"namespace"+"}", url.PathEscape(parameterValueToString(r.namespace, "namespace")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"tenant"+"}", url.PathEscape(parameterValueToString(r.tenant, "tenant")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTestsLastResultRequest struct { + ctx context.Context + ApiService *TestSuitesAPIService + tenant string + testSuiteControllerSearchTestsLastResult *TestSuiteControllerSearchTestsLastResult +} + +func (r ApiTestsLastResultRequest) TestSuiteControllerSearchTestsLastResult(testSuiteControllerSearchTestsLastResult TestSuiteControllerSearchTestsLastResult) ApiTestsLastResultRequest { + r.testSuiteControllerSearchTestsLastResult = &testSuiteControllerSearchTestsLastResult + return r +} + +func (r ApiTestsLastResultRequest) GetTenant() string { + return r.tenant +} +func (r ApiTestsLastResultRequest) GetTestSuiteControllerSearchTestsLastResult() *TestSuiteControllerSearchTestsLastResult { + return r.testSuiteControllerSearchTestsLastResult +} + +func (r ApiTestsLastResultRequest) Execute() (*TestSuiteControllerTestsLastResultResponse, *http.Response, error) { + return r.ApiService.TestsLastResultExecute(r) +} + +/* +TestsLastResult Get tests last result + +Get multiple tests last result for a query. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param tenant + @return ApiTestsLastResultRequest +*/ +func (a *TestSuitesAPIService) TestsLastResult(ctx context.Context, tenant string) ApiTestsLastResultRequest { + return ApiTestsLastResultRequest{ + ApiService: a, + ctx: ctx, + tenant: tenant, + } +} + +// Execute executes the request +// +// @return TestSuiteControllerTestsLastResultResponse +func (a *TestSuitesAPIService) TestsLastResultExecute(r ApiTestsLastResultRequest) (*TestSuiteControllerTestsLastResultResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TestSuiteControllerTestsLastResultResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TestSuitesAPIService.TestsLastResult") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/{tenant}/tests/results/search/last" + localVarPath = strings.Replace(localVarPath, "{"+"tenant"+"}", url.PathEscape(parameterValueToString(r.tenant, "tenant")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.testSuiteControllerSearchTestsLastResult == nil { + return localVarReturnValue, nil, reportError("testSuiteControllerSearchTestsLastResult is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.testSuiteControllerSearchTestsLastResult + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUpdateTestSuiteRequest struct { + ctx context.Context + ApiService *TestSuitesAPIService + namespace string + id string + tenant string + body *string +} + +// The TestSuite source code +func (r ApiUpdateTestSuiteRequest) Body(body string) ApiUpdateTestSuiteRequest { + r.body = &body + return r +} + +func (r ApiUpdateTestSuiteRequest) GetNamespace() string { + return r.namespace +} +func (r ApiUpdateTestSuiteRequest) GetId() string { + return r.id +} +func (r ApiUpdateTestSuiteRequest) GetTenant() string { + return r.tenant +} +func (r ApiUpdateTestSuiteRequest) GetBody() *string { + return r.body +} + +func (r ApiUpdateTestSuiteRequest) Execute() (*TestSuite, *http.Response, error) { + return r.ApiService.UpdateTestSuiteExecute(r) +} + +/* +UpdateTestSuite Update a test from YAML source + +Updates an existing test with a new YAML definition. Requires TEST permission with the UPDATE action. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param namespace The TestSuite namespace + @param id The TestSuite ID + @param tenant + @return ApiUpdateTestSuiteRequest +*/ +func (a *TestSuitesAPIService) UpdateTestSuite(ctx context.Context, namespace string, id string, tenant string) ApiUpdateTestSuiteRequest { + return ApiUpdateTestSuiteRequest{ + ApiService: a, + ctx: ctx, + namespace: namespace, + id: id, + tenant: tenant, + } +} + +// Execute executes the request +// +// @return TestSuite +func (a *TestSuitesAPIService) UpdateTestSuiteExecute(r ApiUpdateTestSuiteRequest) (*TestSuite, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TestSuite + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TestSuitesAPIService.UpdateTestSuite") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/{tenant}/tests/{namespace}/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"namespace"+"}", url.PathEscape(parameterValueToString(r.namespace, "namespace")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"tenant"+"}", url.PathEscape(parameterValueToString(r.tenant, "tenant")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/x-yaml"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiValidateTestSuiteRequest struct { + ctx context.Context + ApiService *TestSuitesAPIService + tenant string + body *string +} + +// The TestSuite source code +func (r ApiValidateTestSuiteRequest) Body(body string) ApiValidateTestSuiteRequest { + r.body = &body + return r +} + +func (r ApiValidateTestSuiteRequest) GetTenant() string { + return r.tenant +} +func (r ApiValidateTestSuiteRequest) GetBody() *string { + return r.body +} + +func (r ApiValidateTestSuiteRequest) Execute() (*ValidateConstraintViolation, *http.Response, error) { + return r.ApiService.ValidateTestSuiteExecute(r) +} + +/* +ValidateTestSuite Validate a test + +Validates a test YAML definition without persisting it. Returns constraint violations if any. Requires TEST permission with the READ action. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param tenant + @return ApiValidateTestSuiteRequest +*/ +func (a *TestSuitesAPIService) ValidateTestSuite(ctx context.Context, tenant string) ApiValidateTestSuiteRequest { + return ApiValidateTestSuiteRequest{ + ApiService: a, + ctx: ctx, + tenant: tenant, + } +} + +// Execute executes the request +// +// @return ValidateConstraintViolation +func (a *TestSuitesAPIService) ValidateTestSuiteExecute(r ApiValidateTestSuiteRequest) (*ValidateConstraintViolation, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ValidateConstraintViolation + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TestSuitesAPIService.ValidateTestSuite") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/{tenant}/tests/validate" + localVarPath = strings.Replace(localVarPath, "{"+"tenant"+"}", url.PathEscape(parameterValueToString(r.tenant, "tenant")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/x-yaml"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/go/go-sdk/client.go b/go/go-sdk/client.go index 8113724b8..bf1796bac 100755 --- a/go/go-sdk/client.go +++ b/go/go-sdk/client.go @@ -61,6 +61,8 @@ type APIClient struct { ServiceAccountAPI *ServiceAccountAPIService + TestSuitesAPI *TestSuitesAPIService + TriggersAPI *TriggersAPIService UsersAPI *UsersAPIService @@ -89,6 +91,7 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.NamespacesAPI = (*NamespacesAPIService)(&c.common) c.RolesAPI = (*RolesAPIService)(&c.common) c.ServiceAccountAPI = (*ServiceAccountAPIService)(&c.common) + c.TestSuitesAPI = (*TestSuitesAPIService)(&c.common) c.TriggersAPI = (*TriggersAPIService)(&c.common) c.UsersAPI = (*UsersAPIService)(&c.common) diff --git a/go/go-sdk/docs/TestSuitesAPI.md b/go/go-sdk/docs/TestSuitesAPI.md new file mode 100644 index 000000000..43ab4c3e7 --- /dev/null +++ b/go/go-sdk/docs/TestSuitesAPI.md @@ -0,0 +1,1071 @@ +# \TestSuitesAPI + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateTestSuite**](TestSuitesAPI.md#CreateTestSuite) | **Post** /api/v1/{tenant}/tests | Create a test from YAML source +[**DeleteTestSuite**](TestSuitesAPI.md#DeleteTestSuite) | **Delete** /api/v1/{tenant}/tests/{namespace}/{id} | Delete a test +[**DeleteTestSuitesByIds**](TestSuitesAPI.md#DeleteTestSuitesByIds) | **Delete** /api/v1/{tenant}/tests/by-ids | Delete multiple tests by id +[**DisableTestSuitesByIds**](TestSuitesAPI.md#DisableTestSuitesByIds) | **Post** /api/v1/{tenant}/tests/disable/by-ids | Disable multiple tests by id +[**EnableTestSuitesByIds**](TestSuitesAPI.md#EnableTestSuitesByIds) | **Post** /api/v1/{tenant}/tests/enable/by-ids | Enable multiple tests by id +[**RunTestSuite**](TestSuitesAPI.md#RunTestSuite) | **Post** /api/v1/{tenant}/tests/{namespace}/{id}/run | Run a full test +[**RunTestSuitesByQuery**](TestSuitesAPI.md#RunTestSuitesByQuery) | **Post** /api/v1/{tenant}/tests/run | Run multiple TestSuites by query +[**SearchTestSuites**](TestSuitesAPI.md#SearchTestSuites) | **Get** /api/v1/{tenant}/tests/search | Search for tests +[**SearchTestSuitesResults**](TestSuitesAPI.md#SearchTestSuitesResults) | **Get** /api/v1/{tenant}/tests/results/search | Search for tests results +[**TestResult**](TestSuitesAPI.md#TestResult) | **Get** /api/v1/{tenant}/tests/results/{id} | Get a test result +[**TestSuite**](TestSuitesAPI.md#TestSuite) | **Get** /api/v1/{tenant}/tests/{namespace}/{id} | Retrieve a test +[**TestsLastResult**](TestSuitesAPI.md#TestsLastResult) | **Post** /api/v1/{tenant}/tests/results/search/last | Get tests last result +[**UpdateTestSuite**](TestSuitesAPI.md#UpdateTestSuite) | **Put** /api/v1/{tenant}/tests/{namespace}/{id} | Update a test from YAML source +[**ValidateTestSuite**](TestSuitesAPI.md#ValidateTestSuite) | **Post** /api/v1/{tenant}/tests/validate | Validate a test + + + +## CreateTestSuite + +> TestSuite CreateTestSuite(ctx, tenant).Body(body).Execute() + +Create a test from YAML source + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/kestra-io/client-sdk/go-sdk" +) + +func main() { + tenant := "tenant_example" // string | + body := "body_example" // string | The TestSuite source code + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TestSuitesAPI.CreateTestSuite(context.Background(), tenant).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TestSuitesAPI.CreateTestSuite``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateTestSuite`: TestSuite + fmt.Fprintf(os.Stdout, "Response from `TestSuitesAPI.CreateTestSuite`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**tenant** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateTestSuiteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | **string** | The TestSuite source code | + +### Return type + +[**TestSuite**](TestSuite.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-yaml +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteTestSuite + +> map[string]interface{} DeleteTestSuite(ctx, namespace, id, tenant).Execute() + +Delete a test + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/kestra-io/client-sdk/go-sdk" +) + +func main() { + namespace := "namespace_example" // string | The TestSuite namespace + id := "id_example" // string | The TestSuite ID + tenant := "tenant_example" // string | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TestSuitesAPI.DeleteTestSuite(context.Background(), namespace, id, tenant).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TestSuitesAPI.DeleteTestSuite``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `DeleteTestSuite`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `TestSuitesAPI.DeleteTestSuite`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**namespace** | **string** | The TestSuite namespace | +**id** | **string** | The TestSuite ID | +**tenant** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteTestSuiteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + +### Return type + +**map[string]interface{}** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteTestSuitesByIds + +> BulkResponse DeleteTestSuitesByIds(ctx, tenant).TestSuiteControllerTestSuiteBulkRequest(testSuiteControllerTestSuiteBulkRequest).Execute() + +Delete multiple tests by id + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/kestra-io/client-sdk/go-sdk" +) + +func main() { + tenant := "tenant_example" // string | + testSuiteControllerTestSuiteBulkRequest := *openapiclient.NewTestSuiteControllerTestSuiteBulkRequest([]openapiclient.TestSuiteControllerTestSuiteApiId{*openapiclient.NewTestSuiteControllerTestSuiteApiId("Namespace_example", "Id_example")}) // TestSuiteControllerTestSuiteBulkRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TestSuitesAPI.DeleteTestSuitesByIds(context.Background(), tenant).TestSuiteControllerTestSuiteBulkRequest(testSuiteControllerTestSuiteBulkRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TestSuitesAPI.DeleteTestSuitesByIds``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `DeleteTestSuitesByIds`: BulkResponse + fmt.Fprintf(os.Stdout, "Response from `TestSuitesAPI.DeleteTestSuitesByIds`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**tenant** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteTestSuitesByIdsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **testSuiteControllerTestSuiteBulkRequest** | [**TestSuiteControllerTestSuiteBulkRequest**](TestSuiteControllerTestSuiteBulkRequest.md) | | + +### Return type + +[**BulkResponse**](BulkResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DisableTestSuitesByIds + +> BulkResponse DisableTestSuitesByIds(ctx, tenant).TestSuiteControllerTestSuiteBulkRequest(testSuiteControllerTestSuiteBulkRequest).Execute() + +Disable multiple tests by id + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/kestra-io/client-sdk/go-sdk" +) + +func main() { + tenant := "tenant_example" // string | + testSuiteControllerTestSuiteBulkRequest := *openapiclient.NewTestSuiteControllerTestSuiteBulkRequest([]openapiclient.TestSuiteControllerTestSuiteApiId{*openapiclient.NewTestSuiteControllerTestSuiteApiId("Namespace_example", "Id_example")}) // TestSuiteControllerTestSuiteBulkRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TestSuitesAPI.DisableTestSuitesByIds(context.Background(), tenant).TestSuiteControllerTestSuiteBulkRequest(testSuiteControllerTestSuiteBulkRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TestSuitesAPI.DisableTestSuitesByIds``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `DisableTestSuitesByIds`: BulkResponse + fmt.Fprintf(os.Stdout, "Response from `TestSuitesAPI.DisableTestSuitesByIds`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**tenant** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDisableTestSuitesByIdsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **testSuiteControllerTestSuiteBulkRequest** | [**TestSuiteControllerTestSuiteBulkRequest**](TestSuiteControllerTestSuiteBulkRequest.md) | | + +### Return type + +[**BulkResponse**](BulkResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## EnableTestSuitesByIds + +> BulkResponse EnableTestSuitesByIds(ctx, tenant).TestSuiteControllerTestSuiteBulkRequest(testSuiteControllerTestSuiteBulkRequest).Execute() + +Enable multiple tests by id + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/kestra-io/client-sdk/go-sdk" +) + +func main() { + tenant := "tenant_example" // string | + testSuiteControllerTestSuiteBulkRequest := *openapiclient.NewTestSuiteControllerTestSuiteBulkRequest([]openapiclient.TestSuiteControllerTestSuiteApiId{*openapiclient.NewTestSuiteControllerTestSuiteApiId("Namespace_example", "Id_example")}) // TestSuiteControllerTestSuiteBulkRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TestSuitesAPI.EnableTestSuitesByIds(context.Background(), tenant).TestSuiteControllerTestSuiteBulkRequest(testSuiteControllerTestSuiteBulkRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TestSuitesAPI.EnableTestSuitesByIds``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `EnableTestSuitesByIds`: BulkResponse + fmt.Fprintf(os.Stdout, "Response from `TestSuitesAPI.EnableTestSuitesByIds`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**tenant** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiEnableTestSuitesByIdsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **testSuiteControllerTestSuiteBulkRequest** | [**TestSuiteControllerTestSuiteBulkRequest**](TestSuiteControllerTestSuiteBulkRequest.md) | | + +### Return type + +[**BulkResponse**](BulkResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## RunTestSuite + +> TestSuiteRunResult RunTestSuite(ctx, namespace, id, tenant).TestSuiteControllerRunRequest(testSuiteControllerRunRequest).Execute() + +Run a full test + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/kestra-io/client-sdk/go-sdk" +) + +func main() { + namespace := "namespace_example" // string | The TestSuite namespace + id := "id_example" // string | The TestSuite ID + tenant := "tenant_example" // string | + testSuiteControllerRunRequest := *openapiclient.NewTestSuiteControllerRunRequest() // TestSuiteControllerRunRequest | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TestSuitesAPI.RunTestSuite(context.Background(), namespace, id, tenant).TestSuiteControllerRunRequest(testSuiteControllerRunRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TestSuitesAPI.RunTestSuite``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `RunTestSuite`: TestSuiteRunResult + fmt.Fprintf(os.Stdout, "Response from `TestSuitesAPI.RunTestSuite`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**namespace** | **string** | The TestSuite namespace | +**id** | **string** | The TestSuite ID | +**tenant** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiRunTestSuiteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **testSuiteControllerRunRequest** | [**TestSuiteControllerRunRequest**](TestSuiteControllerRunRequest.md) | | + +### Return type + +[**TestSuiteRunResult**](TestSuiteRunResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## RunTestSuitesByQuery + +> TestSuiteServiceTestRunByQueryResult RunTestSuitesByQuery(ctx, tenant).TestSuiteServiceRunByQueryRequest(testSuiteServiceRunByQueryRequest).Execute() + +Run multiple TestSuites by query + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/kestra-io/client-sdk/go-sdk" +) + +func main() { + tenant := "tenant_example" // string | + testSuiteServiceRunByQueryRequest := *openapiclient.NewTestSuiteServiceRunByQueryRequest(false) // TestSuiteServiceRunByQueryRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TestSuitesAPI.RunTestSuitesByQuery(context.Background(), tenant).TestSuiteServiceRunByQueryRequest(testSuiteServiceRunByQueryRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TestSuitesAPI.RunTestSuitesByQuery``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `RunTestSuitesByQuery`: TestSuiteServiceTestRunByQueryResult + fmt.Fprintf(os.Stdout, "Response from `TestSuitesAPI.RunTestSuitesByQuery`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**tenant** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiRunTestSuitesByQueryRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **testSuiteServiceRunByQueryRequest** | [**TestSuiteServiceRunByQueryRequest**](TestSuiteServiceRunByQueryRequest.md) | | + +### Return type + +[**TestSuiteServiceTestRunByQueryResult**](TestSuiteServiceTestRunByQueryResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## SearchTestSuites + +> PagedResultsTestSuite SearchTestSuites(ctx, tenant).Page(page).Size(size).IncludeChildNamespaces(includeChildNamespaces).Sort(sort).Namespace(namespace).FlowId(flowId).Execute() + +Search for tests + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/kestra-io/client-sdk/go-sdk" +) + +func main() { + page := int32(56) // int32 | The current page (default to 1) + size := int32(56) // int32 | The current page size (default to 10) + includeChildNamespaces := true // bool | Include child namespaces in filter or not (default to true) + tenant := "tenant_example" // string | + sort := []string{"Inner_example"} // []string | The sort of current page (optional) + namespace := "namespace_example" // string | The namespace to filter on (optional) + flowId := "flowId_example" // string | The flow id to filter on (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TestSuitesAPI.SearchTestSuites(context.Background(), tenant).Page(page).Size(size).IncludeChildNamespaces(includeChildNamespaces).Sort(sort).Namespace(namespace).FlowId(flowId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TestSuitesAPI.SearchTestSuites``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `SearchTestSuites`: PagedResultsTestSuite + fmt.Fprintf(os.Stdout, "Response from `TestSuitesAPI.SearchTestSuites`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**tenant** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiSearchTestSuitesRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **int32** | The current page | [default to 1] + **size** | **int32** | The current page size | [default to 10] + **includeChildNamespaces** | **bool** | Include child namespaces in filter or not | [default to true] + + **sort** | **[]string** | The sort of current page | + **namespace** | **string** | The namespace to filter on | + **flowId** | **string** | The flow id to filter on | + +### Return type + +[**PagedResultsTestSuite**](PagedResultsTestSuite.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## SearchTestSuitesResults + +> PagedResultsTestSuiteRunResult SearchTestSuitesResults(ctx, tenant).Page(page).Size(size).Sort(sort).TestSuiteId(testSuiteId).Namespace(namespace).FlowId(flowId).Execute() + +Search for tests results + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/kestra-io/client-sdk/go-sdk" +) + +func main() { + page := int32(56) // int32 | The current page (default to 1) + size := int32(56) // int32 | The current page size (default to 10) + tenant := "tenant_example" // string | + sort := []string{"Inner_example"} // []string | The sort of current page (optional) + testSuiteId := "testSuiteId_example" // string | The test suite id to filter on (optional) + namespace := "namespace_example" // string | The namespace to filter on (optional) + flowId := "flowId_example" // string | The flow id to filter on (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TestSuitesAPI.SearchTestSuitesResults(context.Background(), tenant).Page(page).Size(size).Sort(sort).TestSuiteId(testSuiteId).Namespace(namespace).FlowId(flowId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TestSuitesAPI.SearchTestSuitesResults``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `SearchTestSuitesResults`: PagedResultsTestSuiteRunResult + fmt.Fprintf(os.Stdout, "Response from `TestSuitesAPI.SearchTestSuitesResults`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**tenant** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiSearchTestSuitesResultsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **int32** | The current page | [default to 1] + **size** | **int32** | The current page size | [default to 10] + + **sort** | **[]string** | The sort of current page | + **testSuiteId** | **string** | The test suite id to filter on | + **namespace** | **string** | The namespace to filter on | + **flowId** | **string** | The flow id to filter on | + +### Return type + +[**PagedResultsTestSuiteRunResult**](PagedResultsTestSuiteRunResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TestResult + +> TestSuiteRunResult TestResult(ctx, id, tenant).Execute() + +Get a test result + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/kestra-io/client-sdk/go-sdk" +) + +func main() { + id := "id_example" // string | The test run ID + tenant := "tenant_example" // string | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TestSuitesAPI.TestResult(context.Background(), id, tenant).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TestSuitesAPI.TestResult``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TestResult`: TestSuiteRunResult + fmt.Fprintf(os.Stdout, "Response from `TestSuitesAPI.TestResult`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | The test run ID | +**tenant** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiTestResultRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +[**TestSuiteRunResult**](TestSuiteRunResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TestSuite + +> TestSuite TestSuite(ctx, namespace, id, tenant).Execute() + +Retrieve a test + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/kestra-io/client-sdk/go-sdk" +) + +func main() { + namespace := "namespace_example" // string | The TestSuite namespace + id := "id_example" // string | The TestSuite ID + tenant := "tenant_example" // string | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TestSuitesAPI.TestSuite(context.Background(), namespace, id, tenant).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TestSuitesAPI.TestSuite``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TestSuite`: TestSuite + fmt.Fprintf(os.Stdout, "Response from `TestSuitesAPI.TestSuite`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**namespace** | **string** | The TestSuite namespace | +**id** | **string** | The TestSuite ID | +**tenant** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiTestSuiteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + +### Return type + +[**TestSuite**](TestSuite.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TestsLastResult + +> TestSuiteControllerTestsLastResultResponse TestsLastResult(ctx, tenant).TestSuiteControllerSearchTestsLastResult(testSuiteControllerSearchTestsLastResult).Execute() + +Get tests last result + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/kestra-io/client-sdk/go-sdk" +) + +func main() { + tenant := "tenant_example" // string | + testSuiteControllerSearchTestsLastResult := *openapiclient.NewTestSuiteControllerSearchTestsLastResult() // TestSuiteControllerSearchTestsLastResult | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TestSuitesAPI.TestsLastResult(context.Background(), tenant).TestSuiteControllerSearchTestsLastResult(testSuiteControllerSearchTestsLastResult).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TestSuitesAPI.TestsLastResult``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TestsLastResult`: TestSuiteControllerTestsLastResultResponse + fmt.Fprintf(os.Stdout, "Response from `TestSuitesAPI.TestsLastResult`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**tenant** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiTestsLastResultRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **testSuiteControllerSearchTestsLastResult** | [**TestSuiteControllerSearchTestsLastResult**](TestSuiteControllerSearchTestsLastResult.md) | | + +### Return type + +[**TestSuiteControllerTestsLastResultResponse**](TestSuiteControllerTestsLastResultResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdateTestSuite + +> TestSuite UpdateTestSuite(ctx, namespace, id, tenant).Body(body).Execute() + +Update a test from YAML source + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/kestra-io/client-sdk/go-sdk" +) + +func main() { + namespace := "namespace_example" // string | The TestSuite namespace + id := "id_example" // string | The TestSuite ID + tenant := "tenant_example" // string | + body := "body_example" // string | The TestSuite source code + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TestSuitesAPI.UpdateTestSuite(context.Background(), namespace, id, tenant).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TestSuitesAPI.UpdateTestSuite``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UpdateTestSuite`: TestSuite + fmt.Fprintf(os.Stdout, "Response from `TestSuitesAPI.UpdateTestSuite`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**namespace** | **string** | The TestSuite namespace | +**id** | **string** | The TestSuite ID | +**tenant** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateTestSuiteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **body** | **string** | The TestSuite source code | + +### Return type + +[**TestSuite**](TestSuite.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-yaml +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ValidateTestSuite + +> ValidateConstraintViolation ValidateTestSuite(ctx, tenant).Body(body).Execute() + +Validate a test + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/kestra-io/client-sdk/go-sdk" +) + +func main() { + tenant := "tenant_example" // string | + body := "body_example" // string | The TestSuite source code + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TestSuitesAPI.ValidateTestSuite(context.Background(), tenant).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TestSuitesAPI.ValidateTestSuite``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ValidateTestSuite`: ValidateConstraintViolation + fmt.Fprintf(os.Stdout, "Response from `TestSuitesAPI.ValidateTestSuite`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**tenant** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiValidateTestSuiteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | **string** | The TestSuite source code | + +### Return type + +[**ValidateConstraintViolation**](ValidateConstraintViolation.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-yaml +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/go/go-sdk/test_go_sdk/api_executions_test.go b/go/go-sdk/test_go_sdk/api_executions_test.go index ef42765a1..d18ca68ac 100644 --- a/go/go-sdk/test_go_sdk/api_executions_test.go +++ b/go/go-sdk/test_go_sdk/api_executions_test.go @@ -58,17 +58,17 @@ namespace: %s description: simple_flow_description inputs: - - id: key + - id: inputA type: STRING defaults: 'default_value' tasks: - id: hello type: io.kestra.plugin.core.log.Log - message: "Hello World! {{ inputs.key }}🚀" + message: "Hello World! {{ inputs.inputA }}🚀" - id: return type: io.kestra.plugin.core.debug.Return - format: "{{ inputs.key }}" + format: "{{ inputs.inputA }}" outputs: - id: flow_output type: STRING @@ -236,7 +236,7 @@ func TestExecutionsAPI_All(t *testing.T) { labels := []string{"label1:created"} inputs := map[string]any{ - "key": "value1", + "inputA": "value1", } res, _, err := KestraTestApiClient().ExecutionsAPI. @@ -251,7 +251,7 @@ func TestExecutionsAPI_All(t *testing.T) { require.Equal(t, flowId, res.FlowId) require.Equal(t, openapiclient.Label{Key: "label1", Value: "created", AdditionalProperties: map[string]interface{}{}}, res.Labels[0]) require.Equal(t, map[string]any{ - "key": "value1", + "inputA": "value1", }, res.Inputs) }) @@ -263,7 +263,7 @@ func TestExecutionsAPI_All(t *testing.T) { labels := []string{"label1:created"} inputs := map[string]any{ - "key": "value1", + "inputA": "value1", } created, _, err := KestraTestApiClient().ExecutionsAPI. @@ -276,7 +276,7 @@ func TestExecutionsAPI_All(t *testing.T) { exec, _, err := KestraTestApiClient().ExecutionsAPI.Execution(ctx, created.Id, MAIN_TENANT).Execute() require.NoError(t, err) require.Equal(t, map[string]any{ - "key": "value1", + "inputA": "value1", }, exec.Inputs) require.Equal(t, map[string]any{ @@ -664,7 +664,7 @@ func TestExecutionsAPI_All(t *testing.T) { // then replay with other inputs inputs := map[string]any{ - "key": "value1FromReplay", + "inputA": "value1FromReplay", } replayingExec, _, err := KestraTestApiClient().ExecutionsAPI.ReplayExecutionWithinputs(ctx, exec.Id, MAIN_TENANT).FormData(inputs).Execute() require.NoError(t, err) diff --git a/go/go-sdk/test_go_sdk/api_testsuites_test.go b/go/go-sdk/test_go_sdk/api_testsuites_test.go new file mode 100644 index 000000000..5ace59bfe --- /dev/null +++ b/go/go-sdk/test_go_sdk/api_testsuites_test.go @@ -0,0 +1,391 @@ +package main + +import ( + "context" + "fmt" + "strings" + "testing" + + kestra_api_client "github.com/kestra-io/client-sdk/go-sdk" + "github.com/stretchr/testify/require" +) + +func SIMPLE_TEST_SUITE(id string, ns string, flowId string) string { + return fmt.Sprintf(` +id: %s +namespace: %s +description: assert flow is returning the input value as output +flowId: %s +testCases: + - id: test_case_1 + description: test_case_1 description + type: io.kestra.core.tests.flow.UnitTest + fixtures: + inputs: + inputA: "Hi there" + assertions: + - value: "{{ outputs.return.value }}" + equalTo: 'Hi there' +`, id, ns, flowId) +} +func INVALID_TEST_SUITE(id string, ns string, flowId string) string { + return fmt.Sprintf(` +id: %s +namespace: %s +description: assert flow %s is returning the input value as output +# missing flow id +# missing test cases +`, id, ns, flowId) +} +func FAILING_SIMPLE_TEST_SUITE(id string, ns string, flowId string) string { + return fmt.Sprintf(` +id: %s +namespace: %s +description: assert flow is returning the input value as output +flowId: %s +testCases: + - id: test_case_1 + description: test_case_1 description + type: io.kestra.core.tests.flow.UnitTest + fixtures: + inputs: + inputA: "another value" + assertions: + - value: "{{ outputs.return.value }}" + description: 'making this assertion always false' + equalTo: 'Hi there' +`, id, ns, flowId) +} + +func TestTestSuitesAPI_All(t *testing.T) { + + t.Run("createTestSuiteTest", func(t *testing.T) { + testSuiteId := randomId() + namespace := randomId() + flowId := randomId() + ctx := GetAuthContext() + testSuiteYaml := SIMPLE_TEST_SUITE(testSuiteId, namespace, flowId) + createSimpleFlow(ctx, flowId, namespace) + + res, _, err := KestraTestApiClient().TestSuitesAPI.CreateTestSuite(ctx, MAIN_TENANT).Body(testSuiteYaml).Execute() + + require.NoError(t, err) + require.EqualValues(t, testSuiteId, res.Id) + require.EqualValues(t, flowId, res.FlowId) + require.EqualValues(t, namespace, res.Namespace) + require.EqualValues(t, "assert flow is returning the input value as output", *res.Description) + require.Len(t, res.TestCases, 1) + testCase := res.TestCases[0] + require.EqualValues(t, "test_case_1 description", *testCase.Description) + require.EqualValues(t, "io.kestra.core.tests.flow.UnitTest", testCase.Type) + require.EqualValues(t, false, *testCase.Disabled) + require.EqualValues(t, map[string]interface{}{"inputA": "Hi there"}, testCase.Fixtures.GetInputs()) + require.Len(t, testCase.Assertions, 1) + assertion := testCase.Assertions[0] + require.EqualValues(t, "Hi there", assertion.GetEqualTo()) + require.EqualValues(t, "{{ outputs.return.value }}", assertion.GetValue()) + }) + t.Run("getTestSuiteTest", func(t *testing.T) { + testSuiteId := randomId() + namespace := randomId() + flowId := randomId() + ctx := GetAuthContext() + testSuiteYaml := SIMPLE_TEST_SUITE(testSuiteId, namespace, flowId) + createSimpleFlow(ctx, flowId, namespace) + _, _, err := KestraTestApiClient().TestSuitesAPI.CreateTestSuite(ctx, MAIN_TENANT).Body(testSuiteYaml).Execute() + require.NoError(t, err) + + res, _, err := KestraTestApiClient().TestSuitesAPI.TestSuite(ctx, namespace, testSuiteId, MAIN_TENANT).Execute() + require.NoError(t, err) + + require.EqualValues(t, testSuiteId, res.Id) + require.EqualValues(t, flowId, res.FlowId) + require.EqualValues(t, namespace, res.Namespace) + require.EqualValues(t, "assert flow is returning the input value as output", *res.Description) + }) + t.Run("deleteTestSuiteTest", func(t *testing.T) { + testSuiteId := randomId() + namespace := randomId() + flowId := randomId() + ctx := GetAuthContext() + testSuiteYaml := SIMPLE_TEST_SUITE(testSuiteId, namespace, flowId) + createSimpleFlow(ctx, flowId, namespace) + + _, _, err := KestraTestApiClient().TestSuitesAPI.CreateTestSuite(ctx, MAIN_TENANT).Body(testSuiteYaml).Execute() + require.NoError(t, err) + assertTestSuiteExists(t, ctx, namespace, testSuiteId) + + _, _, err = KestraTestApiClient().TestSuitesAPI.DeleteTestSuite(ctx, namespace, testSuiteId, MAIN_TENANT).Execute() + require.NoError(t, err) + + assertTestSuiteDoesNotExist(t, ctx, namespace, testSuiteId) + }) + t.Run("updateTestSuiteTest", func(t *testing.T) { + testSuiteId := randomId() + namespace := randomId() + flowId := randomId() + ctx := GetAuthContext() + testSuiteYaml := SIMPLE_TEST_SUITE(testSuiteId, namespace, flowId) + createSimpleFlow(ctx, flowId, namespace) + + _, _, err := KestraTestApiClient().TestSuitesAPI.CreateTestSuite(ctx, MAIN_TENANT).Body(testSuiteYaml).Execute() + require.NoError(t, err) + assertTestSuiteExists(t, ctx, namespace, testSuiteId) + + // when + testSuiteYaml = strings.ReplaceAll(testSuiteYaml, "assert flow is returning the input value as output", "updated testsuite description") + testSuiteYaml = strings.ReplaceAll(testSuiteYaml, "test_case_1 description", "updated testcase description") + + _, _, err = KestraTestApiClient().TestSuitesAPI.UpdateTestSuite(ctx, namespace, testSuiteId, MAIN_TENANT).Body(testSuiteYaml).Execute() + require.NoError(t, err) + + fetchedTestSuite, _, err := KestraTestApiClient().TestSuitesAPI.TestSuite(ctx, namespace, testSuiteId, MAIN_TENANT).Execute() + require.NoError(t, err) + require.EqualValues(t, testSuiteId, fetchedTestSuite.GetId()) + require.EqualValues(t, "updated testsuite description", fetchedTestSuite.GetDescription()) + require.EqualValues(t, "updated testcase description", fetchedTestSuite.GetTestCases()[0].GetDescription()) + }) + t.Run("validateTestSuiteTest_ok", func(t *testing.T) { + testSuiteId := randomId() + namespace := randomId() + flowId := randomId() + ctx := GetAuthContext() + testSuiteYaml := SIMPLE_TEST_SUITE(testSuiteId, namespace, flowId) + createSimpleFlow(ctx, flowId, namespace) + + validations, _, err := KestraTestApiClient().TestSuitesAPI.ValidateTestSuite(ctx, MAIN_TENANT).Body(testSuiteYaml).Execute() + + require.NoError(t, err) + require.Len(t, validations.GetWarnings(), 0) + require.Len(t, validations.GetInfos(), 0) + require.Len(t, validations.GetDeprecationPaths(), 0) + require.Empty(t, validations.GetConstraints()) + }) + t.Run("validateTestSuiteTest_invalid", func(t *testing.T) { + testSuiteId := randomId() + namespace := randomId() + flowId := randomId() + ctx := GetAuthContext() + testSuiteYaml := INVALID_TEST_SUITE(testSuiteId, namespace, flowId) + createSimpleFlow(ctx, flowId, namespace) + + validations, _, err := KestraTestApiClient().TestSuitesAPI.ValidateTestSuite(ctx, MAIN_TENANT).Body(testSuiteYaml).Execute() + + require.NoError(t, err) + require.Contains(t, validations.GetConstraints(), "testCases: must not be empty") + require.Contains(t, validations.GetConstraints(), "flowId: must not be null") + }) + t.Run("deleteTestSuiteByIdsTest", func(t *testing.T) { + testSuiteId1 := randomId() + testSuiteId2 := randomId() + testSuiteId3 := randomId() + namespace := randomId() + flowId := randomId() + ctx := GetAuthContext() + createSimpleFlow(ctx, flowId, namespace) + + testSuite1, _, err := KestraTestApiClient().TestSuitesAPI.CreateTestSuite(ctx, MAIN_TENANT).Body(SIMPLE_TEST_SUITE(testSuiteId1, namespace, flowId)).Execute() + require.NoError(t, err) + testSuite2, _, err := KestraTestApiClient().TestSuitesAPI.CreateTestSuite(ctx, MAIN_TENANT).Body(SIMPLE_TEST_SUITE(testSuiteId2, namespace, flowId)).Execute() + require.NoError(t, err) + testSuite3, _, err := KestraTestApiClient().TestSuitesAPI.CreateTestSuite(ctx, MAIN_TENANT).Body(SIMPLE_TEST_SUITE(testSuiteId3, namespace, flowId)).Execute() + require.NoError(t, err) + assertTestSuiteExists(t, ctx, namespace, testSuite1.Id) + assertTestSuiteExists(t, ctx, namespace, testSuite2.Id) + assertTestSuiteExists(t, ctx, namespace, testSuite3.Id) + + deleteByIdsRequest := kestra_api_client.TestSuiteControllerTestSuiteBulkRequest{ + Ids: []kestra_api_client.TestSuiteControllerTestSuiteApiId{ + {Id: testSuiteId1, Namespace: namespace}, + {Id: testSuiteId3, Namespace: namespace}, + }} + _, _, err = KestraTestApiClient().TestSuitesAPI.DeleteTestSuitesByIds(ctx, MAIN_TENANT).TestSuiteControllerTestSuiteBulkRequest(deleteByIdsRequest).Execute() + + assertTestSuiteExists(t, ctx, namespace, testSuite2.Id) + assertTestSuiteDoesNotExist(t, ctx, namespace, testSuite1.Id) + assertTestSuiteDoesNotExist(t, ctx, namespace, testSuite3.Id) + }) + t.Run("disableTestSuiteByIdsTest", func(t *testing.T) { + testSuiteId1 := randomId() + testSuiteId2 := randomId() + testSuiteId3 := randomId() + namespace := randomId() + flowId := randomId() + ctx := GetAuthContext() + createSimpleFlow(ctx, flowId, namespace) + + testSuite1, _, err := KestraTestApiClient().TestSuitesAPI.CreateTestSuite(ctx, MAIN_TENANT).Body(SIMPLE_TEST_SUITE(testSuiteId1, namespace, flowId)).Execute() + require.NoError(t, err) + testSuite2, _, err := KestraTestApiClient().TestSuitesAPI.CreateTestSuite(ctx, MAIN_TENANT).Body(SIMPLE_TEST_SUITE(testSuiteId2, namespace, flowId)).Execute() + require.NoError(t, err) + testSuite3, _, err := KestraTestApiClient().TestSuitesAPI.CreateTestSuite(ctx, MAIN_TENANT).Body(SIMPLE_TEST_SUITE(testSuiteId3, namespace, flowId)).Execute() + require.NoError(t, err) + assertTestSuiteEnabled(t, ctx, testSuite1) + assertTestSuiteEnabled(t, ctx, testSuite2) + assertTestSuiteEnabled(t, ctx, testSuite3) + + bulkByIdsRequest := kestra_api_client.TestSuiteControllerTestSuiteBulkRequest{ + Ids: []kestra_api_client.TestSuiteControllerTestSuiteApiId{ + {Id: testSuiteId1, Namespace: namespace}, + {Id: testSuiteId3, Namespace: namespace}, + }} + _, _, err = KestraTestApiClient().TestSuitesAPI.DisableTestSuitesByIds(ctx, MAIN_TENANT).TestSuiteControllerTestSuiteBulkRequest(bulkByIdsRequest).Execute() + + assertTestSuiteEnabled(t, ctx, testSuite2) + assertTestSuiteDisabled(t, ctx, testSuite1) + assertTestSuiteDisabled(t, ctx, testSuite3) + }) + t.Run("enableTestSuiteByIdsTest", func(t *testing.T) { + testSuiteId1 := randomId() + testSuiteId2 := randomId() + testSuiteId3 := randomId() + namespace := randomId() + flowId := randomId() + ctx := GetAuthContext() + createSimpleFlow(ctx, flowId, namespace) + + testSuite1, _, err := KestraTestApiClient().TestSuitesAPI.CreateTestSuite(ctx, MAIN_TENANT).Body(SIMPLE_TEST_SUITE(testSuiteId1, namespace, flowId)).Execute() + require.NoError(t, err) + testSuite2, _, err := KestraTestApiClient().TestSuitesAPI.CreateTestSuite(ctx, MAIN_TENANT).Body(SIMPLE_TEST_SUITE(testSuiteId2, namespace, flowId)).Execute() + require.NoError(t, err) + testSuite3, _, err := KestraTestApiClient().TestSuitesAPI.CreateTestSuite(ctx, MAIN_TENANT).Body(SIMPLE_TEST_SUITE(testSuiteId3, namespace, flowId)).Execute() + require.NoError(t, err) + + disableAllReq := kestra_api_client.TestSuiteControllerTestSuiteBulkRequest{ + Ids: []kestra_api_client.TestSuiteControllerTestSuiteApiId{ + {Id: testSuiteId1, Namespace: namespace}, + {Id: testSuiteId2, Namespace: namespace}, + {Id: testSuiteId3, Namespace: namespace}, + }} + _, _, err = KestraTestApiClient().TestSuitesAPI.DisableTestSuitesByIds(ctx, MAIN_TENANT).TestSuiteControllerTestSuiteBulkRequest(disableAllReq).Execute() + assertTestSuiteDisabled(t, ctx, testSuite1) + assertTestSuiteDisabled(t, ctx, testSuite2) + assertTestSuiteDisabled(t, ctx, testSuite3) + + enableRequest := kestra_api_client.TestSuiteControllerTestSuiteBulkRequest{ + Ids: []kestra_api_client.TestSuiteControllerTestSuiteApiId{ + {Id: testSuiteId1, Namespace: namespace}, + {Id: testSuiteId3, Namespace: namespace}, + }} + _, _, err = KestraTestApiClient().TestSuitesAPI.EnableTestSuitesByIds(ctx, MAIN_TENANT).TestSuiteControllerTestSuiteBulkRequest(enableRequest).Execute() + + assertTestSuiteDisabled(t, ctx, testSuite2) + assertTestSuiteEnabled(t, ctx, testSuite1) + assertTestSuiteEnabled(t, ctx, testSuite3) + }) + t.Run("searchTestSuiteTest", func(t *testing.T) { + namespaceXXX := randomId() + namespaceYYY := randomId() + flowIdAAA := randomId() + flowIdBBB := randomId() + flowIdCCC := randomId() + testSuiteId1 := randomId() + testSuiteId2 := randomId() + testSuiteId3 := randomId() + testSuiteId4 := randomId() + ctx := GetAuthContext() + + createSimpleFlow(ctx, flowIdAAA, namespaceXXX) + createSimpleFlow(ctx, flowIdBBB, namespaceXXX) + createSimpleFlow(ctx, flowIdCCC, namespaceYYY) + + _, _, err := KestraTestApiClient().TestSuitesAPI.CreateTestSuite(ctx, MAIN_TENANT).Body(SIMPLE_TEST_SUITE(testSuiteId1, namespaceXXX, flowIdAAA)).Execute() + require.NoError(t, err) + _, _, err = KestraTestApiClient().TestSuitesAPI.CreateTestSuite(ctx, MAIN_TENANT).Body(SIMPLE_TEST_SUITE(testSuiteId2, namespaceXXX, flowIdAAA)).Execute() + require.NoError(t, err) + _, _, err = KestraTestApiClient().TestSuitesAPI.CreateTestSuite(ctx, MAIN_TENANT).Body(SIMPLE_TEST_SUITE(testSuiteId3, namespaceXXX, flowIdBBB)).Execute() + require.NoError(t, err) + _, _, err = KestraTestApiClient().TestSuitesAPI.CreateTestSuite(ctx, MAIN_TENANT).Body(SIMPLE_TEST_SUITE(testSuiteId4, namespaceYYY, flowIdCCC)).Execute() + require.NoError(t, err) + + searchByFlowAAA, _, err := KestraTestApiClient().TestSuitesAPI.SearchTestSuites(ctx, MAIN_TENANT).FlowId(flowIdAAA).Execute() + require.NoError(t, err) + foundIds := []string{} + for _, found := range searchByFlowAAA.GetResults() { + foundIds = append(foundIds, found.GetId()) + } + require.ElementsMatch(t, []string{testSuiteId1, testSuiteId2}, foundIds) + + searchByNamespaceYYY, _, err := KestraTestApiClient().TestSuitesAPI.SearchTestSuites(ctx, MAIN_TENANT).Namespace(namespaceYYY).Execute() + require.NoError(t, err) + foundIds = []string{} + for _, found := range searchByNamespaceYYY.GetResults() { + foundIds = append(foundIds, found.GetId()) + } + require.ElementsMatch(t, []string{testSuiteId4}, foundIds) + }) + t.Run("runTestSuiteTest", func(t *testing.T) { + t.Skip("need to fix AssertionResult expected and actual deserialization first") + testSuiteId := randomId() + namespace := randomId() + flowId := randomId() + ctx := GetAuthContext() + testSuiteYaml := SIMPLE_TEST_SUITE(testSuiteId, namespace, flowId) + createSimpleFlow(ctx, flowId, namespace) + _, _, err := KestraTestApiClient().TestSuitesAPI.CreateTestSuite(ctx, MAIN_TENANT).Body(testSuiteYaml).Execute() + require.NoError(t, err) + + res, _, err := KestraTestApiClient().TestSuitesAPI.RunTestSuite(ctx, namespace, testSuiteId, MAIN_TENANT).Execute() + require.NoError(t, err) + + require.EqualValues(t, testSuiteId, res.GetTestSuiteId()) + require.EqualValues(t, kestra_api_client.TESTSTATE_SUCCESS, res.GetState()) + require.NotEmpty(t, res.GetEndDate()) + }) + t.Run("runTestSuiteTest_failed", func(t *testing.T) { + t.Skip("need to fix AssertionResult expected and actual deserialization first") + testSuiteId := randomId() + namespace := randomId() + flowId := randomId() + ctx := GetAuthContext() + testSuiteYaml := FAILING_SIMPLE_TEST_SUITE(testSuiteId, namespace, flowId) + createSimpleFlow(ctx, flowId, namespace) + _, _, err := KestraTestApiClient().TestSuitesAPI.CreateTestSuite(ctx, MAIN_TENANT).Body(testSuiteYaml).Execute() + require.NoError(t, err) + + res, _, err := KestraTestApiClient().TestSuitesAPI.RunTestSuite(ctx, namespace, testSuiteId, MAIN_TENANT).Execute() + require.NoError(t, err) + + require.EqualValues(t, testSuiteId, res.GetTestSuiteId()) + require.EqualValues(t, kestra_api_client.TESTSTATE_FAILED, res.GetState()) + require.Len(t, res.GetResults(), 1) + result := res.GetResults()[0] + require.EqualValues(t, "test_case_1", result.GetTestId()) + require.Len(t, result.GetAssertionResults(), 1) + assertionResult := result.GetAssertionResults()[0] + require.EqualValues(t, "Hi there", assertionResult.GetExpected()) + require.EqualValues(t, "another value", assertionResult.GetActual()) + require.EqualValues(t, "equalTo", assertionResult.GetOperator()) + require.False(t, assertionResult.GetIsSuccess()) + }) + t.Run("runTestSuiteByQueryTest", func(t *testing.T) { + t.Skip("need to fix AssertionResult expected and actual deserialization first") + }) + t.Run("searchTestSuitesResultsTest", func(t *testing.T) { + t.Skip("need to fix AssertionResult expected and actual deserialization first") + }) + t.Run("getTestResult", func(t *testing.T) { + t.Skip("need to fix AssertionResult expected and actual deserialization first") + }) + t.Run("getTestsLastResultTest", func(t *testing.T) { + t.Skip("need to fix AssertionResult expected and actual deserialization first") + }) +} +func assertTestSuiteExists(t *testing.T, ctx context.Context, namespace string, id string) { + _, _, err := KestraTestApiClient().TestSuitesAPI.TestSuite(ctx, namespace, id, MAIN_TENANT).Execute() + require.NoError(t, err) +} +func assertTestSuiteDoesNotExist(t *testing.T, ctx context.Context, namespace string, id string) { + _, _, err := KestraTestApiClient().TestSuitesAPI.TestSuite(ctx, namespace, id, MAIN_TENANT).Execute() + require.ErrorContains(t, err, "404 Not Found") +} +func assertTestSuiteDisabled(t *testing.T, ctx context.Context, testSuite *kestra_api_client.TestSuite) { + res, _, err := KestraTestApiClient().TestSuitesAPI.TestSuite(ctx, testSuite.Namespace, testSuite.Id, MAIN_TENANT).Execute() + require.NoError(t, err) + require.True(t, res.GetDisabled()) +} +func assertTestSuiteEnabled(t *testing.T, ctx context.Context, testSuite *kestra_api_client.TestSuite) { + res, _, err := KestraTestApiClient().TestSuitesAPI.TestSuite(ctx, testSuite.Namespace, testSuite.Id, MAIN_TENANT).Execute() + require.NoError(t, err) + require.False(t, res.GetDisabled()) +}