diff --git a/api_beta/.openapi-generator/FILES b/api_beta/.openapi-generator/FILES index 55bb8170..c349bc34 100644 --- a/api_beta/.openapi-generator/FILES +++ b/api_beta/.openapi-generator/FILES @@ -218,6 +218,7 @@ docs/ApprovalsAPI.md docs/AppsAPI.md docs/Argument.md docs/ArrayInner.md +docs/ArrayInner1.md docs/AssignmentContextDto.md docs/AttrSyncSource.md docs/AttrSyncSourceAttributeConfig.md @@ -509,6 +510,8 @@ docs/InvocationStatusType.md docs/JsonPatch.md docs/JsonPatchOperation.md docs/JsonPatchOperationValue.md +docs/JsonPatchOperations.md +docs/JsonPatchOperationsValue.md docs/KbaAnswerRequestItem.md docs/KbaAnswerResponseItem.md docs/KbaAuthResponse.md @@ -1134,6 +1137,7 @@ model_approval_status_dto_original_owner.go model_approval_summary.go model_argument.go model_array_inner.go +model_array_inner_1.go model_assignment_context_dto.go model_attr_sync_source.go model_attr_sync_source_attribute_config.go @@ -1404,6 +1408,8 @@ model_invocation_status_type.go model_json_patch.go model_json_patch_operation.go model_json_patch_operation_value.go +model_json_patch_operations.go +model_json_patch_operations_value.go model_kba_answer_request_item.go model_kba_answer_response_item.go model_kba_auth_response.go diff --git a/api_beta/README.md b/api_beta/README.md index cd1fe1d4..73ba1d41 100644 --- a/api_beta/README.md +++ b/api_beta/README.md @@ -125,9 +125,11 @@ Class | Method | HTTP request | Description *AccountsAPI* | [**SubmitReloadAccount**](docs/AccountsAPI.md#submitreloadaccount) | **Post** /accounts/{id}/reload | Reload Account *AccountsAPI* | [**UnlockAccount**](docs/AccountsAPI.md#unlockaccount) | **Post** /accounts/{id}/unlock | Unlock Account *AccountsAPI* | [**UpdateAccount**](docs/AccountsAPI.md#updateaccount) | **Patch** /accounts/{id} | Update Account +*ApplicationDiscoveryAPI* | [**GetDiscoveredApplicationByID**](docs/ApplicationDiscoveryAPI.md#getdiscoveredapplicationbyid) | **Get** /discovered-applications/{id} | Get Discovered Application by ID *ApplicationDiscoveryAPI* | [**GetDiscoveredApplications**](docs/ApplicationDiscoveryAPI.md#getdiscoveredapplications) | **Get** /discovered-applications | Retrieve discovered applications for tenant *ApplicationDiscoveryAPI* | [**GetManualDiscoverApplicationsCsvTemplate**](docs/ApplicationDiscoveryAPI.md#getmanualdiscoverapplicationscsvtemplate) | **Get** /manual-discover-applications-template | CSV template download for discovery *ApplicationDiscoveryAPI* | [**GetVendorConnectorMappings**](docs/ApplicationDiscoveryAPI.md#getvendorconnectormappings) | **Get** /vendor-connector-mappings | List vendor connector mappings +*ApplicationDiscoveryAPI* | [**PatchDiscoveredApplicationByID**](docs/ApplicationDiscoveryAPI.md#patchdiscoveredapplicationbyid) | **Patch** /discovered-applications/{id} | Patch Discovered Application by Id *ApplicationDiscoveryAPI* | [**SendManualDiscoverApplicationsCsvTemplate**](docs/ApplicationDiscoveryAPI.md#sendmanualdiscoverapplicationscsvtemplate) | **Post** /manual-discover-applications | CSV Upload to discover applications *ApprovalsAPI* | [**GetApproval**](docs/ApprovalsAPI.md#getapproval) | **Get** /generic-approvals/{id} | Get an approval *ApprovalsAPI* | [**GetApprovals**](docs/ApprovalsAPI.md#getapprovals) | **Get** /generic-approvals | Get Approvals @@ -746,6 +748,7 @@ Class | Method | HTTP request | Description - [ApprovalSummary](docs/ApprovalSummary.md) - [Argument](docs/Argument.md) - [ArrayInner](docs/ArrayInner.md) + - [ArrayInner1](docs/ArrayInner1.md) - [AssignmentContextDto](docs/AssignmentContextDto.md) - [AttrSyncSource](docs/AttrSyncSource.md) - [AttrSyncSourceAttributeConfig](docs/AttrSyncSourceAttributeConfig.md) @@ -1016,6 +1019,8 @@ Class | Method | HTTP request | Description - [JsonPatch](docs/JsonPatch.md) - [JsonPatchOperation](docs/JsonPatchOperation.md) - [JsonPatchOperationValue](docs/JsonPatchOperationValue.md) + - [JsonPatchOperations](docs/JsonPatchOperations.md) + - [JsonPatchOperationsValue](docs/JsonPatchOperationsValue.md) - [KbaAnswerRequestItem](docs/KbaAnswerRequestItem.md) - [KbaAnswerResponseItem](docs/KbaAnswerResponseItem.md) - [KbaAuthResponse](docs/KbaAuthResponse.md) diff --git a/api_beta/api/openapi.yaml b/api_beta/api/openapi.yaml index 176dfa7a..38a5f999 100644 --- a/api_beta/api/openapi.yaml +++ b/api_beta/api/openapi.yaml @@ -57453,6 +57453,235 @@ paths: summary: Retrieve discovered applications for tenant tags: - Application Discovery + /discovered-applications/{id}: + get: + description: | + This API returns a discovered application with its associated sources based on the ID provided. + operationId: getDiscoveredApplicationByID + parameters: + - description: ID of the discovered application. + example: 123e4567-e89b-12d3-a456-426655440000 + in: path + name: id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + example: + id: app-123 + name: Example App + discoverySource: csv + discoveredVendor: Example Vendor + description: An application for managing examples. + recommendedConnectors: + - ConnectorA + - ConnectorB + discoveredAt: 2023-07-01T12:00:00Z + createdAt: 2024-06-01T12:00:00Z + status: ACTIVE + associatedSources: + - 4e2d7605-833f-4c34-8d03-5b2c7d2f4f66 + - f9b7e2ce-aced-4117-a95f-4ffad8b33989 + - a3b159f2-5f09-43c9-b40e-a6f317aa5b8f + description: Returns the discovered application along with its associated + sources. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponseDto' + description: Client Error - Returned if the request body is invalid. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/listAccessModelMetadataAttribute_401_response' + description: "Unauthorized - Returned if there is no authorization header,\ + \ or if the JWT token is expired." + "403": + content: + application/json: + examples: + "403": + summary: An example of a 403 response object + value: + detailCode: 403 Forbidden + trackingId: b21b1f7ce4da4d639f2c62a57171b427 + messages: + - locale: en-US + localeOrigin: DEFAULT + text: The server understood the request but refuses to authorize + it. + schema: + $ref: '#/components/schemas/ErrorResponseDto' + description: "Forbidden - Returned if the user you are running as, doesn't\ + \ have access to this end-point." + "429": + content: + application/json: + schema: + $ref: '#/components/schemas/listAccessModelMetadataAttribute_429_response' + description: Too Many Requests - Returned in response to too many requests + in a given period of time - rate limited. The Retry-After header in the + response includes how long to wait before trying again. + "500": + content: + application/json: + examples: + "500": + summary: An example of a 500 response object + value: + detailCode: 500.0 Internal Fault + trackingId: b21b1f7ce4da4d639f2c62a57171b427 + messages: + - locale: en-US + localeOrigin: DEFAULT + text: An internal fault occurred. + schema: + $ref: '#/components/schemas/ErrorResponseDto' + description: Internal Server Error - Returned if there is an unexpected + error. + security: + - UserContextAuth: + - idn:application-discovery:read + summary: Get Discovered Application by ID + tags: + - Application Discovery + patch: + description: |- + This API updates an existing discovered application using a limited version of the [JSON Patch](https://tools.ietf.org/html/rfc6902) syntax. + The following fields are patchable: - **associatedSources** - **dismissed** + operationId: patchDiscoveredApplicationByID + parameters: + - description: ID of the discovered application. + example: 123e4567-e89b-12d3-a456-426655440000 + in: path + name: id + required: true + schema: + type: string + requestBody: + content: + application/json-patch+json: + examples: + Dismiss an app: + description: This example shows how use patch to set the dismissal + status of a correlated application to true + value: + - op: replace + path: /dismissed + value: true + Replace associated sources: + description: This example shows how use patch to replace the values + of the associatedSources field. + value: + - op: replace + path: /associatedSources + value: + - 4e2d7605-833f-4c34-8d03-5b2c7d2f4f66 + - f9b7e2ce-aced-4117-a95f-4ffad8b33989 + - a3b159f2-5f09-43c9-b40e-a6f317aa5b8f + Add an associated source to a correlated application: + description: This example shows how to use patch to add an associated + source to a correlated application + value: + - op: add + path: /associatedSources + value: 123e4567-e89b-a456-42655440005 + schema: + example: + - op: replace + path: /dismissed + value: false + items: + $ref: '#/components/schemas/JsonPatchOperations' + type: array + responses: + "200": + content: + application/json: + example: + id: app-123 + name: Example App + discoverySource: csv + discoveredVendor: Example Vendor + description: An application for managing examples. + recommendedConnectors: + - ConnectorA + - ConnectorB + discoveredAt: 2023-07-01T12:00:00Z + createdAt: 2024-06-01T12:00:00Z + status: ACTIVE + associatedSources: + - 4e2d7605-833f-4c34-8d03-5b2c7d2f4f66 + - f9b7e2ce-aced-4117-a95f-4ffad8b33989 + - a3b159f2-5f09-43c9-b40e-a6f317aa5b8f + description: Returns the single patched discovered application. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponseDto' + description: Client Error - Returned if the request body is invalid. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/listAccessModelMetadataAttribute_401_response' + description: "Unauthorized - Returned if there is no authorization header,\ + \ or if the JWT token is expired." + "403": + content: + application/json: + examples: + "403": + summary: An example of a 403 response object + value: + detailCode: 403 Forbidden + trackingId: b21b1f7ce4da4d639f2c62a57171b427 + messages: + - locale: en-US + localeOrigin: DEFAULT + text: The server understood the request but refuses to authorize + it. + schema: + $ref: '#/components/schemas/ErrorResponseDto' + description: "Forbidden - Returned if the user you are running as, doesn't\ + \ have access to this end-point." + "429": + content: + application/json: + schema: + $ref: '#/components/schemas/listAccessModelMetadataAttribute_429_response' + description: Too Many Requests - Returned in response to too many requests + in a given period of time - rate limited. The Retry-After header in the + response includes how long to wait before trying again. + "500": + content: + application/json: + examples: + "500": + summary: An example of a 500 response object + value: + detailCode: 500.0 Internal Fault + trackingId: b21b1f7ce4da4d639f2c62a57171b427 + messages: + - locale: en-US + localeOrigin: DEFAULT + text: An internal fault occurred. + schema: + $ref: '#/components/schemas/ErrorResponseDto' + description: Internal Server Error - Returned if there is an unexpected + error. + security: + - UserContextAuth: + - idn:application-discovery:write + summary: Patch Discovered Application by Id + tags: + - Application Discovery /vendor-connector-mappings: delete: description: | @@ -77008,6 +77237,32 @@ components: type: array title: Discovered Application type: object + JsonPatchOperations: + description: "A limited JSONPatch Operation as defined by [RFC 6902 - JSON Patch](https://tools.ietf.org/html/rfc6902)" + example: + op: replace + path: /dismissed + value: true + properties: + op: + description: The operation to be performed + enum: + - add + - remove + - replace + example: replace + type: string + path: + description: A string representing the target path to an element to be affected + by the operation + example: /dismissed + type: string + value: + $ref: '#/components/schemas/JsonPatchOperations_value' + required: + - op + - path + type: object VendorConnectorMapping: example: createdAt: 2024-03-13T12:56:19.391294Z @@ -89041,6 +89296,28 @@ components: x-go-name: FormDefinitionID type: object x-go-name: Attributes + array_inner_1: + anyOf: + - type: string + example: + - 4e2d7605-833f-4c34-8d03-5b2c7d2f4f66 + - f9b7e2ce-aced-4117-a95f-4ffad8b33989 + - a3b159f2-5f09-43c9-b40e-a6f317aa5b8f + JsonPatchOperations_value: + description: "The value to be used for the operation, required for \"add\" and\ + \ \"replace\" operations" + example: true + oneOf: + - example: New description + title: string + type: string + - example: true + title: boolean + type: boolean + - items: + $ref: '#/components/schemas/array_inner_1' + title: array + type: array VendorConnectorMapping_updatedAt: description: An object representing the nullable timestamp of the last update. example: diff --git a/api_beta/api_application_discovery.go b/api_beta/api_application_discovery.go index 36a46327..0cbe31d2 100644 --- a/api_beta/api_application_discovery.go +++ b/api_beta/api_application_discovery.go @@ -16,6 +16,7 @@ import ( "io" "net/http" "net/url" + "strings" "os" ) @@ -23,6 +24,153 @@ import ( // ApplicationDiscoveryAPIService ApplicationDiscoveryAPI service type ApplicationDiscoveryAPIService service +type ApiGetDiscoveredApplicationByIDRequest struct { + ctx context.Context + ApiService *ApplicationDiscoveryAPIService + id string +} + +func (r ApiGetDiscoveredApplicationByIDRequest) Execute() (*http.Response, error) { + return r.ApiService.GetDiscoveredApplicationByIDExecute(r) +} + +/* +GetDiscoveredApplicationByID Get Discovered Application by ID + +This API returns a discovered application with its associated sources based on the ID provided. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id ID of the discovered application. + @return ApiGetDiscoveredApplicationByIDRequest +*/ +func (a *ApplicationDiscoveryAPIService) GetDiscoveredApplicationByID(ctx context.Context, id string) ApiGetDiscoveredApplicationByIDRequest { + return ApiGetDiscoveredApplicationByIDRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ApplicationDiscoveryAPIService) GetDiscoveredApplicationByIDExecute(r ApiGetDiscoveredApplicationByIDRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ApplicationDiscoveryAPIService.GetDiscoveredApplicationByID") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/discovered-applications/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -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 nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponseDto + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ListAccessModelMetadataAttribute401Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponseDto + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ListAccessModelMetadataAttribute429Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorResponseDto + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + type ApiGetDiscoveredApplicationsRequest struct { ctx context.Context ApiService *ApplicationDiscoveryAPIService @@ -554,6 +702,161 @@ func (a *ApplicationDiscoveryAPIService) GetVendorConnectorMappingsExecute(r Api return localVarReturnValue, localVarHTTPResponse, nil } +type ApiPatchDiscoveredApplicationByIDRequest struct { + ctx context.Context + ApiService *ApplicationDiscoveryAPIService + id string + jsonPatchOperations *[]JsonPatchOperations +} + +func (r ApiPatchDiscoveredApplicationByIDRequest) JsonPatchOperations(jsonPatchOperations []JsonPatchOperations) ApiPatchDiscoveredApplicationByIDRequest { + r.jsonPatchOperations = &jsonPatchOperations + return r +} + +func (r ApiPatchDiscoveredApplicationByIDRequest) Execute() (*http.Response, error) { + return r.ApiService.PatchDiscoveredApplicationByIDExecute(r) +} + +/* +PatchDiscoveredApplicationByID Patch Discovered Application by Id + +This API updates an existing discovered application using a limited version of the [JSON Patch](https://tools.ietf.org/html/rfc6902) syntax. +The following fields are patchable: - **associatedSources** - **dismissed** + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id ID of the discovered application. + @return ApiPatchDiscoveredApplicationByIDRequest +*/ +func (a *ApplicationDiscoveryAPIService) PatchDiscoveredApplicationByID(ctx context.Context, id string) ApiPatchDiscoveredApplicationByIDRequest { + return ApiPatchDiscoveredApplicationByIDRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ApplicationDiscoveryAPIService) PatchDiscoveredApplicationByIDExecute(r ApiPatchDiscoveredApplicationByIDRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ApplicationDiscoveryAPIService.PatchDiscoveredApplicationByID") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/discovered-applications/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json-patch+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.jsonPatchOperations + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponseDto + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ListAccessModelMetadataAttribute401Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponseDto + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ListAccessModelMetadataAttribute429Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorResponseDto + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + type ApiSendManualDiscoverApplicationsCsvTemplateRequest struct { ctx context.Context ApiService *ApplicationDiscoveryAPIService diff --git a/api_beta/docs/ApplicationDiscoveryAPI.md b/api_beta/docs/ApplicationDiscoveryAPI.md index 7470caf8..fbc3d60d 100644 --- a/api_beta/docs/ApplicationDiscoveryAPI.md +++ b/api_beta/docs/ApplicationDiscoveryAPI.md @@ -4,13 +4,83 @@ All URIs are relative to *https://sailpoint.api.identitynow.com/beta* Method | HTTP request | Description ------------- | ------------- | ------------- +[**GetDiscoveredApplicationByID**](ApplicationDiscoveryAPI.md#GetDiscoveredApplicationByID) | **Get** /discovered-applications/{id} | Get Discovered Application by ID [**GetDiscoveredApplications**](ApplicationDiscoveryAPI.md#GetDiscoveredApplications) | **Get** /discovered-applications | Retrieve discovered applications for tenant [**GetManualDiscoverApplicationsCsvTemplate**](ApplicationDiscoveryAPI.md#GetManualDiscoverApplicationsCsvTemplate) | **Get** /manual-discover-applications-template | CSV template download for discovery [**GetVendorConnectorMappings**](ApplicationDiscoveryAPI.md#GetVendorConnectorMappings) | **Get** /vendor-connector-mappings | List vendor connector mappings +[**PatchDiscoveredApplicationByID**](ApplicationDiscoveryAPI.md#PatchDiscoveredApplicationByID) | **Patch** /discovered-applications/{id} | Patch Discovered Application by Id [**SendManualDiscoverApplicationsCsvTemplate**](ApplicationDiscoveryAPI.md#SendManualDiscoverApplicationsCsvTemplate) | **Post** /manual-discover-applications | CSV Upload to discover applications +## GetDiscoveredApplicationByID + +> GetDiscoveredApplicationByID(ctx, id).Execute() + +Get Discovered Application by ID + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/sailpoint-oss/golang-sdk/v2" +) + +func main() { + id := "123e4567-e89b-12d3-a456-426655440000" // string | ID of the discovered application. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.ApplicationDiscoveryAPI.GetDiscoveredApplicationByID(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ApplicationDiscoveryAPI.GetDiscoveredApplicationByID``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | ID of the discovered application. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetDiscoveredApplicationByIDRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[UserContextAuth](../README.md#UserContextAuth), [UserContextAuth](../README.md#UserContextAuth) + +### 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) + + ## GetDiscoveredApplications > []GetDiscoveredApplications200ResponseInner GetDiscoveredApplications(ctx).Limit(limit).Offset(offset).Detail(detail).Filter(filter).Sorters(sorters).Execute() @@ -207,6 +277,76 @@ Other parameters are passed through a pointer to a apiGetVendorConnectorMappings [[Back to README]](../README.md) +## PatchDiscoveredApplicationByID + +> PatchDiscoveredApplicationByID(ctx, id).JsonPatchOperations(jsonPatchOperations).Execute() + +Patch Discovered Application by Id + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/sailpoint-oss/golang-sdk/v2" +) + +func main() { + id := "123e4567-e89b-12d3-a456-426655440000" // string | ID of the discovered application. + jsonPatchOperations := []openapiclient.JsonPatchOperations{*openapiclient.NewJsonPatchOperations("replace", "/dismissed")} // []JsonPatchOperations | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.ApplicationDiscoveryAPI.PatchDiscoveredApplicationByID(context.Background(), id).JsonPatchOperations(jsonPatchOperations).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ApplicationDiscoveryAPI.PatchDiscoveredApplicationByID``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | ID of the discovered application. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiPatchDiscoveredApplicationByIDRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **jsonPatchOperations** | [**[]JsonPatchOperations**](JsonPatchOperations.md) | | + +### Return type + + (empty response body) + +### Authorization + +[UserContextAuth](../README.md#UserContextAuth), [UserContextAuth](../README.md#UserContextAuth) + +### HTTP request headers + +- **Content-Type**: application/json-patch+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) + + ## SendManualDiscoverApplicationsCsvTemplate > SendManualDiscoverApplicationsCsvTemplate(ctx).File(file).Execute() diff --git a/api_beta/docs/ArrayInner1.md b/api_beta/docs/ArrayInner1.md new file mode 100644 index 00000000..b3f3a0e1 --- /dev/null +++ b/api_beta/docs/ArrayInner1.md @@ -0,0 +1,30 @@ +# ArrayInner1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Methods + +### NewArrayInner1 + +`func NewArrayInner1() *ArrayInner1` + +NewArrayInner1 instantiates a new ArrayInner1 object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewArrayInner1WithDefaults + +`func NewArrayInner1WithDefaults() *ArrayInner1` + +NewArrayInner1WithDefaults instantiates a new ArrayInner1 object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/api_beta/docs/JsonPatchOperations.md b/api_beta/docs/JsonPatchOperations.md new file mode 100644 index 00000000..66572c42 --- /dev/null +++ b/api_beta/docs/JsonPatchOperations.md @@ -0,0 +1,98 @@ +# JsonPatchOperations + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Op** | **string** | The operation to be performed | +**Path** | **string** | A string representing the target path to an element to be affected by the operation | +**Value** | Pointer to [**JsonPatchOperationsValue**](JsonPatchOperationsValue.md) | | [optional] + +## Methods + +### NewJsonPatchOperations + +`func NewJsonPatchOperations(op string, path string, ) *JsonPatchOperations` + +NewJsonPatchOperations instantiates a new JsonPatchOperations object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewJsonPatchOperationsWithDefaults + +`func NewJsonPatchOperationsWithDefaults() *JsonPatchOperations` + +NewJsonPatchOperationsWithDefaults instantiates a new JsonPatchOperations object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetOp + +`func (o *JsonPatchOperations) GetOp() string` + +GetOp returns the Op field if non-nil, zero value otherwise. + +### GetOpOk + +`func (o *JsonPatchOperations) GetOpOk() (*string, bool)` + +GetOpOk returns a tuple with the Op field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOp + +`func (o *JsonPatchOperations) SetOp(v string)` + +SetOp sets Op field to given value. + + +### GetPath + +`func (o *JsonPatchOperations) GetPath() string` + +GetPath returns the Path field if non-nil, zero value otherwise. + +### GetPathOk + +`func (o *JsonPatchOperations) GetPathOk() (*string, bool)` + +GetPathOk returns a tuple with the Path field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPath + +`func (o *JsonPatchOperations) SetPath(v string)` + +SetPath sets Path field to given value. + + +### GetValue + +`func (o *JsonPatchOperations) GetValue() JsonPatchOperationsValue` + +GetValue returns the Value field if non-nil, zero value otherwise. + +### GetValueOk + +`func (o *JsonPatchOperations) GetValueOk() (*JsonPatchOperationsValue, bool)` + +GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValue + +`func (o *JsonPatchOperations) SetValue(v JsonPatchOperationsValue)` + +SetValue sets Value field to given value. + +### HasValue + +`func (o *JsonPatchOperations) HasValue() bool` + +HasValue returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/api_beta/docs/JsonPatchOperationsValue.md b/api_beta/docs/JsonPatchOperationsValue.md new file mode 100644 index 00000000..48a10b99 --- /dev/null +++ b/api_beta/docs/JsonPatchOperationsValue.md @@ -0,0 +1,30 @@ +# JsonPatchOperationsValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Methods + +### NewJsonPatchOperationsValue + +`func NewJsonPatchOperationsValue() *JsonPatchOperationsValue` + +NewJsonPatchOperationsValue instantiates a new JsonPatchOperationsValue object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewJsonPatchOperationsValueWithDefaults + +`func NewJsonPatchOperationsValueWithDefaults() *JsonPatchOperationsValue` + +NewJsonPatchOperationsValueWithDefaults instantiates a new JsonPatchOperationsValue object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/api_beta/model_array_inner_1.go b/api_beta/model_array_inner_1.go new file mode 100644 index 00000000..80829ab3 --- /dev/null +++ b/api_beta/model_array_inner_1.go @@ -0,0 +1,89 @@ +/* +Identity Security Cloud Beta API + +Use these APIs to interact with the Identity Security Cloud platform to achieve repeatable, automated processes with greater scalability. These APIs are in beta and are subject to change. We encourage you to join the SailPoint Developer Community forum at https://developer.sailpoint.com/discuss to connect with other developers using our APIs. + +API version: 3.1.0-beta +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api_beta + +import ( + "encoding/json" + "fmt" +) + + +// ArrayInner1 struct for ArrayInner1 +type ArrayInner1 struct { + String *string +} + +// Unmarshal JSON data into any of the pointers in the struct +func (dst *ArrayInner1) UnmarshalJSON(data []byte) error { + var err error + // try to unmarshal JSON data into String + err = json.Unmarshal(data, &dst.String); + if err == nil { + jsonString, _ := json.Marshal(dst.String) + if string(jsonString) == "{}" { // empty struct + dst.String = nil + } else { + return nil // data stored in dst.String, return on the first match + } + } else { + dst.String = nil + } + + return fmt.Errorf("data failed to match schemas in anyOf(ArrayInner1)") +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src *ArrayInner1) MarshalJSON() ([]byte, error) { + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in anyOf schemas +} + + +type NullableArrayInner1 struct { + value *ArrayInner1 + isSet bool +} + +func (v NullableArrayInner1) Get() *ArrayInner1 { + return v.value +} + +func (v *NullableArrayInner1) Set(val *ArrayInner1) { + v.value = val + v.isSet = true +} + +func (v NullableArrayInner1) IsSet() bool { + return v.isSet +} + +func (v *NullableArrayInner1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableArrayInner1(val *ArrayInner1) *NullableArrayInner1 { + return &NullableArrayInner1{value: val, isSet: true} +} + +func (v NullableArrayInner1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableArrayInner1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/api_beta/model_json_patch_operations.go b/api_beta/model_json_patch_operations.go new file mode 100644 index 00000000..ffb7c27c --- /dev/null +++ b/api_beta/model_json_patch_operations.go @@ -0,0 +1,236 @@ +/* +Identity Security Cloud Beta API + +Use these APIs to interact with the Identity Security Cloud platform to achieve repeatable, automated processes with greater scalability. These APIs are in beta and are subject to change. We encourage you to join the SailPoint Developer Community forum at https://developer.sailpoint.com/discuss to connect with other developers using our APIs. + +API version: 3.1.0-beta +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api_beta + +import ( + "encoding/json" + "fmt" +) + +// checks if the JsonPatchOperations type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &JsonPatchOperations{} + +// JsonPatchOperations A limited JSONPatch Operation as defined by [RFC 6902 - JSON Patch](https://tools.ietf.org/html/rfc6902) +type JsonPatchOperations struct { + // The operation to be performed + Op string `json:"op"` + // A string representing the target path to an element to be affected by the operation + Path string `json:"path"` + Value *JsonPatchOperationsValue `json:"value,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _JsonPatchOperations JsonPatchOperations + +// NewJsonPatchOperations instantiates a new JsonPatchOperations object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewJsonPatchOperations(op string, path string) *JsonPatchOperations { + this := JsonPatchOperations{} + this.Op = op + this.Path = path + return &this +} + +// NewJsonPatchOperationsWithDefaults instantiates a new JsonPatchOperations object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewJsonPatchOperationsWithDefaults() *JsonPatchOperations { + this := JsonPatchOperations{} + return &this +} + +// GetOp returns the Op field value +func (o *JsonPatchOperations) GetOp() string { + if o == nil { + var ret string + return ret + } + + return o.Op +} + +// GetOpOk returns a tuple with the Op field value +// and a boolean to check if the value has been set. +func (o *JsonPatchOperations) GetOpOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Op, true +} + +// SetOp sets field value +func (o *JsonPatchOperations) SetOp(v string) { + o.Op = v +} + +// GetPath returns the Path field value +func (o *JsonPatchOperations) GetPath() string { + if o == nil { + var ret string + return ret + } + + return o.Path +} + +// GetPathOk returns a tuple with the Path field value +// and a boolean to check if the value has been set. +func (o *JsonPatchOperations) GetPathOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Path, true +} + +// SetPath sets field value +func (o *JsonPatchOperations) SetPath(v string) { + o.Path = v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *JsonPatchOperations) GetValue() JsonPatchOperationsValue { + if o == nil || IsNil(o.Value) { + var ret JsonPatchOperationsValue + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *JsonPatchOperations) GetValueOk() (*JsonPatchOperationsValue, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *JsonPatchOperations) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given JsonPatchOperationsValue and assigns it to the Value field. +func (o *JsonPatchOperations) SetValue(v JsonPatchOperationsValue) { + o.Value = &v +} + +func (o JsonPatchOperations) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o JsonPatchOperations) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["op"] = o.Op + toSerialize["path"] = o.Path + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *JsonPatchOperations) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "op", + "path", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varJsonPatchOperations := _JsonPatchOperations{} + + err = json.Unmarshal(data, &varJsonPatchOperations) + + if err != nil { + return err + } + + *o = JsonPatchOperations(varJsonPatchOperations) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "op") + delete(additionalProperties, "path") + delete(additionalProperties, "value") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableJsonPatchOperations struct { + value *JsonPatchOperations + isSet bool +} + +func (v NullableJsonPatchOperations) Get() *JsonPatchOperations { + return v.value +} + +func (v *NullableJsonPatchOperations) Set(val *JsonPatchOperations) { + v.value = val + v.isSet = true +} + +func (v NullableJsonPatchOperations) IsSet() bool { + return v.isSet +} + +func (v *NullableJsonPatchOperations) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableJsonPatchOperations(val *JsonPatchOperations) *NullableJsonPatchOperations { + return &NullableJsonPatchOperations{value: val, isSet: true} +} + +func (v NullableJsonPatchOperations) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableJsonPatchOperations) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/api_beta/model_json_patch_operations_value.go b/api_beta/model_json_patch_operations_value.go new file mode 100644 index 00000000..dd23e5c7 --- /dev/null +++ b/api_beta/model_json_patch_operations_value.go @@ -0,0 +1,191 @@ +/* +Identity Security Cloud Beta API + +Use these APIs to interact with the Identity Security Cloud platform to achieve repeatable, automated processes with greater scalability. These APIs are in beta and are subject to change. We encourage you to join the SailPoint Developer Community forum at https://developer.sailpoint.com/discuss to connect with other developers using our APIs. + +API version: 3.1.0-beta +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api_beta + +import ( + "encoding/json" + "gopkg.in/validator.v2" + "fmt" +) + +// JsonPatchOperationsValue - The value to be used for the operation, required for \"add\" and \"replace\" operations +type JsonPatchOperationsValue struct { + ArrayOfArrayInner1 *[]ArrayInner1 + Bool *bool + String *string +} + +// []ArrayInner1AsJsonPatchOperationsValue is a convenience function that returns []ArrayInner1 wrapped in JsonPatchOperationsValue +func ArrayOfArrayInner1AsJsonPatchOperationsValue(v *[]ArrayInner1) JsonPatchOperationsValue { + return JsonPatchOperationsValue{ + ArrayOfArrayInner1: v, + } +} + +// boolAsJsonPatchOperationsValue is a convenience function that returns bool wrapped in JsonPatchOperationsValue +func BoolAsJsonPatchOperationsValue(v *bool) JsonPatchOperationsValue { + return JsonPatchOperationsValue{ + Bool: v, + } +} + +// stringAsJsonPatchOperationsValue is a convenience function that returns string wrapped in JsonPatchOperationsValue +func StringAsJsonPatchOperationsValue(v *string) JsonPatchOperationsValue { + return JsonPatchOperationsValue{ + String: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *JsonPatchOperationsValue) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into ArrayOfArrayInner1 + err = newStrictDecoder(data).Decode(&dst.ArrayOfArrayInner1) + if err == nil { + jsonArrayOfArrayInner1, _ := json.Marshal(dst.ArrayOfArrayInner1) + if string(jsonArrayOfArrayInner1) == "{}" { // empty struct + dst.ArrayOfArrayInner1 = nil + } else { + if err = validator.Validate(dst.ArrayOfArrayInner1); err != nil { + dst.ArrayOfArrayInner1 = nil + } else { + match++ + } + } + } else { + dst.ArrayOfArrayInner1 = nil + } + + // try to unmarshal data into Bool + err = newStrictDecoder(data).Decode(&dst.Bool) + if err == nil { + jsonBool, _ := json.Marshal(dst.Bool) + if string(jsonBool) == "{}" { // empty struct + dst.Bool = nil + } else { + if err = validator.Validate(dst.Bool); err != nil { + dst.Bool = nil + } else { + match++ + } + } + } else { + dst.Bool = nil + } + + // try to unmarshal data into String + err = newStrictDecoder(data).Decode(&dst.String) + if err == nil { + jsonString, _ := json.Marshal(dst.String) + if string(jsonString) == "{}" { // empty struct + dst.String = nil + } else { + if err = validator.Validate(dst.String); err != nil { + dst.String = nil + } else { + match++ + } + } + } else { + dst.String = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.ArrayOfArrayInner1 = nil + dst.Bool = nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(JsonPatchOperationsValue)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(JsonPatchOperationsValue)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src JsonPatchOperationsValue) MarshalJSON() ([]byte, error) { + if src.ArrayOfArrayInner1 != nil { + return json.Marshal(&src.ArrayOfArrayInner1) + } + + if src.Bool != nil { + return json.Marshal(&src.Bool) + } + + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *JsonPatchOperationsValue) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.ArrayOfArrayInner1 != nil { + return obj.ArrayOfArrayInner1 + } + + if obj.Bool != nil { + return obj.Bool + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +type NullableJsonPatchOperationsValue struct { + value *JsonPatchOperationsValue + isSet bool +} + +func (v NullableJsonPatchOperationsValue) Get() *JsonPatchOperationsValue { + return v.value +} + +func (v *NullableJsonPatchOperationsValue) Set(val *JsonPatchOperationsValue) { + v.value = val + v.isSet = true +} + +func (v NullableJsonPatchOperationsValue) IsSet() bool { + return v.isSet +} + +func (v *NullableJsonPatchOperationsValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableJsonPatchOperationsValue(val *JsonPatchOperationsValue) *NullableJsonPatchOperationsValue { + return &NullableJsonPatchOperationsValue{value: val, isSet: true} +} + +func (v NullableJsonPatchOperationsValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableJsonPatchOperationsValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/api_beta/test/api_application_discovery_test.go b/api_beta/test/api_application_discovery_test.go index d87db4df..94b434aa 100644 --- a/api_beta/test/api_application_discovery_test.go +++ b/api_beta/test/api_application_discovery_test.go @@ -22,6 +22,19 @@ func Test_api_beta_ApplicationDiscoveryAPIService(t *testing.T) { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) + t.Run("Test ApplicationDiscoveryAPIService GetDiscoveredApplicationByID", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.ApplicationDiscoveryAPI.GetDiscoveredApplicationByID(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + t.Run("Test ApplicationDiscoveryAPIService GetDiscoveredApplications", func(t *testing.T) { t.Skip("skip test") // remove to run test @@ -58,6 +71,19 @@ func Test_api_beta_ApplicationDiscoveryAPIService(t *testing.T) { }) + t.Run("Test ApplicationDiscoveryAPIService PatchDiscoveredApplicationByID", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.ApplicationDiscoveryAPI.PatchDiscoveredApplicationByID(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + t.Run("Test ApplicationDiscoveryAPIService SendManualDiscoverApplicationsCsvTemplate", func(t *testing.T) { t.Skip("skip test") // remove to run test